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


Java BlockRendererDispatcher.getBlockModelShapes方法代碼示例

本文整理匯總了Java中net.minecraft.client.renderer.BlockRendererDispatcher.getBlockModelShapes方法的典型用法代碼示例。如果您正苦於以下問題:Java BlockRendererDispatcher.getBlockModelShapes方法的具體用法?Java BlockRendererDispatcher.getBlockModelShapes怎麽用?Java BlockRendererDispatcher.getBlockModelShapes使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在net.minecraft.client.renderer.BlockRendererDispatcher的用法示例。


在下文中一共展示了BlockRendererDispatcher.getBlockModelShapes方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: renderBase

import net.minecraft.client.renderer.BlockRendererDispatcher; //導入方法依賴的package包/類
private void renderBase() {
  BlockRendererDispatcher blockrendererdispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher();
  BlockModelShapes modelShapes = blockrendererdispatcher.getBlockModelShapes();
  IBakedModel bakedModel = modelShapes
      .getModelForState(MachineObject.block_enchanter.getBlockNN().getDefaultState().withProperty(EnumRenderMode.RENDER, EnumRenderMode.FRONT));

  RenderUtil.bindBlockTexture();
  GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
  GlStateManager.enableRescaleNormal();
  GlStateManager.pushMatrix();

  Tessellator tessellator = Tessellator.getInstance();
  VertexBuffer vertexbuffer = tessellator.getBuffer();
  vertexbuffer.begin(GL11.GL_QUADS, DefaultVertexFormats.ITEM);

  for (EnumFacing enumfacing : EnumFacing.values()) {
    this.renderQuads(vertexbuffer, bakedModel.getQuads((IBlockState) null, enumfacing, 0L));
  }

  this.renderQuads(vertexbuffer, bakedModel.getQuads((IBlockState) null, (EnumFacing) null, 0L));
  tessellator.draw();

  GlStateManager.popMatrix();
  GlStateManager.disableRescaleNormal();
}
 
開發者ID:SleepyTrousers,項目名稱:EnderIO,代碼行數:26,代碼來源:EnchanterModelRenderer.java

示例2: renderBlockModel

import net.minecraft.client.renderer.BlockRendererDispatcher; //導入方法依賴的package包/類
@SuppressWarnings("null")
public static void renderBlockModel(@Nonnull World world, @Nonnull BlockPos pos, @Nonnull IBlockState state, boolean translateToOrigin, boolean relight) {
  VertexBuffer wr = Tessellator.getInstance().getBuffer();
  wr.begin(GL11.GL_QUADS, DefaultVertexFormats.BLOCK);
  if (translateToOrigin) {
    wr.setTranslation(-pos.getX(), -pos.getY(), -pos.getZ());
  }
  BlockRendererDispatcher blockrendererdispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher();
  BlockModelShapes modelShapes = blockrendererdispatcher.getBlockModelShapes();
  IBakedModel ibakedmodel = modelShapes.getModelForState(state);
  final IBlockAccess worldWrapper = relight ? new WorldWrapper(world, pos) : world;
  for (BlockRenderLayer layer : BlockRenderLayer.values()) {
    if (state.getBlock().canRenderInLayer(state, layer)) {
      ForgeHooksClient.setRenderLayer(layer);
      blockrendererdispatcher.getBlockModelRenderer().renderModel(worldWrapper, ibakedmodel, state, pos, wr, false);
    }
  }
  ForgeHooksClient.setRenderLayer(null);
  if (translateToOrigin) {
    wr.setTranslation(0, 0, 0);
  }
  Tessellator.getInstance().draw();
}
 
開發者ID:SleepyTrousers,項目名稱:EnderIO,代碼行數:24,代碼來源:SoulBinderTESR.java

示例3: getBakedModelFromBlockState

import net.minecraft.client.renderer.BlockRendererDispatcher; //導入方法依賴的package包/類
@SideOnly(Side.CLIENT)
public static IBakedModel getBakedModelFromBlockState(IBlockState state, IBakedModel defaultModel) {
	if (state != null) {
		Minecraft mc = Minecraft.getMinecraft();
		BlockRendererDispatcher blockRendererDispatcher = mc.getBlockRendererDispatcher();
		BlockModelShapes blockModelShapes = blockRendererDispatcher.getBlockModelShapes();
		IBakedModel blockModel = blockModelShapes.getModelForState(state);
		if (blockModel != null && blockModel != blockModelShapes.getModelManager().getMissingModel()) { return blockModel; }
	}
	return defaultModel;
}
 
開發者ID:tom5454,項目名稱:Toms-Mod,代碼行數:12,代碼來源:TomsModUtils.java

示例4: CCBlockRendererDispatcher

import net.minecraft.client.renderer.BlockRendererDispatcher; //導入方法依賴的package包/類
public CCBlockRendererDispatcher(BlockRendererDispatcher dispatcher, BlockColors blockColours) {
    super(dispatcher.getBlockModelShapes(), blockColours);
    parentDispatcher = dispatcher;
}
 
開發者ID:TheCBProject,項目名稱:CodeChickenLib,代碼行數:5,代碼來源:CCBlockRendererDispatcher.java


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