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


Java IBlockAccess.getBlock方法代碼示例

本文整理匯總了Java中net.minecraft.world.IBlockAccess.getBlock方法的典型用法代碼示例。如果您正苦於以下問題:Java IBlockAccess.getBlock方法的具體用法?Java IBlockAccess.getBlock怎麽用?Java IBlockAccess.getBlock使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在net.minecraft.world.IBlockAccess的用法示例。


在下文中一共展示了IBlockAccess.getBlock方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: shouldSideBeRendered

import net.minecraft.world.IBlockAccess; //導入方法依賴的package包/類
@Override
@SideOnly(Side.CLIENT)
public boolean shouldSideBeRendered(IBlockAccess p_149646_1_, int p_149646_2_, int p_149646_3_, int p_149646_4_, int p_149646_5_) {
	Block block = p_149646_1_.getBlock(p_149646_2_, p_149646_3_, p_149646_4_);
	if (p_149646_1_.getBlockMetadata(p_149646_2_, p_149646_3_, p_149646_4_) != p_149646_1_.getBlockMetadata(p_149646_2_ - Facing.offsetsXForSide[p_149646_5_], p_149646_3_ - Facing.offsetsYForSide[p_149646_5_], p_149646_4_ - Facing.offsetsZForSide[p_149646_5_])) {
		return true;
	}

	if (block == this) {
		return false;
	}
	return true;
}
 
開發者ID:viddeno,項目名稱:Technical,代碼行數:14,代碼來源:BlockBaryteSlate.java

示例2: canConnectFenceTo

import net.minecraft.world.IBlockAccess; //導入方法依賴的package包/類
@Override
public boolean canConnectFenceTo(IBlockAccess world, int x, int y, int z) {
	Block block = world.getBlock(x, y, z);
	return super.canConnectFenceTo(world, x, y, z) || block instanceof BlockWoodFence || block instanceof BlockWoodFenceGate;
}
 
開發者ID:jm-organization,項目名稱:connor41-etfuturum2,代碼行數:6,代碼來源:BlockWoodFence.java

示例3: renderWorldBlock

import net.minecraft.world.IBlockAccess; //導入方法依賴的package包/類
@Override
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
	Tessellator tessellator = Tessellator.instance;
	int meta = world.getBlockMetadata(x, y, z);

	if ((meta & 8) != 0) {
		if (world.getBlock(x, y - 1, z) != block)
			return false;
	} else if (world.getBlock(x, y + 1, z) != block)
		return false;

	int brightness = block.getMixedBrightnessForBlock(world, x, y, z);

	tessellator.setBrightness(renderer.renderMinY > 0.0D ? brightness : block.getMixedBrightnessForBlock(world, x, y - 1, z));
	tessellator.setColorOpaque_F(0.5F, 0.5F, 0.5F);
	renderer.renderFaceYNeg(block, x, y, z, renderer.getBlockIcon(block, world, x, y, z, 0));

	if ((meta & 8) != 0) {
		tessellator.setBrightness(renderer.renderMaxY < 1.0D ? brightness : block.getMixedBrightnessForBlock(world, x, y + 1, z));
		tessellator.setColorOpaque_F(1.0F, 1.0F, 1.0F);
		renderer.uvRotateTop = 2;
		renderer.renderFaceYPos(block, x, y, z, renderer.getBlockIcon(block, world, x, y, z, 1));
		renderer.uvRotateTop = 0;
	}

	tessellator.setBrightness(renderer.renderMinZ > 0.0D ? brightness : block.getMixedBrightnessForBlock(world, x, y, z - 1));
	tessellator.setColorOpaque_F(0.8F, 0.8F, 0.8F);
	renderer.renderFaceZNeg(block, x, y, z, renderer.getBlockIcon(block, world, x, y, z, 2));

	renderer.flipTexture = false;
	tessellator.setBrightness(renderer.renderMaxZ < 1.0D ? brightness : block.getMixedBrightnessForBlock(world, x, y, z + 1));
	tessellator.setColorOpaque_F(0.8F, 0.8F, 0.8F);
	renderer.renderFaceZPos(block, x, y, z, renderer.getBlockIcon(block, world, x, y, z, 3));

	renderer.flipTexture = false;
	tessellator.setBrightness(renderer.renderMinX > 0.0D ? brightness : block.getMixedBrightnessForBlock(world, x - 1, y, z));
	tessellator.setColorOpaque_F(0.6F, 0.6F, 0.6F);
	renderer.renderFaceXNeg(block, x, y, z, renderer.getBlockIcon(block, world, x, y, z, 4));

	renderer.flipTexture = false;
	tessellator.setBrightness(renderer.renderMaxX < 1.0D ? brightness : block.getMixedBrightnessForBlock(world, x + 1, y, z));
	tessellator.setColorOpaque_F(0.6F, 0.6F, 0.6F);
	renderer.renderFaceXPos(block, x, y, z, renderer.getBlockIcon(block, world, x, y, z, 5));

	renderer.flipTexture = false;
	return true;
}
 
開發者ID:jm-organization,項目名稱:connor41-etfuturum2,代碼行數:48,代碼來源:BlockDoorRenderer.java


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