当前位置: 首页>>代码示例>>Java>>正文


Java IBlockAccess.getBlockMetadata方法代码示例

本文整理汇总了Java中net.minecraft.world.IBlockAccess.getBlockMetadata方法的典型用法代码示例。如果您正苦于以下问题:Java IBlockAccess.getBlockMetadata方法的具体用法?Java IBlockAccess.getBlockMetadata怎么用?Java IBlockAccess.getBlockMetadata使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.world.IBlockAccess的用法示例。


在下文中一共展示了IBlockAccess.getBlockMetadata方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setBlockBoundsBasedOnState

import net.minecraft.world.IBlockAccess; //导入方法依赖的package包/类
@Override
public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z)
   {
	int meta = world.getBlockMetadata(x, y, z);
	
	float plusX = 0;
	float plusY = 0;
	float plusZ = 0;
	
	if (meta == 0)	{ plusY = 0.375F; }			// Bottom, so need to move to the top
	else if (meta == 1) { plusY = -0.375F; } 	// Top, so need to move to the bottom
	else if (meta == 2) { plusZ = 0.375F; }		// East, so need to move west
	else if (meta == 3) { plusZ = -0.375F; }	// West, so need to move east
	else if (meta == 4) { plusX = 0.375F; } 	// North, so need to move south
	else if (meta == 5) { plusX = -0.375F; } 	// South, so need to move north
	
	this.setBlockBounds(sizeMin + plusX, sizeMin + plusY, sizeMin + plusZ, sizeMax + plusX, sizeMax + plusY, sizeMax + plusZ);
   }
 
开发者ID:Domochevsky,项目名称:minecraft-quiverbow,代码行数:19,代码来源:FenLight.java

示例2: setBlockBoundsBasedOnState

import net.minecraft.world.IBlockAccess; //导入方法依赖的package包/类
@Override
public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) {
	int meta = world.getBlockMetadata(x, y, z);
	if (meta == 0)
		setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F);
	else if (meta == 1)
		setBlockBounds(0.0F, 0.5F, 0.0F, 1.0F, 1.0F, 1.0F);
	else if (meta == 2)
		setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
}
 
开发者ID:jm-organization,项目名称:connor41-etfuturum2,代码行数:11,代码来源:GenericSlab.java

示例3: colorMultiplier

import net.minecraft.world.IBlockAccess; //导入方法依赖的package包/类
@SideOnly(Side.CLIENT)
@Override
public int colorMultiplier(IBlockAccess world, int x, int y, int z)
{
    int meta = world.getBlockMetadata(x, y, z);
    
    return getRenderColor(meta);
}
 
开发者ID:Wahazar,项目名称:TFCPrimitiveTech,代码行数:9,代码来源:BlockWoodenPressWet.java

示例4: 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

示例5: isSideSolid

import net.minecraft.world.IBlockAccess; //导入方法依赖的package包/类
@Override
public boolean isSideSolid(IBlockAccess world, int x, int y, int z, ForgeDirection side) {
	int meta = world.getBlockMetadata(x, y, z);
	return meta == 2 || side == ForgeDirection.UP && meta == 1 || side == ForgeDirection.DOWN && meta == 0;
}
 
开发者ID:jm-organization,项目名称:connor41-etfuturum2,代码行数:6,代码来源:GenericSlab.java

示例6: 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.getBlockMetadata方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。