本文整理汇总了Java中net.minecraft.block.state.IBlockState.getPackedLightmapCoords方法的典型用法代码示例。如果您正苦于以下问题:Java IBlockState.getPackedLightmapCoords方法的具体用法?Java IBlockState.getPackedLightmapCoords怎么用?Java IBlockState.getPackedLightmapCoords使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.block.state.IBlockState
的用法示例。
在下文中一共展示了IBlockState.getPackedLightmapCoords方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: renderModelFlat
import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
public boolean renderModelFlat(IBlockAccess worldIn, IBakedModel modelIn, IBlockState stateIn, BlockPos posIn, VertexBuffer buffer, boolean checkSides, long rand)
{
boolean flag = false;
RenderEnv renderenv = buffer.getRenderEnv(worldIn, stateIn, posIn);
for (EnumFacing enumfacing : EnumFacing.VALUES)
{
List<BakedQuad> list = modelIn.getQuads(stateIn, enumfacing, rand);
if (!list.isEmpty() && (!checkSides || stateIn.shouldSideBeRendered(worldIn, posIn, enumfacing)))
{
int i = stateIn.getPackedLightmapCoords(worldIn, posIn.offset(enumfacing));
list = BlockModelCustomizer.getRenderQuads(list, worldIn, stateIn, posIn, enumfacing, rand, renderenv);
this.renderQuadsFlat(worldIn, stateIn, posIn, i, false, buffer, list, renderenv);
flag = true;
}
}
List<BakedQuad> list1 = modelIn.getQuads(stateIn, (EnumFacing)null, rand);
if (!list1.isEmpty())
{
list1 = BlockModelCustomizer.getRenderQuads(list1, worldIn, stateIn, posIn, (EnumFacing)null, rand, renderenv);
this.renderQuadsFlat(worldIn, stateIn, posIn, -1, true, buffer, list1, renderenv);
flag = true;
}
return flag;
}
示例2: renderModelFlat
import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
public boolean renderModelFlat(IBlockAccess worldIn, IBakedModel modelIn, IBlockState stateIn, BlockPos posIn, VertexBuffer buffer, boolean checkSides, long rand)
{
boolean flag = false;
BitSet bitset = new BitSet(3);
for (EnumFacing enumfacing : EnumFacing.values())
{
List<BakedQuad> list = modelIn.getQuads(stateIn, enumfacing, rand);
if (!list.isEmpty() && (!checkSides || stateIn.shouldSideBeRendered(worldIn, posIn, enumfacing)))
{
int i = stateIn.getPackedLightmapCoords(worldIn, posIn.offset(enumfacing));
this.renderQuadsFlat(worldIn, stateIn, posIn, i, false, buffer, list, bitset);
flag = true;
}
}
List<BakedQuad> list1 = modelIn.getQuads(stateIn, (EnumFacing)null, rand);
if (!list1.isEmpty())
{
this.renderQuadsFlat(worldIn, stateIn, posIn, -1, true, buffer, list1, bitset);
flag = true;
}
return flag;
}
示例3: renderQuadsFlat
import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
private void renderQuadsFlat(IBlockAccess p_renderQuadsFlat_1_, IBlockState p_renderQuadsFlat_2_, BlockPos p_renderQuadsFlat_3_, int p_renderQuadsFlat_4_, boolean p_renderQuadsFlat_5_, VertexBuffer p_renderQuadsFlat_6_, List<BakedQuad> p_renderQuadsFlat_7_, RenderEnv p_renderQuadsFlat_8_)
{
BitSet bitset = p_renderQuadsFlat_8_.getBoundsFlags();
Vec3d vec3d = p_renderQuadsFlat_2_.func_191059_e(p_renderQuadsFlat_1_, p_renderQuadsFlat_3_);
double d0 = (double)p_renderQuadsFlat_3_.getX() + vec3d.xCoord;
double d1 = (double)p_renderQuadsFlat_3_.getY() + vec3d.yCoord;
double d2 = (double)p_renderQuadsFlat_3_.getZ() + vec3d.zCoord;
int i = 0;
for (int j = p_renderQuadsFlat_7_.size(); i < j; ++i)
{
BakedQuad bakedquad = (BakedQuad)p_renderQuadsFlat_7_.get(i);
if (p_renderQuadsFlat_5_)
{
this.fillQuadBounds(p_renderQuadsFlat_2_, bakedquad.getVertexData(), bakedquad.getFace(), (float[])null, bitset);
BlockPos blockpos = bitset.get(0) ? p_renderQuadsFlat_3_.offset(bakedquad.getFace()) : p_renderQuadsFlat_3_;
p_renderQuadsFlat_4_ = p_renderQuadsFlat_2_.getPackedLightmapCoords(p_renderQuadsFlat_1_, blockpos);
}
if (p_renderQuadsFlat_6_.isMultiTexture())
{
p_renderQuadsFlat_6_.addVertexData(bakedquad.getVertexDataSingle());
p_renderQuadsFlat_6_.putSprite(bakedquad.getSprite());
}
else
{
p_renderQuadsFlat_6_.addVertexData(bakedquad.getVertexData());
}
p_renderQuadsFlat_6_.putBrightness4(p_renderQuadsFlat_4_, p_renderQuadsFlat_4_, p_renderQuadsFlat_4_, p_renderQuadsFlat_4_);
int l = CustomColors.getColorMultiplier(bakedquad, p_renderQuadsFlat_2_, p_renderQuadsFlat_1_, p_renderQuadsFlat_3_, p_renderQuadsFlat_8_);
if (!bakedquad.hasTintIndex() && l == -1)
{
if (bakedquad.shouldApplyDiffuseLighting())
{
float f4 = FaceBakery.getFaceBrightness(bakedquad.getFace());
p_renderQuadsFlat_6_.putColorMultiplier(f4, f4, f4, 4);
p_renderQuadsFlat_6_.putColorMultiplier(f4, f4, f4, 3);
p_renderQuadsFlat_6_.putColorMultiplier(f4, f4, f4, 2);
p_renderQuadsFlat_6_.putColorMultiplier(f4, f4, f4, 1);
}
}
else
{
int k = l;
if (l == -1)
{
k = this.blockColors.colorMultiplier(p_renderQuadsFlat_2_, p_renderQuadsFlat_1_, p_renderQuadsFlat_3_, 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;
if (bakedquad.shouldApplyDiffuseLighting())
{
float f3 = FaceBakery.getFaceBrightness(bakedquad.getFace());
f *= f3;
f1 *= f3;
f2 *= f3;
}
p_renderQuadsFlat_6_.putColorMultiplier(f, f1, f2, 4);
p_renderQuadsFlat_6_.putColorMultiplier(f, f1, f2, 3);
p_renderQuadsFlat_6_.putColorMultiplier(f, f1, f2, 2);
p_renderQuadsFlat_6_.putColorMultiplier(f, f1, f2, 1);
}
p_renderQuadsFlat_6_.putPosition(d0, d1, d2);
}
}
示例4: renderOverlayModels
import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
private void renderOverlayModels(IBlockAccess p_renderOverlayModels_1_, IBakedModel p_renderOverlayModels_2_, IBlockState p_renderOverlayModels_3_, BlockPos p_renderOverlayModels_4_, VertexBuffer p_renderOverlayModels_5_, boolean p_renderOverlayModels_6_, long p_renderOverlayModels_7_, RenderEnv p_renderOverlayModels_9_, boolean p_renderOverlayModels_10_)
{
if (p_renderOverlayModels_9_.isOverlaysRendered())
{
for (int i = 0; i < OVERLAY_LAYERS.length; ++i)
{
BlockRenderLayer blockrenderlayer = OVERLAY_LAYERS[i];
ListQuadsOverlay listquadsoverlay = p_renderOverlayModels_9_.getListQuadsOverlay(blockrenderlayer);
if (listquadsoverlay.size() > 0)
{
RegionRenderCacheBuilder regionrendercachebuilder = p_renderOverlayModels_9_.getRegionRenderCacheBuilder();
if (regionrendercachebuilder != null)
{
VertexBuffer vertexbuffer = regionrendercachebuilder.getWorldRendererByLayer(blockrenderlayer);
if (!vertexbuffer.isDrawing())
{
vertexbuffer.begin(7, DefaultVertexFormats.BLOCK);
vertexbuffer.setTranslation(p_renderOverlayModels_5_.getXOffset(), p_renderOverlayModels_5_.getYOffset(), p_renderOverlayModels_5_.getZOffset());
}
for (int j = 0; j < listquadsoverlay.size(); ++j)
{
BakedQuad bakedquad = listquadsoverlay.getQuad(j);
List<BakedQuad> list = listquadsoverlay.getListQuadsSingle(bakedquad);
IBlockState iblockstate = listquadsoverlay.getBlockState(j);
p_renderOverlayModels_9_.reset(p_renderOverlayModels_1_, iblockstate, p_renderOverlayModels_4_);
if (p_renderOverlayModels_10_)
{
this.renderQuadsSmooth(p_renderOverlayModels_1_, iblockstate, p_renderOverlayModels_4_, vertexbuffer, list, p_renderOverlayModels_9_);
}
else
{
int k = iblockstate.getPackedLightmapCoords(p_renderOverlayModels_1_, p_renderOverlayModels_4_.offset(bakedquad.getFace()));
this.renderQuadsFlat(p_renderOverlayModels_1_, iblockstate, p_renderOverlayModels_4_, k, false, vertexbuffer, list, p_renderOverlayModels_9_);
}
}
}
listquadsoverlay.clear();
}
}
}
if (Config.isBetterSnow() && !p_renderOverlayModels_9_.isBreakingAnimation() && BetterSnow.shouldRender(p_renderOverlayModels_1_, p_renderOverlayModels_3_, p_renderOverlayModels_4_))
{
IBakedModel ibakedmodel = BetterSnow.getModelSnowLayer();
IBlockState iblockstate1 = BetterSnow.getStateSnowLayer();
this.renderModel(p_renderOverlayModels_1_, ibakedmodel, iblockstate1, p_renderOverlayModels_4_, p_renderOverlayModels_5_, p_renderOverlayModels_6_, p_renderOverlayModels_7_);
}
}