本文整理汇总了Java中net.minecraft.client.renderer.BufferBuilder.color方法的典型用法代码示例。如果您正苦于以下问题:Java BufferBuilder.color方法的具体用法?Java BufferBuilder.color怎么用?Java BufferBuilder.color使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.client.renderer.BufferBuilder
的用法示例。
在下文中一共展示了BufferBuilder.color方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: renderGhostModel
import net.minecraft.client.renderer.BufferBuilder; //导入方法依赖的package包/类
public static void renderGhostModel(IBakedModel model, BlockPos position, Color color, boolean noDepth, float partialTicks)
{
GlStateManager.enableBlend();
GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE_MINUS_DST_COLOR);
BufferBuilder vb;
if(noDepth)
{
GlStateManager.depthFunc(519);
vb = prepRenderBlockDepth(partialTicks, true);
}
else
vb = prepRender(partialTicks, true);
vb.begin(7, DefaultVertexFormats.BLOCK);
World world = Minecraft.getMinecraft().world;
BlockRendererDispatcher dispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher();
dispatcher.getBlockModelRenderer().renderModel(world, model, Minecraft.getMinecraft().world.getBlockState(position), position.add(0, noDepth ? 500 : 0, 0), vb, false);
for(int i = 0; i < vb.getVertexCount(); i++)
vb.putColorMultiplier(color.getRed() / 255f, color.getGreen() / 255f, color.getBlue() / 255f, i);
vb.color(1, 1, 1, 0.1f);
postRender();
GlStateManager.depthFunc(515);
GlStateManager.disableBlend();
}
示例2: renderGhostBlock
import net.minecraft.client.renderer.BufferBuilder; //导入方法依赖的package包/类
public static void renderGhostBlock(IBlockState state, BlockPos position, Color color, boolean noDepth, float partialTicks)
{
if(!(state.getBlock() instanceof BlockLiquid) && !(state.getBlock() instanceof BlockFluidBase))
{
renderGhostModel(Minecraft.getMinecraft().getBlockRendererDispatcher().getModelForState(state), position, color, noDepth, partialTicks);
return;
}
GlStateManager.enableBlend();
GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE_MINUS_DST_COLOR);
BufferBuilder vb;
if(noDepth)
{
GlStateManager.depthFunc(519);
vb = prepRenderBlockDepth(partialTicks, true);
}
else
vb = prepRender(partialTicks, true);
vb.begin(7, DefaultVertexFormats.BLOCK);
World world = Minecraft.getMinecraft().world;
Minecraft.getMinecraft().getBlockRendererDispatcher().renderBlock(state, position.add(0, noDepth ? 500 : 0, 0), world, vb);
for(int i = 0; i < vb.getVertexCount(); i++)
vb.putColorMultiplier(color.getRed() / 255f, color.getGreen() / 255f, color.getBlue() / 255f, i);
vb.color(1, 1, 1, 0.1f);
postRender();
GlStateManager.disableBlend();
GlStateManager.depthFunc(515);
}