當前位置: 首頁>>代碼示例>>Java>>正文


Java BlockRendererDispatcher.renderBlock方法代碼示例

本文整理匯總了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);
}
 
開發者ID:OpenMods,項目名稱:OpenModsLib,代碼行數:18,代碼來源:GuiComponentSideSelector.java

示例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
    }
  }
 
開發者ID:SleepyTrousers,項目名稱:EnderIO,代碼行數:20,代碼來源:IoConfigRenderer.java

示例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();
}
 
開發者ID:NekoCaffeine,項目名稱:Alchemy,代碼行數:10,代碼來源:RenderHelper.java

示例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
  }
}
 
開發者ID:SleepyTrousers,項目名稱:EnderIO,代碼行數:15,代碼來源:BlockSceneRenderer.java

示例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);
}
 
開發者ID:Alec-WAM,項目名稱:CrystalMod,代碼行數:6,代碼來源:ChunkRenderer.java


注:本文中的net.minecraft.client.renderer.BlockRendererDispatcher.renderBlock方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。