本文整理匯總了Java中net.minecraft.init.Blocks.packed_ice方法的典型用法代碼示例。如果您正苦於以下問題:Java Blocks.packed_ice方法的具體用法?Java Blocks.packed_ice怎麽用?Java Blocks.packed_ice使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.minecraft.init.Blocks
的用法示例。
在下文中一共展示了Blocks.packed_ice方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: updateTick
import net.minecraft.init.Blocks; //導入方法依賴的package包/類
@Override
public void updateTick(World world, int x, int y, int z, Random rand) {
if (world.isRemote)
return;
int surroundingBlockCount = 0;
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
Block block = world.getBlock(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ);
if (block == this || block == Blocks.ice || block == Blocks.packed_ice)
if (++surroundingBlockCount >= 4)
break;
}
if (surroundingBlockCount < 4 || rand.nextInt(100) <= 33) {
int meta = world.getBlockMetadata(x, y, z);
if (meta < 3)
world.setBlockMetadataWithNotify(x, y, z, meta + 1, 2);
else
world.setBlock(x, y, z, Blocks.water);
}
world.scheduleBlockUpdate(x, y, z, this, 40 + rand.nextInt(40));
}
示例2: canPlaceBlockAt
import net.minecraft.init.Blocks; //導入方法依賴的package包/類
public boolean canPlaceBlockAt(World worldIn, BlockPos pos)
{
IBlockState iblockstate = worldIn.getBlockState(pos.down());
Block block = iblockstate.getBlock();
return block != Blocks.ice && block != Blocks.packed_ice ? (block.getMaterial() == Material.leaves ? true : (block == this && ((Integer)iblockstate.getValue(LAYERS)).intValue() >= 7 ? true : block.isOpaqueCube() && block.blockMaterial.blocksMovement())) : false;
}
示例3: getWaterBlock
import net.minecraft.init.Blocks; //導入方法依賴的package包/類
@Override
protected BlockMetaPair getWaterBlock() {
return new BlockMetaPair(Blocks.packed_ice, (byte) 0);
}