Ajouter un gui et un container à un bloc
-
Pas besoin de BlockContainer avec forge.
Laisses comme c’était avant au niveau des extends et des fonctions.Il faut juste adapter onBlockActivated
-
J’ai fait tous les code comme prevu tout marche minecraft se lance mais plante pas jusqu’a que quand je clique sur le block en question ca fait l’animation comme quoi je l’ai ouvert avec la main mais la GUI ne s’affiche pas. J’aurai besoin d’aide pour regler se souci svp !
-
Salut,
Peux-tu envoyer le code de ton gui handler et de ton bloc ? -
@robin4002 tien le GUI Hanlder:
package fr.askipie.funfight; import cpw.mods.fml.common.network.IGuiHandler; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; public class GuiHandlerFungie implements IGuiHandler { @Override public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { TileEntity tile = world.getTileEntity(x, y, z); if(tile instanceof TileEntityFungie) { return new GuiCupboard((TileEntityFungie)tile, player.inventory); } return null; } @Override public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { TileEntity tile = world.getTileEntity(x, y, z); if(tile instanceof TileEntityFungie) { return new ContainerCupboard((TileEntityFungie)tile, player.inventory); } return null; } }
la classe du bloc:
package fr.askipie.funfight; import cpw.mods.fml.common.registry.GameRegistry; import net.minecraft.block.Block; import net.minecraft.block.material.Material; public class FFBlocks { public static Block fungieBlock; public static Block telluriumBlock; public static Block vitriolBlock; public static Block crystaliteBlock; public static Block fungieOre; public static Block telluriumOre; public static Block vitriolOre; public static Block crystaliteOre; public static Block fungieSeedsOre; public static Block telluriumSeedsOre; public static Block vitriolSeedsOre; public static Block crystaliteSeedsOre; public static Block borderBlock; public static Block fungieMachine; public static void init() { fungieBlock = new BlocksBasics(Material.rock).setBlockName("fungieBlock").setCreativeTab(FunFight.funTab).setBlockTextureName(References.MODID + ":fungieBlock").setHardness(2.0F).setResistance(10.0F).setStepSound(Block.soundTypeStone); telluriumBlock = new BlocksBasics(Material.rock).setBlockName("telluriumBlock").setCreativeTab(FunFight.funTab).setBlockTextureName(References.MODID + ":telluriumBlock").setHardness(2.0F).setResistance(10.0F).setStepSound(Block.soundTypeStone); vitriolBlock = new BlocksBasics(Material.rock).setBlockName("vitriolBlock").setCreativeTab(FunFight.funTab).setBlockTextureName(References.MODID + ":vitriolBlock").setHardness(2.0F).setResistance(10.0F).setStepSound(Block.soundTypeStone); crystaliteBlock = new BlocksBasics(Material.rock).setBlockName("crystaliteBlock").setCreativeTab(FunFight.funTab).setBlockTextureName(References.MODID + ":crystaliteBlock").setHardness(2.0F).setResistance(10.0F).setStepSound(Block.soundTypeStone); fungieOre = new BlocksBasics(Material.rock).setBlockName("fungieOre").setCreativeTab(FunFight.funTab).setBlockTextureName(References.MODID + ":fungieOre").setHardness(2.0F).setResistance(10.0F).setStepSound(Block.soundTypeStone); telluriumOre = new BlocksBasics(Material.rock).setBlockName("telluriumOre").setCreativeTab(FunFight.funTab).setBlockTextureName(References.MODID + ":telluriumOre").setHardness(2.0F).setResistance(10.0F).setStepSound(Block.soundTypeStone); vitriolOre = new BlocksBasics(Material.rock).setBlockName("vitriolOre").setCreativeTab(FunFight.funTab).setBlockTextureName(References.MODID + ":vitriolOre").setHardness(2.0F).setResistance(10.0F).setStepSound(Block.soundTypeStone); crystaliteOre = new BlocksBasics(Material.rock).setBlockName("crystaliteOre").setCreativeTab(FunFight.funTab).setBlockTextureName(References.MODID + ":crystaliteOre").setHardness(2.0F).setResistance(10.0F).setStepSound(Block.soundTypeStone); fungieSeedsOre = new BlocksBasics(Material.ground).setBlockName("fungieSeedsOre").setCreativeTab(FunFight.funTab).setBlockTextureName(References.MODID + ":fungieSeedsOre").setHardness(0.2F).setResistance(10.0F).setStepSound(Block.soundTypeGrass); telluriumSeedsOre = new BlocksBasics(Material.ground).setBlockName("telluriumSeedsOre").setCreativeTab(FunFight.funTab).setBlockTextureName(References.MODID + ":telluriumSeedsOre").setHardness(0.2F).setResistance(10.0F).setStepSound(Block.soundTypeGrass); vitriolSeedsOre = new BlocksBasics(Material.ground).setBlockName("vitriolSeedsOre").setCreativeTab(FunFight.funTab).setBlockTextureName(References.MODID + ":vitriolSeedsOre").setHardness(0.2F).setResistance(10.0F).setStepSound(Block.soundTypeGrass); crystaliteSeedsOre = new BlocksBasics(Material.ground).setBlockName("crystaliteSeedsOre").setCreativeTab(FunFight.funTab).setBlockTextureName(References.MODID + ":crystaliteSeedsOre").setHardness(0.2F).setResistance(10.0F).setStepSound(Block.soundTypeGrass); borderBlock = new BlocksBasics(Material.glass).setBlockName("borderBlock").setCreativeTab(FunFight.funTab).setBlockTextureName(References.MODID + ":borderBlock").setHardness(2.0F).setResistance(10.0F).setStepSound(Block.soundTypeCloth); fungieMachine = new GUITutoriel(Material.rock).setBlockName("fungieMachine").setCreativeTab(FunFight.funTab).setBlockTextureName(References.MODID + ":FungieMachine/machineOFF").setHardness(2.0F).setResistance(10.0F).setStepSound(Block.soundTypeStone); } public static void register() { GameRegistry.registerBlock(fungieBlock, fungieBlock.getUnlocalizedName().substring(5)); GameRegistry.registerBlock(telluriumBlock, telluriumBlock.getUnlocalizedName().substring(5)); GameRegistry.registerBlock(vitriolBlock, vitriolBlock.getUnlocalizedName().substring(5)); GameRegistry.registerBlock(crystaliteBlock, crystaliteBlock.getUnlocalizedName().substring(5)); GameRegistry.registerBlock(fungieOre, fungieOre.getUnlocalizedName().substring(5)); GameRegistry.registerBlock(telluriumOre, telluriumOre.getUnlocalizedName().substring(5)); GameRegistry.registerBlock(vitriolOre, vitriolOre.getUnlocalizedName().substring(5)); GameRegistry.registerBlock(crystaliteOre, crystaliteOre.getUnlocalizedName().substring(5)); GameRegistry.registerBlock(fungieSeedsOre, fungieSeedsOre.getUnlocalizedName().substring(5)); GameRegistry.registerBlock(telluriumSeedsOre, telluriumSeedsOre.getUnlocalizedName().substring(5)); GameRegistry.registerBlock(vitriolSeedsOre, vitriolSeedsOre.getUnlocalizedName().substring(5)); GameRegistry.registerBlock(crystaliteSeedsOre, crystaliteSeedsOre.getUnlocalizedName().substring(5)); GameRegistry.registerBlock(borderBlock, borderBlock.getUnlocalizedName().substring(5)); GameRegistry.registerBlock(fungieMachine, fungieMachine.getUnlocalizedName().substring(5)); } }
et le block tile entity:
package fr.askipie.funfight; import cpw.mods.fml.common.Mod.Instance; import cpw.mods.fml.common.network.NetworkRegistry; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.util.Constants; public class TileEntityFungie extends TileEntity implements IInventory { private ItemStack[] contents = new ItemStack[27]; private String customName; @Override public boolean hasCustomInventoryName() { return false; } @Override public void openInventory() { } @Override public void closeInventory() { } @Override public void readFromNBT(NBTTagCompound compound) { super.readFromNBT(compound); // exécute ce qui se trouve dans la fonction readFromNBT de la classe mère (lecture de la position du tile entity) if(compound.hasKey("fungieMachine", Constants.NBT.TAG_STRING)) // si un tag custom name de type string existe { this.customName = compound.getString("fungieMachine"); // on le lit } NBTTagList nbttaglist = compound.getTagList("Items", Constants.NBT.TAG_COMPOUND); // on obtient la liste de tags nommée Items this.contents = new ItemStack[this.getSizeInventory()]; // on réinitialise le tableau for(int i = 0; i < nbttaglist.tagCount(); ++i) // i varie de 0 à la taille la liste { NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i); // on lit le tag nbt int j = nbttagcompound1.getByte("Slot") & 255; // on lit à quel slot se trouve l'item stack if(j >= 0 && j < this.contents.length) { this.contents[j] = ItemStack.loadItemStackFromNBT(nbttagcompound1); // on lit l'item stack qui se trouve dans le tag } } } @Override public void writeToNBT(NBTTagCompound compound) { super.writeToNBT(compound); // exécute se qui se trouve dans la fonction writeToNBT de la classe mère (écriture de la position du tile entity) if(this.hasCustomInventoryName()) // s'il y a un nom custom { compound.setString("fungieMachine", this.customName); // on le met dans le tag nbt } NBTTagList nbttaglist = new NBTTagList(); // on créé une nouvelle liste de tags for(int i = 0; i < this.contents.length; ++i) // i varie de 0 à la taille de notre tableau { if(this.contents[ i] != null) // si l'item stack à l'emplacement i du tableau n'est pas null { NBTTagCompound nbttagcompound1 = new NBTTagCompound(); // on créé un tag nbt nbttagcompound1.setByte("Slot", (byte)i); // on enregistre son emplacement dans le tableau this.contents[ i].writeToNBT(nbttagcompound1); // on écrit l'item dans le tag nbttaglist.appendTag(nbttagcompound1); // on ajoute le tab à la liste } } compound.setTag("Items", nbttaglist); // on enregistre la liste dans le tag nbt } @Override public int getSizeInventory() { return this.contents.length; } @Override public ItemStack getStackInSlot(int slotIndex) { return this.contents[slotIndex]; } @Override public ItemStack decrStackSize(int slotIndex, int amount) { if(this.contents[slotIndex] != null) // si le contenu dans l'emplacement n'est pas null { ItemStack itemstack; if(this.contents[slotIndex].stackSize <= amount) // si la quantité est inférieur où égale à ce qu'on souhaite retirer { itemstack = this.contents[slotIndex]; // la variable itemstack prends la valeur du contenu this.contents[slotIndex] = null; // on retire ce qui est dans la variable contents this.markDirty(); // met à jour le tile entity return itemstack; // renvoie itemstack } else // sinon { itemstack = this.contents[slotIndex].splitStack(amount); // la fonction splitStack(quantité) retire dans this.contents[slotIndex] le contenu et le met dans itemstack if(this.contents[slotIndex].stackSize == 0) // au cas où la quantité passe à 0 (ce qui ne devrait pas arriver en temps normal) { this.contents[slotIndex] = null; // on met sur null, ça évite de se retrouver avec des itemstack bugué qui contiennent 0 } this.markDirty(); // met à jour le tile entity return itemstack; // renvoie itemstack } } else // sinon si le contenu dans cette emplacement est null { return null; // renvoie null, puisqu'il n'y a rien dans cette emplacement } } @Override public ItemStack getStackInSlotOnClosing(int slotIndex) { if(this.contents[slotIndex] != null) { ItemStack itemstack = this.contents[slotIndex]; this.contents[slotIndex] = null; return itemstack; } else { return null; } } @Override public void setInventorySlotContents(int slotIndex, ItemStack stack) { this.contents[slotIndex] = stack; // met l'item stack dans le tableau if(stack != null && stack.stackSize > this.getInventoryStackLimit()) // si la taille de l'item stack dépasse la limite maximum de l'inventaire { stack.stackSize = this.getInventoryStackLimit(); // on le remet sur la limite } this.markDirty(); // met à jour le tile entity } @Override public String getInventoryName() { return this.hasCustomInventoryName() ? this.customName : "tile.cupboard"; } public void setCustomName(String customName) { this.customName = customName; } @Override public int getInventoryStackLimit() { return 64; } @Override public boolean isUseableByPlayer(EntityPlayer player) { return this.worldObj.getTileEntity(this.xCoord, this.yCoord, this.zCoord) != this ? false : player.getDistanceSq((double)this.xCoord + 0.5D, (double)this.yCoord + 0.5D, (double)this.zCoord + 0.5D) <= 64.0D; } @Override public boolean isItemValidForSlot(int slotIndex, ItemStack stack) { return true; } @Instance("funfight") // attention il doit respecter les majuscules/minuscules public static FunFight instance; { NetworkRegistry.INSTANCE.registerGuiHandler(instance, new GuiHandlerFungie()); } }
-
La classe du bloc ce n’est pas ce que tu as envoyé, c’est la classe qui contient
public MonBlock extends Block
Dans ton cas ça semble être GUITutoriel et si c’est bien celle classe, tu l’as très mal nommé. -
@robin4002 Ducoup faut que je change quelle classe et quelle ligne ?
-
Dans les classes que tu as envoyée pas de problème à signaler.
Envoie la classe du bloc.
-
@robin4002 tien c’est la classe de tout mes blocs:
package fr.askipie.funfight; import cpw.mods.fml.common.registry.GameRegistry; import net.minecraft.block.Block; import net.minecraft.block.material.Material; public class FFBlocks { public static Block fungieBlock; public static Block telluriumBlock; public static Block vitriolBlock; public static Block crystaliteBlock; public static Block fungieOre; public static Block telluriumOre; public static Block vitriolOre; public static Block crystaliteOre; public static Block fungieSeedsOre; public static Block telluriumSeedsOre; public static Block vitriolSeedsOre; public static Block crystaliteSeedsOre; public static Block borderBlock; public static Block fungieMachine; public static void init() { fungieBlock = new BlocksBasics(Material.rock).setBlockName("fungieBlock").setCreativeTab(FunFight.funTab).setBlockTextureName(References.MODID + ":fungieBlock").setHardness(2.0F).setResistance(10.0F).setStepSound(Block.soundTypeStone); telluriumBlock = new BlocksBasics(Material.rock).setBlockName("telluriumBlock").setCreativeTab(FunFight.funTab).setBlockTextureName(References.MODID + ":telluriumBlock").setHardness(2.0F).setResistance(10.0F).setStepSound(Block.soundTypeStone); vitriolBlock = new BlocksBasics(Material.rock).setBlockName("vitriolBlock").setCreativeTab(FunFight.funTab).setBlockTextureName(References.MODID + ":vitriolBlock").setHardness(2.0F).setResistance(10.0F).setStepSound(Block.soundTypeStone); crystaliteBlock = new BlocksBasics(Material.rock).setBlockName("crystaliteBlock").setCreativeTab(FunFight.funTab).setBlockTextureName(References.MODID + ":crystaliteBlock").setHardness(2.0F).setResistance(10.0F).setStepSound(Block.soundTypeStone); fungieOre = new BlocksBasics(Material.rock).setBlockName("fungieOre").setCreativeTab(FunFight.funTab).setBlockTextureName(References.MODID + ":fungieOre").setHardness(2.0F).setResistance(10.0F).setStepSound(Block.soundTypeStone); telluriumOre = new BlocksBasics(Material.rock).setBlockName("telluriumOre").setCreativeTab(FunFight.funTab).setBlockTextureName(References.MODID + ":telluriumOre").setHardness(2.0F).setResistance(10.0F).setStepSound(Block.soundTypeStone); vitriolOre = new BlocksBasics(Material.rock).setBlockName("vitriolOre").setCreativeTab(FunFight.funTab).setBlockTextureName(References.MODID + ":vitriolOre").setHardness(2.0F).setResistance(10.0F).setStepSound(Block.soundTypeStone); crystaliteOre = new BlocksBasics(Material.rock).setBlockName("crystaliteOre").setCreativeTab(FunFight.funTab).setBlockTextureName(References.MODID + ":crystaliteOre").setHardness(2.0F).setResistance(10.0F).setStepSound(Block.soundTypeStone); fungieSeedsOre = new BlocksBasics(Material.ground).setBlockName("fungieSeedsOre").setCreativeTab(FunFight.funTab).setBlockTextureName(References.MODID + ":fungieSeedsOre").setHardness(0.2F).setResistance(10.0F).setStepSound(Block.soundTypeGrass); telluriumSeedsOre = new BlocksBasics(Material.ground).setBlockName("telluriumSeedsOre").setCreativeTab(FunFight.funTab).setBlockTextureName(References.MODID + ":telluriumSeedsOre").setHardness(0.2F).setResistance(10.0F).setStepSound(Block.soundTypeGrass); vitriolSeedsOre = new BlocksBasics(Material.ground).setBlockName("vitriolSeedsOre").setCreativeTab(FunFight.funTab).setBlockTextureName(References.MODID + ":vitriolSeedsOre").setHardness(0.2F).setResistance(10.0F).setStepSound(Block.soundTypeGrass); crystaliteSeedsOre = new BlocksBasics(Material.ground).setBlockName("crystaliteSeedsOre").setCreativeTab(FunFight.funTab).setBlockTextureName(References.MODID + ":crystaliteSeedsOre").setHardness(0.2F).setResistance(10.0F).setStepSound(Block.soundTypeGrass); borderBlock = new BlocksBasics(Material.glass).setBlockName("borderBlock").setCreativeTab(FunFight.funTab).setBlockTextureName(References.MODID + ":borderBlock").setHardness(2.0F).setResistance(10.0F).setStepSound(Block.soundTypeCloth); fungieMachine = new GUITutoriel(Material.rock).setBlockName("fungieMachine").setCreativeTab(FunFight.funTab).setBlockTextureName(References.MODID + ":FungieMachine/machineOFF").setHardness(2.0F).setResistance(10.0F).setStepSound(Block.soundTypeStone); } public static void register() { GameRegistry.registerBlock(fungieBlock, fungieBlock.getUnlocalizedName().substring(5)); GameRegistry.registerBlock(telluriumBlock, telluriumBlock.getUnlocalizedName().substring(5)); GameRegistry.registerBlock(vitriolBlock, vitriolBlock.getUnlocalizedName().substring(5)); GameRegistry.registerBlock(crystaliteBlock, crystaliteBlock.getUnlocalizedName().substring(5)); GameRegistry.registerBlock(fungieOre, fungieOre.getUnlocalizedName().substring(5)); GameRegistry.registerBlock(telluriumOre, telluriumOre.getUnlocalizedName().substring(5)); GameRegistry.registerBlock(vitriolOre, vitriolOre.getUnlocalizedName().substring(5)); GameRegistry.registerBlock(crystaliteOre, crystaliteOre.getUnlocalizedName().substring(5)); GameRegistry.registerBlock(fungieSeedsOre, fungieSeedsOre.getUnlocalizedName().substring(5)); GameRegistry.registerBlock(telluriumSeedsOre, telluriumSeedsOre.getUnlocalizedName().substring(5)); GameRegistry.registerBlock(vitriolSeedsOre, vitriolSeedsOre.getUnlocalizedName().substring(5)); GameRegistry.registerBlock(crystaliteSeedsOre, crystaliteSeedsOre.getUnlocalizedName().substring(5)); GameRegistry.registerBlock(borderBlock, borderBlock.getUnlocalizedName().substring(5)); GameRegistry.registerBlock(fungieMachine, fungieMachine.getUnlocalizedName().substring(5)); } }
-
Ce message a été supprimé ! -
Non, ça c’est ta classe ou tu initiales les blocs, tu l’as déjà envoyé …
Moi je veux la classe DU bloc en question, celle qui a un
extends Block
dans son code. -
@robin4002 le guitutoriel ?
package fr.askipie.funfight; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; public class GUITutoriel extends Block { public GUITutoriel(Material p_i45394_1_) { super(p_i45394_1_); } public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { if(world.isRemote) { return true; } else { player.openGui(GuiCupboard.class, 0, world, x, y, z); player.openGui(ContainerCupboard.class, 0, world, x, y, z); return true; } } public void breakBlock(World world, int x, int y, int z, Block block, int metadata) { TileEntity tileentity = world.getTileEntity(x, y, z); if(tileentity instanceof IInventory) { IInventory inv = (IInventory)tileentity; for(int i1 = 0; i1 < inv.getSizeInventory(); ++i1) { ItemStack itemstack = inv.getStackInSlot(i1); if(itemstack != null) { float f = world.rand.nextFloat() * 0.8F + 0.1F; float f1 = world.rand.nextFloat() * 0.8F + 0.1F; EntityItem entityitem; for(float f2 = world.rand.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; world.spawnEntityInWorld(entityitem)) { int j1 = world.rand.nextInt(21) + 10; if(j1 > itemstack.stackSize) { j1 = itemstack.stackSize; } itemstack.stackSize -= j1; entityitem = new EntityItem(world, (double)((float)x + f), (double)((float)y + f1), (double)((float)z + f2), new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage())); float f3 = 0.05F; entityitem.motionX = (double)((float)world.rand.nextGaussian() * f3); entityitem.motionY = (double)((float)world.rand.nextGaussian() * f3 + 0.2F); entityitem.motionZ = (double)((float)world.rand.nextGaussian() * f3); if(itemstack.hasTagCompound()) { entityitem.getEntityItem().setTagCompound((NBTTagCompound)itemstack.getTagCompound().copy()); } } } } world.func_147453_f(x, y, z, block); } super.breakBlock(world, x, y, z, block, metadata); } public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase living, ItemStack stack) { TileEntity tile = world.getTileEntity(x, y, z); if(tile instanceof TileEntityFungie) { if(stack.hasDisplayName()) { ((TileEntityFungie)tile).setCustomName(stack.getDisplayName()); } } } }
-
Oui c’est bien cette classe.
Tu aurais dû mettre “Block” dans le nom de la classe comme c’est un bloc et pas du tout un gui.
Le problème vient d’ici, tu as mis deux fois la fonction player.openGui et tu as mis n’importe quoi comme premier argument.
Il faut mettre l’instance de ton mod (
ClassePrincipale.instance
). -
@robin4002 ca capte pas FunFight.instance la classe principal :
package fr.askipie.funfight; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.SidedProxy; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; @Mod(modid = References.MODID, name = References.MODNAME, version = References.VERSION) public class FunFight { protected static final String ItemMod = null; @SidedProxy(clientSide = References.ClientProxy, serverSide = References.ServerProxy) public static CommonProxy proxy; public static CreativeTabs funTab = new CreativeTabs("funTab") { @SideOnly(Side.CLIENT) public Item getTabIconItem() { return FFItems.fungie; } }; @EventHandler public void preInit(FMLPreInitializationEvent event) { Crops.init(); Crops.register(); FFBlocks.init(); FFBlocks.register(); FFItems.init(); FFItems.register(); FFCraftings.register(); FFWorldRegister.MainRegistry(); GUITutoriel.registerBlocks(); GuiCupboard.getClipboardString(); GuiCupboard.isCtrlKeyDown(); GuiCupboard.isShiftKeyDown(); } @EventHandler public void init(FMLInitializationEvent event) { proxy.registerRenders(); } @EventHandler public void postInit(FMLPostInitializationEvent event) { } }
-
@robin4002 tu peut regler mon souci ou pas des que je marque FunFight.instance ca marche pas (FunFight est ma classe principale)
-
Car tu n’as pas créé de variable instance dans ta classe principale.
Va voir le tutoriel sur la base du mod pour savoir comment faire : https://www.minecraftforgefrance.fr/topic/526/créer-la-base-de-votre-mod
-
@robin4002 J’ai ajouter
@Instance("FunFight") public static FunFight instance;
mais la gui s’ouvre toujours pas
-
Ah oui normal, il te manque les fonctions gérant le tile entity dans la classe de ton bloc.
https://www.minecraftforgefrance.fr/topic/995/ajouter-une-entité-à-votre-bloc-tile-entity -
@robin4002 sinon est-ce que je pourrai t’envoyer un lien mediafire de mon workspace de mod car je suis pas fort niveau codage je suis perdu sur les codes et tout est-ce que tu peut ???
-
Je n’ai plus aucune workspace 1.7.10 sur mon ordinateur, donc ça va être compliqué.
-
@robin4002 ouai mais c’est deja compilé ya plus qu’a lancer avec eclipse et ca vat marcher normalement !