DiamondMiner88
Members-
Posts
186 -
Joined
-
Last visited
Everything posted by DiamondMiner88
-
Thank you very much, that got me off the ground really fast! The last things I would like to ask is, I managed to make an outline that shows though blocks, however the highlighted rectangle does not. EDIT: If i disable drawing the highlight aka #drawCube then the outline stops being able to be seen though blocks however is still seen if you have a direct path to it. no idea why this is happening And the drawing is locked to a block, it can't be not centered on a block. Is there a way around this? Heres an example: outline.mp4 Heres the code: @SubscribeEvent public static void renderWorldLastEvent(RenderWorldLastEvent event) { MatrixStack ms = event.getMatrixStack(); IRenderTypeBuffer.Impl buffers = IRenderTypeBuffer.getImpl(Tessellator.getInstance().getBuffer()); RenderSystem.disableCull(); ms.push(); for (Entity e : Minecraft.getInstance().world.getAllEntities()) { if (!Minecraft.getInstance().player.equals(e) && !(e instanceof ItemEntity) && !(e instanceof ExperienceOrbEntity)) { drawCube(ms, buffers, new AxisAlignedBB(e.getPosition()).expand(0, 1, 0), new Color(0, 255, 0, 127)); draw3dOutline(ms, buffers, new AxisAlignedBB(e.getPosition()).expand(0, 1, 0), new Color(255, 255, 255, 255)); } } draw3dOutline(ms, buffers, new AxisAlignedBB(new BlockPos(0, 10, 0)), new Color(255, 255, 255, 255)); ms.pop(); buffers.finish(); } public static void drawCube(MatrixStack ms, IRenderTypeBuffer buffers, AxisAlignedBB aabb, Color color) { draw3dRectangle(ms, buffers, aabb, color, "TOP"); draw3dRectangle(ms, buffers, aabb, color, "BOTTOM"); draw3dRectangle(ms, buffers, aabb, color, "NORTH"); draw3dRectangle(ms, buffers, aabb, color, "EAST"); draw3dRectangle(ms, buffers, aabb, color, "SOUTH"); draw3dRectangle(ms, buffers, aabb, color, "WEST"); } public static void draw3dRectangle(MatrixStack ms, IRenderTypeBuffer buffers, AxisAlignedBB aabb, Color color, String side) { int r = color.getRed(); int g = color.getGreen(); int b = color.getBlue(); int a = color.getAlpha(); double renderPosX = Minecraft.getInstance().getRenderManager().info.getProjectedView().getX(); double renderPosY = Minecraft.getInstance().getRenderManager().info.getProjectedView().getY(); double renderPosZ = Minecraft.getInstance().getRenderManager().info.getProjectedView().getZ(); ms.push(); ms.translate(aabb.minX - renderPosX, aabb.minY - renderPosY, aabb.minZ - renderPosZ); IVertexBuilder buffer = buffers.getBuffer(RenderType.makeType(HypixelClient.MODID + ":rectangle_highlight", DefaultVertexFormats.POSITION_COLOR, GL11.GL_QUADS, 256, false, true, RenderType.State.getBuilder().transparency(ObfuscationReflectionHelper.getPrivateValue(RenderState.class, null, "field_228515_g_")).cull(new RenderState.CullState(false)).build(false))); Matrix4f mat = ms.getLast().getMatrix(); float x = (float) (aabb.maxX - aabb.minX); float y = (float) (aabb.maxY - aabb.minY); float z = (float) (aabb.maxZ - aabb.minZ); switch (side) { case "TOP": buffer.pos(mat, x, y, 0).color(r, g, b, a).endVertex(); buffer.pos(mat, 0, y, 0).color(r, g, b, a).endVertex(); buffer.pos(mat, 0, y, z).color(r, g, b, a).endVertex(); buffer.pos(mat, x, y, z).color(r, g, b, a).endVertex(); break; case "BOTTOM": buffer.pos(mat, x, 0, 0).color(r, g, b, a).endVertex(); buffer.pos(mat, 0, 0, 0).color(r, g, b, a).endVertex(); buffer.pos(mat, 0, 0, z).color(r, g, b, a).endVertex(); buffer.pos(mat, x, 0, z).color(r, g, b, a).endVertex(); break; case "NORTH": buffer.pos(mat, 0, y, 0).color(r, g, b, a).endVertex(); buffer.pos(mat, 0, 0, 0).color(r, g, b, a).endVertex(); buffer.pos(mat, x, 0, 0).color(r, g, b, a).endVertex(); buffer.pos(mat, x, y, 0).color(r, g, b, a).endVertex(); break; case "EAST": buffer.pos(mat, x, y, 0).color(r, g, b, a).endVertex(); buffer.pos(mat, x, 0, 0).color(r, g, b, a).endVertex(); buffer.pos(mat, x, 0, z).color(r, g, b, a).endVertex(); buffer.pos(mat, x, y, z).color(r, g, b, a).endVertex(); break; case "SOUTH": buffer.pos(mat, 0, y, z).color(r, g, b, a).endVertex(); buffer.pos(mat, 0, 0, z).color(r, g, b, a).endVertex(); buffer.pos(mat, x, 0, z).color(r, g, b, a).endVertex(); buffer.pos(mat, x, y, z).color(r, g, b, a).endVertex(); break; case "WEST": buffer.pos(mat, 0, y, 0).color(r, g, b, a).endVertex(); buffer.pos(mat, 0, 0, 0).color(r, g, b, a).endVertex(); buffer.pos(mat, 0, 0, z).color(r, g, b, a).endVertex(); buffer.pos(mat, 0, y, z).color(r, g, b, a).endVertex(); break; } ms.pop(); } public static void draw3dOutline(MatrixStack ms, IRenderTypeBuffer buffers, AxisAlignedBB aabb, Color color) { int r = color.getRed(); int g = color.getGreen(); int b = color.getBlue(); int a = color.getAlpha(); double renderPosX = Minecraft.getInstance().getRenderManager().info.getProjectedView().getX(); double renderPosY = Minecraft.getInstance().getRenderManager().info.getProjectedView().getY(); double renderPosZ = Minecraft.getInstance().getRenderManager().info.getProjectedView().getZ(); ms.push(); ms.translate(aabb.minX - renderPosX, aabb.minY - renderPosY, aabb.minZ - renderPosZ); RenderType.State glState = RenderType.State.getBuilder().line(new RenderState.LineState(OptionalDouble.of(1))).layer(ObfuscationReflectionHelper.getPrivateValue(RenderState.class, null, "field_228500_J_")).transparency(ObfuscationReflectionHelper.getPrivateValue(RenderState.class, null, "field_228515_g_")).writeMask(new RenderState.WriteMaskState(true, false)).depthTest(new RenderState.DepthTestState(GL11.GL_ALWAYS)).build(false); IVertexBuilder buffer = buffers.getBuffer(RenderType.makeType(HypixelClient.MODID + ":line_1_no_depth", DefaultVertexFormats.POSITION_COLOR, GL11.GL_LINES, 128, glState)); Matrix4f mat = ms.getLast().getMatrix(); float x = (float) (aabb.maxX - aabb.minX); float y = (float) (aabb.maxY - aabb.minY); float z = (float) (aabb.maxZ - aabb.minZ); // Top edges buffer.pos(mat, x, y, 0).color(r, g, b, a).endVertex(); buffer.pos(mat, 0, y, 0).color(r, g, b, a).endVertex(); buffer.pos(mat, 0, y, 0).color(r, g, b, a).endVertex(); buffer.pos(mat, 0, y, z).color(r, g, b, a).endVertex(); buffer.pos(mat, 0, y, z).color(r, g, b, a).endVertex(); buffer.pos(mat, x, y, z).color(r, g, b, a).endVertex(); buffer.pos(mat, x, y, z).color(r, g, b, a).endVertex(); buffer.pos(mat, x, y, 0).color(r, g, b, a).endVertex(); // Bottom edges buffer.pos(mat, x, 0, 0).color(r, g, b, a).endVertex(); buffer.pos(mat, 0, 0, 0).color(r, g, b, a).endVertex(); buffer.pos(mat, 0, 0, 0).color(r, g, b, a).endVertex(); buffer.pos(mat, 0, 0, z).color(r, g, b, a).endVertex(); buffer.pos(mat, 0, 0, z).color(r, g, b, a).endVertex(); buffer.pos(mat, x, 0, z).color(r, g, b, a).endVertex(); buffer.pos(mat, x, 0, z).color(r, g, b, a).endVertex(); buffer.pos(mat, x, 0, 0).color(r, g, b, a).endVertex(); // Side edges buffer.pos(mat, x, 0, 0).color(r, g, b, a).endVertex(); buffer.pos(mat, x, y, 0).color(r, g, b, a).endVertex(); buffer.pos(mat, 0, y, 0).color(r, g, b, a).endVertex(); buffer.pos(mat, 0, 0, 0).color(r, g, b, a).endVertex(); buffer.pos(mat, 0, y, z).color(r, g, b, a).endVertex(); buffer.pos(mat, 0, 0, z).color(r, g, b, a).endVertex(); buffer.pos(mat, x, 0, z).color(r, g, b, a).endVertex(); buffer.pos(mat, x, y, z).color(r, g, b, a).endVertex(); ms.pop(); }
-
I already tested nearly all of them that returned a Vec3d, and got the same exact results as in the screenshot; just a line that won't stay in one position Even with the current calculation i get the exact same thing With some of the methods in the screenshot below the hand appears detached
-
how do i downgrade lower the version of my forge?
DiamondMiner88 replied to aiman02's topic in Support & Bug Reports
1.12 is no longer supported on this forum. Please update to a modern version of Minecraft to receive support. -
bump
-
I don't know why this doesn't work, it looks like the line is relative to the camera position, but it only shows if you're near 0,0,0 in the world @SubscribeEvent public static void renderWorldLastEvent(RenderWorldLastEvent event) { ClientPlayerEntity player = Minecraft.getInstance().player; GL11.glPushMatrix(); GL11.glPushAttrib(GL11.GL_ENABLE_BIT); double d0 = player.prevPosX + (player.getPosX() - player.prevPosX) * (double)event.getPartialTicks(); double d1 = player.prevPosY + (player.getPosY() - player.prevPosY) * (double)event.getPartialTicks(); double d2 = player.prevPosZ + (player.getPosZ() - player.prevPosZ) * (double)event.getPartialTicks(); Vec3d player_pos = new Vec3d(d0, d1, d2); GL11.glTranslated(-player_pos.x, -player_pos.y, -player_pos.z); GL11.glDisable(GL11.GL_LIGHTING); GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glDisable(GL11.GL_DEPTH_TEST); Vec3d blockA = new Vec3d (0,0,0); Vec3d blockB = new Vec3d (0,10,0); GL11.glColor4f(1,1,1,1); GL11.glBegin(GL11.GL_LINE_STRIP); GL11.glVertex3d(blockA.x, blockA.y, blockA.z); GL11.glVertex3d(blockB.x, blockB.y, blockB.z); GL11.glEnd(); GL11.glPopAttrib(); GL11.glPopMatrix(); } Its supposed to draw a line from 0,0,0 (that bedrock) to 0,10,0 but i get something like this with the line moving randomly as i move around
-
I would like to make an block outline that's visible though other blocks, however i could not find a way to do it after searching for over 2 hours The closest I've gotten is this thread however that's for 1.11.2 and the renderBox method won't work in 1.15.2 I'm new to rendering stuff so i have no idea how it works either.
-
how can I assign more cpu cores to the forge server?
DiamondMiner88 replied to KingplaysYT's topic in Support & Bug Reports
Unless they re-wrote Minecraft to make it optimized they don't split workload across cores If they did they're definitely not gonna distribute it -
[1.14.4] How do i intercept player chat client side
DiamondMiner88 replied to DiamondMiner88's topic in Modder Support
No i did use a type hierarchy. i use intellij -
[1.14.4] How do i intercept player chat client side
DiamondMiner88 replied to DiamondMiner88's topic in Modder Support
Thank you! It took me a while to figure out but i found out that its not TextComponentString, its StringTextComponent -
[1.14.4] How do i intercept player chat client side
DiamondMiner88 replied to DiamondMiner88's topic in Modder Support
Sorry im still at a loss. I can't find TextComponentString, which for all the examples i see is required -
[1.14.4] How do i intercept player chat client side
DiamondMiner88 replied to DiamondMiner88's topic in Modder Support
I feel stupider with every message, how do i use ITextComponent? I cant find a way -
[1.14.4] How do i intercept player chat client side
DiamondMiner88 replied to DiamondMiner88's topic in Modder Support
Sorry how do make a ServerPlayerEntity? And this is a client only mod so this won't go though to the server correct? -
[1.14.4] How do i intercept player chat client side
DiamondMiner88 replied to DiamondMiner88's topic in Modder Support
Thanks it works now, but now im trying to send a chat message to the player that only the player can see. Im trying to use this post's 2nd comment. Now in 1.14 i can't find the EntityPlayer class. -
[1.14.4] How do i intercept player chat client side
DiamondMiner88 replied to DiamondMiner88's topic in Modder Support
Sorry i haven't modded for a long time, so i forgot how to use Events. This doesn't work public static void clientChatEvent(ClientChatEvent event) { System.out.println(event.getMessage()); } -
Did you install the 1.12.2 installer?
-
How do i intercept what the player sends though chat to a server? I'm trying to make a bot using baritone and if the player sends like %start i need to stop it from going though to the server.
-
I need help with Forge, Library
DiamondMiner88 replied to xthatoneperson's topic in Support & Bug Reports
Look in the same directory as where the installer is located for a log file that is generated after each time the installer is run. Please post its contents though Pastebin or a Github gist. -
Caught exception from Minecraft Forge
DiamondMiner88 replied to WhiterunMage's topic in Support & Bug Reports
Below DaemonUmbra's post is this text: For players asking for assistance with Forge please expand the spoiler below and read the appropriate section(s) in its/their entirety. Below that says "Reveal hidden contents" that expands and has a section titled Logs. Read its contents -
Too many items in world crashes game. [NOT THE MOD]
DiamondMiner88 replied to DiamondMiner88's topic in Minecraft General
Wont even load the world for me to run it. Ill try that. -
BTW there is already a mod for changing the menu through a json config file. Its called CustomMainMenu and there's a version for 1.12.2