• Recently Browsing

    No registered users viewing this page.

  • Posts

    • Did you read what I said? You are creating the EntityType object in a static initializer. You must not do that. Registry entries must be created at a very particular time, which is why DeferredRegistry asks for a Supplier, which will then automatically be ran at the appropriate time. You are bypassing this.
    • So Chris, I think I have sort of worked it out... If I draw a single quad, the player hand reamains rendered but if I loop over an array, it disappears. The way I am doing it is:   ActiveRenderInfo renderInfo = Minecraft.getInstance().gameRenderer.getActiveRenderInfo(); Vec3d projectedView = renderInfo.getProjectedView(); GlStateManager.rotatef(renderInfo.getPitch(), 1, 0, 0); // Fixes camera rotation. GlStateManager.rotatef(renderInfo.getYaw() + 180, 0, 1, 0); // Fixes camera rotation. GlStateManager.translated(-projectedView.x, -projectedView.y, -projectedView.z);   then for each box, I am calling: GlStateManager.pushMatrix(); GlStateManager.enableBlend(); GlStateManager.disableCull(); GlStateManager.disableDepthTest(); GlStateManager.disableTexture(); GlStateManager.disableLighting(); GlStateManager.disableAlphaTest(); Tessellator tessellator = Tessellator.getInstance(); BufferBuilder bufferBuilder = tessellator.getBuffer(); bufferBuilder.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION); Block block = player.world.getBlockState(oresBlockPosList.get(oreBlockPos)).getBlock(); // bottom bufferBuilder.pos(oresBlockPosList.get(oreBlockPos).getX(), oresBlockPosList.get(oreBlockPos).getY(), oresBlockPosList.get(oreBlockPos).getZ()).endVertex(); bufferBuilder.pos(oresBlockPosList.get(oreBlockPos).getX() + 1, oresBlockPosList.get(oreBlockPos).getY(), oresBlockPosList.get(oreBlockPos).getZ()).endVertex(); bufferBuilder.pos(oresBlockPosList.get(oreBlockPos).getX() + 1, oresBlockPosList.get(oreBlockPos).getY(), oresBlockPosList.get(oreBlockPos).getZ() + 1).endVertex(); bufferBuilder.pos(oresBlockPosList.get(oreBlockPos).getX(), oresBlockPosList.get(oreBlockPos).getY(), oresBlockPosList.get(oreBlockPos).getZ() + 1).endVertex(); // top bufferBuilder.pos(oresBlockPosList.get(oreBlockPos).getX(), oresBlockPosList.get(oreBlockPos).getY()+ 1, oresBlockPosList.get(oreBlockPos).getZ()).endVertex(); bufferBuilder.pos(oresBlockPosList.get(oreBlockPos).getX() + 1, oresBlockPosList.get(oreBlockPos).getY()+ 1, oresBlockPosList.get(oreBlockPos).getZ()).endVertex(); bufferBuilder.pos(oresBlockPosList.get(oreBlockPos).getX() + 1, oresBlockPosList.get(oreBlockPos).getY()+ 1, oresBlockPosList.get(oreBlockPos).getZ() + 1).endVertex(); bufferBuilder.pos(oresBlockPosList.get(oreBlockPos).getX(), oresBlockPosList.get(oreBlockPos).getY()+ 1, oresBlockPosList.get(oreBlockPos).getZ() + 1).endVertex(); // left bufferBuilder.pos(oresBlockPosList.get(oreBlockPos).getX(), oresBlockPosList.get(oreBlockPos).getY(), oresBlockPosList.get(oreBlockPos).getZ()).endVertex(); bufferBuilder.pos(oresBlockPosList.get(oreBlockPos).getX(), oresBlockPosList.get(oreBlockPos).getY() + 1, oresBlockPosList.get(oreBlockPos).getZ()).endVertex(); bufferBuilder.pos(oresBlockPosList.get(oreBlockPos).getX(), oresBlockPosList.get(oreBlockPos).getY() + 1, oresBlockPosList.get(oreBlockPos).getZ() + 1).endVertex(); bufferBuilder.pos(oresBlockPosList.get(oreBlockPos).getX(), oresBlockPosList.get(oreBlockPos).getY(), oresBlockPosList.get(oreBlockPos).getZ() + 1).endVertex(); // right bufferBuilder.pos(oresBlockPosList.get(oreBlockPos).getX() + 1, oresBlockPosList.get(oreBlockPos).getY(), oresBlockPosList.get(oreBlockPos).getZ()).endVertex(); bufferBuilder.pos(oresBlockPosList.get(oreBlockPos).getX() + 1, oresBlockPosList.get(oreBlockPos).getY() + 1, oresBlockPosList.get(oreBlockPos).getZ()).endVertex(); bufferBuilder.pos(oresBlockPosList.get(oreBlockPos).getX() + 1, oresBlockPosList.get(oreBlockPos).getY() + 1, oresBlockPosList.get(oreBlockPos).getZ() + 1).endVertex(); bufferBuilder.pos(oresBlockPosList.get(oreBlockPos).getX() + 1, oresBlockPosList.get(oreBlockPos).getY(), oresBlockPosList.get(oreBlockPos).getZ() + 1).endVertex(); // front bufferBuilder.pos(oresBlockPosList.get(oreBlockPos).getX(), oresBlockPosList.get(oreBlockPos).getY(), oresBlockPosList.get(oreBlockPos).getZ()).endVertex(); bufferBuilder.pos(oresBlockPosList.get(oreBlockPos).getX() + 1, oresBlockPosList.get(oreBlockPos).getY(), oresBlockPosList.get(oreBlockPos).getZ()).endVertex(); bufferBuilder.pos(oresBlockPosList.get(oreBlockPos).getX() + 1, oresBlockPosList.get(oreBlockPos).getY() + 1, oresBlockPosList.get(oreBlockPos).getZ()).endVertex(); bufferBuilder.pos(oresBlockPosList.get(oreBlockPos).getX(), oresBlockPosList.get(oreBlockPos).getY() + 1, oresBlockPosList.get(oreBlockPos).getZ()).endVertex(); // back bufferBuilder.pos(oresBlockPosList.get(oreBlockPos).getX(), oresBlockPosList.get(oreBlockPos).getY(), oresBlockPosList.get(oreBlockPos).getZ() + 1).endVertex(); bufferBuilder.pos(oresBlockPosList.get(oreBlockPos).getX() + 1, oresBlockPosList.get(oreBlockPos).getY(), oresBlockPosList.get(oreBlockPos).getZ() + 1).endVertex(); bufferBuilder.pos(oresBlockPosList.get(oreBlockPos).getX() + 1, oresBlockPosList.get(oreBlockPos).getY() + 1, oresBlockPosList.get(oreBlockPos).getZ() + 1).endVertex(); bufferBuilder.pos(oresBlockPosList.get(oreBlockPos).getX(), oresBlockPosList.get(oreBlockPos).getY() + 1, oresBlockPosList.get(oreBlockPos).getZ() + 1).endVertex(); // Tessellator has to come before the rest or some of the GlStateManager stuff tessellator.draw(); GlStateManager.enableCull(); GlStateManager.enableDepthTest(); GlStateManager.enableTexture(); GlStateManager.enableLighting(); GlStateManager.disableBlend(); GlStateManager.enableAlphaTest(); GlStateManager.popMatrix();   Basically I am not sure if I need to  1) Push and Pop the matrix for each bufferBuilder? 2) Draw tessellator every time 3) Create a new BufferBuilder for each block (6 quads)   Also, if you worked out how to use the RenderSystem and the matrixStack, please share it with me, it'd be much appreachiated.   Thanks
    • Why it doesn’t work?   public static final RegistryObject<EntityType<EnderSlimeEntity>> ENDER_SLIME_OBJ = ENTITIES.register("enderslime", () -> ENDER_SLIME);
    • This is not how you use DeferredRegister. The point is that you do not create your registry objects (e.g. EntityType) in static initializers, that's why DeferredRegister#register takes a Supplier. Create your registry object in that supplier. That way Forge will ensure your object is created at the correct time.
    • 1.12 is no longer supported on this forum. Please update to a modern version of Minecraft to receive support.
  • Topics

  • Who's Online (See full list)