@‘robin4002’:
Tu as mit cette ligne où ?
Dans ta classe principale et dans la fonction init ?
blockIngotMasherIdle = new IngotMasher(false).setBlockName("IngotMasherIdle").setCreativeTab(CreativeTabs.tabBlock).setHardness(3.5F);
blockIngotMasherActive = new IngotMasher(true).setBlockName("IngotMasherActive").setHardness(3.5F);
GameRegistry.registerTileEntity(TileEntityIngotMasher.class, "blockIngotMasherIdle");
GameRegistry.registerBlock(blockIngotMasherIdle, "IngotMasherIdle");
GameRegistry.registerBlock(blockIngotMasherActive, "IngotMasherActive");
Edit:
J’ai modifié mon code sa marche, mais le problème c’est que y a pas l’animation de mon Gui
package fr.darkvince.ultrav2.four;
import org.lwjgl.opengl.GL11;
import fr.darkvince.ultrav2.Main;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.util.ResourceLocation;
public class GuiIngotMasher extends GuiContainer{
private static final ResourceLocation texture = new ResourceLocation("ultrav2:textures/gui/IngotMasherGui.png");
public TileEntityIngotMasher ingotMasher;
public GuiIngotMasher(InventoryPlayer invPlayer, TileEntityIngotMasher teIngotMasher)
{
super(new ContainerIngotMasher(invPlayer, teIngotMasher));
this.ingotMasher = teIngotMasher;
this.xSize = 176;
this.ySize = 166;
}
protected void func_146979_b(int i, int j)
{
String name = this.ingotMasher.isInventoryNameLocalized() ? this.ingotMasher.getInventoryName() : I18n.format(this.ingotMasher.getInventoryName(), new Object[0]);
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 5, 4210752);
}
protected void drawGuiContainerBackgroundLayer(float f, int i, int j)
{
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, this.xSize, this.ySize);
if (this.ingotMasher.hasPower())
{
int i1 = this.ingotMasher.getPowerRemainingScaled(45);
drawTexturedModalRect(this.guiLeft + 8, this.guiTop + 53 - i1, 176, 89 - i1, 44, i1);
}
int j1 = this.ingotMasher.getMasherProgressScaled(44);
drawTexturedModalRect(this.guiLeft + 63, this.guiTop + 19, 176, 0, j1 + 1, 44);
}
}