本文整理匯總了Java中net.minecraft.client.renderer.BlockRendererDispatcher.renderBlock方法的典型用法代碼示例。如果您正苦於以下問題:Java BlockRendererDispatcher.renderBlock方法的具體用法?Java BlockRendererDispatcher.renderBlock怎麽用?Java BlockRendererDispatcher.renderBlock使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.minecraft.client.renderer.BlockRendererDispatcher
的用法示例。
在下文中一共展示了BlockRendererDispatcher.renderBlock方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: drawBlock
import net.minecraft.client.renderer.BlockRendererDispatcher; //導入方法依賴的package包/類
private void drawBlock() {
final Tessellator tessellator = Tessellator.getInstance();
final BufferBuilder wr = tessellator.getBuffer();
final BlockRendererDispatcher dispatcher = parent.getMinecraft().getBlockRendererDispatcher();
for (BlockRenderLayer layer : BlockRenderLayer.values()) {
if (blockState.getBlock().canRenderInLayer(blockState, layer)) {
net.minecraftforge.client.ForgeHooksClient.setRenderLayer(layer);
wr.setTranslation(-0.5, -0.5, -0.5);
wr.begin(GL11.GL_QUADS, DefaultVertexFormats.BLOCK);
dispatcher.renderBlock(blockState, FakeBlockAccess.ORIGIN, access, wr);
tessellator.draw();
}
}
wr.setTranslation(0.0D, 0.0D, 0.0D);
net.minecraftforge.client.ForgeHooksClient.setRenderLayer(null);
}
示例2: renderBlock
import net.minecraft.client.renderer.BlockRendererDispatcher; //導入方法依賴的package包/類
public void renderBlock(@Nonnull IBlockState state, @Nonnull BlockPos pos, @Nonnull IBlockAccess blockAccess, @Nonnull VertexBuffer worldRendererIn) {
try {
BlockRendererDispatcher blockrendererdispatcher = mc.getBlockRendererDispatcher();
EnumBlockRenderType type = state.getRenderType();
if (type != EnumBlockRenderType.MODEL) {
blockrendererdispatcher.renderBlock(state, pos, blockAccess, worldRendererIn);
return;
}
// We only want to change one param here, the check sides
IBakedModel ibakedmodel = blockrendererdispatcher.getModelForState(state);
state = state.getBlock().getExtendedState(state, world, pos);
blockrendererdispatcher.getBlockModelRenderer().renderModel(blockAccess, ibakedmodel, state, pos, worldRendererIn, false);
} catch (Throwable throwable) {
// Just bury a render issue here, it is only the IO screen
}
}
示例3: renderBlock
import net.minecraft.client.renderer.BlockRendererDispatcher; //導入方法依賴的package包/類
public static void renderBlock(IBlockState state, BlockPos pos) {
Tessellator tessellator = Tessellator.getInstance();
BufferBuilder BufferBuilder = tessellator.getBuffer();
BufferBuilder.begin(GL_QUADS, DefaultVertexFormats.BLOCK);
Minecraft minecraft = Minecraft.getMinecraft();
BlockRendererDispatcher dispatcher = minecraft.getBlockRendererDispatcher();
dispatcher.renderBlock(state, pos, minecraft.world, BufferBuilder);
tessellator.draw();
}
示例4: renderBlock
import net.minecraft.client.renderer.BlockRendererDispatcher; //導入方法依賴的package包/類
public void renderBlock(@Nonnull IBlockState state, @Nonnull BlockPos pos, @Nonnull VertexBuffer worldRendererIn) {
try {
BlockRendererDispatcher blockrendererdispatcher = mc.getBlockRendererDispatcher();
EnumBlockRenderType type = state.getRenderType();
if (type != EnumBlockRenderType.MODEL) {
blockrendererdispatcher.renderBlock(state, pos, Minecraft.getMinecraft().world, worldRendererIn);
return;
}
IBakedModel ibakedmodel = blockrendererdispatcher.getModelForState(state);
blockrendererdispatcher.getBlockModelRenderer().renderModel(Minecraft.getMinecraft().world, ibakedmodel, state, pos, worldRendererIn, false);
} catch (Throwable throwable) {
// Just bury a render issue here, it is only the IO screen
}
}
示例5: dispatchBlockRender
import net.minecraft.client.renderer.BlockRendererDispatcher; //導入方法依賴的package包/類
public void dispatchBlockRender(IBlockState blockState, BlockPos blockPos, VertexBuffer worldRenderer) {
worldRenderer.color(1.0F, 1.0F, 1.0F, 1.0F);
BlockRendererDispatcher blockRendererDispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher();
blockRendererDispatcher.renderBlock(blockState, blockPos, chunk, worldRenderer);
}