本文整理汇总了Java中net.minecraft.util.BlockRenderLayer.values方法的典型用法代码示例。如果您正苦于以下问题:Java BlockRenderLayer.values方法的具体用法?Java BlockRenderLayer.values怎么用?Java BlockRenderLayer.values使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.util.BlockRenderLayer
的用法示例。
在下文中一共展示了BlockRenderLayer.values方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: renderBlockModel
import net.minecraft.util.BlockRenderLayer; //导入方法依赖的package包/类
public static void renderBlockModel(World world, BlockPos pos, IBlockState state) {
VertexBuffer wr = Tessellator.getInstance().getBuffer();
wr.begin(GL11.GL_QUADS, DefaultVertexFormats.BLOCK);
wr.setTranslation(-pos.getX(), -pos.getY(), -pos.getZ());
BlockRendererDispatcher blockrendererdispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher();
BlockModelShapes modelShapes = blockrendererdispatcher.getBlockModelShapes();
IBakedModel ibakedmodel = modelShapes.getModelForState(state);
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
for(BlockRenderLayer layer : BlockRenderLayer.values()) {
if(state.getBlock().canRenderInLayer(state, layer)) {
ForgeHooksClient.setRenderLayer(layer);
blockrendererdispatcher.getBlockModelRenderer().renderModel(world, ibakedmodel, state, pos, wr, true);
}
}
ForgeHooksClient.setRenderLayer(null);
wr.setTranslation(0, 0, 0);
Tessellator.getInstance().draw();
}
示例2: RenderChunk
import net.minecraft.util.BlockRenderLayer; //导入方法依赖的package包/类
public RenderChunk(World p_i47120_1_, RenderGlobal p_i47120_2_, int p_i47120_3_)
{
for (int i = 0; i < this.mapEnumFacing.length; ++i)
{
this.mapEnumFacing[i] = new BlockPos.MutableBlockPos();
}
this.world = p_i47120_1_;
this.renderGlobal = p_i47120_2_;
this.index = p_i47120_3_;
if (OpenGlHelper.useVbo())
{
for (int j = 0; j < BlockRenderLayer.values().length; ++j)
{
this.vertexBuffers[j] = new VertexBuffer(DefaultVertexFormats.BLOCK);
}
}
}
示例3: parseBlockRenderLayer
import net.minecraft.util.BlockRenderLayer; //导入方法依赖的package包/类
public BlockRenderLayer parseBlockRenderLayer(String p_parseBlockRenderLayer_1_, BlockRenderLayer p_parseBlockRenderLayer_2_)
{
if (p_parseBlockRenderLayer_1_ == null)
{
return p_parseBlockRenderLayer_2_;
}
else
{
p_parseBlockRenderLayer_1_ = p_parseBlockRenderLayer_1_.toLowerCase().trim();
BlockRenderLayer[] ablockrenderlayer = BlockRenderLayer.values();
for (int i = 0; i < ablockrenderlayer.length; ++i)
{
BlockRenderLayer blockrenderlayer = ablockrenderlayer[i];
if (p_parseBlockRenderLayer_1_.equals(blockrenderlayer.name().toLowerCase()))
{
return blockrenderlayer;
}
}
return p_parseBlockRenderLayer_2_;
}
}
示例4: process
import net.minecraft.util.BlockRenderLayer; //导入方法依赖的package包/类
@Override
public MultiLayerModel process(ImmutableMap<String, String> customData)
{
ImmutableMap.Builder<Optional<BlockRenderLayer>, ModelResourceLocation> builder = ImmutableMap.builder();
for(String key : customData.keySet())
{
if("base".equals(key))
{
builder.put(Optional.<BlockRenderLayer>absent(), getLocation(customData.get(key)));
}
for(BlockRenderLayer layer : BlockRenderLayer.values())
{
if(layer.toString().equals(key))
{
builder.put(Optional.of(layer), getLocation(customData.get(key)));
}
}
}
ImmutableMap<Optional<BlockRenderLayer>, ModelResourceLocation> models = builder.build();
if(models.isEmpty()) return INSTANCE;
return new MultiLayerModel(models);
}
示例5: deleteGlResources
import net.minecraft.util.BlockRenderLayer; //导入方法依赖的package包/类
public void deleteGlResources()
{
this.stopCompileTask();
this.world = null;
for (int i = 0; i < BlockRenderLayer.values().length; ++i)
{
if (this.vertexBuffers[i] != null)
{
this.vertexBuffers[i].deleteGlBuffers();
}
}
}