Problème Mob
-
[font=Ubuntu, sans-serifJe suis sur Eclipse avec forge-1.8.9-11.15.1.1722-mdk .]
[font=Ubuntu, sans-serifBonjour, j’essaie de créer mon premier mob.]
[font=Ubuntu, sans-serifJ’ai suivi un autre tutoriel que celui du forum, car je suis en 1.8 et j’ai tout le temps des problèmes quand je les suis.]Alors voilà, dans ma classe principale, j’ai une erreur (une seule…) qui fait crash le client.
J’aimerais tout simplement fixer cette erreur pour pouvoir lancer le jeu.
Il est à noter que le mob n’a pas encore d’IA.La classe principale:
@EventHandler public void Init(FMLInitializationEvent event) { proxy.registerRender(); if(event.getSide().isClient()) { MinecraftForge.EVENT_BUS.register(new LivingEventHandler()); proxy.registerRender(); //Textures //Items Enregistrés //Items Armor Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(copperHelmet, 0, new ModelResourceLocation("modegypte:copper_Helmet", "inventory")); Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(copperChestPlate, 0, new ModelResourceLocation("modegypte:copper_ChestPlate", "inventory")); Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(copperLeggings, 0, new ModelResourceLocation("modegypte:copper_Leggings", "inventory")); Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(copperBoots, 0, new ModelResourceLocation("modegypte:copper_Boots", "inventory")); //Items Tools Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(copperSword, 0, new ModelResourceLocation("modegypte:copper_Sword", "inventory")); Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(copperAxe, 0, new ModelResourceLocation("modegypte:copper_Axe", "inventory")); Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(copperPickaxe, 0, new ModelResourceLocation("modegypte:copper_Pickaxe", "inventory")); Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(copperShovel, 0, new ModelResourceLocation("modegypte:copper_Shovel", "inventory")); Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(copperHoe, 0, new ModelResourceLocation("modegypte:copper_Hoe", "inventory")); //Items Food Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(fig, 0, new ModelResourceLocation("modegypte:fig", "inventory")); Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(barleyBread, 0, new ModelResourceLocation("modegypte:barley_Bread", "inventory")); Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(onion, 0, new ModelResourceLocation("modegypte:onion", "inventory")); //Items Material Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(cuivreLingot, 0, new ModelResourceLocation("modegypte:cuivre_Lingot", "inventory")); Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(barleyy, 0, new ModelResourceLocation("modegypte:barleyy", "inventory")); Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(barleySeeds, 0, new ModelResourceLocation("modegypte:barley_seeds", "inventory")); //Blocs Enregistrés en Items Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(cuivreBloc), 0, new ModelResourceLocation("modegypte:cuivre_bloc", "inventory")); Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(limonBloc), 0, new ModelResourceLocation("modegypte:limon_bloc", "inventory")); Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(limonMouilleBloc), 0, new ModelResourceLocation("modegypte:limon_mouille_bloc", "inventory")); Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(briqueCrueBloc), 0, new ModelResourceLocation("modegypte:brique_crue_bloc", "inventory")); Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(copperOreBlock), 0, new ModelResourceLocation("modegypte:copper_ore_block", "inventory")); Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(hieroglyphBlock), 0, new ModelResourceLocation("modegypte:hieroglyph_block", "inventory")); Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(hieroglyphBlock2), 0, new ModelResourceLocation("modegypte:hieroglyph_block2", "inventory")); Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(blockBarley), 0, new ModelResourceLocation("modegypte:Barley", "inventory")); Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(blockOnion), 0, new ModelResourceLocation("modegypte:block_onion", "inventory")); //CRAFTS //Crafting Table //Recipes Blocks GameRegistry.addRecipe(new ItemStack(cuivreBloc), new Object[]{"XXX", "XXX", "XXX", 'X', new ItemStack(cuivreLingot)}); //Recipes Tools GameRegistry.addRecipe(new ItemStack(copperSword), new Object[]{"X", "X", "S", 'X', new ItemStack(cuivreLingot), 'S' , Items.stick}); GameRegistry.addRecipe(new ItemStack(copperAxe), new Object[]{"XX ", "XS ", " S ", 'X', new ItemStack(cuivreLingot), 'S' , Items.stick}); GameRegistry.addRecipe(new ItemStack(copperAxe), new Object[]{" XX", " XS", " S", 'X', new ItemStack(cuivreLingot), 'S' , Items.stick}); GameRegistry.addRecipe(new ItemStack(copperPickaxe), new Object[]{"XXX", " S ", " S ", 'X', new ItemStack(cuivreLingot), 'S' , Items.stick}); GameRegistry.addRecipe(new ItemStack(copperShovel), new Object[]{"X", "S", "S", 'X', new ItemStack(cuivreLingot), 'S' , Items.stick}); GameRegistry.addRecipe(new ItemStack(copperHoe), new Object[]{"XX ", " S ", " S ", 'X', new ItemStack(cuivreLingot), 'S' , Items.stick}); GameRegistry.addRecipe(new ItemStack(copperHoe), new Object[]{" XX", " S", " S", 'X', new ItemStack(cuivreLingot), 'S' , Items.stick}); // Recipes Armors GameRegistry.addRecipe(new ItemStack(copperHelmet, 1), new Object[]{"XXX", "X X", 'X', new ItemStack(cuivreLingot)}); GameRegistry.addRecipe(new ItemStack(copperChestPlate, 1), new Object[]{"X X", "XXX", "XXX", 'X', new ItemStack(cuivreLingot)}); GameRegistry.addRecipe(new ItemStack(copperLeggings, 1), new Object[]{"XXX", "X X", "X X", 'X', new ItemStack(cuivreLingot)}); GameRegistry.addRecipe(new ItemStack(copperBoots, 1), new Object[]{"X X", "X X", 'X', new ItemStack(cuivreLingot)}); //Recipes Materials //Recipes Decorations //Furnace GameRegistry.addSmelting(copperOreBlock, new ItemStack(cuivreLingot), 0.6F); MinecraftForge.addGrassSeed(new ItemStack(barleySeeds), 10); //WorldGeneratorRegistry GameRegistry.registerWorldGenerator(new OreGenerator(copperOreBlock), 0); //BiomeGeneratorRegistry BiomeManager.addBiome(BiomeType.DESERT, new BiomeEntry(new EgyptBiome(), 10)); // EntityCreator.createEntity(EntityBeaf.class, new RenderBeaf(), "Beaf", EnumCreatureType.CREATURE, 10, 1, 5, BiomeGenBase[] (BiomeGenBase.birchForest) , 0xBF6437, 0xF5E8D3, true);
Il y a une erreur ici en rouge dans la dernière ligne de la classe principale:
EntityCreator.createEntity(EntityBeaf.class, new RenderBeaf(), "Beaf", EnumCreatureType.CREATURE, 10, 1, 5, %(#ff3333)[***BiomeGenBase[]***] (BiomeGenBase.birchForest) , 0xBF6437, 0xF5E8D3, true);
Classe ‘ModelBeaf.java’
package fr.vorax.egypte.common; import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; public class ModelBeaf extends ModelBase { //fields ModelRenderer head; ModelRenderer body; ModelRenderer legRightBottom; ModelRenderer legLeftBottom; ModelRenderer legLeftFront; ModelRenderer legRightFront; ModelRenderer hornRightHead; ModelRenderer hornLeftAir; ModelRenderer hornRightAir; ModelRenderer hornLeftHead; public ModelBeaf() { textureWidth = 64; textureHeight = 64; head = new ModelRenderer(this, 17, 21); head.addBox(-4F, -4F, -6F, 8, 8, 6); head.setRotationPoint(0F, 4F, -8F); head.setTextureSize(64, 64); head.mirror = true; setRotation(head, 0F, 0F, 0F); body = new ModelRenderer(this, 0, 36); body.addBox(-6F, -10F, -7F, 12, 18, 10); body.setRotationPoint(0F, 5F, 2F); body.setTextureSize(64, 64); body.mirror = true; setRotation(body, 1.570796F, 0F, 0F); legRightBottom = new ModelRenderer(this, 0, 16); legRightBottom.addBox(-3F, 0F, -2F, 4, 12, 4); legRightBottom.setRotationPoint(-3F, 12F, 7F); legRightBottom.setTextureSize(64, 64); legRightBottom.mirror = true; setRotation(legRightBottom, 0F, 0F, 0F); legLeftBottom = new ModelRenderer(this, 0, 16); legLeftBottom.addBox(-1F, 0F, -2F, 4, 12, 4); legLeftBottom.setRotationPoint(3F, 12F, 7F); legLeftBottom.setTextureSize(64, 64); legLeftBottom.mirror = true; setRotation(legLeftBottom, 0F, 0F, 0F); legLeftFront = new ModelRenderer(this, 0, 16); legLeftFront.addBox(-3F, 0F, -3F, 4, 12, 4); legLeftFront.setRotationPoint(-3F, 12F, -5F); legLeftFront.setTextureSize(64, 64); legLeftFront.mirror = true; setRotation(legLeftFront, 0F, 0F, 0F); legRightFront = new ModelRenderer(this, 0, 16); legRightFront.addBox(-1F, 0F, -3F, 4, 12, 4); legRightFront.setRotationPoint(3F, 12F, -5F); legRightFront.setTextureSize(64, 64); legRightFront.mirror = true; setRotation(legRightFront, 0F, 0F, 0F); hornRightHead = new ModelRenderer(this, 12, 5); hornRightHead.addBox(-7F, -5F, -4F, 3, 1, 1); hornRightHead.setRotationPoint(0F, 5F, -7F); hornRightHead.setTextureSize(64, 64); hornRightHead.mirror = true; setRotation(hornRightHead, 0F, 0F, 0F); hornLeftAir = new ModelRenderer(this, 17, 13); hornLeftAir.addBox(7F, -9F, -4F, 1, 4, 1); hornLeftAir.setRotationPoint(0F, 5F, -7F); hornLeftAir.setTextureSize(64, 64); hornLeftAir.mirror = true; setRotation(hornLeftAir, 0F, 0F, 0F); hornRightAir = new ModelRenderer(this, 23, 8); hornRightAir.addBox(-8F, -9F, -3F, 1, 4, 1); hornRightAir.setRotationPoint(0F, 5F, -8F); hornRightAir.setTextureSize(64, 64); hornRightAir.mirror = true; setRotation(hornRightAir, 0F, 0F, 0F); hornLeftHead = new ModelRenderer(this, 14, 8); hornLeftHead.addBox(4F, -4F, -3F, 3, 1, 1); hornLeftHead.setRotationPoint(0F, 4F, -8F); hornLeftHead.setTextureSize(64, 64); hornLeftHead.mirror = true; setRotation(hornLeftHead, 0F, 0F, 0F); } public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { super.render(entity, f, f1, f2, f3, f4, f5); setRotationAngles(f, f1, f2, f3, f4, f5, entity); head.render(f5); body.render(f5); legRightBottom.render(f5); legLeftBottom.render(f5); legLeftFront.render(f5); legRightFront.render(f5); hornRightHead.render(f5); hornLeftAir.render(f5); hornRightAir.render(f5); hornLeftHead.render(f5); } private void setRotation(ModelRenderer model, float x, float y, float z) { model.rotateAngleX = x; model.rotateAngleY = y; model.rotateAngleZ = z; } public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) { super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); } }
Classe ‘RenderBeaf.java’
package fr.vorax.egypte.common; import net.minecraft.client.Minecraft; import net.minecraft.client.model.ModelBase; import net.minecraft.client.renderer.entity.RenderLiving; import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.entity.Entity; import net.minecraft.util.ResourceLocation; public class RenderBeaf extends RenderLiving { public RenderBeaf() { super(Minecraft.getMinecraft().getRenderManager(), new ModelBeaf(), 0); } @Override protected ResourceLocation getEntityTexture(Entity entity) { return new ResourceLocation("ModEgypte", "textures/entity/beaf.png"); } }
Classe ‘EntityBeaf.java’
package fr.vorax.egypte.common; import net.minecraft.entity.EntityCreature; import net.minecraft.entity.monster.EntityMob; import net.minecraft.world.World; public class EntityBeaf extends EntityMob { public EntityBeaf(World worldIn) { super(worldIn); } }
-
Ligne 231 de MpdEgypte.java ?
-
EntityCreator.createEntity(EntityBeaf.class, new RenderBeaf(), "Beaf", EnumCreatureType.CREATURE, 10, 1, 5, BiomeGenBase[] (BiomeGenBase.birchForest) , 0xBF6437, 0xF5E8D3, true); ``` devient ```java EntityCreator.createEntity(EntityBeaf.class, new RenderBeaf(), "Beaf", EnumCreatureType.CREATURE, 10, 1, 5, new BiomeGenBase[] (BiomeGenBase.birchForest) , 0xBF6437, 0xF5E8D3, true);
-
J’avais déjà essayé comme ça.
%(#000000)[[font=monospace]EntityCreator]%(#666600)[[font=monospace].]%(#000000)[[font=monospace]createEntity]%(#666600)[[font=monospace](]%(#000000)[[font=monospace]EntityBeaf]%(#666600)[[font=monospace].]%(#7f0055)[[font=monospace]**class**]%(#666600)[[font=monospace],] %(#7f0055)[[font=monospace]**new**] %(#000000)[[font=monospace]RenderBeaf]%(#666600)[[font=monospace](),] %(#2a00ff)[[font=monospace]"Beaf"]%(#666600)[[font=monospace],] %(#000000)[[font=monospace]EnumCreatureType]%(#666600)[[font=monospace].]%(#000000)[[font=monospace]CREATURE]%(#666600)[[font=monospace],] %(#646464)[[font=monospace]10]%(#666600)[[font=monospace],] %(#646464)[[font=monospace]1]%(#666600)[[font=monospace],] %(#646464)[[font=monospace]5]%(#666600)[[font=monospace],] %(#7f0055)[[font=monospace]**new**] %(#000000)[[font=monospace]BiomeGenBase]%(#666600)[[font=monospace][][/font]] %(#666600)[[font=monospace](]%(#000000)[[font=monospace]BiomeGenBase]%(#666600)[[font=monospace].]%(#000000)[[font=monospace]birchForest]%(#666600)[[font=monospace])] %(#666600)[[font=monospace],] %(#646464)[[font=monospace]0xBF6437]%(#666600)[[font=monospace],] %(#646464)[[font=monospace]0xF5E8D3]%(#666600)[[font=monospace],] %(#7f0055)[[font=monospace]**true**]%(#666600)[[font=monospace]);]
Il ya toujours une erreur:
[font=monospaceEntityCreator][font=monospace.][font=monospacecreateEntity][font=monospace(][font=monospaceEntityBeaf][font=monospace.][font=monospaceclass][font=monospace,] [font=monospacenew] [font=monospaceRenderBeaf]font=monospace, [font=monospace“Beaf”][font=monospace,] [font=monospaceEnumCreatureType][font=monospace.][font=monospaceCREATURE][font=monospace,] [font=monospace10][font=monospace,] [font=monospace1][font=monospace,] [font=monospace5][font=monospace,] [font=monospacenew BiomeGenBase[][/font]] font=monospace [font=monospace,] [font=monospace0xBF6437][font=monospace,] [font=monospace0xF5E8D3][font=monospace,] [font=monospacetrue][font=monospace);]J’ai essayé de mettre ça, et il ya une erreur:
EntityCreator.createEntity(EntityBeaf.class, new RenderBeaf(), “Beaf”, EnumCreatureType.CREATURE, 10, 1, 5, BiomeGenBase.birchForest , 0xBF6437, 0xF5E8D3, true);
-
Sur la 1ere forme que ta mis dans ta réponse, change les () autour de BiomeGenBase.birchForest par des {}
Envoyé de mon RAINBOW LITE 4G en utilisant Tapatalk
-
Ah merci ça marche! Les ravages du lag sur les vidéos (pixelisation), tout simplement.
Par contre, comment le faire spawner dans mon biome custom, et si possible, dans plusieurs biomes?
-
Tu rajoutes les biomes à la suite du birchForest en les séparant pas des virgules
Envoyé de mon RAINBOW LITE 4G en utilisant Tapatalk
-
Ah merci. Seulement, il y a un problème, c’est que ça ne marche qu’en solo!
Quand je lance le serveur, il plante.
Je pense que c’est dû au fait que je dois enregistrer le mob dans la classe ‘ClientProxy’ .
Classe ‘ClientProxy’ :
package fr.vorax.egypte.proxy; import fr.vorax.egypte.common.EntityBeaf; import fr.vorax.egypte.common.RenderBeaf; import net.minecraft.client.model.ModelBiped; import net.minecraftforge.fml.client.registry.RenderingRegistry; public class ClientProxy extends CommonProxy { @Override public void registerRender() { System.out.println("Méthode côté client"); RenderingRegistry.registerEntityRenderingHandler(EntityBeaf.class, new RenderBeaf(new RenderBeaf(), 0.5F)); } }
J’ai une erreur ici:
RenderingRegistry.registerEntityRenderingHandler(EntityBeaf.class,* ***new RenderBeaf(new RenderBeaf(), 0.5F) -
“new RenderBeaf(new RenderBeaf(), 0.5F)” normal tu as deux new RenderBeaf(), il faut que tu replaces le deuxième par “Minecraft.getMinecraft().textureManager” (c’est peut être getTextureManager()).
-
RenderingRegistry.registerEntityRenderingHandler(EntityBeaf.class, new RenderBeaf(Minecraft.getMinecraft().getTextureManager(), 0.5F));
Erreur sur: new RenderBeaf(Minecraft.getMinecraft().getTextureManager(), 0.5F))
Et c’est bien ‘getTextureManager’ qu’il m’a proposé.
-
Donne le constructeur de ton RenderBeaf
Envoyé de mon RAINBOW LITE 4G en utilisant Tapatalk
-
Ou carrément la classe ‘RenderBeaf’ pour être sûr:
package fr.vorax.egypte.common; import net.minecraft.client.Minecraft; import net.minecraft.client.model.ModelBase; import net.minecraft.client.renderer.entity.RenderLiving; import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.entity.Entity; import net.minecraft.util.ResourceLocation; public class RenderBeaf extends RenderLiving { public RenderBeaf() { super(Minecraft.getMinecraft().getRenderManager(), new ModelBeaf(), 0); } @Override protected ResourceLocation getEntityTexture(Entity entity) { return new ResourceLocation("ModEgypte", "textures/entity/beaf.png"); } }
-
Du-coup :
RenderingRegistry.registerEntityRenderingHandler(EntityBeaf.class, new RenderBeaf(new RenderBeaf(), 0.5F));
↓↓↓↓
RenderingRegistry.registerEntityRenderingHandler(EntityBeaf.class, new RenderBeaf()); -
Crash au lancement. Fatal error dans le log aussi que je ne comprends pas trop.
Classe ‘ClientProxy’ :
package fr.vorax.egypte.proxy; import fr.vorax.egypte.common.EntityBeaf; import fr.vorax.egypte.common.RenderBeaf; import net.minecraft.client.Minecraft; import net.minecraft.client.model.ModelBiped; import net.minecraftforge.fml.client.registry.RenderingRegistry; public class ClientProxy extends CommonProxy { @Override public void registerRender() { System.out.println("Méthode côté client"); RenderingRegistry.registerEntityRenderingHandler(EntityBeaf.class, new RenderBeaf()); } }
-
Envoi le common proxy
-
package fr.vorax.egypte.proxy; public class CommonProxy { public void registerRender() { System.out.println("Méthode côté serveur"); } }
-
Envoi la classe principale
-
package fr.vorax.egypte.common; import fr.vorax.egypte.proxy.CommonProxy; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.Minecraft; import net.minecraft.client.resources.model.ModelResourceLocation; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntitySpawnPlacementRegistry; import net.minecraft.entity.EnumCreatureType; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemSeedFood; import net.minecraft.item.Item.ToolMaterial; import net.minecraft.item.ItemArmor.ArmorMaterial; import net.minecraft.item.ItemSeeds; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; import net.minecraft.world.biome.BiomeGenBase; import net.minecraft.world.biome.BiomeGenDesert; import net.minecraft.world.biome.BiomeGenPlains; import net.minecraftforge.client.gui.ForgeGuiFactory.ForgeConfigGui.AddModOverrideEntry; import net.minecraftforge.common.BiomeManager; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.BiomeManager.BiomeEntry; import net.minecraftforge.common.BiomeManager.BiomeType; import net.minecraftforge.common.util.EnumHelper; 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.ModMetadata; import net.minecraftforge.fml.common.SidedProxy; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import net.minecraftforge.fml.common.registry.GameRegistry; @Mod(modid = "modegypte", name = "Mod Egypte", version = "1.0.0") public class ModEgypte { @Instance("modegypte") public static ModEgypte instance; @SidedProxy(clientSide = "fr.vorax.egypte.proxy.ClientProxy", serverSide = "fr.vorax.egypte.proxy.CommonProxy") public static CommonProxy proxy; //DECLARATIONS public static Item cuivreLingot, copperHelmet, copperChestPlate, copperLeggings, copperBoots, copperSword, copperAxe, copperPickaxe, copperShovel, copperHoe, fig, barleyy, barleySeeds, barleyBread, onion; public static Block cuivreBloc, limonBloc, limonMouilleBloc, briqueCrueBloc, copperOreBlock, hieroglyphBlock, hieroglyphBlock2, blockBarley, blockOnion; public static ArmorMaterial armorCopper = EnumHelper.addArmorMaterial("armorCopper", "armorCopper", 10, new int[]{2, 6, 5, 2}, 20); public static ToolMaterial toolCopper = EnumHelper.addToolMaterial("toolCopper", 2, 200, 5.0F, 2.0F, 17); @EventHandler public void preInit(FMLPreInitializationEvent event) { ModMetadata data = event.getModMetadata(); data.autogenerated = false; data.name = EnumChatFormatting.GOLD + "EgyptMod"; data.description = EnumChatFormatting.YELLOW + "Who does not want to end up in Ancient Egypt? Immerse yourself in ancient Egypt! Quick! Go find a village, adventure awaits!"; data.credits = EnumChatFormatting.LIGHT_PURPLE + "Special thanks to Forge team and MFF," + EnumChatFormatting.DARK_RED + "Wilza," + EnumChatFormatting.LIGHT_PURPLE + "Sowelo, Anderov, and Fab1us."; data.logoFile = "assets/modegypte/textures/logo/logo.png"; data.url = EnumChatFormatting.AQUA + "Comming Soon (Really, this is not a joke!) !"; //BLOCS cuivreBloc = new CuivreBloc(Material.iron).setUnlocalizedName("cuivrebloc").setHardness(5.0F).setResistance(10.0F).setCreativeTab(CreativeTabs.tabBlock); limonBloc = new LimonBloc(Material.sand).setUnlocalizedName("limonbloc").setHardness(1.15F).setResistance(10.0F).setCreativeTab(CreativeTabs.tabBlock); limonMouilleBloc = new LimonMouilleBloc(Material.ground).setUnlocalizedName("limonmouillebloc").setHardness(0.6F).setCreativeTab(CreativeTabs.tabBlock); briqueCrueBloc = new BriqueCrueBloc(Material.rock).setUnlocalizedName("briquecruebloc").setHardness(1.5F).setResistance(10.0F).setCreativeTab(CreativeTabs.tabBlock); copperOreBlock = new CopperOreBlock(Material.rock).setUnlocalizedName("copperoreblock").setHardness(3.0F).setResistance(5.0F).setCreativeTab(CreativeTabs.tabBlock); hieroglyphBlock = new HieroglyphBlock().setUnlocalizedName("hieroglyphblock").setHardness(1.5F).setResistance(10.0F).setCreativeTab(CreativeTabs.tabBlock); hieroglyphBlock2 = new HieroglyphBlock2().setUnlocalizedName("hieroglyphblock2").setHardness(1.5F).setResistance(10.0F).setCreativeTab(CreativeTabs.tabBlock); blockBarley = new BlockBarley().setUnlocalizedName("blockBarley"); blockOnion = new BlockOnion().setUnlocalizedName("blockOnion"); //BlocsRegistry GameRegistry.registerBlock(cuivreBloc, "cuivre_bloc"); GameRegistry.registerBlock(limonBloc, "limon_bloc"); GameRegistry.registerBlock(limonMouilleBloc, "limon_mouille_bloc"); GameRegistry.registerBlock(briqueCrueBloc, "brique_crue_bloc"); GameRegistry.registerBlock(copperOreBlock, "copper_ore_block"); GameRegistry.registerBlock(hieroglyphBlock, "hieroglyph_block"); GameRegistry.registerBlock(hieroglyphBlock2, "hieroglyph_block2"); GameRegistry.registerBlock(blockBarley, "barley_block"); GameRegistry.registerBlock(blockOnion, "onion_block"); //ITEMS //Armors Items copperHelmet = new ArmorCopper(armorCopper, 0).setUnlocalizedName("copperHelmet"); copperChestPlate = new ArmorCopper(armorCopper, 1).setUnlocalizedName("copperChestPlate"); copperLeggings = new ArmorCopper(armorCopper, 2).setUnlocalizedName("copperLeggings"); copperBoots = new ArmorCopper(armorCopper, 3).setUnlocalizedName("copperBoots"); //Materials Items cuivreLingot = new CuivreLingot().setUnlocalizedName("cuivreLingot").setCreativeTab(CreativeTabs.tabMaterials); barleyy = new Barleyy().setUnlocalizedName("barleyy").setCreativeTab(CreativeTabs.tabMaterials); barleySeeds = new ItemSeeds(blockBarley, Blocks.farmland).setUnlocalizedName("barleySeed"); //Tools Items copperSword = new SwordCopper(toolCopper).setUnlocalizedName("copperSword"); copperAxe = new AxeCopper(toolCopper).setUnlocalizedName("copperAxe"); copperPickaxe = new PickaxeCopper(toolCopper).setUnlocalizedName("copperPickaxe"); copperShovel = new ShovelCopper(toolCopper).setUnlocalizedName("copperShovel"); copperHoe = new HoeCopper(toolCopper).setUnlocalizedName("copperHoe"); //Food Items fig = new Fig(5, false).setUnlocalizedName("fig").setCreativeTab(CreativeTabs.tabFood); barleyBread = new BarleyBread(5, false).setUnlocalizedName("barleyBread").setCreativeTab(CreativeTabs.tabFood); onion = new ItemSeedFood(6, 9, blockOnion, Blocks.farmland).setUnlocalizedName("onion").setCreativeTab(CreativeTabs.tabFood); //ItemsRegistry //Itemsregistry Armor GameRegistry.registerItem(copperHelmet, "copper_Helmet"); GameRegistry.registerItem(copperChestPlate, "copper_ChestPlate"); GameRegistry.registerItem(copperLeggings, "copper_Leggings"); GameRegistry.registerItem(copperBoots, "copper_Boots"); //Itemsregistry Tools GameRegistry.registerItem(copperSword, "copper_Sword"); GameRegistry.registerItem(copperAxe, "copper_Axe"); GameRegistry.registerItem(copperPickaxe, "copper_Pickaxe"); GameRegistry.registerItem(copperShovel, "copper_Shovel"); GameRegistry.registerItem(copperHoe, "copper_Hoe"); //Itemsregistry Food GameRegistry.registerItem(fig, "fig"); GameRegistry.registerItem(barleyBread, "barley_Bread"); GameRegistry.registerItem(onion, "onion"); //Itemsregistry Material GameRegistry.registerItem(cuivreLingot, "cuivre_Lingot"); GameRegistry.registerItem(barleyy, "barleyy"); GameRegistry.registerItem(barleySeeds, "barley_seeds"); } @EventHandler public void Init(FMLInitializationEvent event) { proxy.registerRender(); if(event.getSide().isClient()) { MinecraftForge.EVENT_BUS.register(new LivingEventHandler()); proxy.registerRender(); //Textures //Items Enregistrés //Items Armor Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(copperHelmet, 0, new ModelResourceLocation("modegypte:copper_Helmet", "inventory")); Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(copperChestPlate, 0, new ModelResourceLocation("modegypte:copper_ChestPlate", "inventory")); Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(copperLeggings, 0, new ModelResourceLocation("modegypte:copper_Leggings", "inventory")); Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(copperBoots, 0, new ModelResourceLocation("modegypte:copper_Boots", "inventory")); //Items Tools Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(copperSword, 0, new ModelResourceLocation("modegypte:copper_Sword", "inventory")); Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(copperAxe, 0, new ModelResourceLocation("modegypte:copper_Axe", "inventory")); Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(copperPickaxe, 0, new ModelResourceLocation("modegypte:copper_Pickaxe", "inventory")); Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(copperShovel, 0, new ModelResourceLocation("modegypte:copper_Shovel", "inventory")); Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(copperHoe, 0, new ModelResourceLocation("modegypte:copper_Hoe", "inventory")); //Items Food Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(fig, 0, new ModelResourceLocation("modegypte:fig", "inventory")); Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(barleyBread, 0, new ModelResourceLocation("modegypte:barley_Bread", "inventory")); Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(onion, 0, new ModelResourceLocation("modegypte:onion", "inventory")); //Items Material Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(cuivreLingot, 0, new ModelResourceLocation("modegypte:cuivre_Lingot", "inventory")); Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(barleyy, 0, new ModelResourceLocation("modegypte:barleyy", "inventory")); Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(barleySeeds, 0, new ModelResourceLocation("modegypte:barley_seeds", "inventory")); //Blocs Enregistrés en Items Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(cuivreBloc), 0, new ModelResourceLocation("modegypte:cuivre_bloc", "inventory")); Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(limonBloc), 0, new ModelResourceLocation("modegypte:limon_bloc", "inventory")); Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(limonMouilleBloc), 0, new ModelResourceLocation("modegypte:limon_mouille_bloc", "inventory")); Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(briqueCrueBloc), 0, new ModelResourceLocation("modegypte:brique_crue_bloc", "inventory")); Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(copperOreBlock), 0, new ModelResourceLocation("modegypte:copper_ore_block", "inventory")); Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(hieroglyphBlock), 0, new ModelResourceLocation("modegypte:hieroglyph_block", "inventory")); Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(hieroglyphBlock2), 0, new ModelResourceLocation("modegypte:hieroglyph_block2", "inventory")); Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(blockBarley), 0, new ModelResourceLocation("modegypte:Barley", "inventory")); Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(blockOnion), 0, new ModelResourceLocation("modegypte:block_onion", "inventory")); //CRAFTS //Crafting Table //Recipes Blocks GameRegistry.addRecipe(new ItemStack(cuivreBloc), new Object[]{"XXX", "XXX", "XXX", 'X', new ItemStack(cuivreLingot)}); //Recipes Tools GameRegistry.addRecipe(new ItemStack(copperSword), new Object[]{"X", "X", "S", 'X', new ItemStack(cuivreLingot), 'S' , Items.stick}); GameRegistry.addRecipe(new ItemStack(copperAxe), new Object[]{"XX ", "XS ", " S ", 'X', new ItemStack(cuivreLingot), 'S' , Items.stick}); GameRegistry.addRecipe(new ItemStack(copperAxe), new Object[]{" XX", " XS", " S", 'X', new ItemStack(cuivreLingot), 'S' , Items.stick}); GameRegistry.addRecipe(new ItemStack(copperPickaxe), new Object[]{"XXX", " S ", " S ", 'X', new ItemStack(cuivreLingot), 'S' , Items.stick}); GameRegistry.addRecipe(new ItemStack(copperShovel), new Object[]{"X", "S", "S", 'X', new ItemStack(cuivreLingot), 'S' , Items.stick}); GameRegistry.addRecipe(new ItemStack(copperHoe), new Object[]{"XX ", " S ", " S ", 'X', new ItemStack(cuivreLingot), 'S' , Items.stick}); GameRegistry.addRecipe(new ItemStack(copperHoe), new Object[]{" XX", " S", " S", 'X', new ItemStack(cuivreLingot), 'S' , Items.stick}); // Recipes Armors GameRegistry.addRecipe(new ItemStack(copperHelmet, 1), new Object[]{"XXX", "X X", 'X', new ItemStack(cuivreLingot)}); GameRegistry.addRecipe(new ItemStack(copperChestPlate, 1), new Object[]{"X X", "XXX", "XXX", 'X', new ItemStack(cuivreLingot)}); GameRegistry.addRecipe(new ItemStack(copperLeggings, 1), new Object[]{"XXX", "X X", "X X", 'X', new ItemStack(cuivreLingot)}); GameRegistry.addRecipe(new ItemStack(copperBoots, 1), new Object[]{"X X", "X X", 'X', new ItemStack(cuivreLingot)}); //Recipes Materials //Recipes Decorations //Furnace GameRegistry.addSmelting(copperOreBlock, new ItemStack(cuivreLingot), 0.6F); MinecraftForge.addGrassSeed(new ItemStack(barleySeeds), 10); //WorldGeneratorRegistry GameRegistry.registerWorldGenerator(new OreGenerator(copperOreBlock), 0); //BiomeGeneratorRegistry BiomeManager.addBiome(BiomeType.DESERT, new BiomeEntry(new EgyptBiome(), 10)); // //EntityCreator.createEntity(EntityBeaf.class, new RenderBeaf(), "Beaf", EnumCreatureType.CREATURE, 10, 1, 5, new BiomeGenBase[] {BiomeGenBase.desert} , 0xBF6437, 0xF5E8D3, true); MinecraftForge.EVENT_BUS.register(new Events()); } } @EventHandler public void postInit(FMLPostInitializationEvent event) { } }
-
Je ne sais pas pourquoi il essaye de load cette class pendant la pre-init : Render (net.minecraft.client.renderer.entity.Render), as-tu un block/item qui utilise cette class (ou qui l’a en import) ?
-
Dans la méthode init, tu appelles 2 fois ```java
proxy.registerRender;