Problème sur le mod lor du lancement sur le server !



  • coucou j'ai un pb avec mon mod alors il trouve pas une class qui est presente dans mon code
    avez vous une idée de la cause de ce soucis ?

    text alternatif

    text alternatif

    text alternatif

    et désoler j'ais que des image du bug !



  • Salut,

    Tu pourrais nous fournir le code de ta class Main ainsi que celui du BlockBase également.

    Et en plus tu n'es pas sur la bonne catégorie, il faudrait qu'un admin te move si possible.



  • Voila le main et le block base

    package fr.thexrayfr.familygame;
    
    import fr.thexrayfr.familygame.blocks.FamilyBlocks;
    import fr.thexrayfr.familygame.init.FamilygameRecipe;
    import fr.thexrayfr.familygame.items.FamilyItems;
    import fr.thexrayfr.familygame.tile.TileEntityCrate;
    import fr.thexrayfr.familygame.util.ObjectRegistry;
    import net.minecraft.creativetab.CreativeTabs;
    import net.minecraft.init.Blocks;
    import net.minecraft.item.Item;
    import net.minecraft.item.ItemStack;
    import net.minecraft.util.ResourceLocation;
    import net.minecraftforge.fml.common.Mod;
    import net.minecraftforge.fml.common.Mod.EventHandler;
    import net.minecraftforge.fml.common.Mod.Instance;
    import net.minecraftforge.fml.common.SidedProxy;
    import net.minecraftforge.fml.common.event.FMLInitializationEvent;
    import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
    import net.minecraftforge.fml.common.network.NetworkRegistry;
    import net.minecraftforge.fml.common.registry.GameRegistry;
    
    @Mod(modid = Main.MODID, name = "Family-Game", version = "8.5.1", acceptedMinecraftVersions = "[1.12.2]")
    public class Main
    {
        public static final String MODID = "familygame";
        public static final CreativeTabs TABFAMILYGAME = new CreativeTabs("tab_familygame")
        {
    
            @Override
            public ItemStack getTabIconItem()
            {
                return new ItemStack(Item.getItemFromBlock(FamilyBlocks.PLOT));
            }
        };
            public static CreativeTabs TABFAMILYGAMEJAR = new CreativeTabs("tab_familygame_jar")
        {
    
            @Override
            public ItemStack getTabIconItem()
            {
                return new ItemStack(Item.getItemFromBlock(Blocks.GLASS));
            }
        };
        public static final CreativeTabs TABFAMILYGAMEORE = new CreativeTabs("tab_familygame_ore")
        {
    
            @Override
            public ItemStack getTabIconItem()
            {
                return new ItemStack(Item.getItemFromBlock(FamilyBlocks.ORE_OVERWORLD_PLATINIUM));
            }
        };
        public static final CreativeTabs TABFAMILYGAMETOOLS = new CreativeTabs("tab_familygame_tools")
        {
    
            @Override
            public ItemStack getTabIconItem()
            {
                return new ItemStack(FamilyItems.PALADIUM_HELMET);
            }
        };
        @Instance(Main.MODID)
        public static Main instance;
    
        @SidedProxy(clientSide = "fr.thexrayfr.familygame.proxy.FamilyClient", serverSide = "fr.thexrayfr.familygame.proxy.FamilyServer")
        public static FamilyCommon proxy;
    
        private ObjectRegistry registry;
    
        @EventHandler
        public void preInit(FMLPreInitializationEvent event)
        {
            proxy.preInit(event.getSuggestedConfigurationFile());
    
            this.registry = new ObjectRegistry(MODID);
    
            FamilyBlocks.init(this.registry);
            FamilyItems.init(this.registry);
            
        }
    
        @EventHandler
        public void init(FMLInitializationEvent event)
        {
            proxy.init();
            FamilygameRecipe.init();
            NetworkRegistry.INSTANCE.registerGuiHandler(instance, new GuiHandler());
            GameRegistry.registerTileEntity(TileEntityCrate.class, new ResourceLocation(MODID, "TileEntityCrate"));
    //
    //        File f = new File("./jsons");
    //        if (!f.exists()) f.mkdir();
    //
    //        for (IRegistryObject obj : this.registry.getObjects())
    //        {
    //            if (obj instanceof IRegistryObject.Block)
    //            {
    //                IRegistryObject.Block b = (IRegistryObject.Block) obj;
    //
    //                if (b.getObject() instanceof BlockJar)
    //                {
    //                    BlockJar j = (BlockJar) b.getObject();
    //
    //                    try
    //                    {
    //                        BufferedWriter w = new BufferedWriter(new FileWriter(new File(f, obj.getName() + ".json")));
    //                        w.write("{\n" +
    //                                "    \"parent\": \"familygame:block/jar\",\n" +
    //                                "    \"textures\":\n" +
    //                                "    {\n" +
    //                                "        \"glass\": \"blocks/glass" + (j.getColor() == null ? "" : "_" +j.getColor().getName()) + "\",\n" +
    //                                "        \"wood\": \"blocks/log_" + j.getWoodType().getUnlocalizedName() + "\"\n" +
    //                                "    }\n" +
    //                                "}");
    //
    //                        w.write("{\n" +
    //                                "\t\"variants\":\n" +
    //                                "\t{\n" +
    //                                "\t\t\"normal\" : \n" +
    //                                "        {\n" +
    //                                "            \"model\": \"familygame:" + obj.getName() + "\",\n" +
    //                                "        }\n" +
    //                                "\t}\n" +
    //                                "}");
    //
    //                        w.write("{\n" +
    //                                "\t\"parent\": \"familygame:block/" + obj.getName() + "\"\n" +
    //                                "}");
    //                        w.close();
    //                    }
    //                    catch (IOException e)
    //                    {
    //                        e.printStackTrace();
    //                    }
    //                }
    //            }
    //        }
         }
    }
    
    
    package fr.thexrayfr.familygame.blocks;
    
    import fr.thexrayfr.familygame.util.IRegistryObject;
    import net.minecraft.block.Block;
    import net.minecraft.block.BlockFence;
    import net.minecraft.block.material.Material;
    import net.minecraft.block.state.BlockFaceShape;
    import net.minecraft.block.state.IBlockState;
    import net.minecraft.init.Blocks;
    import net.minecraft.item.ItemBlock;
    import net.minecraft.util.EnumFacing;
    import net.minecraft.util.math.BlockPos;
    import net.minecraft.world.IBlockAccess;
    
    public class BlockBase extends Block implements IRegistryObject.Block
    {
        private String name;
        private ItemBlock itemBlock;
    
        public BlockBase(String name, Material material)
        {
            super(material);
            this.setUnlocalizedName(name);
            this.setRegistryName(name);
            this.name = name;
            this.itemBlock = new ItemBlock(this);
            this.itemBlock.setRegistryName(name);
        }
    
        @Override
        public net.minecraft.block.Block getObject()
        {
            return this;
        }
    
        @Override
        public String getName()
        {
            return this.name;
        }
    
        @Override
        public ItemBlock getItemBlock()
        {
            return this.itemBlock;
        }
    }
    
    


  • Résolut !