本文整理匯總了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();
}
}
}