本文整理匯總了Java中net.minecraft.entity.Entity.getMaxFallHeight方法的典型用法代碼示例。如果您正苦於以下問題:Java Entity.getMaxFallHeight方法的具體用法?Java Entity.getMaxFallHeight怎麽用?Java Entity.getMaxFallHeight使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.minecraft.entity.Entity
的用法示例。
在下文中一共展示了Entity.getMaxFallHeight方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getSafePoint
import net.minecraft.entity.Entity; //導入方法依賴的package包/類
/**
* Returns a point that the entity can safely move to
*/
private PathPoint getSafePoint(Entity entityIn, int x, int y, int z, int p_176171_5_)
{
PathPoint pathpoint = null;
int i = this.getVerticalOffset(entityIn, x, y, z);
if (i == 2)
{
return this.openPoint(x, y, z);
}
else
{
if (i == 1)
{
pathpoint = this.openPoint(x, y, z);
}
if (pathpoint == null && p_176171_5_ > 0 && i != -3 && i != -4 && this.getVerticalOffset(entityIn, x, y + p_176171_5_, z) == 1)
{
pathpoint = this.openPoint(x, y + p_176171_5_, z);
y += p_176171_5_;
}
if (pathpoint != null)
{
int j = 0;
int k;
for (k = 0; y > 0; pathpoint = this.openPoint(x, y, z))
{
k = this.getVerticalOffset(entityIn, x, y - 1, z);
if (this.avoidsWater && k == -1)
{
return null;
}
if (k != 1)
{
break;
}
if (j++ >= entityIn.getMaxFallHeight())
{
return null;
}
--y;
if (y <= 0)
{
return null;
}
}
if (k == -2)
{
return null;
}
}
return pathpoint;
}
}