本文整理匯總了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();
}
示例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();
}
示例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;
}
示例4: CCBlockRendererDispatcher
import net.minecraft.client.renderer.BlockRendererDispatcher; //導入方法依賴的package包/類
public CCBlockRendererDispatcher(BlockRendererDispatcher dispatcher, BlockColors blockColours) {
super(dispatcher.getBlockModelShapes(), blockColours);
parentDispatcher = dispatcher;
}