MFF

    Minecraft Forge France
    • Récent
    • Mots-clés
    • Populaire
    • Utilisateurs
    • Groupes
    • Forge Events
      • Automatique
      • Foncé
      • Clair
    • S'inscrire
    • Se connecter

    Créer un gui et un container sur un bloc (type coffre)

    Planifier Épinglé Verrouillé Déplacé Les interfaces (GUI) et les container
    1.6.x
    136 Messages 24 Publieurs 55.9k Vues 5 Watching
    Charger plus de messages
    • Du plus ancien au plus récent
    • Du plus récent au plus ancien
    • Les plus votés
    Répondre
    • Répondre à l'aide d'un nouveau sujet
    Se connecter pour répondre
    Ce sujet a été supprimé. Seuls les utilisateurs avec les droits d'administration peuvent le voir.
    • robin4002R Hors-ligne
      robin4002 Moddeurs confirmés Rédacteurs Administrateurs
      dernière édition par

      Je vois deux problèmes dans le bloc.
      1. Ta fonction createTileEntity retourne null, cela devrait être :

      @Override
      public TileEntity createNewTileEntity(World world) {
      return new TileEntityBigChest();
      }
      

      Autre problème, j’ai dit que dans le cas du tutoriel je créé le container sur le metadata 3, dans ton cas tu n’as pas de métadata donc :

      public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9)
      {
      if(world.getBlockMetadata(x, y, z) == 3)
      {
      FMLNetworkHandler.openGui(player, ModCatnos.instance, 0, world, x, y, z);
      return true;
      }
      return false;
      }
      public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase living, ItemStack stack)
      {
      TileEntity te = world.getBlockTileEntity(x, y, z);
      if(te != null && stack.getItemDamage() == 3 && te instanceof TileEntityBigChest && stack.hasDisplayName())
      {
      ((TileEntityBigChest)te).setCustomGuiName(stack.getDisplayName());
      }
      }
      public void breakBlock(World world, int x, int y, int z, int side, int metadata)
      {
      if(metadata == 3)
      {
      dropContainerItem(world, x, y, z);
      }
      super.breakBlock(world, x, y, z, side, metadata);
      }
      

      Devrait être :

      public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9)
      {
      FMLNetworkHandler.openGui(player, ModCatnos.instance, 0, world, x, y, z);
      return true;
      }
      public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase living, ItemStack stack)
      {
      TileEntity te = world.getBlockTileEntity(x, y, z);
      if(te instanceof TileEntityBigChest && stack.hasDisplayName())
      {
      ((TileEntityBigChest)te).setCustomGuiName(stack.getDisplayName());
      }
      }
      public void breakBlock(World world, int x, int y, int z, int side, int metadata)
      {
      dropContainerItem(world, x, y, z);
      super.breakBlock(world, x, y, z, side, metadata);
      }
      
      1 réponse Dernière réponse Répondre Citer 0
      • pulganP Hors-ligne
        pulgan
        dernière édition par

        Bon meme apres correction rien ne se passe faut t’il que je te donne ma nouvelle classe + la classe principal?

        1 réponse Dernière réponse Répondre Citer 0
        • robin4002R Hors-ligne
          robin4002 Moddeurs confirmés Rédacteurs Administrateurs
          dernière édition par

          Heu ouai envoie toutes tes classes.

          1 réponse Dernière réponse Répondre Citer 0
          • pulganP Hors-ligne
            pulgan
            dernière édition par

            @‘robin4002’:

            Heu ouai envoie toutes tes classes.

            Donc de retour cette fois avec toutes les classe:
            les corrections donné par robin ont était effectuer sur la classe block

            merci de votre aide

            Classe principal:

            
            package craftz;
            
            import net.minecraft.block.Block;
            import net.minecraft.block.material.Material;
            import net.minecraft.client.gui.Gui;
            import net.minecraft.creativetab.CreativeTabs;
            import net.minecraft.entity.Entity;
            import net.minecraft.entity.EnumCreatureType;
            import net.minecraft.item.EnumToolMaterial;
            import net.minecraft.item.Item;
            import net.minecraft.item.ItemFood;
            import net.minecraft.item.ItemSeeds;
            import net.minecraft.world.biome.BiomeGenBase;
            import net.minecraftforge.common.DimensionManager;
            import net.minecraftforge.common.EnumHelper;
            import cpw.mods.fml.common.Mod;
            import cpw.mods.fml.common.Mod.Init;
            import cpw.mods.fml.common.Mod.Instance;
            import cpw.mods.fml.common.Mod.PostInit;
            import cpw.mods.fml.common.Mod.PreInit;
            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.common.network.NetworkMod;
            import cpw.mods.fml.common.network.NetworkRegistry;
            import cpw.mods.fml.common.registry.EntityRegistry;
            import cpw.mods.fml.common.registry.GameRegistry;
            import cpw.mods.fml.common.registry.LanguageRegistry;
            import cpw.mods.fml.common.registry.TickRegistry;
            import cpw.mods.fml.relauncher.Side;
            
            @Mod(modid = "craftz", name = "craftz", version = "0.1")
            @NetworkMod(clientSideRequired = true, serverSideRequired = false)
            
            public class ModCatnos
            {
            @SidedProxy(clientSide = "craftz.ClientProxy", serverSide = "craftz.CommonProxy")
            public static CommonProxy proxy;
            public static Block BlockOrgeCulture, matrixportalblock, porte, porte2, mychest, wallwood, sculture, yolo;
            public static Item itemcake, poire, sniper, couteau, ItemOrge, ItemOrgeGraines, cleporte, itemporte2;
            public static CreativeTabs TestCreativeTabs = new TestCreativeTabs("TestCreativeTabs");
            public static boolean zoom;
            public static Gui guitest;
            public static BiomeGenBase Biomedetest;
            public static final int dimensionId = 8;
            
            @Instance("ModCatnos")
            public static ModCatnos instance;
            
            static EnumToolMaterial cut = EnumHelper.addToolMaterial("cut", 3, 1561, 8.0F, 3, 10);
            
            @PreInit
            public void preload(FMLPreInitializationEvent event)
            {
            //Configuration
            
            //Blocks
            matrixportalblock = new BlockPortalmatrixblock(4001).setCreativeTab(ModCatnos.TestCreativeTabs).setUnlocalizedName("matrixlock");
            porte = new BlockPorte(4002, Material.rock).setCreativeTab(ModCatnos.TestCreativeTabs).setBlockUnbreakable().setUnlocalizedName("porte");
            porte2 = new PorteBlock(4003, Material.rock).setCreativeTab(ModCatnos.TestCreativeTabs).setBlockUnbreakable().setUnlocalizedName("porte2");
            wallwood = new WallWoodBlock(4004, Block.planks).setCreativeTab(ModCatnos.TestCreativeTabs).setUnlocalizedName("wallwood");
            // sculture = new BlockSculpture(4005).setCreativeTab(ModCatnos.TestCreativeTabs).setUnlocalizedName("sculture");
            yolo = new BlockCoffre(4006, Material.wood).setCreativeTab(ModCatnos.TestCreativeTabs).setUnlocalizedName("coffre");
            //Items
            sniper = new ItemSniper1(3001).setCreativeTab(ModCatnos.TestCreativeTabs).setUnlocalizedName("sniper");
            couteau = new ItemCouteau(3002, cut).setCreativeTab(ModCatnos.TestCreativeTabs).setUnlocalizedName("cut");
            poire = new ItemPoire(3003, 3, false).setCreativeTab(ModCatnos.TestCreativeTabs).setUnlocalizedName("poire");
            cleporte = new ItemClePorte(3004).setCreativeTab(ModCatnos.TestCreativeTabs).setUnlocalizedName("cleporte");
            itemporte2 = new Itemporte2(3005, Material.wood).setCreativeTab(ModCatnos.TestCreativeTabs).setUnlocalizedName("itemporte2");
            
            //CreativeTabs
            
            //Achievements
            
            //Biome
            Biomedetest = new biomeDeTest(40).setBiomeName("Biome De test").setDisableRain().setTemperatureRainfall(1.2F, 0.9F).setEnableSnow().setMinMaxHeight(0.3F, 0.5F);
            
            }
            
            @Init
            public void load(FMLInitializationEvent event)
            {
            //Registry Block
            GameRegistry.registerBlock(matrixportalblock, "matrixportalblock");
            GameRegistry.registerBlock(wallwood, "mur en bois");
            GameRegistry.registerBlock(porte, "porte");
            GameRegistry.registerBlock(porte2,"porte2");
            // GameRegistry.registerBlock(sculture, "sculture");
            GameRegistry.registerBlock(yolo, "yolo");
            
            //Registry Item
            GameRegistry.registerItem(sniper, "sniper");
            GameRegistry.registerItem(poire, "poire");
            GameRegistry.registerItem(couteau, "couteau");
            GameRegistry.registerItem(cleporte, "cleporte");
            
            //registry Biome
            GameRegistry.addBiome(Biomedetest);
            
            //registry TileEntity
            GameRegistry.registerTileEntity(TileEntityBigChest.class, "TileEntityBigChest");
            
            NetworkRegistry.instance().registerGuiHandler(this.instance, new GuiHandlerTutorial());
            
            TickRegistry.registerTickHandler(new TickClientHandler(), Side.CLIENT);
            
            DimensionManager.registerProviderType(ModCatnos.dimensionId, WorldProviderMatrix.class, false);
            DimensionManager.registerDimension(ModCatnos.dimensionId, ModCatnos.dimensionId);
            //Mobs
            
            //Render
            proxy.registerRender();
            proxy.registerTileEntityRender();
            //NetWork
            }
            
            @PostInit
            public void modloaded(FMLPostInitializationEvent event)
            {
            //Language
            LanguageRegistry.addName(sniper, "sniper");
            LanguageRegistry.addName(couteau, "couteau");
            LanguageRegistry.addName(poire, "poire");
            LanguageRegistry.addName(matrixportalblock, "matrixportalblock");
            LanguageRegistry.addName(cleporte, "cle de securite");
            LanguageRegistry.addName(porte, "porte de securite");
            LanguageRegistry.addName(yolo, "coffre geant");
            
            LanguageRegistry.instance().addStringLocalization("entity.AnyZob.name", "AnyZob");
            //Recipe
            
            }
            
            }
            
            

            Classe block

            
            package craftz;
            
            import java.util.List;
            
            import net.minecraft.block.BlockContainer;
            import net.minecraft.block.material.Material;
            import net.minecraft.client.renderer.texture.IconRegister;
            import net.minecraft.creativetab.CreativeTabs;
            import net.minecraft.entity.EntityLivingBase;
            import net.minecraft.entity.item.EntityItem;
            import net.minecraft.entity.player.EntityPlayer;
            import net.minecraft.item.ItemStack;
            import net.minecraft.nbt.NBTTagCompound;
            import net.minecraft.tileentity.TileEntity;
            import net.minecraft.tileentity.TileEntityChest;
            import net.minecraft.util.Icon;
            import net.minecraft.util.MathHelper;
            import net.minecraft.world.IBlockAccess;
            import net.minecraft.world.World;
            import cpw.mods.fml.common.network.FMLNetworkHandler;
            import cpw.mods.fml.relauncher.Side;
            import cpw.mods.fml.relauncher.SideOnly;
            
            public class BlockCoffre extends BlockContainer
            {
            
            protected BlockCoffre(int par1, Material par2Material) {
            super(par1, par2Material);
            }
            public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9)
            {
            FMLNetworkHandler.openGui(player, ModCatnos.instance, 0, world, x, y, z);
            return true;
            }
            public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase living, ItemStack stack)
            {
            TileEntity te = world.getBlockTileEntity(x, y, z);
            if(te instanceof TileEntityBigChest && stack.hasDisplayName())
            {
            ((TileEntityBigChest)te).setCustomGuiName(stack.getDisplayName());
            }
            }
            public void breakBlock(World world, int x, int y, int z, int side, int metadata)
            {
            dropContainerItem(world, x, y, z);
            super.breakBlock(world, x, y, z, side, metadata);
            }
            @Override
            public TileEntity createNewTileEntity(World world) {
            return new TileEntityBigChest();
            }
            protected void dropContainerItem(World world, int x, int y, int z)
            {
            TileEntityBigChest bigchest = (TileEntityBigChest)world.getBlockTileEntity(x, y, z);
            
            if (bigchest != null)
            {
            for (int slotId = 0; slotId < bigchest.getSizeInventory(); slotId++)
            {
            ItemStack stack = bigchest.getStackInSlot(slotId);
            
            if (stack != 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; stack.stackSize > 0; world.spawnEntityInWorld(entityitem))
            {
            int k1 = world.rand.nextInt(21) + 10;
            
            if (k1 > stack.stackSize)
            {
            k1 = stack.stackSize;
            }
            
            stack.stackSize -= k1;
            entityitem = new EntityItem(world, (double)((float)x + f), (double)((float)y + f1), (double)((float)z + f2), new ItemStack(stack.itemID, k1, stack.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 (stack.hasTagCompound())
            {
            entityitem.getEntityItem().setTagCompound((NBTTagCompound)stack.getTagCompound().copy());
            }
            }
            }
            }
            }
            }
            public boolean onBlockEventReceived(World world, int x, int y, int z, int eventId, int eventValue)
            {
            super.onBlockEventReceived(world, x, y, z, eventId, eventValue);
            TileEntity tileentity = world.getBlockTileEntity(x, y, z);
            return tileentity != null ? tileentity.receiveClientEvent(eventId, eventValue) : false;
            }
            }
            
            

            Classe Container

            
            package craftz;
            
            import net.minecraft.entity.player.EntityPlayer;
            import net.minecraft.entity.player.InventoryPlayer;
            import net.minecraft.inventory.Container;
            import net.minecraft.inventory.Slot;
            import net.minecraft.item.ItemStack;
            
            public class ContainerBigChest extends Container
            {
            private TileEntityBigChest tileEntity;
            
            public ContainerBigChest(InventoryPlayer playerInventory, TileEntityBigChest teChest)
            {
            this.tileEntity = teChest;
            teChest.openChest();
            
            for(int i = 0; i < 6; i++)
            {
            for(int j = 0; j < 9; j++)
            {
            this.addSlotToContainer(new Slot(teChest, j + i * 9, 8 + j * 18, 18 + i * 18));
            }
            }
            this.bindPlayerInventory(playerInventory);
            }
            
            private void bindPlayerInventory(InventoryPlayer playerInventory)
            {
            int i;
            for(i = 0; i < 3; i++)
            {
            for(int j = 0; j < 9; j++)
            {
            this.addSlotToContainer(new Slot(playerInventory, j + i * 9 + 9, 8 + j * 18, 103 + i * 18 + 37));
            }
            }
            
            for(i = 0; i < 9; i++)
            {
            this.addSlotToContainer(new Slot(playerInventory, i, 8 + i * 18, 161 + 37));
            }
            }
            
            @Override
            public boolean canInteractWith(EntityPlayer player)
            {
            return tileEntity.isUseableByPlayer(player);
            }
            
            public ItemStack transferStackInSlot(EntityPlayer player, int slotId)
            {
            ItemStack itemstack = null;
            Slot slot = (Slot)this.inventorySlots.get(slotId);
            
            if(slot != null && slot.getHasStack())
            {
            ItemStack itemstack1 = slot.getStack();
            itemstack = itemstack1.copy();
            
            if(slotId < 9)
            {
            if(!this.mergeItemStack(itemstack1, 9, this.inventorySlots.size(), true))
            {
            return null;
            }
            }
            else if(!this.mergeItemStack(itemstack1, 0, 9, false))
            {
            return null;
            }
            
            if(itemstack1.stackSize == 0)
            {
            slot.putStack((ItemStack)null);
            }
            else
            {
            slot.onSlotChanged();
            }
            }
            return itemstack;
            }
            public void onContainerClosed(EntityPlayer player)
            {
            super.onContainerClosed(player);
            tileEntity.closeChest();
            }
            
            }
            
            

            Classe Guihandler

            
            package craftz;
            
            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 GuiHandlerTutorial implements IGuiHandler
            
            {
            
            @Override
            public Object getServerGuiElement(int ID, EntityPlayer player, World world,
            int x, int y, int z) {
            TileEntity te = world.getBlockTileEntity(x, y, z);
            if(te instanceof TileEntityBigChest)
            {
            return new ContainerBigChest(player.inventory, (TileEntityBigChest)te);
            }
            return null;
            }
            
            @Override
            public Object getClientGuiElement(int ID, EntityPlayer player, World world,
            int x, int y, int z) {
            
            TileEntity te = world.getBlockTileEntity(x, y, z);
            if(te instanceof TileEntityBigChest)
            {
            return new GuiBigChest(player.inventory, (TileEntityBigChest)te);
            }
            return null;
            }
            }
            
            

            Classe TileEntity

            
            package craftz;
            
            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.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;
            
            public class TileEntityBigChest extends TileEntity implements IInventory
            {
            private ItemStack[] inventory = new ItemStack[72];
            private String customName;
            
            public void readFromNBT(NBTTagCompound nbttag)
            {
            super.readFromNBT(nbttag);
            NBTTagList nbttaglist = nbttag.getTagList("Items");
            this.inventory = new ItemStack[this.getSizeInventory()];
            
            if (nbttag.hasKey("CustomName"))
            {
            this.customName = nbttag.getString("CustomName");
            }
            
            for (int i = 0; i < nbttaglist.tagCount(); i++)
            {
            NBTTagCompound nbttagcompound1 = (NBTTagCompound)nbttaglist.tagAt(i);
            int j = nbttagcompound1.getByte("Slot");
            
            if (j >= 0 && j < this.inventory.length)
            {
            this.inventory[j] = ItemStack.loadItemStackFromNBT(nbttagcompound1);
            }
            }
            }
            
            public void writeToNBT(NBTTagCompound nbttag)
            {
            super.writeToNBT(nbttag);
            NBTTagList nbttaglist = new NBTTagList();
            
            for (int i = 0; i < this.inventory.length; i++)
            {
            if (this.inventory* != null)
            {
            NBTTagCompound nbttagcompound1 = new NBTTagCompound();
            nbttagcompound1.setByte("Slot", (byte)i);
            this.inventory*.writeToNBT(nbttagcompound1);
            nbttaglist.appendTag(nbttagcompound1);
            }
            }
            
            nbttag.setTag("Items", nbttaglist);
            
            if (this.isInvNameLocalized())
            {
            nbttag.setString("CustomName", this.customName);
            }
            }
            @Override
            public int getSizeInventory()
            {
            return inventory.length;
            }
            @Override
            public ItemStack getStackInSlot(int slotId)
            {
            return inventory[slotId];
            }
            @Override
            public ItemStack decrStackSize(int slotId, int quantity)
            {
            if (this.inventory[slotId] != null)
            {
            ItemStack itemstack;
            
            if (this.inventory[slotId].stackSize <= quantity)
            {
            itemstack = this.inventory[slotId];
            this.inventory[slotId] = null;
            this.onInventoryChanged();
            return itemstack;
            }
            else
            {
            itemstack = this.inventory[slotId].splitStack(quantity);
            
            if (this.inventory[slotId].stackSize == 0)
            {
            this.inventory[slotId] = null;
            }
            
            this.onInventoryChanged();
            return itemstack;
            }
            }
            else
            {
            return null;
            }
            }
            
            @Override
            public ItemStack getStackInSlotOnClosing(int slotId)
            {
            if (this.inventory[slotId] != null)
            {
            ItemStack itemstack = this.inventory[slotId];
            this.inventory[slotId] = null;
            return itemstack;
            }
            else
            {
            return null;
            }
            }
            
            @Override
            public void setInventorySlotContents(int slotId, ItemStack stack)
            {
            this.inventory[slotId] = stack;
            
            if (stack != null && stack.stackSize > this.getInventoryStackLimit())
            {
            stack.stackSize = this.getInventoryStackLimit();
            }
            
            this.onInventoryChanged();
            }
            @Override
            public String getInvName()
            {
            return this.isInvNameLocalized() ? this.customName : "container.bigchest";
            }
            
            @Override
            public boolean isInvNameLocalized()
            {
            return this.customName != null && this.customName.length() > 0;
            }
            
            public void setCustomGuiName(String name)
            {
            this.customName = name;
            }
            @Override
            public int getInventoryStackLimit()
            {
            return 64;
            }
            @Override
            public boolean isUseableByPlayer(EntityPlayer player)
            {
            return worldObj.getBlockTileEntity(xCoord, yCoord, zCoord) == this && player.getDistanceSq(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5) < 64;
            }
            @Override
            public void openChest()
            {
            
            }
            
            @Override
            public void closeChest()
            {
            
            }
            @Override
            public boolean isItemValidForSlot(int slotId, ItemStack stack)
            {
            return true;
            }
            
            }
            
            
            1 réponse Dernière réponse Répondre Citer 0
            • robin4002R Hors-ligne
              robin4002 Moddeurs confirmés Rédacteurs Administrateurs
              dernière édition par

              Je ne vois pourtant plus aucune erreur, tu as essayé en plaçant un nouveau bloc ou tu essayé sur des blocs déjà existant ?
              Test sur une nouvelle map, ça serait mieux.

              1 réponse Dernière réponse Répondre Citer 0
              • pulganP Hors-ligne
                pulgan
                dernière édition par

                @‘robin4002’:

                Je ne vois pourtant plus aucune erreur, tu as essayé en plaçant un nouveau bloc ou tu essayé sur des blocs déjà existant ?
                Test sur une nouvelle map, ça serait mieux.

                Pour info peut être un rapport, j’ai fait le tutoriel et au moment ou j’ai fait dans une classe le .instance, il n’exister pas j’ai du le créer mais je n’ai rien changer dessus peut être un rapport avec sa

                PS: j’ai pas encore tester sur un nouveau monde

                1 réponse Dernière réponse Répondre Citer 0
                • robin4002R Hors-ligne
                  robin4002 Moddeurs confirmés Rédacteurs Administrateurs
                  dernière édition par

                  Ah ba oui, je viens de voir le problème :
                  @Instance(“ModCatnos”)
                  public static ModCatnos instance;

                  @Mod(modid = “craftz”

                  Ces deux valeurs sont sensés être identique, si tu ne suis pas correctement la base, normal que ça bloque après.

                  1 réponse Dernière réponse Répondre Citer 0
                  • pulganP Hors-ligne
                    pulgan
                    dernière édition par

                    @‘robin4002’:

                    Ah ba oui, je viens de voir le problème :
                    @Instance(“ModCatnos”)
                    public static ModCatnos instance;

                    @Mod(modid = “craftz”

                    Ces deux valeurs sont sensés être identique, si tu ne suis pas correctement la base, normal que ça bloque après.

                    Cela doit venir du moment ou j’ai changer le nom de la classe

                    1 réponse Dernière réponse Répondre Citer 0
                    • pulganP Hors-ligne
                      pulgan
                      dernière édition par

                      Salut J’ai un probleme lorsque je fait shift + click sur un item pour le mettre dans le coffre les 9 premier items se range normalement (1ligne) mais je ne peut pas en placer d’autre

                      1 réponse Dernière réponse Répondre Citer 0
                      • M Hors-ligne
                        Mralexou95
                        dernière édition par

                        Bonjour ! Est ce que ce tutoriel peux marcher en 1.7.X ? Merci de vos réponses !

                        1 réponse Dernière réponse Répondre Citer 0
                        • robin4002R Hors-ligne
                          robin4002 Moddeurs confirmés Rédacteurs Administrateurs
                          dernière édition par

                          Non, il y a eu beaucoup de modification depuis, je vais essayer de le mettre à jour au plus vite (j’ai prévu de faire un tutoriel sur les TESR en 1.7, puis je vais faire celui-la).

                          1 réponse Dernière réponse Répondre Citer 0
                          • M Hors-ligne
                            Mralexou95
                            dernière édition par

                            Ok ! Merci !

                            1 réponse Dernière réponse Répondre Citer 0
                            • Bowser338B Hors-ligne
                              Bowser338
                              dernière édition par

                              je ne sais pas si c’est ici que je dois le mettre mais comme c’est du gui c’est lié ( reprends moi si je me trompe ).
                              Comme le tuto ne marche pas en 1.7 j’ai chercher ailleurs et j’ai trouver mon bonheur cependant quand je fait clic droit crash 
                              et dans le crash report sa m’indique :

                              ​Unexpected error
                              
                              at cpw.mods.fml.common.network.NetworkRegistry.getLocalGuiContainer(NetworkRegistry.java:263)
                              at cpw.mods.fml.common.network.internal.FMLNetworkHandler.openGui(FMLNetworkHandler.java:93)
                              ***at com.bowser.robotic.common.FourArcBlock.onBlockActivated(FourArcBlock.java:71)***
                              at net.minecraft.client.multiplayer.PlayerControllerMP.onPlayerRightClick(PlayerControllerMP.java:376)
                              at net.minecraft.client.Minecraft.func_147121_ag(Minecraft.java:1518)
                              at net.minecraft.client.Minecraft.runTick(Minecraft.java:2033)
                              at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1028)
                              at net.minecraft.client.Minecraft.run(Minecraft.java:951)
                              at net.minecraft.client.main.Main.main(Main.java:164)
                              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                              at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
                              at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                              at java.lang.reflect.Method.invoke(Unknown Source)
                              at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
                              at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
                              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                              at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
                              at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                              at java.lang.reflect.Method.invoke(Unknown Source)
                              at GradleStart.bounce(GradleStart.java:107)
                              at GradleStart.startClient(GradleStart.java:100)
                              at GradleStart.main(GradleStart.java:65)
                              

                              il y a la ligne que j’ai surlignée qui renvoie a cette partie de la classe du bloc

                              ​    public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9) {
                              
                                      FMLNetworkHandler.openGui(player, Robotic.instance, 0, world, x, y, z);
                                      return true;
                                  }
                              

                              a mon avis c’est sa qui fait crash mais je ne suis pas sur et je ne sais pas comment le régler

                              merci.

                              Tout probleme a sa solution, s'il n'y a pas de solution c'est qu'il n'y a pas de problemes

                              1 réponse Dernière réponse Répondre Citer 0
                              • robin4002R Hors-ligne
                                robin4002 Moddeurs confirmés Rédacteurs Administrateurs
                                dernière édition par

                                Tu peux envoyer le crash complet ? Car là on a tout sauf l’exception …

                                1 réponse Dernière réponse Répondre Citer 0
                                • Bowser338B Hors-ligne
                                  Bowser338
                                  dernière édition par

                                  voila :

                                  ​–-- Minecraft Crash Report ----
                                  
                                  // Don't do that.
                                  
                                  Time: 25/10/14 11:00
                                  Description: Unexpected error
                                  
                                  java.lang.NullPointerException: Unexpected error
                                  at cpw.mods.fml.common.network.NetworkRegistry.getLocalGuiContainer(NetworkRegistry.java:263)
                                  at cpw.mods.fml.common.network.internal.FMLNetworkHandler.openGui(FMLNetworkHandler.java:93)
                                  at com.bowser.robotic.common.FourArcBlock.onBlockActivated(FourArcBlock.java:71)
                                  at net.minecraft.client.multiplayer.PlayerControllerMP.onPlayerRightClick(PlayerControllerMP.java:376)
                                  at net.minecraft.client.Minecraft.func_147121_ag(Minecraft.java:1518)
                                  at net.minecraft.client.Minecraft.runTick(Minecraft.java:2033)
                                  at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1028)
                                  at net.minecraft.client.Minecraft.run(Minecraft.java:951)
                                  at net.minecraft.client.main.Main.main(Main.java:164)
                                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                                  at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
                                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                                  at java.lang.reflect.Method.invoke(Unknown Source)
                                  at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
                                  at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
                                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                                  at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
                                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                                  at java.lang.reflect.Method.invoke(Unknown Source)
                                  at GradleStart.bounce(GradleStart.java:107)
                                  at GradleStart.startClient(GradleStart.java:100)
                                  at GradleStart.main(GradleStart.java:65)
                                  
                                  A detailed walkthrough of the error, its code path and all known details is as follows:
                                  ---------------------------------------------------------------------------------------
                                  
                                  -- Head --
                                  Stacktrace:
                                  at cpw.mods.fml.common.network.NetworkRegistry.getLocalGuiContainer(NetworkRegistry.java:263)
                                  at cpw.mods.fml.common.network.internal.FMLNetworkHandler.openGui(FMLNetworkHandler.java:93)
                                  at com.bowser.robotic.common.FourArcBlock.onBlockActivated(FourArcBlock.java:71)
                                  at net.minecraft.client.multiplayer.PlayerControllerMP.onPlayerRightClick(PlayerControllerMP.java:376)
                                  at net.minecraft.client.Minecraft.func_147121_ag(Minecraft.java:1518)
                                  
                                  -- Affected level --
                                  Details:
                                  Level name: MpServer
                                  All players: 1 total; [EntityClientPlayerMP['Bowser338'/120, l='MpServer', x=294,09, y=28,62, z=550,88]]
                                  Chunk stats: MultiplayerChunkCache: 465, 465
                                  Level seed: 0
                                  Level generator: ID 00 - default, ver 1\. Features enabled: false
                                  Level generator options: 
                                  Level spawn location: World: (228,64,244), Chunk: (at 4,4,4 in 14,15; contains blocks 224,0,240 to 239,255,255), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511)
                                  Level time: 12314 game time, 12314 day time
                                  Level dimension: 0
                                  Level storage version: 0x00000 - Unknown?
                                  Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false)
                                  Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: false
                                  Forced entities: 95 total; [EntityBat['Bat'/275, l='MpServer', x=371,34, y=17,10, z=596,09], EntitySkeleton['Skeleton'/137, l='MpServer', x=335,91, y=25,00, z=523,50], EntitySquid['Squid'/136, l='MpServer', x=321,15, y=44,00, z=527,13], EntitySkeleton['Skeleton'/139, l='MpServer', x=251,06, y=28,00, z=536,47], EntityWitch['Witch'/272, l='MpServer', x=370,31, y=14,00, z=595,25], EntityCreeper['Creeper'/138, l='MpServer', x=298,77, y=24,00, z=506,35], EntitySpider['Spider'/141, l='MpServer', x=250,47, y=29,00, z=539,03], EntityZombie['Zombie'/278, l='MpServer', x=343,44, y=26,00, z=624,66], EntitySkeleton['Skeleton'/140, l='MpServer', x=244,84, y=29,00, z=543,50], EntitySquid['Squid'/143, l='MpServer', x=257,47, y=50,93, z=607,89], EntityWitch['Witch'/142, l='MpServer', x=339,60, y=27,00, z=531,69], EntitySquid['Squid'/129, l='MpServer', x=326,38, y=39,12, z=552,42], EntitySquid['Squid'/128, l='MpServer', x=327,54, y=39,00, z=550,77], EntitySquid['Squid'/131, l='MpServer', x=268,56, y=40,00, z=564,51], EntitySquid['Squid'/130, l='MpServer', x=286,01, y=41,13, z=587,16], EntitySquid['Squid'/133, l='MpServer', x=260,00, y=37,40, z=532,41], EntitySquid['Squid'/132, l='MpServer', x=269,43, y=55,05, z=567,63], EntitySquid['Squid'/135, l='MpServer', x=279,54, y=45,00, z=522,50], EntitySquid['Squid'/134, l='MpServer', x=259,50, y=39,23, z=543,95], EntityCreeper['Creeper'/258, l='MpServer', x=372,50, y=13,00, z=583,50], EntitySpider['Spider'/259, l='MpServer', x=370,38, y=13,00, z=585,31], EntitySpider['Spider'/256, l='MpServer', x=367,77, y=11,00, z=576,03], EntitySkeleton['Skeleton'/154, l='MpServer', x=332,94, y=26,00, z=496,50], EntityCreeper['Creeper'/257, l='MpServer', x=371,25, y=13,00, z=580,56], EntityMinecartChest['entity.MinecartChest.name'/262, l='MpServer', x=360,50, y=15,50, z=615,88], EntitySpider['Spider'/263, l='MpServer', x=361,59, y=22,00, z=618,94], EntityZombie['Zombie'/260, l='MpServer', x=368,77, y=18,00, z=576,53], EntityCreeper['Creeper'/158, l='MpServer', x=339,66, y=31,00, z=525,53], EntityBat['Bat'/266, l='MpServer', x=359,90, y=23,01, z=606,84], EntitySquid['Squid'/144, l='MpServer', x=242,16, y=52,42, z=522,72], EntityZombie['Zombie'/267, l='MpServer', x=246,30, y=11,03, z=628,70], EntitySkeleton['Skeleton'/145, l='MpServer', x=326,50, y=16,00, z=500,31], EntityCreeper['Creeper'/264, l='MpServer', x=363,47, y=24,04, z=620,67], EntityBat['Bat'/265, l='MpServer', x=359,44, y=23,04, z=615,61], EntityZombie['Zombie'/149, l='MpServer', x=324,47, y=23,00, z=497,02], EntityCreeper['Creeper'/169, l='MpServer', x=340,03, y=24,00, z=519,38], EntityZombie['Zombie'/174, l='MpServer', x=339,50, y=15,00, z=590,50], EntityCreeper['Creeper'/162, l='MpServer', x=346,50, y=26,00, z=523,50], EntitySkeleton['Skeleton'/160, l='MpServer', x=341,50, y=26,00, z=526,13], EntityCreeper['Creeper'/167, l='MpServer', x=342,30, y=24,00, z=517,22], EntityCreeper['Creeper'/165, l='MpServer', x=345,44, y=25,00, z=521,41], EntityBat['Bat'/288, l='MpServer', x=353,45, y=11,00, z=470,27], EntityItem['item.tile.rail'/186, l='MpServer', x=331,06, y=12,13, z=606,16], EntitySquid['Squid'/187, l='MpServer', x=327,72, y=59,92, z=594,52], EntityItem['item.tile.rail'/184, l='MpServer', x=329,09, y=12,13, z=605,53], EntityZombie['Zombie'/291, l='MpServer', x=374,30, y=14,00, z=614,53], EntityZombie['Zombie'/178, l='MpServer', x=336,41, y=15,00, z=584,03], EntityZombie['Zombie'/176, l='MpServer', x=334,96, y=15,00, z=586,53], EntityBat['Bat'/204, l='MpServer', x=310,06, y=16,10, z=612,53], EntitySkeleton['Skeleton'/207, l='MpServer', x=344,09, y=27,00, z=509,53], EntityCreeper['Creeper'/206, l='MpServer', x=255,53, y=23,97, z=593,75], EntitySkeleton['Skeleton'/201, l='MpServer', x=231,13, y=30,00, z=538,50], EntityMinecartChest['entity.MinecartChest.name'/203, l='MpServer', x=314,50, y=19,50, z=610,50], EntityCreeper['Creeper'/202, l='MpServer', x=354,50, y=26,00, z=532,03], EntitySkeleton['Skeleton'/197, l='MpServer', x=233,13, y=24,00, z=546,50], EntitySquid['Squid'/199, l='MpServer', x=292,42, y=55,38, z=487,12], EntityZombie['Zombie'/194, l='MpServer', x=227,50, y=30,00, z=557,50], EntityCreeper['Creeper'/220, l='MpServer', x=363,50, y=14,00, z=588,50], EntityZombie['Zombie'/221, l='MpServer', x=364,22, y=14,00, z=582,34], EntityCreeper['Creeper'/222, l='MpServer', x=367,92, y=13,00, z=582,03], EntityZombie['Zombie'/223, l='MpServer', x=357,50, y=20,00, z=589,94], EntitySquid['Squid'/216, l='MpServer', x=259,69, y=55,99, z=488,35], EntitySkeleton['Skeleton'/217, l='MpServer', x=331,75, y=27,00, z=483,53], EntityCreeper['Creeper'/218, l='MpServer', x=354,09, y=25,00, z=526,53], EntitySkeleton['Skeleton'/212, l='MpServer', x=349,34, y=15,00, z=593,89], EntityCreeper['Creeper'/213, l='MpServer', x=342,56, y=12,00, z=595,66], EntityBat['Bat'/214, l='MpServer', x=244,61, y=25,00, z=530,14], EntitySkeleton['Skeleton'/208, l='MpServer', x=340,53, y=27,00, z=510,09], EntitySkeleton['Skeleton'/209, l='MpServer', x=337,26, y=30,00, z=497,58], EntityCreeper['Creeper'/210, l='MpServer', x=338,77, y=31,00, z=498,26], EntitySquid['Squid'/211, l='MpServer', x=346,34, y=55,73, z=507,77], EntitySpider['Spider'/239, l='MpServer', x=355,44, y=20,00, z=596,06], EntityBat['Bat'/238, l='MpServer', x=361,75, y=16,10, z=594,28], EntityMinecartChest['entity.MinecartChest.name'/237, l='MpServer', x=352,50, y=27,50, z=599,50], EntitySpider['Spider'/236, l='MpServer', x=354,81, y=15,00, z=595,28], EntitySpider['Spider'/232, l='MpServer', x=341,37, y=27,00, z=496,57], EntitySkeleton['Skeleton'/231, l='MpServer', x=236,38, y=23,00, z=507,75], EntityCreeper['Creeper'/230, l='MpServer', x=233,50, y=32,00, z=606,50], EntitySpider['Spider'/228, l='MpServer', x=251,78, y=15,24, z=617,53], EntityBat['Bat'/227, l='MpServer', x=322,25, y=31,10, z=618,25], EntityBat['Bat'/226, l='MpServer', x=361,09, y=16,10, z=589,28], EntityCreeper['Creeper'/225, l='MpServer', x=359,75, y=17,00, z=578,84], EntitySkeleton['Skeleton'/224, l='MpServer', x=367,95, y=18,00, z=576,50], EntityZombie['Zombie'/250, l='MpServer', x=259,16, y=18,00, z=624,44], EntityZombie['Zombie'/251, l='MpServer', x=216,16, y=22,00, z=515,25], EntityBat['Bat'/246, l='MpServer', x=367,50, y=17,73, z=575,50], EntitySkeleton['Skeleton'/127, l='MpServer', x=321,84, y=28,00, z=560,22], EntityMinecartChest['entity.MinecartChest.name'/247, l='MpServer', x=319,50, y=14,50, z=628,50], EntitySkeleton['Skeleton'/126, l='MpServer', x=321,50, y=27,16, z=557,46], EntitySquid['Squid'/125, l='MpServer', x=260,50, y=39,00, z=547,39], EntitySquid['Squid'/124, l='MpServer', x=278,89, y=50,01, z=543,23], EntitySquid['Squid'/123, l='MpServer', x=300,37, y=44,00, z=530,65], EntitySquid['Squid'/122, l='MpServer', x=302,53, y=39,70, z=547,47], EntityBat['Bat'/240, l='MpServer', x=355,03, y=27,10, z=596,22], EntityClientPlayerMP['Bowser338'/120, l='MpServer', x=294,09, y=28,62, z=550,88]]
                                  Retry entities: 0 total; []
                                  Server brand: fml,forge
                                  Server type: Integrated singleplayer server
                                  Stacktrace:
                                  at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:415)
                                  at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2555)
                                  at net.minecraft.client.Minecraft.run(Minecraft.java:980)
                                  at net.minecraft.client.main.Main.main(Main.java:164)
                                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                                  at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
                                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                                  at java.lang.reflect.Method.invoke(Unknown Source)
                                  at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
                                  at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
                                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                                  at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
                                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                                  at java.lang.reflect.Method.invoke(Unknown Source)
                                  at GradleStart.bounce(GradleStart.java:107)
                                  at GradleStart.startClient(GradleStart.java:100)
                                  at GradleStart.main(GradleStart.java:65)
                                  
                                  – System Details --
                                  Details:
                                  Minecraft Version: 1.7.10
                                  Operating System: Windows 7 (amd64) version 6.1
                                  Java Version: 1.7.0_51, Oracle Corporation
                                  Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
                                  Memory: 758906560 bytes (723 MB) / 1037959168 bytes (989 MB) up to 1037959168 bytes (989 MB)
                                  JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
                                  AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
                                  IntCache: cache: 0, tcache: 0, allocated: 12, tallocated: 94
                                  FML: MCP v9.05 FML v7.10.85.1231 Minecraft Forge 10.13.2.1231 4 mods loaded, 4 mods active
                                  mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
                                  FML{7.10.85.1231} [Forge Mod Loader] (forgeSrc-1.7.10-10.13.2.1231.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
                                  Forge{10.13.2.1231} [Minecraft Forge] (forgeSrc-1.7.10-10.13.2.1231.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
                                  roboticmod{1.0.0} [Robotic Mod] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
                                  Launched Version: 1.7.10
                                  LWJGL: 2.9.1
                                  OpenGL: GeForce GTX 770/PCIe/SSE2 GL version 4.4.0, NVIDIA Corporation
                                  GL Caps: Using GL 1.3 multitexturing.
                                  Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported.
                                  Anisotropic filtering is supported and maximum anisotropy is 16.
                                  Shaders are available because OpenGL 2.1 is supported.
                                  
                                  Is Modded: Definitely; Client brand changed to 'fml,forge'
                                  Type: Client (map_client.txt)
                                  Resource Packs: []
                                  Current Language: English (US)
                                  Profiler Position: N/A (disabled)
                                  Vec3 Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
                                  Anisotropic Filtering: Off (1)
                                  

                                  Tout probleme a sa solution, s'il n'y a pas de solution c'est qu'il n'y a pas de problemes

                                  1 réponse Dernière réponse Répondre Citer 0
                                  • M Hors-ligne
                                    MrAzErTy31
                                    dernière édition par

                                    As-tu remplis ta fonction getLocalGuiContainer dans le GuiHandler ? Si non, mets-y exactement pareil que pour le serveur en changeant le return par le gui de ton bloc.

                                    Ce qui donne :

                                    ​@Override
                                    
                                        public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
                                            TileEntity te = world.getTileEntity(x, y, z);
                                            if(te instanceof TonTileEntity)
                                            return new GuiDetonBloc(player.inventory, (TonTileEntity)te);
                                            return null;
                                        }
                                    

                                    Mes mods :

                                    >! GGButtonMod : http://minecraftforgefrance.fr/showthread.php?tid=1280
                                    CraftYourMenu : http://minecraftforgefrance.fr/showth…

                                    1 réponse Dernière réponse Répondre Citer 0
                                    • Bowser338B Hors-ligne
                                      Bowser338
                                      dernière édition par

                                      j’ai sa :

                                      ​    @Override
                                      
                                          public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
                                              if(ID == 0){
                                                  TileEntityFourArc tileEntityFourArc = (TileEntityFourArc) world.getTileEntity(x, y, z);
                                                  return new ContainerFourArc(player.inventory, tileEntityFourArc);
                                              }
                                              return null;
                                          }
                                      
                                          @Override
                                          public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
                                              if(ID == 0){
                                                  TileEntityFourArc ContainerFourArc = (TileEntityFourArc) world.getTileEntity(x, y, z);
                                                  return new GuiFourArc(player.inventory, ContainerFourArc);
                                              }
                                              return null;
                                          }
                                      

                                      en faisant comme tu me dit sa me met des erreurs

                                      Tout probleme a sa solution, s'il n'y a pas de solution c'est qu'il n'y a pas de problemes

                                      1 réponse Dernière réponse Répondre Citer 0
                                      • robin4002R Hors-ligne
                                        robin4002 Moddeurs confirmés Rédacteurs Administrateurs
                                        dernière édition par

                                        Tu as un NPE, à mon avis c’est ton instance qui est null, envoie ta classe principale.

                                        1 réponse Dernière réponse Répondre Citer 0
                                        • Bowser338B Hors-ligne
                                          Bowser338
                                          dernière édition par

                                          je pense que j’ai oublié des choses dans la classe principale

                                          ​package com.bowser.robotic.common;
                                          
                                          import net.minecraft.block.Block;
                                          import net.minecraft.block.material.Material;
                                          import net.minecraft.creativetab.CreativeTabs;
                                          import net.minecraft.item.Item;
                                          import net.minecraft.item.ItemStack;
                                          import net.minecraftforge.common.MinecraftForge;
                                          
                                          import com.bowser.robotic.proxy.CommonProxy;
                                          
                                          import cpw.mods.fml.common.Mod;
                                          import cpw.mods.fml.common.Mod.EventHandler;
                                          import cpw.mods.fml.common.Mod.Instance;
                                          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.common.network.NetworkRegistry;
                                          import cpw.mods.fml.common.registry.GameRegistry;
                                          
                                          @Mod(modid = "roboticmod", name = "Mod Robotic", version = "1.0.0")
                                          
                                          public class Robotic
                                          {
                                          
                                          public static final String modid = "roboticmod";
                                          
                                              @Instance("roboticmod")
                                              public static Robotic instance;
                                          
                                              @SidedProxy(clientSide = "com.bowser.robotic.proxy.ClientProxy", serverSide = "com.bowser.robotic.proxy.CommonProxy")
                                              public static CommonProxy proxy;
                                          
                                              //blocks
                                              public static Block cuivreOre;
                                              public static Block blockCable;
                                              public static Block boisResine;
                                              public static Block feuillesResine;
                                              public static Block pousseResine;
                                              public static Block fourArc;
                                              public static Block lithiumOre;
                                          
                                              //items
                                              public static Item copperIngot;
                                              public static Item lithiumDust;
                                          
                                              @EventHandler
                                              public void preInit(FMLPreInitializationEvent event)
                                              {
                                                  //Blocks
                                                  cuivreOre = new OreCuivre(Material.rock).setBlockName("cuivreore").setBlockTextureName("roboticmod:orecuivre").setCreativeTab(CreativeTabs.tabBlock).setHardness(3.0F).setResistance(5.0F);
                                                  GameRegistry.registerBlock(cuivreOre, "block_cuivre");
                                          
                                                  lithiumOre = new LithiumOre(Material.rock).setBlockName("lithiumore").setBlockTextureName("roboticmod:orelithium").setCreativeTab(CreativeTabs.tabBlock).setHardness(4.0F).setResistance(5.0F);
                                                  GameRegistry.registerBlock(lithiumOre, "block_lithium");
                                          
                                                      //blocks+techne
                                                  fourArc = new FourArcBlock(Material.rock, false).setBlockName("fourarc").setBlockTextureName("roboticmod:fourarcbreak").setCreativeTab(CreativeTabs.tabBlock).setHardness(3.0F).setResistance(5.0F);
                                                  GameRegistry.registerBlock(fourArc, "four_arc");
                                          
                                                  blockCable = new BlockElectricCable().setBlockName("blockPipe").setCreativeTab(CreativeTabs.tabBlock);
                                                  GameRegistry.registerBlock(blockCable, "block_cable");
                                          
                                                  //arbre de Resine
                                                  boisResine = new BoisResine().setBlockTextureName("roboticmod:resine_bois").setBlockName("resine_bois");
                                                  feuillesResine = new FeuillesResine().setBlockTextureName("roboticmod:feuilles").setBlockName("resine_feuilles"); 
                                                  pousseResine = new PousseResine().setBlockTextureName("roboticmod:pousse").setBlockName("resine_pousse");
                                          
                                                  GameRegistry.registerBlock(boisResine , "resine_bois");
                                                  GameRegistry.registerBlock(feuillesResine , "resine_feuilles");
                                                  GameRegistry.registerBlock(pousseResine, "resine_pousse");
                                          
                                                  //items
                                                  copperIngot = new CopperIngot().setUnlocalizedName("copperingot").setTextureName("roboticmod:copperingot").setCreativeTab(CreativeTabs.tabMaterials);
                                                  GameRegistry.registerItem(copperIngot, "copper_ingot");
                                          
                                                  lithiumDust = new LithiumDust().setUnlocalizedName("lithiumdust").setTextureName("roboticmod:lithiumdust").setCreativeTab(CreativeTabs.tabMaterials);
                                                  GameRegistry.registerItem(lithiumDust, "lithium_dust");
                                          
                                                  //recipe furnace basic
                                                  GameRegistry.addSmelting(cuivreOre, new ItemStack(copperIngot, 1), 0f);
                                              }
                                          
                                              @EventHandler
                                              public void init(FMLInitializationEvent event)
                                              {
                                                  proxy.registerRender();
                                          
                                                  proxy.registerTileEntityRender();
                                          
                                                  GameRegistry.registerTileEntity(TileEntityFourArc.class, "FourArc");
                                          
                                                  //generator
                                                  GameRegistry.registerWorldGenerator(new WorldGeneratorCopper(), 0);
                                          
                                                      //generation Arbres a Resine
                                                  GameRegistry.registerWorldGenerator(new WorldGeneration(), 0);
                                          
                                                  GameRegistry.registerTileEntity(TileEntityPipe.class, "Pipe");
                                              }
                                          
                                              @EventHandler
                                              public void postInit(FMLPostInitializationEvent event)
                                              {
                                          
                                              }
                                          }
                                          

                                          Tout probleme a sa solution, s'il n'y a pas de solution c'est qu'il n'y a pas de problemes

                                          1 réponse Dernière réponse Répondre Citer 0
                                          • robin4002R Hors-ligne
                                            robin4002 Moddeurs confirmés Rédacteurs Administrateurs
                                            dernière édition par

                                            En fait non, ton instance est bonne, je viens de relire le crash, le npe n’est pas sur l’instance, mais ici :
                                            at cpw.mods.fml.common.network.NetworkRegistry.getLocalGuiContainer(NetworkRegistry.java:263)
                                            Donc le problème vient bien du GuiHandle que tu n’as visiblement pas enregistré.
                                            Donc enregistre ton gui handler de la methode init de ta classe principale et ça sera bon.

                                            1 réponse Dernière réponse Répondre Citer 1
                                            • 1
                                            • 2
                                            • 3
                                            • 4
                                            • 5
                                            • 6
                                            • 7
                                            • 4 / 7
                                            • Premier message
                                              Dernier message
                                            Design by Woryk
                                            ContactMentions Légales

                                            MINECRAFT FORGE FRANCE © 2024

                                            Powered by NodeBB