本文整理匯總了Java中net.minecraft.init.Blocks.iron_trapdoor方法的典型用法代碼示例。如果您正苦於以下問題:Java Blocks.iron_trapdoor方法的具體用法?Java Blocks.iron_trapdoor怎麽用?Java Blocks.iron_trapdoor使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.minecraft.init.Blocks
的用法示例。
在下文中一共展示了Blocks.iron_trapdoor方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: func_176170_a
import net.minecraft.init.Blocks; //導入方法依賴的package包/類
public static int func_176170_a(IBlockAccess blockaccessIn, Entity entityIn, int x, int y, int z, int sizeX, int sizeY, int sizeZ, boolean avoidWater, boolean breakDoors, boolean enterDoors)
{
boolean flag = false;
BlockPos blockpos = new BlockPos(entityIn);
BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos();
for (int i = x; i < x + sizeX; ++i)
{
for (int j = y; j < y + sizeY; ++j)
{
for (int k = z; k < z + sizeZ; ++k)
{
blockpos$mutableblockpos.func_181079_c(i, j, k);
Block block = blockaccessIn.getBlockState(blockpos$mutableblockpos).getBlock();
if (block.getMaterial() != Material.air)
{
if (block != Blocks.trapdoor && block != Blocks.iron_trapdoor)
{
if (block != Blocks.flowing_water && block != Blocks.water)
{
if (!enterDoors && block instanceof BlockDoor && block.getMaterial() == Material.wood)
{
return 0;
}
}
else
{
if (avoidWater)
{
return -1;
}
flag = true;
}
}
else
{
flag = true;
}
if (entityIn.worldObj.getBlockState(blockpos$mutableblockpos).getBlock() instanceof BlockRailBase)
{
if (!(entityIn.worldObj.getBlockState(blockpos).getBlock() instanceof BlockRailBase) && !(entityIn.worldObj.getBlockState(blockpos.down()).getBlock() instanceof BlockRailBase))
{
return -3;
}
}
else if (!block.isPassable(blockaccessIn, blockpos$mutableblockpos) && (!breakDoors || !(block instanceof BlockDoor) || block.getMaterial() != Material.wood))
{
if (block instanceof BlockFence || block instanceof BlockFenceGate || block instanceof BlockWall)
{
return -3;
}
if (block == Blocks.trapdoor || block == Blocks.iron_trapdoor)
{
return -4;
}
Material material = block.getMaterial();
if (material != Material.lava)
{
return 0;
}
if (!entityIn.isInLava())
{
return -2;
}
}
}
}
}
}
return flag ? 2 : 1;
}