voila mon code
package com.gmail.martin67370.MineAzurMod.common.gui;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.achievement.GuiAchievements;
import net.minecraft.client.gui.achievement.GuiStats;
import net.minecraft.client.gui.inventory.GuiChest;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.gui.inventory.GuiContainerCreative;
import net.minecraft.client.gui.inventory.GuiDispenser;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.tileentity.TileEntityChest;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
import com.gmail.martin67370.MineAzurMod.common.ContainerShowcaseInv;
import com.gmail.martin67370.MineAzurMod.common.MineAzurMod;
import com.gmail.martin67370.MineAzurMod.common.TileEntityShowcase;
public class GuiShowcaseInv extends GuiContainer {
private static final ResourceLocation texture = new ResourceLocation(MineAzurMod.MODID,"textures/gui/container/monitor.png");
private TileEntityShowcase tileShowcase;
private InventoryPlayer playerInv;
protected World world;
public GuiShowcaseInv(TileEntityShowcase tile, InventoryPlayer inventory, World world)
{
super(new ContainerShowcaseInv(tile, inventory));
this.tileShowcase = tile;
this.playerInv = inventory;
this.allowUserInput = false;
//this.ySize = 175;
//this.xSize = 175;
this.world = world;
this.ySize = 236/2;
this.xSize = 420/2;
}
public void drawTexturedModalRectHd(int p_73729_1_, int p_73729_2_, int p_73729_3_, int p_73729_4_, int p_73729_5_, int p_73729_6_)
{
float fx = (float)1/xSize;
float fy = (float)1/ySize;
Tessellator tessellator = Tessellator.instance;
tessellator.startDrawingQuads();
tessellator.addVertexWithUV((double)(p_73729_1_ + 0), (double)(p_73729_2_ + p_73729_6_), (double)this.zLevel, (double)((float)(p_73729_3_ + 0) * fx), (double)((float)(p_73729_4_ + p_73729_6_) * fy));
tessellator.addVertexWithUV((double)(p_73729_1_ + p_73729_5_), (double)(p_73729_2_ + p_73729_6_), (double)this.zLevel, (double)((float)(p_73729_3_ + p_73729_5_) * fx), (double)((float)(p_73729_4_ + p_73729_6_) * fy));
tessellator.addVertexWithUV((double)(p_73729_1_ + p_73729_5_), (double)(p_73729_2_ + 0), (double)this.zLevel, (double)((float)(p_73729_3_ + p_73729_5_) * fx), (double)((float)(p_73729_4_ + 0) * fy));
tessellator.addVertexWithUV((double)(p_73729_1_ + 0), (double)(p_73729_2_ + 0), (double)this.zLevel, (double)((float)(p_73729_3_ + 0) * fx), (double)((float)(p_73729_4_ + 0) * fy));
tessellator.draw();
}
@Override
public void initGui()
{
super.initGui();
Keyboard.enableRepeatEvents(true);
int i = (this.width - this.xSize) / 2;
int j = (this.height - this.ySize) / 2;
this.buttonList.clear();
}
@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 - 420) / 2;
int l = (this.height - 236) / 2;
this.drawTexturedModalRectHd(k, l, 0, 0, this.xSize, this.ySize);
}
public void drawScreen(int par1, int par2, float par3)
{
super.drawScreen(par1, par2, par3);
GL11.glDisable(GL11.GL_LIGHTING);
}
protected void drawGuiContainerForegroundLayer(int x, int y)
{
}
protected void actionPerformed(GuiButton p_146284_1_)
{
}
}
Lis le tuto pour comprendre les différente modification
Ps : attention j’ai changer la tileEntity le container et le nom de la class tu aura juste a remettre tes trucs
Si tu comprend pas qu’elle que chose tu me le dit 😄