本文整理匯總了Java中net.minecraft.pathfinding.PathNavigate.getCanBreakDoors方法的典型用法代碼示例。如果您正苦於以下問題:Java PathNavigate.getCanBreakDoors方法的具體用法?Java PathNavigate.getCanBreakDoors怎麽用?Java PathNavigate.getCanBreakDoors使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.minecraft.pathfinding.PathNavigate
的用法示例。
在下文中一共展示了PathNavigate.getCanBreakDoors方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: shouldExecute
import net.minecraft.pathfinding.PathNavigate; //導入方法依賴的package包/類
@Override
public boolean shouldExecute() {
if (!theEntity.isCollidedHorizontally)
return false;
else {
PathNavigate pathnavigate = theEntity.getNavigator();
PathEntity pathentity = pathnavigate.getPath();
if (pathentity != null && !pathentity.isFinished() && pathnavigate.getCanBreakDoors()) {
for (int i = 0; i < Math.min(pathentity.getCurrentPathIndex() + 2, pathentity.getCurrentPathLength()); ++i) {
PathPoint pathpoint = pathentity.getPathPointFromIndex(i);
entityPosX = pathpoint.xCoord;
entityPosY = pathpoint.yCoord + 1;
entityPosZ = pathpoint.zCoord;
if (theEntity.getDistanceSq(entityPosX, theEntity.posY, entityPosZ) <= 2.25D) {
field_151504_e = func_151503_a(entityPosX, entityPosY, entityPosZ);
if (field_151504_e != null)
return true;
}
}
entityPosX = MathHelper.floor_double(theEntity.posX);
entityPosY = MathHelper.floor_double(theEntity.posY + 1.0D);
entityPosZ = MathHelper.floor_double(theEntity.posZ);
field_151504_e = func_151503_a(entityPosX, entityPosY, entityPosZ);
return field_151504_e != null;
} else
return false;
}
}
示例2: shouldExecute
import net.minecraft.pathfinding.PathNavigate; //導入方法依賴的package包/類
/**
* Returns whether the EntityAIBase should begin execution.
*/
public boolean shouldExecute()
{
if (!this.theEntity.isCollidedHorizontally)
{
return false;
}
else
{
PathNavigate var1 = this.theEntity.getNavigator();
PathEntity var2 = var1.getPath();
if (var2 != null && !var2.isFinished() && var1.getCanBreakDoors())
{
for (int var3 = 0; var3 < Math.min(var2.getCurrentPathIndex() + 2, var2.getCurrentPathLength()); ++var3)
{
PathPoint var4 = var2.getPathPointFromIndex(var3);
this.entityPosX = var4.xCoord;
this.entityPosY = var4.yCoord + 1;
this.entityPosZ = var4.zCoord;
if (this.theEntity.getDistanceSq((double)this.entityPosX, this.theEntity.posY, (double)this.entityPosZ) <= 2.25D)
{
this.field_151504_e = this.func_151503_a(this.entityPosX, this.entityPosY, this.entityPosZ);
if (this.field_151504_e != null)
{
return true;
}
}
}
this.entityPosX = MathHelper.floor_double(this.theEntity.posX);
this.entityPosY = MathHelper.floor_double(this.theEntity.posY + 1.0D);
this.entityPosZ = MathHelper.floor_double(this.theEntity.posZ);
this.field_151504_e = this.func_151503_a(this.entityPosX, this.entityPosY, this.entityPosZ);
return this.field_151504_e != null;
}
else
{
return false;
}
}
}
示例3: shouldExecute
import net.minecraft.pathfinding.PathNavigate; //導入方法依賴的package包/類
/**
* Returns whether the EntityAIBase should begin execution.
*/
public boolean shouldExecute()
{
if (!this.theEntity.isCollidedHorizontally)
{
return false;
}
else
{
PathNavigate pathnavigate = this.theEntity.getNavigator();
PathEntity pathentity = pathnavigate.getPath();
if (pathentity != null && !pathentity.isFinished() && pathnavigate.getCanBreakDoors())
{
for (int i = 0; i < Math.min(pathentity.getCurrentPathIndex() + 2, pathentity.getCurrentPathLength()); ++i)
{
PathPoint pathpoint = pathentity.getPathPointFromIndex(i);
this.entityPosX = pathpoint.xCoord;
this.entityPosY = pathpoint.yCoord + 1;
this.entityPosZ = pathpoint.zCoord;
if (this.theEntity.getDistanceSq((double)this.entityPosX, this.theEntity.posY, (double)this.entityPosZ) <= 2.25D)
{
this.targetDoor = this.findUsableDoor(this.entityPosX, this.entityPosY, this.entityPosZ);
if (this.targetDoor != null)
{
return true;
}
}
}
this.entityPosX = MathHelper.floor_double(this.theEntity.posX);
this.entityPosY = MathHelper.floor_double(this.theEntity.posY + 1.0D);
this.entityPosZ = MathHelper.floor_double(this.theEntity.posZ);
this.targetDoor = this.findUsableDoor(this.entityPosX, this.entityPosY, this.entityPosZ);
return this.targetDoor != null;
}
else
{
return false;
}
}
}
示例4: shouldExecute
import net.minecraft.pathfinding.PathNavigate; //導入方法依賴的package包/類
public boolean shouldExecute()
{
if (!this.theEntity.isCollidedHorizontally)
{
return false;
}
else
{
PathNavigate pathnavigate = this.theEntity.getNavigator();
PathEntity pathentity = pathnavigate.getPath();
if (pathentity != null && !pathentity.isFinished() && pathnavigate.getCanBreakDoors())
{
for (int i = 0; i < Math.min(pathentity.getCurrentPathIndex() + 2, pathentity.getCurrentPathLength()); ++i)
{
PathPoint pathpoint = pathentity.getPathPointFromIndex(i);
this.entityPosX = pathpoint.xCoord;
this.entityPosY = pathpoint.yCoord + 1;
this.entityPosZ = pathpoint.zCoord;
if (this.theEntity.getDistanceSq((double)this.entityPosX, this.theEntity.posY, (double)this.entityPosZ) <= 2.25D)
{
this.field_151504_e = this.func_151503_a(this.entityPosX, this.entityPosY, this.entityPosZ);
if (this.field_151504_e != null)
{
return true;
}
}
}
this.entityPosX = MathHelper.floor_double(this.theEntity.posX);
this.entityPosY = MathHelper.floor_double(this.theEntity.posY + 1.0D);
this.entityPosZ = MathHelper.floor_double(this.theEntity.posZ);
this.field_151504_e = this.func_151503_a(this.entityPosX, this.entityPosY, this.entityPosZ);
return this.field_151504_e != null;
}
else
{
return false;
}
}
}