本文整理汇总了Java中net.minecraft.village.Village.findNearestDoorUnrestricted方法的典型用法代码示例。如果您正苦于以下问题:Java Village.findNearestDoorUnrestricted方法的具体用法?Java Village.findNearestDoorUnrestricted怎么用?Java Village.findNearestDoorUnrestricted使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.village.Village
的用法示例。
在下文中一共展示了Village.findNearestDoorUnrestricted方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: shouldExecute
import net.minecraft.village.Village; //导入方法依赖的package包/类
/**
* Returns whether the EntityAIBase should begin execution.
*/
public boolean shouldExecute()
{
int var1 = MathHelper.floor_double(this.entityObj.posX);
int var2 = MathHelper.floor_double(this.entityObj.posY);
int var3 = MathHelper.floor_double(this.entityObj.posZ);
if ((!this.entityObj.worldObj.isDaytime() || this.entityObj.worldObj.isRaining() || !this.entityObj.worldObj.getBiomeGenForCoords(var1, var3).canSpawnLightningBolt()) && !this.entityObj.worldObj.provider.hasNoSky)
{
if (this.entityObj.getRNG().nextInt(50) != 0)
{
return false;
}
else if (this.insidePosX != -1 && this.entityObj.getDistanceSq((double)this.insidePosX, this.entityObj.posY, (double)this.insidePosZ) < 4.0D)
{
return false;
}
else
{
Village var4 = this.entityObj.worldObj.villageCollectionObj.findNearestVillage(var1, var2, var3, 14);
if (var4 == null)
{
return false;
}
else
{
this.doorInfo = var4.findNearestDoorUnrestricted(var1, var2, var3);
return this.doorInfo != null;
}
}
}
else
{
return false;
}
}
示例2: shouldExecute
import net.minecraft.village.Village; //导入方法依赖的package包/类
public boolean shouldExecute()
{
int i = MathHelper.floor_double(this.entityObj.posX);
int j = MathHelper.floor_double(this.entityObj.posY);
int k = MathHelper.floor_double(this.entityObj.posZ);
if ((!this.entityObj.worldObj.isDaytime() || this.entityObj.worldObj.isRaining() || !this.entityObj.worldObj.getBiomeGenForCoords(i, k).canSpawnLightningBolt()) && !this.entityObj.worldObj.provider.hasNoSky)
{
if (this.entityObj.getRNG().nextInt(50) != 0)
{
return false;
}
else if (this.insidePosX != -1 && this.entityObj.getDistanceSq((double)this.insidePosX, this.entityObj.posY, (double)this.insidePosZ) < 4.0D)
{
return false;
}
else
{
Village village = this.entityObj.worldObj.villageCollectionObj.findNearestVillage(i, j, k, 14);
if (village == null)
{
return false;
}
else
{
this.doorInfo = village.findNearestDoorUnrestricted(i, j, k);
return this.doorInfo != null;
}
}
}
else
{
return false;
}
}
示例3: shouldExecute
import net.minecraft.village.Village; //导入方法依赖的package包/类
/**
* Returns whether the EntityAIBase should begin execution.
*/
public boolean shouldExecute()
{
if ((!this.entityObj.worldObj.isDaytime() || this.entityObj.worldObj.isRaining()) && !this.entityObj.worldObj.provider.hasNoSky)
{
if (this.entityObj.getRNG().nextInt(50) != 0)
{
return false;
}
else if (this.insidePosX != -1 && this.entityObj.getDistanceSq((double)this.insidePosX, this.entityObj.posY, (double)this.insidePosZ) < 4.0D)
{
return false;
}
else
{
Village village = this.entityObj.worldObj.villageCollectionObj.findNearestVillage(MathHelper.floor_double(this.entityObj.posX), MathHelper.floor_double(this.entityObj.posY), MathHelper.floor_double(this.entityObj.posZ), 14);
if (village == null)
{
return false;
}
else
{
this.doorInfo = village.findNearestDoorUnrestricted(MathHelper.floor_double(this.entityObj.posX), MathHelper.floor_double(this.entityObj.posY), MathHelper.floor_double(this.entityObj.posZ));
return this.doorInfo != null;
}
}
}
else
{
return false;
}
}