當前位置: 首頁>>代碼示例>>Java>>正文


Java Blocks.packed_ice方法代碼示例

本文整理匯總了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));
}
 
開發者ID:jm-organization,項目名稱:connor41-etfuturum2,代碼行數:24,代碼來源:FrostedIce.java

示例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;
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:7,代碼來源:BlockSnow.java

示例3: getWaterBlock

import net.minecraft.init.Blocks; //導入方法依賴的package包/類
@Override
protected BlockMetaPair getWaterBlock() {
	return new BlockMetaPair(Blocks.packed_ice, (byte) 0);
}
 
開發者ID:BlesseNtumble,項目名稱:TRAPPIST-1,代碼行數:5,代碼來源:ChunkProviderTrappistOneC.java


注:本文中的net.minecraft.init.Blocks.packed_ice方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。