public RenderChunk(World worldIn, RenderGlobal renderGlobalIn, BlockPos blockPosIn, int indexIn) { this.world = worldIn; this.renderGlobal = renderGlobalIn; this.index = indexIn; if (!blockPosIn.equals(this.getPosition())) { this.setPosition(blockPosIn); } if (OpenGlHelper.useVbo()) { for (int i = 0; i < EnumWorldBlockLayer.values().length; ++i) { this.vertexBuffers[i] = new VertexBuffer(DefaultVertexFormats.BLOCK); } } }
public static void update(RenderGlobal p_update_0_) { long i = System.currentTimeMillis(); if (i >= timeUpdateMs + 50L) { timeUpdateMs = i; synchronized (mapDynamicLights) { updateMapDynamicLights(p_update_0_); if (mapDynamicLights.size() > 0) { for (DynamicLight dynamiclight : mapDynamicLights.values()) { dynamiclight.update(p_update_0_); } } } } }
public static void drawOutlinedBoundingBox(AxisAlignedBB bb, int color) { float[] color1; float red = (color >> 16 & 0xFF) / 255.0F; float blue = (color >> 8 & 0xFF) / 255.0F; float green = (color & 0xFF) / 255.0F; float alpha = (color >> 24 & 0xFF) / 255.0F; color1 = new float[] { red, blue, green, alpha }; GL11.glLineWidth(1.0F); GL11.glColor4f(color1[0], color1[1], color1[2], 0.8F); RenderGlobal.func_181561_a(bb); GlStateManager.disableDepth(); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glPopMatrix(); }
public void render(float p_190060_1_, long p_190060_2_) { this.field_191313_b = this.field_191312_a.player; this.field_191314_c = this.field_191313_b.lastTickPosX + (this.field_191313_b.posX - this.field_191313_b.lastTickPosX) * (double)p_190060_1_; this.field_191315_d = this.field_191313_b.lastTickPosY + (this.field_191313_b.posY - this.field_191313_b.lastTickPosY) * (double)p_190060_1_; this.field_191316_e = this.field_191313_b.lastTickPosZ + (this.field_191313_b.posZ - this.field_191313_b.lastTickPosZ) * (double)p_190060_1_; World world = this.field_191312_a.player.world; List<AxisAlignedBB> list = world.getCollisionBoxes(this.field_191313_b, this.field_191313_b.getEntityBoundingBox().expand(4.0D, 4.0D, 4.0D)); GlStateManager.enableBlend(); GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO); GlStateManager.glLineWidth(2.0F); GlStateManager.disableTexture2D(); GlStateManager.depthMask(false); for (AxisAlignedBB axisalignedbb : list) { RenderGlobal.drawSelectionBoundingBox(axisalignedbb.expandXyz(0.002D).offset(-this.field_191314_c, -this.field_191315_d, -this.field_191316_e), 1.0F, 1.0F, 1.0F, 1.0F); } GlStateManager.depthMask(true); GlStateManager.enableTexture2D(); GlStateManager.disableBlend(); }
public RenderChunk(World p_i47120_1_, RenderGlobal p_i47120_2_, int p_i47120_3_) { for (int i = 0; i < this.mapEnumFacing.length; ++i) { this.mapEnumFacing[i] = new BlockPos.MutableBlockPos(); } this.world = p_i47120_1_; this.renderGlobal = p_i47120_2_; this.index = p_i47120_3_; if (OpenGlHelper.useVbo()) { for (int j = 0; j < BlockRenderLayer.values().length; ++j) { this.vertexBuffers[j] = new VertexBuffer(DefaultVertexFormats.BLOCK); } } }
@SideOnly(Side.CLIENT) public boolean drawHighlight(final MovingObjectPosition hit, final EntityPlayer player, final float frame) { GL11.glEnable(3042); OpenGlHelper.glBlendFunc(770, 771, 1, 0); GL11.glColor4f(0.0f, 0.0f, 0.0f, 0.4f); GL11.glLineWidth(2.0f); GL11.glDisable(3553); GL11.glDepthMask(false); final float f1 = 0.002f; final double d0 = player.lastTickPosX + (player.posX - player.lastTickPosX) * frame; final double d2 = player.lastTickPosY + (player.posY - player.lastTickPosY) * frame; final double d3 = player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * frame; RenderGlobal.drawOutlinedBoundingBox(this.getBounds().add(new Vector3((double)this.x(), (double)this.y(), (double)this.z())).toAABB().expand((double)f1, (double)f1, (double)f1).getOffsetBoundingBox(-d0, -d2, -d3), -1); GL11.glDepthMask(true); GL11.glEnable(3553); GL11.glDisable(3042); return true; }
private void renderBlockSelection(Entity viewEntity) { RenderHelper.enableStandardItemLighting(); ServerBlockSystemHandler structureHandler = BlockSystems.PROXY.getBlockSystemHandler(this.blockSystem.getMainWorld()); if (viewEntity instanceof EntityPlayer && structureHandler.getMousedOver((EntityPlayer) viewEntity) == this.blockSystem) { BlockSystemPlayerHandler handler = structureHandler.get(this.blockSystem, MC.player); if (handler != null) { RayTraceResult result = handler.getMouseOver(); BlockPos pos = result.getBlockPos(); GlStateManager.enableBlend(); GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO); GlStateManager.glLineWidth(2.0F); GlStateManager.disableTexture2D(); GlStateManager.depthMask(false); IBlockState state = this.blockSystem.getBlockState(pos); if (state.getMaterial() != Material.AIR) { RenderGlobal.drawSelectionBoundingBox(state.getSelectedBoundingBox(this.blockSystem, pos).expandXyz(0.002), 0.0F, 0.0F, 0.0F, 0.4F); } GlStateManager.depthMask(true); GlStateManager.enableTexture2D(); GlStateManager.disableBlend(); } } }
@Override public void render (TileEntityEnderTether te, double x, double y, double z, float partialTicks, int destroyStage, float alpha) { if (!te.showBorder || te.area == null) { return; } GlStateManager.pushMatrix(); GlStateManager.enableBlend(); GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO); GlStateManager.glLineWidth(25.0F); GlStateManager.disableTexture2D(); GlStateManager.depthMask(false); RenderUtils.translateAgainstPlayer(te.getPos(), false); // drawSelectionBoundingBox RenderGlobal.drawSelectionBoundingBox(te.area, 1f, 0f, 1f, 0.5f); GlStateManager.depthMask(true); GlStateManager.enableTexture2D(); GlStateManager.disableBlend(); GlStateManager.popMatrix(); }
@Override public void render (TileEntityEnderHopper te, double x, double y, double z, float partialTicks, int destroyStage, float alpha) { if (!te.showBorder || te.area == null) { return; } GlStateManager.pushMatrix(); GlStateManager.enableBlend(); GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO); GlStateManager.glLineWidth(25.0F); GlStateManager.disableTexture2D(); GlStateManager.depthMask(false); RenderUtils.translateAgainstPlayer(te.getPos(), false); // drawSelectionBoundingBox RenderGlobal.drawSelectionBoundingBox(te.area, 1f, 0f, 1f, 0.5f); GlStateManager.depthMask(true); GlStateManager.enableTexture2D(); GlStateManager.disableBlend(); GlStateManager.popMatrix(); }
@Override public void doRender(FlatRayTarget entity, double x, double y, double z, float entityYaw, float partialTicks) { if (entity.box == null) return; final Minecraft mc = Minecraft.getMinecraft(); if (mc.objectMouseOver.entityHit != entity) return; GL11.glPushMatrix(); GL11.glTranslated(x, y, z); AxisAlignedBB offBox = entity.box.offset(-entity.posX, -entity.posY, -entity.posZ); RenderGlobal.drawSelectionBoundingBox(offBox); GlStateManager.disableTexture2D(); int c = 0xB0; GL11.glLineWidth(4); RenderGlobal.drawOutlinedBoundingBox(offBox, c, c, c, 0xFF); GlStateManager.enableTexture2D(); GL11.glPopMatrix(); }
public static void drawESP(double d, double d1, double d2, double r, double b, double g) { GL11.glPushMatrix(); GL11.glEnable(3042); GL11.glBlendFunc(770, 771); GL11.glLineWidth(1.5F); // GL11.glDisable( GL11.GL_LIGHTING ); GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glEnable(GL11.GL_LINE_SMOOTH); GL11.glDisable(2929); GL11.glDepthMask(false); GL11.glColor4d(r, g, b, 0.1825F); RenderUtils.drawColorBox(new AxisAlignedBB(d, d1, d2, d + 1.0, d1 + 1.0, d2 + 1.0)); GL11.glColor4d(r, g, b, 1.0F); RenderGlobal.drawOutlinedBoundingBox(new AxisAlignedBB(d, d1, d2, d + 1.0, d1 + 1.0, d2 + 1.0), new Color(1f, 0.25f, 0.25f).getRGB()); GL11.glLineWidth(2.0F); GL11.glDisable(GL11.GL_LINE_SMOOTH); GL11.glEnable(GL11.GL_TEXTURE_2D); // GL11.glEnable( GL11.GL_LIGHTING ); GL11.glEnable(2929); GL11.glDepthMask(true); GL11.glDisable(3042); GL11.glPopMatrix(); }
/** * Renders a box with any size and any color. */ public static void box(double x, double y, double z, double x2, double y2, double z2, Color color) { x = x - Minecraft.getMinecraft().getRenderManager().renderPosX; y = y - Minecraft.getMinecraft().getRenderManager().renderPosY; z = z - Minecraft.getMinecraft().getRenderManager().renderPosZ; x2 = x2 - Minecraft.getMinecraft().getRenderManager().renderPosX; y2 = y2 - Minecraft.getMinecraft().getRenderManager().renderPosY; z2 = z2 - Minecraft.getMinecraft().getRenderManager().renderPosZ; GL11.glBlendFunc(770, 771); GL11.glEnable(GL_BLEND); GL11.glLineWidth(2.0F); RenderUtil.setColor(color); GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glDisable(GL_DEPTH_TEST); GL11.glDepthMask(false); drawColorBox(new AxisAlignedBB(x, y, z, x2, y2, z2)); GL11.glColor4d(0, 0, 0, 0.5F); RenderGlobal.drawOutlinedBoundingBox(new AxisAlignedBB(x, y, z, x2, y2, z2), -1); GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glEnable(GL_DEPTH_TEST); GL11.glDepthMask(true); GL11.glDisable(GL_BLEND); }
/** * Renders a frame with any size and any color. */ public static void frame(double x, double y, double z, double x2, double y2, double z2, Color color) { x = x - Minecraft.getMinecraft().getRenderManager().renderPosX; y = y - Minecraft.getMinecraft().getRenderManager().renderPosY; z = z - Minecraft.getMinecraft().getRenderManager().renderPosZ; x2 = x2 - Minecraft.getMinecraft().getRenderManager().renderPosX; y2 = y2 - Minecraft.getMinecraft().getRenderManager().renderPosY; z2 = z2 - Minecraft.getMinecraft().getRenderManager().renderPosZ; GL11.glBlendFunc(770, 771); GL11.glEnable(GL_BLEND); GL11.glLineWidth(2.0F); GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glDisable(GL_DEPTH_TEST); GL11.glDepthMask(false); RenderUtil.setColor(color); RenderGlobal.drawOutlinedBoundingBox(new AxisAlignedBB(x, y, z, x2, y2, z2), -1); GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glEnable(GL_DEPTH_TEST); GL11.glDepthMask(true); GL11.glDisable(GL_BLEND); }
/** * Renders an ESP box with the size of a normal block at the specified * coordinates. */ public static void blockESPBox(BlockPos blockPos) { double x = blockPos.getX() - Minecraft.getMinecraft().getRenderManager().renderPosX; double y = blockPos.getY() - Minecraft.getMinecraft().getRenderManager().renderPosY; double z = blockPos.getZ() - Minecraft.getMinecraft().getRenderManager().renderPosZ; GL11.glBlendFunc(770, 771); GL11.glEnable(GL_BLEND); GL11.glLineWidth(1.0F); GL11.glColor4d(0, 1, 0, 0.15F); GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glDisable(GL_DEPTH_TEST); GL11.glDepthMask(false); drawColorBox(new AxisAlignedBB(x, y, z, x + 1.0, y + 1.0, z + 1.0)); GL11.glColor4d(0, 0, 0, 0.5F); RenderGlobal.drawOutlinedBoundingBox(new AxisAlignedBB(x, y, z, x + 1.0, y + 1.0, z + 1.0), -1); GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glEnable(GL_DEPTH_TEST); GL11.glDepthMask(true); GL11.glDisable(GL_BLEND); }
public static void emptyBlockESPBox(BlockPos blockPos) { double x = blockPos.getX() - Minecraft.getMinecraft().getRenderManager().renderPosX; double y = blockPos.getY() - Minecraft.getMinecraft().getRenderManager().renderPosY; double z = blockPos.getZ() - Minecraft.getMinecraft().getRenderManager().renderPosZ; GL11.glBlendFunc(770, 771); GL11.glEnable(GL_BLEND); GL11.glLineWidth(2.0F); GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glDisable(GL_DEPTH_TEST); GL11.glDepthMask(false); GL11.glColor4d(0, 0, 0, 0.5F); RenderGlobal.drawOutlinedBoundingBox(new AxisAlignedBB(x, y, z, x + 1.0, y + 1.0, z + 1.0), -1); GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glEnable(GL_DEPTH_TEST); GL11.glDepthMask(true); GL11.glDisable(GL_BLEND); }
public static void entityESPBox(Entity entity, int mode) { GL11.glBlendFunc(770, 771); GL11.glEnable(GL_BLEND); GL11.glLineWidth(2.0F); GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glDisable(GL_DEPTH_TEST); updateColorFromTargetType(mode, entity); Minecraft.getMinecraft().getRenderManager(); RenderGlobal.drawOutlinedBoundingBox(new AxisAlignedBB(entity.boundingBox.minX - 0.05 - entity.posX + (entity.posX - Minecraft.getMinecraft().getRenderManager().renderPosX), entity.boundingBox.minY - entity.posY + (entity.posY - Minecraft.getMinecraft().getRenderManager().renderPosY), entity.boundingBox.minZ - 0.05 - entity.posZ + (entity.posZ - Minecraft.getMinecraft().getRenderManager().renderPosZ), entity.boundingBox.maxX + 0.05 - entity.posX + (entity.posX - Minecraft.getMinecraft().getRenderManager().renderPosX), entity.boundingBox.maxY + 0.1 - entity.posY + (entity.posY - Minecraft.getMinecraft().getRenderManager().renderPosY), entity.boundingBox.maxZ + 0.05 - entity.posZ + (entity.posZ - Minecraft.getMinecraft().getRenderManager().renderPosZ)), -1); GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glEnable(GL_DEPTH_TEST); GL11.glDepthMask(true); GL11.glDisable(GL_BLEND); }
public static void nukerBox(BlockPos blockPos, float damage) { double x = blockPos.getX() - Minecraft.getMinecraft().getRenderManager().renderPosX; double y = blockPos.getY() - Minecraft.getMinecraft().getRenderManager().renderPosY; double z = blockPos.getZ() - Minecraft.getMinecraft().getRenderManager().renderPosZ; GL11.glBlendFunc(770, 771); GL11.glEnable(GL_BLEND); GL11.glLineWidth(1.0F); GL11.glColor4d(damage, 1 - damage, 0, 0.15F); GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glDisable(GL_DEPTH_TEST); GL11.glDepthMask(false); drawColorBox(new AxisAlignedBB(x + 0.5 - damage / 2, y + 0.5 - damage / 2, z + 0.5 - damage / 2, x + 0.5 + damage / 2, y + 0.5 + damage / 2, z + 0.5 + damage / 2)); GL11.glColor4d(0, 0, 0, 0.5F); RenderGlobal.drawOutlinedBoundingBox( new AxisAlignedBB(x + 0.5 - damage / 2, y + 0.5 - damage / 2, z + 0.5 - damage / 2, x + 0.5 + damage / 2, y + 0.5 + damage / 2, z + 0.5 + damage / 2), -1); GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glEnable(GL_DEPTH_TEST); GL11.glDepthMask(true); GL11.glDisable(GL_BLEND); }
public static void searchBox(BlockPos blockPos) { double x = blockPos.getX() - Minecraft.getMinecraft().getRenderManager().renderPosX; double y = blockPos.getY() - Minecraft.getMinecraft().getRenderManager().renderPosY; double z = blockPos.getZ() - Minecraft.getMinecraft().getRenderManager().renderPosZ; GL11.glBlendFunc(770, 771); GL11.glEnable(GL_BLEND); GL11.glLineWidth(1.0F); float sinus = 1F - MathHelper .abs(MathHelper.sin(Minecraft.getSystemTime() % 10000L / 10000.0F * (float) Math.PI * 4.0F) * 1F); GL11.glColor4d(1 - sinus, sinus, 0, 0.15); GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glDisable(GL_DEPTH_TEST); GL11.glDepthMask(false); drawColorBox(new AxisAlignedBB(x, y, z, x + 1.0, y + 1.0, z + 1.0)); GL11.glColor4d(0, 0, 0, 0.5); RenderGlobal.drawOutlinedBoundingBox(new AxisAlignedBB(x, y, z, x + 1.0, y + 1.0, z + 1.0), -1); GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glEnable(GL_DEPTH_TEST); GL11.glDepthMask(true); GL11.glDisable(GL_BLEND); }
private void func_85094_b(Entity par1Entity, double par2, double par4, double par6, float par8, float par9) { GL11.glDepthMask(false); GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glDisable(GL11.GL_LIGHTING); GL11.glDisable(GL11.GL_CULL_FACE); GL11.glDisable(GL11.GL_BLEND); float var10 = par1Entity.width / 2.0F; AxisAlignedBB var11 = AxisAlignedBB.getAABBPool().getAABB(par2 - (double)var10, par4, par6 - (double)var10, par2 + (double)var10, par4 + (double)par1Entity.height, par6 + (double)var10); RenderGlobal.drawOutlinedBoundingBox(var11, 16777215); GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glEnable(GL11.GL_LIGHTING); GL11.glEnable(GL11.GL_CULL_FACE); GL11.glDisable(GL11.GL_BLEND); GL11.glDepthMask(true); }
@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); } } } }
@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(); }
public void RenderBoundingBox(EntityPlayer player, BaseRobotPlatesTileEntity tileEntity, float partialTicks) { double d0 = player.lastTickPosX + (player.posX - player.lastTickPosX) * (double)partialTicks; double d1 = player.lastTickPosY + (player.posY - player.lastTickPosY) * (double)partialTicks; double d2 = player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * (double)partialTicks; GL11.glEnable(GL11.GL_BLEND); OpenGlHelper.glBlendFunc(770, 771, 1, 0); GL11.glColor4f(0.0F, 0.0F, 0.0F, 0.4F); GL11.glLineWidth(2.0F); GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glDepthMask(false); float e = 0.01f; AxisAlignedBB drawBoundingBox = AxisAlignedBB.getBoundingBox( (double)tileEntity.xCoord + boundingBox.minX, (double)tileEntity.yCoord + boundingBox.minY, (double)tileEntity.zCoord + boundingBox.minZ, (double)tileEntity.xCoord + boundingBox.maxX, (double)tileEntity.yCoord + boundingBox.maxY, (double)tileEntity.zCoord + boundingBox.maxZ); RenderGlobal.drawOutlinedBoundingBox(drawBoundingBox.expand(e, e, e).getOffsetBoundingBox(-d0, -d1, -d2), -1); GL11.glDepthMask(true); GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glDisable(GL11.GL_BLEND); }
public static void drawBoundingBox(EntityLivingBase entity, AxisAlignedBB aabb) { if (aabb == null) { return; } GL11.glEnable(GL11.GL_BLEND); OpenGlHelper.glBlendFunc(770, 771, 1, 0); GL11.glColor4f(0.0F, 0.0F, 0.0F, 0.4F); GL11.glLineWidth(2.0F); GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glDepthMask(false); float f1 = 0.002F; double d0 = entity.lastTickPosX + (entity.posX - entity.lastTickPosX); double d1 = entity.lastTickPosY + (entity.posY - entity.lastTickPosY); double d2 = entity.lastTickPosZ + (entity.posZ - entity.lastTickPosZ); RenderGlobal.drawOutlinedBoundingBox(aabb.expand((double) f1, (double) f1, (double) f1).getOffsetBoundingBox(-d0, -d1, -d2), -1); GL11.glDepthMask(true); GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glDisable(GL11.GL_BLEND); }
private void renderBlockOutlines(Mode mode, EntityPlayer player, BlockPosEU posStart, BlockPosEU posEnd, float partialTicks) { GlStateManager.glLineWidth(2.0f); float expand = mode == Mode.REPLACE ? 0.001f : 0f; for (int i = 0; i < this.positions.size(); i++) { BlockPosEU pos = this.positions.get(i); if (pos.equals(posStart) == false && pos.equals(posEnd) == false) { AxisAlignedBB aabb = createAABB(pos.getX(), pos.getY(), pos.getZ(), expand, partialTicks, player); RenderGlobal.drawSelectionBoundingBox(aabb, 1.0f, 1.0f, 1.0f, 1.0f); } } }
private void renderPositions(EntityPlayer clientPlayer, BlockPosEU posStart, BlockPosEU posEnd, int color, float partialTicks) { GlStateManager.glLineWidth(2.0f); for (int a = 0; a < 3; a++) { List<BlockPosEU> column = this.positions.get(a); if (column != null) { final int size = column.size(); for (int i = 0; i < size; i++) { BlockPosEU pos = column.get(i); //if (pos.equals(posStart) == false && (posEnd == null || posEnd.equals(pos) == false)) { AxisAlignedBB aabb = BuildersWandRenderer.createAABB(pos.getX(), pos.getY(), pos.getZ(), 0, partialTicks, clientPlayer); RenderGlobal.drawSelectionBoundingBox(aabb, ((color >>> 16) & 0xFF) / 255f, ((color >>> 8) & 0xFF) / 255f, (color & 0xFF) / 255f, 1.0f); } } } } }
private void renderDebugBoundingBox(Entity p_85094_1_, double p_85094_2_, double p_85094_4_, double p_85094_6_, float p_85094_8_, float p_85094_9_) { GL11.glDepthMask(false); GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glDisable(GL11.GL_LIGHTING); GL11.glDisable(GL11.GL_CULL_FACE); GL11.glDisable(GL11.GL_BLEND); float f2 = p_85094_1_.width / 2.0F; AxisAlignedBB axisalignedbb = AxisAlignedBB.getBoundingBox(p_85094_2_ - (double)f2, p_85094_4_, p_85094_6_ - (double)f2, p_85094_2_ + (double)f2, p_85094_4_ + (double)p_85094_1_.height, p_85094_6_ + (double)f2); RenderGlobal.drawOutlinedBoundingBox(axisalignedbb, 16777215); GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glEnable(GL11.GL_LIGHTING); GL11.glEnable(GL11.GL_CULL_FACE); GL11.glDisable(GL11.GL_BLEND); GL11.glDepthMask(true); }
/** * Renders the bounding box around an entity when F3+B is pressed */ private void renderDebugBoundingBox(Entity entityIn, double p_85094_2_, double p_85094_4_, double p_85094_6_, float p_85094_8_, float p_85094_9_) { GlStateManager.depthMask(false); GlStateManager.disableTexture2D(); GlStateManager.disableLighting(); GlStateManager.disableCull(); GlStateManager.disableBlend(); float f = entityIn.width / 2.0F; AxisAlignedBB axisalignedbb = entityIn.getEntityBoundingBox(); AxisAlignedBB axisalignedbb1 = new AxisAlignedBB(axisalignedbb.minX - entityIn.posX + p_85094_2_, axisalignedbb.minY - entityIn.posY + p_85094_4_, axisalignedbb.minZ - entityIn.posZ + p_85094_6_, axisalignedbb.maxX - entityIn.posX + p_85094_2_, axisalignedbb.maxY - entityIn.posY + p_85094_4_, axisalignedbb.maxZ - entityIn.posZ + p_85094_6_); RenderGlobal.func_181563_a(axisalignedbb1, 255, 255, 255, 255); if (entityIn instanceof EntityLivingBase) { float f1 = 0.01F; RenderGlobal.func_181563_a(new AxisAlignedBB(p_85094_2_ - (double)f, p_85094_4_ + (double)entityIn.getEyeHeight() - 0.009999999776482582D, p_85094_6_ - (double)f, p_85094_2_ + (double)f, p_85094_4_ + (double)entityIn.getEyeHeight() + 0.009999999776482582D, p_85094_6_ + (double)f), 255, 0, 0, 255); } Tessellator tessellator = Tessellator.getInstance(); WorldRenderer worldrenderer = tessellator.getWorldRenderer(); Vec3 vec3 = entityIn.getLook(p_85094_9_); worldrenderer.begin(3, DefaultVertexFormats.POSITION_COLOR); worldrenderer.pos(p_85094_2_, p_85094_4_ + (double)entityIn.getEyeHeight(), p_85094_6_).color(0, 0, 255, 255).endVertex(); worldrenderer.pos(p_85094_2_ + vec3.xCoord * 2.0D, p_85094_4_ + (double)entityIn.getEyeHeight() + vec3.yCoord * 2.0D, p_85094_6_ + vec3.zCoord * 2.0D).color(0, 0, 255, 255).endVertex(); tessellator.draw(); GlStateManager.enableTexture2D(); GlStateManager.enableLighting(); GlStateManager.enableCull(); GlStateManager.disableBlend(); GlStateManager.depthMask(true); }
public RenderGlobal.ContainerLocalRenderInformation getRenderInfo() { if (this.renderInfo == null) { this.renderInfo = new RenderGlobal.ContainerLocalRenderInformation(this.renderChunk, (EnumFacing)null, 0); } return this.renderInfo; }
public static void entityRemoved(Entity p_entityRemoved_0_, RenderGlobal p_entityRemoved_1_) { synchronized (mapDynamicLights) { DynamicLight dynamiclight = (DynamicLight)mapDynamicLights.remove(IntegerCache.valueOf(p_entityRemoved_0_.getEntityId())); if (dynamiclight != null) { dynamiclight.updateLitChunks(p_entityRemoved_1_); } } }
private static void updateMapDynamicLights(RenderGlobal p_updateMapDynamicLights_0_) { World world = p_updateMapDynamicLights_0_.getWorld(); if (world != null) { for (Entity entity : world.getLoadedEntityList()) { int i = getLightLevel(entity); if (i > 0) { Integer integer = IntegerCache.valueOf(entity.getEntityId()); DynamicLight dynamiclight = (DynamicLight)mapDynamicLights.get(integer); if (dynamiclight == null) { dynamiclight = new DynamicLight(entity); mapDynamicLights.put(integer, dynamiclight); } } else { Integer integer1 = IntegerCache.valueOf(entity.getEntityId()); DynamicLight dynamiclight1 = (DynamicLight)mapDynamicLights.remove(integer1); if (dynamiclight1 != null) { dynamiclight1.updateLitChunks(p_updateMapDynamicLights_0_); } } } } }
public static void removeLights(RenderGlobal p_removeLights_0_) { synchronized (mapDynamicLights) { Collection<DynamicLight> collection = mapDynamicLights.values(); Iterator iterator = collection.iterator(); while (iterator.hasNext()) { DynamicLight dynamiclight = (DynamicLight)iterator.next(); iterator.remove(); dynamiclight.updateLitChunks(p_removeLights_0_); } } }
public void updateLitChunks(RenderGlobal p_updateLitChunks_1_) { for (BlockPos blockpos : this.setLitChunkPos) { RenderChunk renderchunk = p_updateLitChunks_1_.getRenderChunk(blockpos); this.updateChunkLight(renderchunk, (Set<BlockPos>)null, (Set<BlockPos>)null); } }