Jump to content

MineGame159

Members
  • Posts

    8
  • Joined

  • Last visited

Everything posted by MineGame159

  1. GlStateManager.pushMatrix(); GlStateManager.disableTexture(); GlStateManager.disableLighting(); GlStateManager.disableDepthTest(); GlStateManager.enableBlend(); GlStateManager.blendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0); GlStateManager.lineWidth(1); Vec3d renderPos = Utils.getInterpolatedEyePos(MC.player, event.getPartialTicks()); RenderEvent renderEvent = new RenderEvent(GeometryTessellator.getInstance(), renderPos, event.getPartialTicks()); renderEvent.resetTranslation(); MinecraftForge.EVENT_BUS.post(renderEvent); GlStateManager.lineWidth(1); GlStateManager.disableBlend(); GlStateManager.enableDepthTest(); GlStateManager.enableLighting(); GlStateManager.enableTexture(); GlStateManager.popMatrix(); GeometryTesselattor extends Tesselator and adds some helper functions. RenderEvent.resetTranslation() translates tesselators buffer by renderPos. (Passed in constructor) Utils.getInterpolatedEyePos(): public static Vec3d getInterpolated(Entity entity, double x, double y, double z) { return new Vec3d((entity.posX - entity.lastTickPosX) * x, (entity.posY - entity.lastTickPosY) * y, (entity.posZ - entity.lastTickPosZ) * z); } public static Vec3d getInterpolated(Entity entity, double ticks) { return getInterpolated(entity, ticks, ticks, ticks); } public static Vec3d getInterpolatedPos(Entity entity, double ticks) { return new Vec3d(entity.posX, entity.posY, entity.posZ).add(getInterpolated(entity, ticks)) ; } public static Vec3d getInterpolatedEyePos(Entity entity, double ticks) { return getInterpolatedPos(entity, ticks).add(0, entity.getEyeHeight(), 0); } And when I Subscribe to that event is just adds some vertices to buffer and calls tesselators draw method. If you can help me it would be awesome.
  2. Thanks and another question, so I am interpolating players last and current position with partialTicks, it works but when I am moving its is rendering it a little bit behind the actual position. I think it is because of usage of lastPos but there must be some way to fix it.
  3. Before I render line from one block to another I translate it with negative player position, that works fine but when I sneak the line moves up and down. How I can prevent that?
  4. In documentation are mentioned @Config and Configuration class but in 1.14.4 there is none. How I can do it?
  5. When I set up forge and want to start minecraft it gives this error. I dont know what to do with it. latest.log
×
×
  • Create New...

Important Information

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