Jump to content

Befell

Members
  • Posts

    5
  • Joined

  • Last visited

Posts posted by Befell

  1. I am trying to render  an item in a container. I have found that Minecraft.getMinecraft().fontRenderedObj.drawString() works but I do not know how to do the correct x and y.
    Someone had made this code, the position is right but only works in chests. 

    int guiLeft = (guiContainer.width - 176) / 2;
    int inventoryRows = inventory.getSizeInventory() / 9;
    int ySize = 222 - 108 + inventoryRows * 18;
    int guiTop = (guiContainer.height - ySize) / 2;
    
    int slotX = (int) ((guiLeft + inventorySlot.xDisplayPosition) / scaleFactor);
    int slotY = (int) ((guiTop + inventorySlot.yDisplayPosition) / scaleFactor);

    image.png.ea766b1d1f4bf153fd6c1d692e0d11c7.png

×
×
  • Create New...

Important Information

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