Jump to content

Fabillotic

Members
  • Posts

    9
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Fabillotic's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. public void renderArea(AxisAlignedBB aabb, float r, float g, float b) { RenderSystem.pushMatrix(); ActiveRenderInfo info = Minecraft.getInstance().getRenderManager().info; RenderSystem.rotatef(info.getYaw()-180, 0, 1, 0); RenderSystem.rotatef(info.getPitch(), (float) (-Math.sin((info.getYaw() + 90) / 360 * Math.PI * 2)), 0.0f, (float) (Math.cos((info.getYaw() + 90) / 360 * Math.PI * 2))); RenderSystem.translated(-info.getProjectedView().x, -info.getProjectedView().y, -info.getProjectedView().z); RenderSystem.lineWidth(4); RenderSystem.color4f(r, g, b, 1.0f); aabb = aabb.expand(0.001, 0.001, 0.001); aabb = aabb.offset(-0.0005, -0.0005, -0.0005); Tessellator tessellator = Tessellator.getInstance(); BufferBuilder builder = tessellator.getBuffer(); builder.begin(GL11.GL_LINES, DefaultVertexFormats.POSITION); builder.pos(aabb.minX, aabb.minY, aabb.minZ).endVertex(); builder.pos(aabb.maxX, aabb.minY, aabb.minZ).endVertex(); builder.pos(aabb.minX, aabb.maxY, aabb.minZ).endVertex(); builder.pos(aabb.maxX, aabb.maxY, aabb.minZ).endVertex(); builder.pos(aabb.minX, aabb.minY, aabb.minZ).endVertex(); builder.pos(aabb.minX, aabb.maxY, aabb.minZ).endVertex(); builder.pos(aabb.maxX, aabb.minY, aabb.minZ).endVertex(); builder.pos(aabb.maxX, aabb.maxY, aabb.minZ).endVertex(); builder.pos(aabb.minX, aabb.minY, aabb.maxZ).endVertex(); builder.pos(aabb.maxX, aabb.minY, aabb.maxZ).endVertex(); builder.pos(aabb.minX, aabb.maxY, aabb.maxZ).endVertex(); builder.pos(aabb.maxX, aabb.maxY, aabb.maxZ).endVertex(); builder.pos(aabb.minX, aabb.minY, aabb.maxZ).endVertex(); builder.pos(aabb.minX, aabb.maxY, aabb.maxZ).endVertex(); builder.pos(aabb.maxX, aabb.minY, aabb.maxZ).endVertex(); builder.pos(aabb.maxX, aabb.maxY, aabb.maxZ).endVertex(); builder.pos(aabb.minX, aabb.minY, aabb.minZ).endVertex(); builder.pos(aabb.minX, aabb.minY, aabb.maxZ).endVertex(); builder.pos(aabb.minX, aabb.maxY, aabb.minZ).endVertex(); builder.pos(aabb.minX, aabb.maxY, aabb.maxZ).endVertex(); builder.pos(aabb.maxX, aabb.minY, aabb.minZ).endVertex(); builder.pos(aabb.maxX, aabb.minY, aabb.maxZ).endVertex(); builder.pos(aabb.maxX, aabb.maxY, aabb.minZ).endVertex(); builder.pos(aabb.maxX, aabb.maxY, aabb.maxZ).endVertex(); tessellator.draw(); RenderSystem.popMatrix(); } I have changed the renderArea method to this and it still has the same problems.
  2. Nice mod! The only problem now is that the DrawHighlightEvent is only called when the player highlights a block. But the player should also see the structure when it is not targeted. It should look similar to a structure block for example. Thanks for the help though! You should really continue that mod!
  3. The idea is a mod, with wich you can highlight a specific block area. You can just press a key while looking at a block and the mod saves the position. After selecting two positions the mod will highlight the area between them. When pressing another keybind the mod will open a GUI. In this GUI you can select what operation should be executed. ("fill" or "clone") The mod will automatically generate the correct fill or clone command and execute it on behalf of the player. This is intended to make executing commands quicker. I have uploaded a video on youtube (unlisted) that shows how the mod is used and what problems it has.
  4. This is my first Forge mod for 1.15.2. I'm trying to render 3d lines into the world. Previously I used the RenderWorldLastEvent, but after I disabled Clouds in the Video settings I noticed, that the event wasn't being called anymore. This led me to believe, that I may have used the wrong event for this kind of stuff. This is the code I use to draw an outline around an area: //The method that should be called by the event public void render() { if(pos1 != null && pos2 != null) { //The next few lines calculate, where to render the area int[] xList = new int[4]; int[] yList = new int[4]; int[] zList = new int[4]; xList[0] = pos1.getX(); xList[1] = pos1.getX()+1; yList[0] = pos1.getY(); yList[1] = pos1.getY()+1; zList[0] = pos1.getZ(); zList[1] = pos1.getZ()+1; xList[2] = pos2.getX(); xList[3] = pos2.getX()+1; yList[2] = pos2.getY(); yList[3] = pos2.getY()+1; zList[2] = pos2.getZ(); zList[3] = pos2.getZ()+1; int minX = Integer.MAX_VALUE; int minY = Integer.MAX_VALUE; int minZ = Integer.MAX_VALUE; int maxX = Integer.MIN_VALUE; int maxY = Integer.MIN_VALUE; int maxZ = Integer.MIN_VALUE; for(int x : xList) { if(x < minX) minX = x; if(x > maxX) maxX = x; } for(int y : yList) { if(y < minY) minY = y; if(y > maxY) maxY = y; } for(int z : zList) { if(z < minZ) minZ = z; if(z > maxZ) maxZ = z; } //Render the first area AxisAlignedBB aabb = new AxisAlignedBB(minX, minY, minZ, maxX, maxY, maxZ); renderArea(aabb, 1.0f, 1.0f, 1.0f); //If position 3 is set, render the second area in another color if(pos3 != null) { AxisAlignedBB aabb2 = new AxisAlignedBB(pos3.getX(), pos3.getY(), pos3.getZ(), pos3.getX() + (maxX - minX), pos3.getY() + (maxY - minY), pos3.getZ() + (maxZ - minZ)); renderArea(aabb2, 1.0f, 0.33f, 0.33f); } } } //Contains the code to do the actual rendering public void renderArea(AxisAlignedBB aabb, float r, float g, float b) { Minecraft mc = Minecraft.getInstance(); Vec3d pos = mc.getRenderManager().info.getProjectedView(); float yaw = mc.getRenderManager().info.getYaw(); float pitch = mc.getRenderManager().info.getPitch(); GL11.glPushMatrix(); //Rotate after the camera GL11.glRotated(yaw-180, 0, 1, 0); GL11.glRotated(pitch, -Math.sin((yaw + 90) / 360 * Math.PI * 2), 0, Math.cos((yaw + 90) / 360 * Math.PI * 2)); //Translation GL11.glTranslated(-pos.x, -pos.y, -pos.z); //Expand the area for better visibility aabb = aabb.expand(0.01, 0.01, 0.01); aabb = aabb.offset(-0.005, -0.005, -0.005); //Color RenderSystem.color4f(r, g, b, 1.0f); GL11.glLineWidth(4); //Vertices GL11.glBegin(GL11.GL_LINES); GL11.glVertex3d(aabb.minX, aabb.minY, aabb.minZ); GL11.glVertex3d(aabb.maxX, aabb.minY, aabb.minZ); GL11.glVertex3d(aabb.minX, aabb.maxY, aabb.minZ); GL11.glVertex3d(aabb.maxX, aabb.maxY, aabb.minZ); GL11.glVertex3d(aabb.minX, aabb.minY, aabb.minZ); GL11.glVertex3d(aabb.minX, aabb.maxY, aabb.minZ); GL11.glVertex3d(aabb.maxX, aabb.minY, aabb.minZ); GL11.glVertex3d(aabb.maxX, aabb.maxY, aabb.minZ); GL11.glVertex3d(aabb.minX, aabb.minY, aabb.maxZ); GL11.glVertex3d(aabb.maxX, aabb.minY, aabb.maxZ); GL11.glVertex3d(aabb.minX, aabb.maxY, aabb.maxZ); GL11.glVertex3d(aabb.maxX, aabb.maxY, aabb.maxZ); GL11.glVertex3d(aabb.minX, aabb.minY, aabb.maxZ); GL11.glVertex3d(aabb.minX, aabb.maxY, aabb.maxZ); GL11.glVertex3d(aabb.maxX, aabb.minY, aabb.maxZ); GL11.glVertex3d(aabb.maxX, aabb.maxY, aabb.maxZ); GL11.glVertex3d(aabb.minX, aabb.minY, aabb.minZ); GL11.glVertex3d(aabb.minX, aabb.minY, aabb.maxZ); GL11.glVertex3d(aabb.minX, aabb.maxY, aabb.minZ); GL11.glVertex3d(aabb.minX, aabb.maxY, aabb.maxZ); GL11.glVertex3d(aabb.maxX, aabb.minY, aabb.minZ); GL11.glVertex3d(aabb.maxX, aabb.minY, aabb.maxZ); GL11.glVertex3d(aabb.maxX, aabb.maxY, aabb.minZ); GL11.glVertex3d(aabb.maxX, aabb.maxY, aabb.maxZ); GL11.glEnd(); GL11.glPopMatrix(); }
  5. Thanks for your answer! I thought every Minecraft version was supported on this forum.
  6. But were is it in 1.8.8?? In 1.8.8 there is already a debug menu. Where is it located at?
  7. This should be a PVP mod for Hypixel.net . So the version should be max 1.8.8! What version do i need?
  8. Hello Minecraft Forge Forums, I would like to analyze the F3 menu in Minecraft and how it is being rendered. Does anyone know, what class is important here? I have searched through "net/minecraft/client/gui/" , but I have not found anything. Please help!
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.