本文整理匯總了Java中net.minecraft.client.renderer.RenderGlobal.addChainedFilledBoxVertices方法的典型用法代碼示例。如果您正苦於以下問題:Java RenderGlobal.addChainedFilledBoxVertices方法的具體用法?Java RenderGlobal.addChainedFilledBoxVertices怎麽用?Java RenderGlobal.addChainedFilledBoxVertices使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.minecraft.client.renderer.RenderGlobal
的用法示例。
在下文中一共展示了RenderGlobal.addChainedFilledBoxVertices方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: drawBox
import net.minecraft.client.renderer.RenderGlobal; //導入方法依賴的package包/類
@SideOnly(Side.CLIENT)
public void drawBox(BufferBuilder bufferbuilder, double d0, double d1, double d2)
{
if(this.didDrawBoundsLastTime)
{
if(this.positions == null)
{
AxisAlignedBB box = this.aabb;
RenderGlobal.addChainedFilledBoxVertices(bufferbuilder, box.minX - d0, box.minY - d1, box.minZ - d2, box.maxX - d0, box.maxY - d1, box.maxZ - d2, 1f, 0.3f, 0.3f, 0.3f);
}
else
{
for(BlockPos pos : this.positions)
{
double x = pos.getX() - d0;
double y = pos.getY() - d1;
double z = pos.getZ() - d2;
RenderGlobal.addChainedFilledBoxVertices(bufferbuilder, x, y, z, x + 1, y + 1, z + 1, 1f, 0.3f, 0.3f, 0.3f);
}
}
}
}
示例2: drawSelection
import net.minecraft.client.renderer.RenderGlobal; //導入方法依賴的package包/類
@SideOnly(Side.CLIENT)
@Override
protected void drawSelection(Tessellator tessellator, BufferBuilder bufferBuilder)
{
if(this.region == null) return;
AxisAlignedBB box = this.region.toAABB();
// draw edge without depth to show extent of region
GlStateManager.disableDepth();
GlStateManager.glLineWidth(2.0F);
bufferBuilder.begin(GL11.GL_LINE_STRIP, DefaultVertexFormats.POSITION_COLOR);
RenderGlobal.drawBoundingBox(bufferBuilder, box.minX, box.minY, box.minZ, box.maxX, box.maxY, box.maxZ, SELECT.red, SELECT.green, SELECT.blue, 1f);
tessellator.draw();
// draw sides with depth to better show what parts are unobstructed
GlStateManager.enableDepth();
bufferBuilder.begin(GL11.GL_TRIANGLE_STRIP, DefaultVertexFormats.POSITION_COLOR);
RenderGlobal.addChainedFilledBoxVertices(bufferBuilder, box.minX, box.minY, box.minZ, box.maxX, box.maxY, box.maxZ, SELECT.red, SELECT.green, SELECT.blue, 0.4f);
tessellator.draw();
}
示例3: render
import net.minecraft.client.renderer.RenderGlobal; //導入方法依賴的package包/類
public void render(float p_190060_1_, long p_190060_2_)
{
EntityPlayer entityplayer = this.minecraft.player;
World world = this.minecraft.world;
double d0 = entityplayer.lastTickPosX + (entityplayer.posX - entityplayer.lastTickPosX) * (double)p_190060_1_;
double d1 = entityplayer.lastTickPosY + (entityplayer.posY - entityplayer.lastTickPosY) * (double)p_190060_1_;
double d2 = entityplayer.lastTickPosZ + (entityplayer.posZ - entityplayer.lastTickPosZ) * (double)p_190060_1_;
GlStateManager.pushMatrix();
GlStateManager.enableBlend();
GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
GlStateManager.disableTexture2D();
BlockPos blockpos = new BlockPos(entityplayer.posX, 0.0D, entityplayer.posZ);
Iterable<BlockPos> iterable = BlockPos.getAllInBox(blockpos.add(-40, 0, -40), blockpos.add(40, 0, 40));
Tessellator tessellator = Tessellator.getInstance();
VertexBuffer vertexbuffer = tessellator.getBuffer();
vertexbuffer.begin(5, DefaultVertexFormats.POSITION_COLOR);
for (BlockPos blockpos1 : iterable)
{
int i = world.getHeight(blockpos1.getX(), blockpos1.getZ());
if (world.getBlockState(blockpos1.add(0, i, 0).down()) == Blocks.AIR.getDefaultState())
{
RenderGlobal.addChainedFilledBoxVertices(vertexbuffer, (double)((float)blockpos1.getX() + 0.25F) - d0, (double)i - d1, (double)((float)blockpos1.getZ() + 0.25F) - d2, (double)((float)blockpos1.getX() + 0.75F) - d0, (double)i + 0.09375D - d1, (double)((float)blockpos1.getZ() + 0.75F) - d2, 0.0F, 0.0F, 1.0F, 0.5F);
}
else
{
RenderGlobal.addChainedFilledBoxVertices(vertexbuffer, (double)((float)blockpos1.getX() + 0.25F) - d0, (double)i - d1, (double)((float)blockpos1.getZ() + 0.25F) - d2, (double)((float)blockpos1.getX() + 0.75F) - d0, (double)i + 0.09375D - d1, (double)((float)blockpos1.getZ() + 0.75F) - d2, 0.0F, 1.0F, 0.0F, 0.5F);
}
}
tessellator.draw();
GlStateManager.enableTexture2D();
GlStateManager.popMatrix();
}
示例4: render
import net.minecraft.client.renderer.RenderGlobal; //導入方法依賴的package包/類
public void render(float p_190060_1_, long p_190060_2_)
{
EntityPlayer entityplayer = this.minecraft.thePlayer;
World world = this.minecraft.theWorld;
double d0 = entityplayer.lastTickPosX + (entityplayer.posX - entityplayer.lastTickPosX) * (double)p_190060_1_;
double d1 = entityplayer.lastTickPosY + (entityplayer.posY - entityplayer.lastTickPosY) * (double)p_190060_1_;
double d2 = entityplayer.lastTickPosZ + (entityplayer.posZ - entityplayer.lastTickPosZ) * (double)p_190060_1_;
GlStateManager.pushMatrix();
GlStateManager.enableBlend();
GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
GlStateManager.disableTexture2D();
BlockPos blockpos = new BlockPos(entityplayer.posX, 0.0D, entityplayer.posZ);
Iterable<BlockPos> iterable = BlockPos.MutableBlockPos.getAllInBox(blockpos.add(-40, 0, -40), blockpos.add(40, 0, 40));
Tessellator tessellator = Tessellator.getInstance();
VertexBuffer vertexbuffer = tessellator.getBuffer();
vertexbuffer.begin(5, DefaultVertexFormats.POSITION_COLOR);
for (BlockPos blockpos1 : iterable)
{
int i = world.getHeightmapHeight(blockpos1.getX(), blockpos1.getZ());
if (world.getBlockState(blockpos1.add(0, i, 0).down()) == Blocks.AIR.getDefaultState())
{
RenderGlobal.addChainedFilledBoxVertices(vertexbuffer, (double)((float)blockpos1.getX() + 0.25F) - d0, (double)i - d1, (double)((float)blockpos1.getZ() + 0.25F) - d2, (double)((float)blockpos1.getX() + 0.75F) - d0, (double)i + 0.09375D - d1, (double)((float)blockpos1.getZ() + 0.75F) - d2, 0.0F, 0.0F, 1.0F, 0.5F);
}
else
{
RenderGlobal.addChainedFilledBoxVertices(vertexbuffer, (double)((float)blockpos1.getX() + 0.25F) - d0, (double)i - d1, (double)((float)blockpos1.getZ() + 0.25F) - d2, (double)((float)blockpos1.getX() + 0.75F) - d0, (double)i + 0.09375D - d1, (double)((float)blockpos1.getZ() + 0.75F) - d2, 0.0F, 1.0F, 0.0F, 0.5F);
}
}
tessellator.draw();
GlStateManager.enableTexture2D();
GlStateManager.popMatrix();
}
示例5: drawPlacement
import net.minecraft.client.renderer.RenderGlobal; //導入方法依賴的package包/類
@SideOnly(Side.CLIENT)
@Override
protected void drawPlacement(Tessellator tessellator, BufferBuilder bufferBuilder, PlacementPreviewRenderMode previewMode)
{
switch(previewMode)
{
case EXCAVATE:
AxisAlignedBB box = new AxisAlignedBB(this.pPos.inPos);
// draw edges without depth to show extent of region
GlStateManager.disableDepth();
GlStateManager.glLineWidth(2.0F);
bufferBuilder.begin(GL11.GL_LINE_STRIP, DefaultVertexFormats.POSITION_COLOR);
RenderGlobal.drawBoundingBox(bufferBuilder, box.minX, box.minY, box.minZ, box.maxX, box.maxY, box.maxZ, previewMode.red, previewMode.green, previewMode.blue, 1f);
tessellator.draw();
// draw sides with depth to better show what parts are unobstructed
GlStateManager.enableDepth();
bufferBuilder.begin(GL11.GL_TRIANGLE_STRIP, DefaultVertexFormats.POSITION_COLOR);
RenderGlobal.addChainedFilledBoxVertices(bufferBuilder, box.minX, box.minY, box.minZ, box.maxX, box.maxY, box.maxZ, previewMode.red, previewMode.green, previewMode.blue, 0.4f);
tessellator.draw();
break;
case PLACE:
this.drawPlacementPreview(tessellator, bufferBuilder);
break;
case SELECT:
case OBSTRUCTED:
default:
break;
}
}
示例6: drawPlacement
import net.minecraft.client.renderer.RenderGlobal; //導入方法依賴的package包/類
@SideOnly(Side.CLIENT)
@Override
protected void drawPlacement(Tessellator tessellator, BufferBuilder bufferBuilder, PlacementPreviewRenderMode previewMode)
{
if(this.region == null) return;
AxisAlignedBB box = this.region.toAABB();
// fixed regions could be outside of view
if(ClientProxy.camera() == null || !ClientProxy.camera().isBoundingBoxInFrustum(box)) return;
// draw edges without depth to show extent of region
GlStateManager.disableDepth();
GlStateManager.glLineWidth(2.0F);
bufferBuilder.begin(GL11.GL_LINE_STRIP, DefaultVertexFormats.POSITION_COLOR);
RenderGlobal.drawBoundingBox(bufferBuilder, box.minX, box.minY, box.minZ, box.maxX, box.maxY, box.maxZ, previewMode.red, previewMode.green, previewMode.blue, 1f);
tessellator.draw();
Entity entity = Minecraft.getMinecraft().getRenderViewEntity();
if(entity != null)
{
GlStateManager.glLineWidth(1.0F);
bufferBuilder.begin(GL11.GL_LINES, DefaultVertexFormats.POSITION_COLOR);
RenderUtil.drawGrid(
bufferBuilder,
box,
entity.getPositionEyes(Minecraft.getMinecraft().getRenderPartialTicks()),
0, 0, 0, previewMode.red, previewMode.green, previewMode.blue, 0.5f);
tessellator.draw();
}
if(previewMode == OBSTRUCTED)
{
// try to show where obstructions are
for(BlockPos pos : this.region.exclusions())
{
bufferBuilder.begin(GL11.GL_LINE_STRIP, DefaultVertexFormats.POSITION_COLOR);
RenderGlobal.drawBoundingBox(bufferBuilder, pos.getX(), pos.getY(), pos.getZ(), pos.getX() + 1, pos.getY() + 1, pos.getZ() + 1, OBSTRUCTED.red, OBSTRUCTED.green, OBSTRUCTED.blue, 1f);
tessellator.draw();
}
}
else if(previewMode == PLACE)
{
// show shape/orientation of blocks to be be placed via a sample
this.drawPlacementPreview(tessellator, bufferBuilder);
}
// draw sides with depth to better show what parts are unobstructed
GlStateManager.enableDepth();
bufferBuilder.begin(GL11.GL_TRIANGLE_STRIP, DefaultVertexFormats.POSITION_COLOR);
RenderGlobal.addChainedFilledBoxVertices(bufferBuilder, box.minX, box.minY, box.minZ, box.maxX, box.maxY, box.maxZ, previewMode.red, previewMode.green, previewMode.blue, 0.4f);
tessellator.draw();
}