2
0
Fork 0
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
834 B
Java

package net.minecraft.entity.ai;
import net.minecraft.entity.EntityLiving;
public class EntityAISwimming extends EntityAIBase
{
private EntityLiving theEntity;
private static final String __OBFID = "CL_00001584";
public EntityAISwimming(EntityLiving p_i1624_1_)
{
this.theEntity = p_i1624_1_;
this.setMutexBits(4);
p_i1624_1_.getNavigator().setCanSwim(true);
}
/**
* Returns whether the EntityAIBase should begin execution.
*/
public boolean shouldExecute()
{
return this.theEntity.isInWater() || this.theEntity.handleLavaMovement();
}
/**
* Updates the task
*/
public void updateTask()
{
if (this.theEntity.getRNG().nextFloat() < 0.8F)
{
this.theEntity.getJumpHelper().setJumping();
}
}
}