本文整理汇总了Java中net.minecraft.block.Block.getOffsetType方法的典型用法代码示例。如果您正苦于以下问题:Java Block.getOffsetType方法的具体用法?Java Block.getOffsetType怎么用?Java Block.getOffsetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.block.Block
的用法示例。
在下文中一共展示了Block.getOffsetType方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: renderModelAmbientOcclusionQuads
import net.minecraft.block.Block; //导入方法依赖的package包/类
private void renderModelAmbientOcclusionQuads(IBlockAccess blockAccessIn, Block blockIn, BlockPos blockPosIn, WorldRenderer worldRendererIn, List<BakedQuad> listQuadsIn, float[] quadBounds, BitSet boundsFlags, BlockModelRenderer.AmbientOcclusionFace aoFaceIn)
{
double d0 = (double)blockPosIn.getX();
double d1 = (double)blockPosIn.getY();
double d2 = (double)blockPosIn.getZ();
Block.EnumOffsetType block$enumoffsettype = blockIn.getOffsetType();
if (block$enumoffsettype != Block.EnumOffsetType.NONE)
{
long i = MathHelper.getPositionRandom(blockPosIn);
d0 += ((double)((float)(i >> 16 & 15L) / 15.0F) - 0.5D) * 0.5D;
d2 += ((double)((float)(i >> 24 & 15L) / 15.0F) - 0.5D) * 0.5D;
if (block$enumoffsettype == Block.EnumOffsetType.XYZ)
{
d1 += ((double)((float)(i >> 20 & 15L) / 15.0F) - 1.0D) * 0.2D;
}
}
for (BakedQuad bakedquad : listQuadsIn)
{
this.fillQuadBounds(blockIn, bakedquad.getVertexData(), bakedquad.getFace(), quadBounds, boundsFlags);
aoFaceIn.updateVertexBrightness(blockAccessIn, blockIn, blockPosIn, bakedquad.getFace(), quadBounds, boundsFlags);
worldRendererIn.addVertexData(bakedquad.getVertexData());
worldRendererIn.putBrightness4(aoFaceIn.vertexBrightness[0], aoFaceIn.vertexBrightness[1], aoFaceIn.vertexBrightness[2], aoFaceIn.vertexBrightness[3]);
if (bakedquad.hasTintIndex())
{
int j = blockIn.colorMultiplier(blockAccessIn, blockPosIn, bakedquad.getTintIndex());
if (EntityRenderer.anaglyphEnable)
{
j = TextureUtil.anaglyphColor(j);
}
float f = (float)(j >> 16 & 255) / 255.0F;
float f1 = (float)(j >> 8 & 255) / 255.0F;
float f2 = (float)(j & 255) / 255.0F;
worldRendererIn.putColorMultiplier(aoFaceIn.vertexColorMultiplier[0] * f, aoFaceIn.vertexColorMultiplier[0] * f1, aoFaceIn.vertexColorMultiplier[0] * f2, 4);
worldRendererIn.putColorMultiplier(aoFaceIn.vertexColorMultiplier[1] * f, aoFaceIn.vertexColorMultiplier[1] * f1, aoFaceIn.vertexColorMultiplier[1] * f2, 3);
worldRendererIn.putColorMultiplier(aoFaceIn.vertexColorMultiplier[2] * f, aoFaceIn.vertexColorMultiplier[2] * f1, aoFaceIn.vertexColorMultiplier[2] * f2, 2);
worldRendererIn.putColorMultiplier(aoFaceIn.vertexColorMultiplier[3] * f, aoFaceIn.vertexColorMultiplier[3] * f1, aoFaceIn.vertexColorMultiplier[3] * f2, 1);
}
else
{
worldRendererIn.putColorMultiplier(aoFaceIn.vertexColorMultiplier[0], aoFaceIn.vertexColorMultiplier[0], aoFaceIn.vertexColorMultiplier[0], 4);
worldRendererIn.putColorMultiplier(aoFaceIn.vertexColorMultiplier[1], aoFaceIn.vertexColorMultiplier[1], aoFaceIn.vertexColorMultiplier[1], 3);
worldRendererIn.putColorMultiplier(aoFaceIn.vertexColorMultiplier[2], aoFaceIn.vertexColorMultiplier[2], aoFaceIn.vertexColorMultiplier[2], 2);
worldRendererIn.putColorMultiplier(aoFaceIn.vertexColorMultiplier[3], aoFaceIn.vertexColorMultiplier[3], aoFaceIn.vertexColorMultiplier[3], 1);
}
worldRendererIn.putPosition(d0, d1, d2);
}
}
示例2: renderModelStandardQuads
import net.minecraft.block.Block; //导入方法依赖的package包/类
private void renderModelStandardQuads(IBlockAccess blockAccessIn, Block blockIn, BlockPos blockPosIn, EnumFacing faceIn, int brightnessIn, boolean ownBrightness, WorldRenderer worldRendererIn, List<BakedQuad> listQuadsIn, BitSet boundsFlags)
{
double d0 = (double)blockPosIn.getX();
double d1 = (double)blockPosIn.getY();
double d2 = (double)blockPosIn.getZ();
Block.EnumOffsetType block$enumoffsettype = blockIn.getOffsetType();
if (block$enumoffsettype != Block.EnumOffsetType.NONE)
{
int i = blockPosIn.getX();
int j = blockPosIn.getZ();
long k = (long)(i * 3129871) ^ (long)j * 116129781L;
k = k * k * 42317861L + k * 11L;
d0 += ((double)((float)(k >> 16 & 15L) / 15.0F) - 0.5D) * 0.5D;
d2 += ((double)((float)(k >> 24 & 15L) / 15.0F) - 0.5D) * 0.5D;
if (block$enumoffsettype == Block.EnumOffsetType.XYZ)
{
d1 += ((double)((float)(k >> 20 & 15L) / 15.0F) - 1.0D) * 0.2D;
}
}
for (BakedQuad bakedquad : listQuadsIn)
{
if (ownBrightness)
{
this.fillQuadBounds(blockIn, bakedquad.getVertexData(), bakedquad.getFace(), (float[])null, boundsFlags);
brightnessIn = boundsFlags.get(0) ? blockIn.getMixedBrightnessForBlock(blockAccessIn, blockPosIn.offset(bakedquad.getFace())) : blockIn.getMixedBrightnessForBlock(blockAccessIn, blockPosIn);
}
worldRendererIn.addVertexData(bakedquad.getVertexData());
worldRendererIn.putBrightness4(brightnessIn, brightnessIn, brightnessIn, brightnessIn);
if (bakedquad.hasTintIndex())
{
int l = blockIn.colorMultiplier(blockAccessIn, blockPosIn, bakedquad.getTintIndex());
if (EntityRenderer.anaglyphEnable)
{
l = TextureUtil.anaglyphColor(l);
}
float f = (float)(l >> 16 & 255) / 255.0F;
float f1 = (float)(l >> 8 & 255) / 255.0F;
float f2 = (float)(l & 255) / 255.0F;
worldRendererIn.putColorMultiplier(f, f1, f2, 4);
worldRendererIn.putColorMultiplier(f, f1, f2, 3);
worldRendererIn.putColorMultiplier(f, f1, f2, 2);
worldRendererIn.putColorMultiplier(f, f1, f2, 1);
}
worldRendererIn.putPosition(d0, d1, d2);
}
}
示例3: renderQuadsSmooth
import net.minecraft.block.Block; //导入方法依赖的package包/类
private void renderQuadsSmooth(IBlockAccess blockAccessIn, IBlockState stateIn, BlockPos posIn, VertexBuffer buffer, List<BakedQuad> list, float[] quadBounds, BitSet bitSet, BlockModelRenderer.AmbientOcclusionFace aoFace)
{
double d0 = (double)posIn.getX();
double d1 = (double)posIn.getY();
double d2 = (double)posIn.getZ();
Block block = stateIn.getBlock();
Block.EnumOffsetType block$enumoffsettype = block.getOffsetType();
if (block$enumoffsettype != Block.EnumOffsetType.NONE)
{
long i = MathHelper.getPositionRandom(posIn);
d0 += ((double)((float)(i >> 16 & 15L) / 15.0F) - 0.5D) * 0.5D;
d2 += ((double)((float)(i >> 24 & 15L) / 15.0F) - 0.5D) * 0.5D;
if (block$enumoffsettype == Block.EnumOffsetType.XYZ)
{
d1 += ((double)((float)(i >> 20 & 15L) / 15.0F) - 1.0D) * 0.2D;
}
}
int l = 0;
for (int j = list.size(); l < j; ++l)
{
BakedQuad bakedquad = (BakedQuad)list.get(l);
this.fillQuadBounds(stateIn, bakedquad.getVertexData(), bakedquad.getFace(), quadBounds, bitSet);
aoFace.updateVertexBrightness(blockAccessIn, stateIn, posIn, bakedquad.getFace(), quadBounds, bitSet);
buffer.addVertexData(bakedquad.getVertexData());
buffer.putBrightness4(aoFace.vertexBrightness[0], aoFace.vertexBrightness[1], aoFace.vertexBrightness[2], aoFace.vertexBrightness[3]);
if(bakedquad.shouldApplyDiffuseLighting())
{
float diffuse = net.minecraftforge.client.model.pipeline.LightUtil.diffuseLight(bakedquad.getFace());
aoFace.vertexColorMultiplier[0] *= diffuse;
aoFace.vertexColorMultiplier[1] *= diffuse;
aoFace.vertexColorMultiplier[2] *= diffuse;
aoFace.vertexColorMultiplier[3] *= diffuse;
}
if (bakedquad.hasTintIndex())
{
int k = this.blockColors.colorMultiplier(stateIn, blockAccessIn, posIn, bakedquad.getTintIndex());
if (EntityRenderer.anaglyphEnable)
{
k = TextureUtil.anaglyphColor(k);
}
float f = (float)(k >> 16 & 255) / 255.0F;
float f1 = (float)(k >> 8 & 255) / 255.0F;
float f2 = (float)(k & 255) / 255.0F;
buffer.putColorMultiplier(aoFace.vertexColorMultiplier[0] * f, aoFace.vertexColorMultiplier[0] * f1, aoFace.vertexColorMultiplier[0] * f2, 4);
buffer.putColorMultiplier(aoFace.vertexColorMultiplier[1] * f, aoFace.vertexColorMultiplier[1] * f1, aoFace.vertexColorMultiplier[1] * f2, 3);
buffer.putColorMultiplier(aoFace.vertexColorMultiplier[2] * f, aoFace.vertexColorMultiplier[2] * f1, aoFace.vertexColorMultiplier[2] * f2, 2);
buffer.putColorMultiplier(aoFace.vertexColorMultiplier[3] * f, aoFace.vertexColorMultiplier[3] * f1, aoFace.vertexColorMultiplier[3] * f2, 1);
}
else
{
buffer.putColorMultiplier(aoFace.vertexColorMultiplier[0], aoFace.vertexColorMultiplier[0], aoFace.vertexColorMultiplier[0], 4);
buffer.putColorMultiplier(aoFace.vertexColorMultiplier[1], aoFace.vertexColorMultiplier[1], aoFace.vertexColorMultiplier[1], 3);
buffer.putColorMultiplier(aoFace.vertexColorMultiplier[2], aoFace.vertexColorMultiplier[2], aoFace.vertexColorMultiplier[2], 2);
buffer.putColorMultiplier(aoFace.vertexColorMultiplier[3], aoFace.vertexColorMultiplier[3], aoFace.vertexColorMultiplier[3], 1);
}
buffer.putPosition(d0, d1, d2);
}
}