21 juin 2015, 12:38

@‘robin4002’:

@‘Eryah’:

Je me présente, Eryah, coddeur de merde.

Si tu as cette image de toi et que tu ne fais aucun effort pour comprendre ce que tu es en train de faire, laisse tomber la programmation.

C’ets de l’ironie, je fais des efforts, mais ej suis toujours à un niveau trèsq très bas, donc je me référence ainsi, mais ironiquement




Donc, j’ai bidouillé un peu, et j’ai une erreur sur le Gui
Classe du GUI

​package eryah.usefulthings.gui;

import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.tileentity.TileEntityFurnace;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import eryah.usefulthings.container.ContainerCrusher;

@SideOnly(Side.CLIENT)
public class GuiCrusher extends GuiContainer
{
    private static final ResourceLocation furnaceGuiTextures = new ResourceLocation("textures/gui/container/furnace.png");
    /** The player inventory bound to this GUI. */
    private final InventoryPlayer playerInventory;
    private IInventory tileCrusher;
    private static final String __OBFID = "CL_00000758";

public GuiCrusher(InventoryPlayer playerInv, IInventory crusherInv) {
super(**new ContainerCrusher(playerInv, crusherInv**));
        this.playerInventory = playerInv;
        this.tileCrusher = crusherInv;
}

/**
     * Draw the foreground layer for the GuiContainer (everything in front of the items). Args : mouseX, mouseY
     */
    protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY)
    {
        String s = this.tileCrusher.getDisplayName().getUnformattedText();
        this.fontRendererObj.drawString(s, this.xSize / 2 - this.fontRendererObj.getStringWidth(s) / 2, 6, 4210752);
        this.fontRendererObj.drawString(this.playerInventory.getDisplayName().getUnformattedText(), 8, this.ySize - 96 + 2, 4210752);
    }

    /**
     * Args : renderPartialTicks, mouseX, mouseY
     */
    protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY)
    {
        GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
        this.mc.getTextureManager().bindTexture(furnaceGuiTextures);
        int k = (this.width - this.xSize) / 2;
        int l = (this.height - this.ySize) / 2;
        this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
        int i1;

        if (TileEntityFurnace.isBurning(this.tileCrusher))
        {
            i1 = this.func_175382_i(13);
            this.drawTexturedModalRect(k + 56, l + 36 + 12 - i1, 176, 12 - i1, 14, i1 + 1);
        }

        i1 = this.func_175381_h(24);
        this.drawTexturedModalRect(k + 79, l + 34, 176, 14, i1 + 1, 16);
    }

    private int func_175381_h(int p_175381_1_)
    {
        int j = this.tileCrusher.getField(2);
        int k = this.tileCrusher.getField(3);
        return k != 0 && j != 0 ? j * p_175381_1_ / k : 0;
    }

    private int func_175382_i(int p_175382_1_)
    {
        int j = this.tileCrusher.getField(1);

        if (j == 0)
        {
            j = 200;
        }

        return this.tileCrusher.getField(0) * p_175382_1_ / j;
    }
}

The constructor ContainerCrusher(InventoryPlayer, IInventory) is undefined

J’ai testé toutes les solutions, mais çela provoque une boucle d’erreur