Probleme de Gui



  • Bonsoir,

    J'ai creer une machine mais quand j'ouvre la machine il ya un bug, "inventory" est mal place, comment ce pourait faire pour le suprimer?

    la classe du gui:

    
     public class Guimercure_machine extends GuiContainer {
    
      private static final ResourceLocation texture = new ResourceLocation(Reference.MOD_ID + ":textures/gui/container/guimercure_machine.png");
         private TileEntitymercure_machine tileCompressor;
         private IInventory playerInv;
    
      public Guimercure_machine(TileEntitymercure_machine tile, InventoryPlayer inventory)
      {
       super(new Containermercure_machine(tile, inventory));
             this.tileCompressor = tile;
             this.playerInv = inventory;
             this.allowUserInput = false;
             this.ySize = 340;
             this.xSize = 200;
      }
    
      @Override
      protected void drawGuiContainerBackgroundLayer(float partialRenderTick, int x, int y)
      {
    
       GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
             this.mc.getTextureManager().bindTexture(texture);
             int k = (this.width - this.xSize) / 2;
             int l = (this.height - this.ySize) / 2;
             this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
             if(this.tileCompressor.isBurning())
    
             {
    
                 int i = this.tileCompressor.getCookProgress();
    
                 this.drawTexturedModalRect(k +  90, l + 122, 201, 105, 20, i);
    
             }
    
      }
    
      protected void drawGuiContainerForegroundLayer(int x, int y)
         {
             this.fontRendererObj.drawString(this.playerInv.hasCustomInventoryName() ? this.playerInv.getInventoryName() : I18n.format(this.playerInv.getInventoryName()), 10, this.ySize - 98, 4210752);
         }
    
     }
    
    


  • essaye sa et sa devrait etre bon

    package com.adamitemod.mod;
    
    public class Guimercure_machine extends GuiContainer {
    
     private static final ResourceLocation texture = new ResourceLocation(Reference.MOD_ID + ":textures/gui/container/guimercure_machine.png");
        private TileEntitymercure_machine tileCompressor;
    
     public Guimercure_machine(TileEntitymercure_machine tile, InventoryPlayer inventory) 
     {
      super(new Containermercure_machine(tile, inventory));
            this.tileCompressor = tile;
            this.allowUserInput = false;
            this.ySize = 340;
            this.xSize = 200;
     }
    
     @Override
     protected void drawGuiContainerBackgroundLayer(float partialRenderTick, int x, int y) 
     {
    
      GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
            this.mc.getTextureManager().bindTexture(texture);
            int k = (this.width - this.xSize) / 2;
            int l = (this.height - this.ySize) / 2;
            this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); 
            if(this.tileCompressor.isBurning())
    
            {
    
                int i = this.tileCompressor.getCookProgress();
    
                this.drawTexturedModalRect(k +  90, l + 122, 201, 105, 20, i);
    
            }
    
     }
    
    }
    
    

    si sa foctionne oublie pas le petit plus 😛



  • Sa fonctione niquel



  • ok met le sujet en résolut du coup


Log in to reply