Résolu Spawn mob + fix id + texture
-
@‘monpetitflocon’:
oui je sais j’ai commrncer par le tuto ecrit justement suivi a la lettre et comme sa marchait pas et bah j’ai pris la vidéo
:::
package com.google.monpetitflocon.modtest.common; import java.awt.Color; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.enchantment.Enchantment; import net.minecraft.entity.Entity; import net.minecraft.entity.EnumCreatureType; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.Item.ToolMaterial; import net.minecraft.item.ItemArmor.ArmorMaterial; import net.minecraft.item.ItemStack; import net.minecraft.world.biome.BiomeGenBase; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.util.EnumHelper; import com.google.monpetitflocon.modtest.common.blocks.BlockOreTutoriel; import com.google.monpetitflocon.modtest.common.blocks.BlockTutorialStairs; import com.google.monpetitflocon.modtest.common.blocks.BlockTutoriel; import com.google.monpetitflocon.modtest.common.blocks.BlockTutorielMetadata; import com.google.monpetitflocon.modtest.common.blocks.FantasyBlock; import com.google.monpetitflocon.modtest.common.blocks.FenceBlock; import com.google.monpetitflocon.modtest.common.blocks.GreenWall; import com.google.monpetitflocon.modtest.common.blocks.WallBlock; import com.google.monpetitflocon.modtest.common.entity.Aznching; import com.google.monpetitflocon.modtest.common.entity.Darkheaven; import com.google.monpetitflocon.modtest.common.entity.EntityMonMob; import com.google.monpetitflocon.modtest.common.entity.Oxilac; import com.google.monpetitflocon.modtest.common.items.FantasyNugget; import com.google.monpetitflocon.modtest.common.items.FufuAple; import com.google.monpetitflocon.modtest.common.items.HautEpee; import com.google.monpetitflocon.modtest.common.items.ItemTutoArmor; import com.google.monpetitflocon.modtest.common.items.ItemTutoAxe; import com.google.monpetitflocon.modtest.common.items.ItemTutoHoe; import com.google.monpetitflocon.modtest.common.items.ItemTutoPickaxe; import com.google.monpetitflocon.modtest.common.items.ItemTutoShovel; import com.google.monpetitflocon.modtest.common.items.ItemTutoSword; import com.google.monpetitflocon.modtest.common.items.Letest; import com.google.monpetitflocon.modtest.common.items.MancheEpee; import com.google.monpetitflocon.modtest.common.items.MilieuEpee; import com.google.monpetitflocon.modtest.proxy.CommonProxy; import cpw.mods.fml.common.FMLCommonHandler; 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.registry.EntityRegistry; import cpw.mods.fml.common.registry.GameRegistry; @Mod(modid = "ModTest.MODID", name = "Fantasy Mod", version = "1.0.0") public class ModTest { public static final String MODID = "modtest"; @Instance("MODID") public static ModTest instance; @SidedProxy(clientSide = "com.google.monpetitflocon.modtest.proxy.ClientProxy", serverSide ="com.google.monpetitflocon.modtest.proxy.CommonProxy") public static CommonProxy proxy; public static Item letest, fufuaple, helmetTuto, chestPlateTuto, leggingsTuto, bootsTuto, swordTuto, pickaxeTuto, axeTuto, shovelTuto, hoeTuto, MancheEpee, MilieuEpee, HautEpee,FantasyNugget,record_tuto; public static Block blockTutoriel, blockTutoriel2, blockMetadataTuto, blockTutoriel3, blocktutorialstairs,Wallblock, FantasyBlock,GreenFence,GreenStair,GreenWall,RedFence,RedStair,RedWall,PinkFence,PinkStair,PinkWall,OrangeFence,OrangeStair,OrangeWall; public static ArmorMaterial armorTuto = EnumHelper.addArmorMaterial("armorTuto", 45, new int[] {4, 9, 7, 4}, 30); public static ToolMaterial toolTuto = EnumHelper.addToolMaterial("toolTuto", 3, 1000, 12.0F, 4.0F, 20); public static ToolMaterial toolsword = EnumHelper.addToolMaterial("toolTuto", 3, 1000, 12.0F, 14.0F, 20); public static CreativeTabs FantasyBlockCreativeTabs = new FantasyBlockCreativeTabs("fantasy_block_creative_tabs"); public static CreativeTabs tutorialCreativeTabs = new TutorialCreativeTabs("tutorial_creative_tabs"); WorldGeneration worldgeneration = new WorldGeneration(); @EventHandler public void preInit(FMLPreInitializationEvent event) { letest = new Letest().setUnlocalizedName("letest").setTextureName(MODID + ":Item_letest"); fufuaple = new FufuAple(5, 1.5F, false).setAlwaysEdible().setUnlocalizedName("fufuaple").setTextureName(MODID + ":Item_fufuaple"); helmetTuto = new ItemTutoArmor(armorTuto, 0).setUnlocalizedName("helmetTuto").setTextureName(MODID + ":helmet_tutoriel"); chestPlateTuto = new ItemTutoArmor(armorTuto, 1).setUnlocalizedName("chestPlateTuto").setTextureName(MODID + ":chestplate_tutoriel"); leggingsTuto = new ItemTutoArmor(armorTuto, 2).setUnlocalizedName("leggingsTuto").setTextureName(MODID + ":leggings_tutoriel"); bootsTuto = new ItemTutoArmor(armorTuto, 3).setUnlocalizedName("bootsTuto").setTextureName(MODID + ":boots_tutoriel"); swordTuto = new ItemTutoSword(toolsword).setUnlocalizedName("swordTuto").setTextureName(MODID + ":sword_tutoriel"); pickaxeTuto = new ItemTutoPickaxe(toolTuto).setUnlocalizedName("pickaxeTuto").setTextureName(MODID + ":pickaxe_tutoriel"); axeTuto = new ItemTutoAxe(toolTuto).setUnlocalizedName("axeTuto").setTextureName(MODID + ":axe_tutoriel"); shovelTuto = new ItemTutoShovel(toolTuto).setUnlocalizedName("shovelTuto").setTextureName(MODID + ":shovel_tutoriel"); hoeTuto = new ItemTutoHoe(toolTuto).setUnlocalizedName("hoeTuto").setTextureName(MODID + ":hoe_tutoriel"); MancheEpee = new MancheEpee().setUnlocalizedName("MancheEpee").setTextureName(MODID + ":manche_epee"); MilieuEpee = new MilieuEpee().setUnlocalizedName("MilieuEpee").setTextureName(MODID + ":milieu_epee"); HautEpee = new HautEpee().setUnlocalizedName("HautEpee").setTextureName(MODID + ":haut_epee"); FantasyNugget = new FantasyNugget().setUnlocalizedName("FantasyNugget").setTextureName(MODID + ":fantasy_nugget"); record_tuto = new MusicDisc("tutomusique").setUnlocalizedName("tutomusiqueRecord"); GameRegistry.registerItem(letest, "item_letest"); GameRegistry.registerItem(fufuaple, "item_fufuaple"); GameRegistry.registerItem(helmetTuto, "item_tuto_helmet"); GameRegistry.registerItem(chestPlateTuto, "item_tuto_chestplate"); GameRegistry.registerItem(leggingsTuto, "item_tuto_leggings"); GameRegistry.registerItem(bootsTuto, "item_tuto_boots"); GameRegistry.registerItem(swordTuto, "item_tuto_sword"); GameRegistry.registerItem(pickaxeTuto, "item_tuto_pickaxe"); GameRegistry.registerItem(axeTuto, "item_tuto_axe"); GameRegistry.registerItem(shovelTuto, "item_tuto_shovel"); GameRegistry.registerItem(hoeTuto, "item_tuto_hoe"); GameRegistry.registerItem(MancheEpee, "manche_epee"); GameRegistry.registerItem(MilieuEpee, "milieu_epee"); GameRegistry.registerItem(HautEpee, "haut_epee"); GameRegistry.registerItem(FantasyNugget, "fantasy_nugget"); GameRegistry.registerItem(record_tuto,"tutomusiqueRecord"); blockTutoriel = new BlockOreTutoriel(Material.rock).setHardness(15.0F).setResistance(10.0F).setBlockName("tutoriel").setBlockTextureName(MODID + ":block_tutoriel"); blockTutoriel2 = new BlockTutoriel(Material.wood).setHardness(1.5F).setResistance(10.0F).setBlockName("tutoriel2").setBlockTextureName(MODID + ":block_tutoriel2"); blockMetadataTuto = new BlockTutorielMetadata().setBlockName("metadataTuto").setHardness(1.5F).setResistance(10.0F).setCreativeTab(ModTest.FantasyBlockCreativeTabs); blockTutoriel3 = new FenceBlock(MODID +":fantasy_block", Material.wood).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood).setBlockName("tutoriel3"); blocktutorialstairs = new BlockTutorialStairs(ModTest.blockTutoriel3, 0, Material.wood).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood).setBlockName("TutorialStairs").setBlockTextureName(MODID + ":fantasy_block"); Wallblock = new WallBlock(blockTutoriel3).setBlockName("WallBlock"); FantasyBlock = new FantasyBlock(Material.rock).setHardness(5.0F).setResistance(10.0F).setBlockName("FantasyBlock").setBlockTextureName(MODID + ":fantasy_block"); GreenFence = new FenceBlock(MODID +":block4", Material.wood).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood).setBlockName("green_fence"); GreenStair = new BlockTutorialStairs(ModTest.GreenFence, 0, Material.wood).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood).setBlockName("green_stair").setBlockTextureName(MODID + ":block4"); GreenWall = new GreenWall(ModTest.GreenFence).setBlockName("GreenWall"); RedFence = new FenceBlock(MODID +":block1", Material.wood).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood).setBlockName("red_fence"); RedStair = new BlockTutorialStairs(ModTest.RedFence, 0, Material.wood).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood).setBlockName("red_stair").setBlockTextureName(MODID + ":block1"); RedWall = new com.google.monpetitflocon.modtest.common.blocks.RedWall(ModTest.RedFence).setBlockName("RedWall"); PinkFence = new FenceBlock(MODID +":block2", Material.wood).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood).setBlockName("pink_fence"); PinkStair = new BlockTutorialStairs(ModTest.PinkFence, 0, Material.wood).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood).setBlockName("pink_stair").setBlockTextureName(MODID + ":block2"); PinkWall = new com.google.monpetitflocon.modtest.common.blocks.PinkWall(ModTest.PinkFence).setBlockName("PinkWall"); OrangeFence = new FenceBlock(MODID +":block3", Material.wood).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood).setBlockName("orange_fence"); OrangeStair = new BlockTutorialStairs(ModTest.OrangeFence, 0, Material.wood).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood).setBlockName("orange_stair").setBlockTextureName(MODID + ":block3"); OrangeWall = new com.google.monpetitflocon.modtest.common.blocks.OrangeWall(ModTest.OrangeFence).setBlockName("OrangeWall"); GameRegistry.registerBlock(blockTutoriel, "block_tutoriel"); GameRegistry.registerBlock(blockTutoriel2, "block_tutoriel2"); GameRegistry.registerBlock(blockMetadataTuto, ItemBlockMetadataTutoriel.class, "block_tuto_metadata", new Object[]{BlockTutorielMetadata.subBlock}); GameRegistry.registerBlock(blockTutoriel3, "block_tutoriel3"); GameRegistry.registerBlock(blocktutorialstairs, "TutorialStairs"); GameRegistry.registerBlock(Wallblock, "Wall_block"); GameRegistry.registerBlock(FantasyBlock, "Fantasy_block"); GameRegistry.registerBlock(GreenFence, "green_fence"); GameRegistry.registerBlock(GreenStair, "green_stair"); GameRegistry.registerBlock(GreenWall, "green_wall"); GameRegistry.registerBlock(RedFence, "red_fence"); GameRegistry.registerBlock(RedStair, "red_stair"); GameRegistry.registerBlock(RedWall, "red_wall"); GameRegistry.registerBlock(PinkFence, "pink_fence"); GameRegistry.registerBlock(PinkStair, "pink_stair"); GameRegistry.registerBlock(PinkWall, "pink_wall"); GameRegistry.registerBlock(OrangeFence, "orange_fence"); GameRegistry.registerBlock(OrangeStair, "orange_stair"); GameRegistry.registerBlock(OrangeWall, "orange_wall"); GameRegistry.registerWorldGenerator(worldgeneration, 0); } public static BiomeGenBase[] allBiomes = { BiomeGenBase.plains, BiomeGenBase.extremeHills, BiomeGenBase.beach, BiomeGenBase.desert, BiomeGenBase.desertHills, BiomeGenBase.extremeHillsEdge, BiomeGenBase.forest, BiomeGenBase.forestHills, BiomeGenBase.icePlains, BiomeGenBase.iceMountains, BiomeGenBase.river, BiomeGenBase.birchForest, BiomeGenBase.birchForestHills, BiomeGenBase.coldBeach, BiomeGenBase.coldTaiga, BiomeGenBase.coldTaigaHills, BiomeGenBase.deepOcean, BiomeGenBase.extremeHillsPlus, BiomeGenBase.jungleEdge, BiomeGenBase.megaTaiga, BiomeGenBase.megaTaigaHills, BiomeGenBase.mesa, BiomeGenBase.mesaPlateau, BiomeGenBase.mesaPlateau_F, BiomeGenBase.roofedForest, BiomeGenBase.savanna, BiomeGenBase.savannaPlateau, BiomeGenBase.stoneBeach }; @EventHandler public void init(FMLInitializationEvent event) { MinecraftForge.EVENT_BUS.register(new LivingEventHandler()); FMLCommonHandler.instance().bus().register(new PlayerEventHandler()); MinecraftForge.EVENT_BUS.register(new PlayerEventHandler()); addEntity(EntityMonMob.class, "MobTuto", 125, 255, 100); addEntity(Darkheaven.class, "Darkheaven", 126, 255, 100); addEntity(Aznching.class, "Aznching", 127, 255, 100); addEntity(Oxilac.class, "Oxilac", 128, 255, 100); EntityRegistry.registerGlobalEntityID(EntityMonMob.class, "MobTuto", EntityRegistry.findGlobalUniqueEntityId(), new Color(97, 0, 255).getRGB(), new Color(146, 91, 255).getRGB()); EntityRegistry.registerModEntity(EntityMonMob.class, "MobTuto", 430, ModTest.instance, 40, 1, true); EntityRegistry.addSpawn(EntityMonMob.class, 9, 1, 3, EnumCreatureType.creature, allBiomes); proxy.registerRender(); ItemStack itemenchante = new ItemStack(swordTuto, 1, 0); itemenchante.addEnchantment(Enchantment.knockback, 5); itemenchante.addEnchantment(Enchantment.looting, 2); itemenchante.addEnchantment(Enchantment.baneOfArthropods, 2); itemenchante.addEnchantment(Enchantment.sharpness, 5); itemenchante.addEnchantment(Enchantment.smite, 4); //Recipes GameRegistry.addRecipe(new ItemStack(helmetTuto), new Object[]{"XXX", "X X", " ", 'X', ModTest.letest}); GameRegistry.addRecipe(new ItemStack(chestPlateTuto), new Object[]{"X X", "XXX", "XXX", 'X', ModTest.letest}); GameRegistry.addRecipe(new ItemStack(leggingsTuto), new Object[]{"XXX", "X X", "X X", 'X', ModTest.letest}); GameRegistry.addRecipe(new ItemStack(bootsTuto), new Object[]{" ", "X X", "X X", 'X', ModTest.letest}); GameRegistry.addRecipe(itemenchante, new Object[]{"X ", " Y ", " Z", 'X', ModTest.HautEpee, 'Y', new ItemStack(ModTest.MilieuEpee), 'Z', new ItemStack(ModTest.MancheEpee),}); GameRegistry.addRecipe(new ItemStack(pickaxeTuto), new Object[]{"XXX", " Y ", " Y ", 'X', ModTest.letest, 'Y', new ItemStack(Items.stick),}); GameRegistry.addRecipe(new ItemStack(axeTuto), new Object[]{" XX", " YX", " Y ", 'X', ModTest.letest, 'Y', new ItemStack(Items.stick),}); GameRegistry.addRecipe(new ItemStack(shovelTuto), new Object[]{" X ", " Y ", " Y ", 'X', ModTest.letest, 'Y', new ItemStack(Items.stick),}); GameRegistry.addRecipe(new ItemStack(hoeTuto), new Object[]{"XX ", " Y ", " Y ", 'X', ModTest.letest, 'Y', new ItemStack(Items.stick),}); GameRegistry.addRecipe(new ItemStack(blockTutoriel2), new Object[]{"XY ", "ZA ", " ", 'X', ModTest.fufuaple, 'Y', new ItemStack(Items.cooked_porkchop), 'Z', new ItemStack(Blocks.wool), 'A', new ItemStack(Blocks.wool, 1, 15),}); GameRegistry.addRecipe(new ItemStack(fufuaple), new Object[]{"XXX", "XYX", "XXX", 'X',ModTest.letest, 'Y', new ItemStack(Items.golden_apple),}); GameRegistry.addRecipe(new ItemStack(FantasyBlock), new Object[]{"XXX", "XXX", "XXX", 'X',ModTest.letest, }); GameRegistry.addRecipe(new ItemStack(letest, 9), new Object[]{"X ", " ", " ", 'X',ModTest.FantasyBlock, }); GameRegistry.addRecipe(new ItemStack(FantasyNugget , 9), new Object[]{"X ", " ", " ", 'X',ModTest.letest, }); GameRegistry.addRecipe(new ItemStack(letest), new Object[]{"XXX", "XXX", "XXX", 'X',ModTest.FantasyNugget, }); GameRegistry.addRecipe(new ItemStack(blockTutoriel3, 3), new Object[]{" ", "XYX", "XYX", 'X',ModTest.FantasyNugget, 'Y', new ItemStack(Items.stick),}); GameRegistry.addRecipe(new ItemStack(Wallblock, 6), new Object[]{" ", "XXX", "XXX", 'X',ModTest.FantasyNugget, }); GameRegistry.addRecipe(new ItemStack(blocktutorialstairs, 4), new Object[]{" X", " XX", "XXX", 'X',ModTest.FantasyNugget, }); GameRegistry.addRecipe(new ItemStack(blockMetadataTuto, 1, 0), new Object[]{"XY ", " ", " ", 'X',ModTest.FantasyBlock, 'Y', new ItemStack(Items.dye, 1, 1),}); GameRegistry.addRecipe(new ItemStack(blockMetadataTuto, 1, 1), new Object[]{"XY ", " ", " ", 'X',ModTest.FantasyBlock, 'Y', new ItemStack(Items.dye, 1, 9),}); GameRegistry.addRecipe(new ItemStack(blockMetadataTuto, 1, 2), new Object[]{"XY ", " ", " ", 'X',ModTest.FantasyBlock, 'Y', new ItemStack(Items.dye, 1, 14),}); GameRegistry.addRecipe(new ItemStack(blockMetadataTuto, 1, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.FantasyBlock, 'Y', new ItemStack(Items.dye, 1, 10),}); GameRegistry.addRecipe(new ItemStack(GreenWall, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.Wallblock, 'Y', new ItemStack(Items.dye, 3, 10),}); GameRegistry.addRecipe(new ItemStack(RedWall, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.Wallblock, 'Y', new ItemStack(Items.dye, 3, 1),}); GameRegistry.addRecipe(new ItemStack(PinkWall, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.Wallblock, 'Y', new ItemStack(Items.dye, 3, 9),}); GameRegistry.addRecipe(new ItemStack(OrangeWall, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.Wallblock, 'Y', new ItemStack(Items.dye, 3, 14),}); GameRegistry.addRecipe(new ItemStack(GreenFence, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.blockTutoriel3, 'Y', new ItemStack(Items.dye, 3, 10),}); GameRegistry.addRecipe(new ItemStack(RedFence, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.blockTutoriel3, 'Y', new ItemStack(Items.dye, 3, 1),}); GameRegistry.addRecipe(new ItemStack(PinkFence, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.blockTutoriel3, 'Y', new ItemStack(Items.dye, 3, 9),}); GameRegistry.addRecipe(new ItemStack(OrangeFence, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.blockTutoriel3, 'Y', new ItemStack(Items.dye, 3, 14),}); GameRegistry.addRecipe(new ItemStack(GreenStair, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.blocktutorialstairs, 'Y', new ItemStack(Items.dye, 3, 10),}); GameRegistry.addRecipe(new ItemStack(RedStair, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.blocktutorialstairs, 'Y', new ItemStack(Items.dye, 3, 1),}); GameRegistry.addRecipe(new ItemStack(PinkStair, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.blocktutorialstairs, 'Y', new ItemStack(Items.dye, 3, 9),}); GameRegistry.addRecipe(new ItemStack(OrangeStair, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.blocktutorialstairs, 'Y', new ItemStack(Items.dye, 3, 14),}); //Parts GameRegistry.addRecipe(new ItemStack(ModTest.MancheEpee), new Object[]{" Y", " Y ", "X ", 'X',ModTest.letest, 'Y', new ItemStack(Items.stick),}); // Manche Epee GameRegistry.addRecipe(new ItemStack(ModTest.MilieuEpee), new Object[]{"X X", " X ", " ", 'X',ModTest.letest,}); // Milieu Epee GameRegistry.addRecipe(new ItemStack(ModTest.HautEpee), new Object[]{" X ", "XYX", "XYX", 'X',ModTest.letest, 'Y', new ItemStack(Items.diamond),}); // Haut Epee } @EventHandler public void postInit(FMLPostInitializationEvent event) { } public void addEntity(Class entityClass, String name, int id, int backgroundEggColour,int foregroundEggColour) { EntityRegistry.registerGlobalEntityID(entityClass, name, EntityRegistry.findGlobalUniqueEntityId(), backgroundEggColour, foregroundEggColour); EntityRegistry.registerModEntity(entityClass, name, id, this, 40, 1, true); } }
:::
Déjà tu as des soucis au niveau de ton MODID je te corrige ça dès que je peux
-
@‘monpetitflocon’:
oui je sais j’ai commrncer par le tuto ecrit justement suivi a la lettre et comme sa marchait pas et bah j’ai pris la vidéo
:::
package com.google.monpetitflocon.modtest.common; import java.awt.Color; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.enchantment.Enchantment; import net.minecraft.entity.Entity; import net.minecraft.entity.EnumCreatureType; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.Item.ToolMaterial; import net.minecraft.item.ItemArmor.ArmorMaterial; import net.minecraft.item.ItemStack; import net.minecraft.world.biome.BiomeGenBase; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.util.EnumHelper; import com.google.monpetitflocon.modtest.common.blocks.BlockOreTutoriel; import com.google.monpetitflocon.modtest.common.blocks.BlockTutorialStairs; import com.google.monpetitflocon.modtest.common.blocks.BlockTutoriel; import com.google.monpetitflocon.modtest.common.blocks.BlockTutorielMetadata; import com.google.monpetitflocon.modtest.common.blocks.FantasyBlock; import com.google.monpetitflocon.modtest.common.blocks.FenceBlock; import com.google.monpetitflocon.modtest.common.blocks.GreenWall; import com.google.monpetitflocon.modtest.common.blocks.WallBlock; import com.google.monpetitflocon.modtest.common.entity.Aznching; import com.google.monpetitflocon.modtest.common.entity.Darkheaven; import com.google.monpetitflocon.modtest.common.entity.EntityMonMob; import com.google.monpetitflocon.modtest.common.entity.Oxilac; import com.google.monpetitflocon.modtest.common.items.FantasyNugget; import com.google.monpetitflocon.modtest.common.items.FufuAple; import com.google.monpetitflocon.modtest.common.items.HautEpee; import com.google.monpetitflocon.modtest.common.items.ItemTutoArmor; import com.google.monpetitflocon.modtest.common.items.ItemTutoAxe; import com.google.monpetitflocon.modtest.common.items.ItemTutoHoe; import com.google.monpetitflocon.modtest.common.items.ItemTutoPickaxe; import com.google.monpetitflocon.modtest.common.items.ItemTutoShovel; import com.google.monpetitflocon.modtest.common.items.ItemTutoSword; import com.google.monpetitflocon.modtest.common.items.Letest; import com.google.monpetitflocon.modtest.common.items.MancheEpee; import com.google.monpetitflocon.modtest.common.items.MilieuEpee; import com.google.monpetitflocon.modtest.proxy.CommonProxy; import cpw.mods.fml.common.FMLCommonHandler; 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.registry.EntityRegistry; import cpw.mods.fml.common.registry.GameRegistry; @Mod(modid = "ModTest.MODID", name = "Fantasy Mod", version = "1.0.0") public class ModTest { public static final String MODID = "modtest"; @Instance("MODID") public static ModTest instance; @SidedProxy(clientSide = "com.google.monpetitflocon.modtest.proxy.ClientProxy", serverSide ="com.google.monpetitflocon.modtest.proxy.CommonProxy") public static CommonProxy proxy; public static Item letest, fufuaple, helmetTuto, chestPlateTuto, leggingsTuto, bootsTuto, swordTuto, pickaxeTuto, axeTuto, shovelTuto, hoeTuto, MancheEpee, MilieuEpee, HautEpee,FantasyNugget,record_tuto; public static Block blockTutoriel, blockTutoriel2, blockMetadataTuto, blockTutoriel3, blocktutorialstairs,Wallblock, FantasyBlock,GreenFence,GreenStair,GreenWall,RedFence,RedStair,RedWall,PinkFence,PinkStair,PinkWall,OrangeFence,OrangeStair,OrangeWall; public static ArmorMaterial armorTuto = EnumHelper.addArmorMaterial("armorTuto", 45, new int[] {4, 9, 7, 4}, 30); public static ToolMaterial toolTuto = EnumHelper.addToolMaterial("toolTuto", 3, 1000, 12.0F, 4.0F, 20); public static ToolMaterial toolsword = EnumHelper.addToolMaterial("toolTuto", 3, 1000, 12.0F, 14.0F, 20); public static CreativeTabs FantasyBlockCreativeTabs = new FantasyBlockCreativeTabs("fantasy_block_creative_tabs"); public static CreativeTabs tutorialCreativeTabs = new TutorialCreativeTabs("tutorial_creative_tabs"); WorldGeneration worldgeneration = new WorldGeneration(); @EventHandler public void preInit(FMLPreInitializationEvent event) { letest = new Letest().setUnlocalizedName("letest").setTextureName(MODID + ":Item_letest"); fufuaple = new FufuAple(5, 1.5F, false).setAlwaysEdible().setUnlocalizedName("fufuaple").setTextureName(MODID + ":Item_fufuaple"); helmetTuto = new ItemTutoArmor(armorTuto, 0).setUnlocalizedName("helmetTuto").setTextureName(MODID + ":helmet_tutoriel"); chestPlateTuto = new ItemTutoArmor(armorTuto, 1).setUnlocalizedName("chestPlateTuto").setTextureName(MODID + ":chestplate_tutoriel"); leggingsTuto = new ItemTutoArmor(armorTuto, 2).setUnlocalizedName("leggingsTuto").setTextureName(MODID + ":leggings_tutoriel"); bootsTuto = new ItemTutoArmor(armorTuto, 3).setUnlocalizedName("bootsTuto").setTextureName(MODID + ":boots_tutoriel"); swordTuto = new ItemTutoSword(toolsword).setUnlocalizedName("swordTuto").setTextureName(MODID + ":sword_tutoriel"); pickaxeTuto = new ItemTutoPickaxe(toolTuto).setUnlocalizedName("pickaxeTuto").setTextureName(MODID + ":pickaxe_tutoriel"); axeTuto = new ItemTutoAxe(toolTuto).setUnlocalizedName("axeTuto").setTextureName(MODID + ":axe_tutoriel"); shovelTuto = new ItemTutoShovel(toolTuto).setUnlocalizedName("shovelTuto").setTextureName(MODID + ":shovel_tutoriel"); hoeTuto = new ItemTutoHoe(toolTuto).setUnlocalizedName("hoeTuto").setTextureName(MODID + ":hoe_tutoriel"); MancheEpee = new MancheEpee().setUnlocalizedName("MancheEpee").setTextureName(MODID + ":manche_epee"); MilieuEpee = new MilieuEpee().setUnlocalizedName("MilieuEpee").setTextureName(MODID + ":milieu_epee"); HautEpee = new HautEpee().setUnlocalizedName("HautEpee").setTextureName(MODID + ":haut_epee"); FantasyNugget = new FantasyNugget().setUnlocalizedName("FantasyNugget").setTextureName(MODID + ":fantasy_nugget"); record_tuto = new MusicDisc("tutomusique").setUnlocalizedName("tutomusiqueRecord"); GameRegistry.registerItem(letest, "item_letest"); GameRegistry.registerItem(fufuaple, "item_fufuaple"); GameRegistry.registerItem(helmetTuto, "item_tuto_helmet"); GameRegistry.registerItem(chestPlateTuto, "item_tuto_chestplate"); GameRegistry.registerItem(leggingsTuto, "item_tuto_leggings"); GameRegistry.registerItem(bootsTuto, "item_tuto_boots"); GameRegistry.registerItem(swordTuto, "item_tuto_sword"); GameRegistry.registerItem(pickaxeTuto, "item_tuto_pickaxe"); GameRegistry.registerItem(axeTuto, "item_tuto_axe"); GameRegistry.registerItem(shovelTuto, "item_tuto_shovel"); GameRegistry.registerItem(hoeTuto, "item_tuto_hoe"); GameRegistry.registerItem(MancheEpee, "manche_epee"); GameRegistry.registerItem(MilieuEpee, "milieu_epee"); GameRegistry.registerItem(HautEpee, "haut_epee"); GameRegistry.registerItem(FantasyNugget, "fantasy_nugget"); GameRegistry.registerItem(record_tuto,"tutomusiqueRecord"); blockTutoriel = new BlockOreTutoriel(Material.rock).setHardness(15.0F).setResistance(10.0F).setBlockName("tutoriel").setBlockTextureName(MODID + ":block_tutoriel"); blockTutoriel2 = new BlockTutoriel(Material.wood).setHardness(1.5F).setResistance(10.0F).setBlockName("tutoriel2").setBlockTextureName(MODID + ":block_tutoriel2"); blockMetadataTuto = new BlockTutorielMetadata().setBlockName("metadataTuto").setHardness(1.5F).setResistance(10.0F).setCreativeTab(ModTest.FantasyBlockCreativeTabs); blockTutoriel3 = new FenceBlock(MODID +":fantasy_block", Material.wood).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood).setBlockName("tutoriel3"); blocktutorialstairs = new BlockTutorialStairs(ModTest.blockTutoriel3, 0, Material.wood).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood).setBlockName("TutorialStairs").setBlockTextureName(MODID + ":fantasy_block"); Wallblock = new WallBlock(blockTutoriel3).setBlockName("WallBlock"); FantasyBlock = new FantasyBlock(Material.rock).setHardness(5.0F).setResistance(10.0F).setBlockName("FantasyBlock").setBlockTextureName(MODID + ":fantasy_block"); GreenFence = new FenceBlock(MODID +":block4", Material.wood).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood).setBlockName("green_fence"); GreenStair = new BlockTutorialStairs(ModTest.GreenFence, 0, Material.wood).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood).setBlockName("green_stair").setBlockTextureName(MODID + ":block4"); GreenWall = new GreenWall(ModTest.GreenFence).setBlockName("GreenWall"); RedFence = new FenceBlock(MODID +":block1", Material.wood).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood).setBlockName("red_fence"); RedStair = new BlockTutorialStairs(ModTest.RedFence, 0, Material.wood).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood).setBlockName("red_stair").setBlockTextureName(MODID + ":block1"); RedWall = new com.google.monpetitflocon.modtest.common.blocks.RedWall(ModTest.RedFence).setBlockName("RedWall"); PinkFence = new FenceBlock(MODID +":block2", Material.wood).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood).setBlockName("pink_fence"); PinkStair = new BlockTutorialStairs(ModTest.PinkFence, 0, Material.wood).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood).setBlockName("pink_stair").setBlockTextureName(MODID + ":block2"); PinkWall = new com.google.monpetitflocon.modtest.common.blocks.PinkWall(ModTest.PinkFence).setBlockName("PinkWall"); OrangeFence = new FenceBlock(MODID +":block3", Material.wood).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood).setBlockName("orange_fence"); OrangeStair = new BlockTutorialStairs(ModTest.OrangeFence, 0, Material.wood).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood).setBlockName("orange_stair").setBlockTextureName(MODID + ":block3"); OrangeWall = new com.google.monpetitflocon.modtest.common.blocks.OrangeWall(ModTest.OrangeFence).setBlockName("OrangeWall"); GameRegistry.registerBlock(blockTutoriel, "block_tutoriel"); GameRegistry.registerBlock(blockTutoriel2, "block_tutoriel2"); GameRegistry.registerBlock(blockMetadataTuto, ItemBlockMetadataTutoriel.class, "block_tuto_metadata", new Object[]{BlockTutorielMetadata.subBlock}); GameRegistry.registerBlock(blockTutoriel3, "block_tutoriel3"); GameRegistry.registerBlock(blocktutorialstairs, "TutorialStairs"); GameRegistry.registerBlock(Wallblock, "Wall_block"); GameRegistry.registerBlock(FantasyBlock, "Fantasy_block"); GameRegistry.registerBlock(GreenFence, "green_fence"); GameRegistry.registerBlock(GreenStair, "green_stair"); GameRegistry.registerBlock(GreenWall, "green_wall"); GameRegistry.registerBlock(RedFence, "red_fence"); GameRegistry.registerBlock(RedStair, "red_stair"); GameRegistry.registerBlock(RedWall, "red_wall"); GameRegistry.registerBlock(PinkFence, "pink_fence"); GameRegistry.registerBlock(PinkStair, "pink_stair"); GameRegistry.registerBlock(PinkWall, "pink_wall"); GameRegistry.registerBlock(OrangeFence, "orange_fence"); GameRegistry.registerBlock(OrangeStair, "orange_stair"); GameRegistry.registerBlock(OrangeWall, "orange_wall"); GameRegistry.registerWorldGenerator(worldgeneration, 0); } public static BiomeGenBase[] allBiomes = { BiomeGenBase.plains, BiomeGenBase.extremeHills, BiomeGenBase.beach, BiomeGenBase.desert, BiomeGenBase.desertHills, BiomeGenBase.extremeHillsEdge, BiomeGenBase.forest, BiomeGenBase.forestHills, BiomeGenBase.icePlains, BiomeGenBase.iceMountains, BiomeGenBase.river, BiomeGenBase.birchForest, BiomeGenBase.birchForestHills, BiomeGenBase.coldBeach, BiomeGenBase.coldTaiga, BiomeGenBase.coldTaigaHills, BiomeGenBase.deepOcean, BiomeGenBase.extremeHillsPlus, BiomeGenBase.jungleEdge, BiomeGenBase.megaTaiga, BiomeGenBase.megaTaigaHills, BiomeGenBase.mesa, BiomeGenBase.mesaPlateau, BiomeGenBase.mesaPlateau_F, BiomeGenBase.roofedForest, BiomeGenBase.savanna, BiomeGenBase.savannaPlateau, BiomeGenBase.stoneBeach }; @EventHandler public void init(FMLInitializationEvent event) { MinecraftForge.EVENT_BUS.register(new LivingEventHandler()); FMLCommonHandler.instance().bus().register(new PlayerEventHandler()); MinecraftForge.EVENT_BUS.register(new PlayerEventHandler()); addEntity(EntityMonMob.class, "MobTuto", 125, 255, 100); addEntity(Darkheaven.class, "Darkheaven", 126, 255, 100); addEntity(Aznching.class, "Aznching", 127, 255, 100); addEntity(Oxilac.class, "Oxilac", 128, 255, 100); EntityRegistry.registerGlobalEntityID(EntityMonMob.class, "MobTuto", EntityRegistry.findGlobalUniqueEntityId(), new Color(97, 0, 255).getRGB(), new Color(146, 91, 255).getRGB()); EntityRegistry.registerModEntity(EntityMonMob.class, "MobTuto", 430, ModTest.instance, 40, 1, true); EntityRegistry.addSpawn(EntityMonMob.class, 9, 1, 3, EnumCreatureType.creature, allBiomes); proxy.registerRender(); ItemStack itemenchante = new ItemStack(swordTuto, 1, 0); itemenchante.addEnchantment(Enchantment.knockback, 5); itemenchante.addEnchantment(Enchantment.looting, 2); itemenchante.addEnchantment(Enchantment.baneOfArthropods, 2); itemenchante.addEnchantment(Enchantment.sharpness, 5); itemenchante.addEnchantment(Enchantment.smite, 4); //Recipes GameRegistry.addRecipe(new ItemStack(helmetTuto), new Object[]{"XXX", "X X", " ", 'X', ModTest.letest}); GameRegistry.addRecipe(new ItemStack(chestPlateTuto), new Object[]{"X X", "XXX", "XXX", 'X', ModTest.letest}); GameRegistry.addRecipe(new ItemStack(leggingsTuto), new Object[]{"XXX", "X X", "X X", 'X', ModTest.letest}); GameRegistry.addRecipe(new ItemStack(bootsTuto), new Object[]{" ", "X X", "X X", 'X', ModTest.letest}); GameRegistry.addRecipe(itemenchante, new Object[]{"X ", " Y ", " Z", 'X', ModTest.HautEpee, 'Y', new ItemStack(ModTest.MilieuEpee), 'Z', new ItemStack(ModTest.MancheEpee),}); GameRegistry.addRecipe(new ItemStack(pickaxeTuto), new Object[]{"XXX", " Y ", " Y ", 'X', ModTest.letest, 'Y', new ItemStack(Items.stick),}); GameRegistry.addRecipe(new ItemStack(axeTuto), new Object[]{" XX", " YX", " Y ", 'X', ModTest.letest, 'Y', new ItemStack(Items.stick),}); GameRegistry.addRecipe(new ItemStack(shovelTuto), new Object[]{" X ", " Y ", " Y ", 'X', ModTest.letest, 'Y', new ItemStack(Items.stick),}); GameRegistry.addRecipe(new ItemStack(hoeTuto), new Object[]{"XX ", " Y ", " Y ", 'X', ModTest.letest, 'Y', new ItemStack(Items.stick),}); GameRegistry.addRecipe(new ItemStack(blockTutoriel2), new Object[]{"XY ", "ZA ", " ", 'X', ModTest.fufuaple, 'Y', new ItemStack(Items.cooked_porkchop), 'Z', new ItemStack(Blocks.wool), 'A', new ItemStack(Blocks.wool, 1, 15),}); GameRegistry.addRecipe(new ItemStack(fufuaple), new Object[]{"XXX", "XYX", "XXX", 'X',ModTest.letest, 'Y', new ItemStack(Items.golden_apple),}); GameRegistry.addRecipe(new ItemStack(FantasyBlock), new Object[]{"XXX", "XXX", "XXX", 'X',ModTest.letest, }); GameRegistry.addRecipe(new ItemStack(letest, 9), new Object[]{"X ", " ", " ", 'X',ModTest.FantasyBlock, }); GameRegistry.addRecipe(new ItemStack(FantasyNugget , 9), new Object[]{"X ", " ", " ", 'X',ModTest.letest, }); GameRegistry.addRecipe(new ItemStack(letest), new Object[]{"XXX", "XXX", "XXX", 'X',ModTest.FantasyNugget, }); GameRegistry.addRecipe(new ItemStack(blockTutoriel3, 3), new Object[]{" ", "XYX", "XYX", 'X',ModTest.FantasyNugget, 'Y', new ItemStack(Items.stick),}); GameRegistry.addRecipe(new ItemStack(Wallblock, 6), new Object[]{" ", "XXX", "XXX", 'X',ModTest.FantasyNugget, }); GameRegistry.addRecipe(new ItemStack(blocktutorialstairs, 4), new Object[]{" X", " XX", "XXX", 'X',ModTest.FantasyNugget, }); GameRegistry.addRecipe(new ItemStack(blockMetadataTuto, 1, 0), new Object[]{"XY ", " ", " ", 'X',ModTest.FantasyBlock, 'Y', new ItemStack(Items.dye, 1, 1),}); GameRegistry.addRecipe(new ItemStack(blockMetadataTuto, 1, 1), new Object[]{"XY ", " ", " ", 'X',ModTest.FantasyBlock, 'Y', new ItemStack(Items.dye, 1, 9),}); GameRegistry.addRecipe(new ItemStack(blockMetadataTuto, 1, 2), new Object[]{"XY ", " ", " ", 'X',ModTest.FantasyBlock, 'Y', new ItemStack(Items.dye, 1, 14),}); GameRegistry.addRecipe(new ItemStack(blockMetadataTuto, 1, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.FantasyBlock, 'Y', new ItemStack(Items.dye, 1, 10),}); GameRegistry.addRecipe(new ItemStack(GreenWall, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.Wallblock, 'Y', new ItemStack(Items.dye, 3, 10),}); GameRegistry.addRecipe(new ItemStack(RedWall, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.Wallblock, 'Y', new ItemStack(Items.dye, 3, 1),}); GameRegistry.addRecipe(new ItemStack(PinkWall, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.Wallblock, 'Y', new ItemStack(Items.dye, 3, 9),}); GameRegistry.addRecipe(new ItemStack(OrangeWall, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.Wallblock, 'Y', new ItemStack(Items.dye, 3, 14),}); GameRegistry.addRecipe(new ItemStack(GreenFence, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.blockTutoriel3, 'Y', new ItemStack(Items.dye, 3, 10),}); GameRegistry.addRecipe(new ItemStack(RedFence, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.blockTutoriel3, 'Y', new ItemStack(Items.dye, 3, 1),}); GameRegistry.addRecipe(new ItemStack(PinkFence, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.blockTutoriel3, 'Y', new ItemStack(Items.dye, 3, 9),}); GameRegistry.addRecipe(new ItemStack(OrangeFence, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.blockTutoriel3, 'Y', new ItemStack(Items.dye, 3, 14),}); GameRegistry.addRecipe(new ItemStack(GreenStair, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.blocktutorialstairs, 'Y', new ItemStack(Items.dye, 3, 10),}); GameRegistry.addRecipe(new ItemStack(RedStair, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.blocktutorialstairs, 'Y', new ItemStack(Items.dye, 3, 1),}); GameRegistry.addRecipe(new ItemStack(PinkStair, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.blocktutorialstairs, 'Y', new ItemStack(Items.dye, 3, 9),}); GameRegistry.addRecipe(new ItemStack(OrangeStair, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.blocktutorialstairs, 'Y', new ItemStack(Items.dye, 3, 14),}); //Parts GameRegistry.addRecipe(new ItemStack(ModTest.MancheEpee), new Object[]{" Y", " Y ", "X ", 'X',ModTest.letest, 'Y', new ItemStack(Items.stick),}); // Manche Epee GameRegistry.addRecipe(new ItemStack(ModTest.MilieuEpee), new Object[]{"X X", " X ", " ", 'X',ModTest.letest,}); // Milieu Epee GameRegistry.addRecipe(new ItemStack(ModTest.HautEpee), new Object[]{" X ", "XYX", "XYX", 'X',ModTest.letest, 'Y', new ItemStack(Items.diamond),}); // Haut Epee } @EventHandler public void postInit(FMLPostInitializationEvent event) { } public void addEntity(Class entityClass, String name, int id, int backgroundEggColour,int foregroundEggColour) { EntityRegistry.registerGlobalEntityID(entityClass, name, EntityRegistry.findGlobalUniqueEntityId(), backgroundEggColour, foregroundEggColour); EntityRegistry.registerModEntity(entityClass, name, id, this, 40, 1, true); } }
:::
addEntity(EntityMonMob.class, "MobTuto", 125, 255, 100); addEntity(Darkheaven.class, "Darkheaven", 126, 255, 100); addEntity(Aznching.class, "Aznching", 127, 255, 100); addEntity(Oxilac.class, "Oxilac", 128, 255, 100); EntityRegistry.registerGlobalEntityID(EntityMonMob.class, "MobTuto", EntityRegistry.findGlobalUniqueEntityId(), new Color(97, 0, 255).getRGB(), new Color(146, 91, 255).getRGB()); EntityRegistry.registerModEntity(EntityMonMob.class, "MobTuto", 430, ModTest.instance, 40, 1, true);
Si t’enregistres ton mob plusieurs fois, ça risque pas de marcher.
-
@‘SCAREX’:
@‘monpetitflocon’:
oui je sais j’ai commrncer par le tuto ecrit justement suivi a la lettre et comme sa marchait pas et bah j’ai pris la vidéo
:::
package com.google.monpetitflocon.modtest.common; import java.awt.Color; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.enchantment.Enchantment; import net.minecraft.entity.Entity; import net.minecraft.entity.EnumCreatureType; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.Item.ToolMaterial; import net.minecraft.item.ItemArmor.ArmorMaterial; import net.minecraft.item.ItemStack; import net.minecraft.world.biome.BiomeGenBase; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.util.EnumHelper; import com.google.monpetitflocon.modtest.common.blocks.BlockOreTutoriel; import com.google.monpetitflocon.modtest.common.blocks.BlockTutorialStairs; import com.google.monpetitflocon.modtest.common.blocks.BlockTutoriel; import com.google.monpetitflocon.modtest.common.blocks.BlockTutorielMetadata; import com.google.monpetitflocon.modtest.common.blocks.FantasyBlock; import com.google.monpetitflocon.modtest.common.blocks.FenceBlock; import com.google.monpetitflocon.modtest.common.blocks.GreenWall; import com.google.monpetitflocon.modtest.common.blocks.WallBlock; import com.google.monpetitflocon.modtest.common.entity.Aznching; import com.google.monpetitflocon.modtest.common.entity.Darkheaven; import com.google.monpetitflocon.modtest.common.entity.EntityMonMob; import com.google.monpetitflocon.modtest.common.entity.Oxilac; import com.google.monpetitflocon.modtest.common.items.FantasyNugget; import com.google.monpetitflocon.modtest.common.items.FufuAple; import com.google.monpetitflocon.modtest.common.items.HautEpee; import com.google.monpetitflocon.modtest.common.items.ItemTutoArmor; import com.google.monpetitflocon.modtest.common.items.ItemTutoAxe; import com.google.monpetitflocon.modtest.common.items.ItemTutoHoe; import com.google.monpetitflocon.modtest.common.items.ItemTutoPickaxe; import com.google.monpetitflocon.modtest.common.items.ItemTutoShovel; import com.google.monpetitflocon.modtest.common.items.ItemTutoSword; import com.google.monpetitflocon.modtest.common.items.Letest; import com.google.monpetitflocon.modtest.common.items.MancheEpee; import com.google.monpetitflocon.modtest.common.items.MilieuEpee; import com.google.monpetitflocon.modtest.proxy.CommonProxy; import cpw.mods.fml.common.FMLCommonHandler; 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.registry.EntityRegistry; import cpw.mods.fml.common.registry.GameRegistry; @Mod(modid = "ModTest.MODID", name = "Fantasy Mod", version = "1.0.0") public class ModTest { public static final String MODID = "modtest"; @Instance("MODID") public static ModTest instance; @SidedProxy(clientSide = "com.google.monpetitflocon.modtest.proxy.ClientProxy", serverSide ="com.google.monpetitflocon.modtest.proxy.CommonProxy") public static CommonProxy proxy; public static Item letest, fufuaple, helmetTuto, chestPlateTuto, leggingsTuto, bootsTuto, swordTuto, pickaxeTuto, axeTuto, shovelTuto, hoeTuto, MancheEpee, MilieuEpee, HautEpee,FantasyNugget,record_tuto; public static Block blockTutoriel, blockTutoriel2, blockMetadataTuto, blockTutoriel3, blocktutorialstairs,Wallblock, FantasyBlock,GreenFence,GreenStair,GreenWall,RedFence,RedStair,RedWall,PinkFence,PinkStair,PinkWall,OrangeFence,OrangeStair,OrangeWall; public static ArmorMaterial armorTuto = EnumHelper.addArmorMaterial("armorTuto", 45, new int[] {4, 9, 7, 4}, 30); public static ToolMaterial toolTuto = EnumHelper.addToolMaterial("toolTuto", 3, 1000, 12.0F, 4.0F, 20); public static ToolMaterial toolsword = EnumHelper.addToolMaterial("toolTuto", 3, 1000, 12.0F, 14.0F, 20); public static CreativeTabs FantasyBlockCreativeTabs = new FantasyBlockCreativeTabs("fantasy_block_creative_tabs"); public static CreativeTabs tutorialCreativeTabs = new TutorialCreativeTabs("tutorial_creative_tabs"); WorldGeneration worldgeneration = new WorldGeneration(); @EventHandler public void preInit(FMLPreInitializationEvent event) { letest = new Letest().setUnlocalizedName("letest").setTextureName(MODID + ":Item_letest"); fufuaple = new FufuAple(5, 1.5F, false).setAlwaysEdible().setUnlocalizedName("fufuaple").setTextureName(MODID + ":Item_fufuaple"); helmetTuto = new ItemTutoArmor(armorTuto, 0).setUnlocalizedName("helmetTuto").setTextureName(MODID + ":helmet_tutoriel"); chestPlateTuto = new ItemTutoArmor(armorTuto, 1).setUnlocalizedName("chestPlateTuto").setTextureName(MODID + ":chestplate_tutoriel"); leggingsTuto = new ItemTutoArmor(armorTuto, 2).setUnlocalizedName("leggingsTuto").setTextureName(MODID + ":leggings_tutoriel"); bootsTuto = new ItemTutoArmor(armorTuto, 3).setUnlocalizedName("bootsTuto").setTextureName(MODID + ":boots_tutoriel"); swordTuto = new ItemTutoSword(toolsword).setUnlocalizedName("swordTuto").setTextureName(MODID + ":sword_tutoriel"); pickaxeTuto = new ItemTutoPickaxe(toolTuto).setUnlocalizedName("pickaxeTuto").setTextureName(MODID + ":pickaxe_tutoriel"); axeTuto = new ItemTutoAxe(toolTuto).setUnlocalizedName("axeTuto").setTextureName(MODID + ":axe_tutoriel"); shovelTuto = new ItemTutoShovel(toolTuto).setUnlocalizedName("shovelTuto").setTextureName(MODID + ":shovel_tutoriel"); hoeTuto = new ItemTutoHoe(toolTuto).setUnlocalizedName("hoeTuto").setTextureName(MODID + ":hoe_tutoriel"); MancheEpee = new MancheEpee().setUnlocalizedName("MancheEpee").setTextureName(MODID + ":manche_epee"); MilieuEpee = new MilieuEpee().setUnlocalizedName("MilieuEpee").setTextureName(MODID + ":milieu_epee"); HautEpee = new HautEpee().setUnlocalizedName("HautEpee").setTextureName(MODID + ":haut_epee"); FantasyNugget = new FantasyNugget().setUnlocalizedName("FantasyNugget").setTextureName(MODID + ":fantasy_nugget"); record_tuto = new MusicDisc("tutomusique").setUnlocalizedName("tutomusiqueRecord"); GameRegistry.registerItem(letest, "item_letest"); GameRegistry.registerItem(fufuaple, "item_fufuaple"); GameRegistry.registerItem(helmetTuto, "item_tuto_helmet"); GameRegistry.registerItem(chestPlateTuto, "item_tuto_chestplate"); GameRegistry.registerItem(leggingsTuto, "item_tuto_leggings"); GameRegistry.registerItem(bootsTuto, "item_tuto_boots"); GameRegistry.registerItem(swordTuto, "item_tuto_sword"); GameRegistry.registerItem(pickaxeTuto, "item_tuto_pickaxe"); GameRegistry.registerItem(axeTuto, "item_tuto_axe"); GameRegistry.registerItem(shovelTuto, "item_tuto_shovel"); GameRegistry.registerItem(hoeTuto, "item_tuto_hoe"); GameRegistry.registerItem(MancheEpee, "manche_epee"); GameRegistry.registerItem(MilieuEpee, "milieu_epee"); GameRegistry.registerItem(HautEpee, "haut_epee"); GameRegistry.registerItem(FantasyNugget, "fantasy_nugget"); GameRegistry.registerItem(record_tuto,"tutomusiqueRecord"); blockTutoriel = new BlockOreTutoriel(Material.rock).setHardness(15.0F).setResistance(10.0F).setBlockName("tutoriel").setBlockTextureName(MODID + ":block_tutoriel"); blockTutoriel2 = new BlockTutoriel(Material.wood).setHardness(1.5F).setResistance(10.0F).setBlockName("tutoriel2").setBlockTextureName(MODID + ":block_tutoriel2"); blockMetadataTuto = new BlockTutorielMetadata().setBlockName("metadataTuto").setHardness(1.5F).setResistance(10.0F).setCreativeTab(ModTest.FantasyBlockCreativeTabs); blockTutoriel3 = new FenceBlock(MODID +":fantasy_block", Material.wood).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood).setBlockName("tutoriel3"); blocktutorialstairs = new BlockTutorialStairs(ModTest.blockTutoriel3, 0, Material.wood).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood).setBlockName("TutorialStairs").setBlockTextureName(MODID + ":fantasy_block"); Wallblock = new WallBlock(blockTutoriel3).setBlockName("WallBlock"); FantasyBlock = new FantasyBlock(Material.rock).setHardness(5.0F).setResistance(10.0F).setBlockName("FantasyBlock").setBlockTextureName(MODID + ":fantasy_block"); GreenFence = new FenceBlock(MODID +":block4", Material.wood).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood).setBlockName("green_fence"); GreenStair = new BlockTutorialStairs(ModTest.GreenFence, 0, Material.wood).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood).setBlockName("green_stair").setBlockTextureName(MODID + ":block4"); GreenWall = new GreenWall(ModTest.GreenFence).setBlockName("GreenWall"); RedFence = new FenceBlock(MODID +":block1", Material.wood).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood).setBlockName("red_fence"); RedStair = new BlockTutorialStairs(ModTest.RedFence, 0, Material.wood).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood).setBlockName("red_stair").setBlockTextureName(MODID + ":block1"); RedWall = new com.google.monpetitflocon.modtest.common.blocks.RedWall(ModTest.RedFence).setBlockName("RedWall"); PinkFence = new FenceBlock(MODID +":block2", Material.wood).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood).setBlockName("pink_fence"); PinkStair = new BlockTutorialStairs(ModTest.PinkFence, 0, Material.wood).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood).setBlockName("pink_stair").setBlockTextureName(MODID + ":block2"); PinkWall = new com.google.monpetitflocon.modtest.common.blocks.PinkWall(ModTest.PinkFence).setBlockName("PinkWall"); OrangeFence = new FenceBlock(MODID +":block3", Material.wood).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood).setBlockName("orange_fence"); OrangeStair = new BlockTutorialStairs(ModTest.OrangeFence, 0, Material.wood).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood).setBlockName("orange_stair").setBlockTextureName(MODID + ":block3"); OrangeWall = new com.google.monpetitflocon.modtest.common.blocks.OrangeWall(ModTest.OrangeFence).setBlockName("OrangeWall"); GameRegistry.registerBlock(blockTutoriel, "block_tutoriel"); GameRegistry.registerBlock(blockTutoriel2, "block_tutoriel2"); GameRegistry.registerBlock(blockMetadataTuto, ItemBlockMetadataTutoriel.class, "block_tuto_metadata", new Object[]{BlockTutorielMetadata.subBlock}); GameRegistry.registerBlock(blockTutoriel3, "block_tutoriel3"); GameRegistry.registerBlock(blocktutorialstairs, "TutorialStairs"); GameRegistry.registerBlock(Wallblock, "Wall_block"); GameRegistry.registerBlock(FantasyBlock, "Fantasy_block"); GameRegistry.registerBlock(GreenFence, "green_fence"); GameRegistry.registerBlock(GreenStair, "green_stair"); GameRegistry.registerBlock(GreenWall, "green_wall"); GameRegistry.registerBlock(RedFence, "red_fence"); GameRegistry.registerBlock(RedStair, "red_stair"); GameRegistry.registerBlock(RedWall, "red_wall"); GameRegistry.registerBlock(PinkFence, "pink_fence"); GameRegistry.registerBlock(PinkStair, "pink_stair"); GameRegistry.registerBlock(PinkWall, "pink_wall"); GameRegistry.registerBlock(OrangeFence, "orange_fence"); GameRegistry.registerBlock(OrangeStair, "orange_stair"); GameRegistry.registerBlock(OrangeWall, "orange_wall"); GameRegistry.registerWorldGenerator(worldgeneration, 0); } public static BiomeGenBase[] allBiomes = { BiomeGenBase.plains, BiomeGenBase.extremeHills, BiomeGenBase.beach, BiomeGenBase.desert, BiomeGenBase.desertHills, BiomeGenBase.extremeHillsEdge, BiomeGenBase.forest, BiomeGenBase.forestHills, BiomeGenBase.icePlains, BiomeGenBase.iceMountains, BiomeGenBase.river, BiomeGenBase.birchForest, BiomeGenBase.birchForestHills, BiomeGenBase.coldBeach, BiomeGenBase.coldTaiga, BiomeGenBase.coldTaigaHills, BiomeGenBase.deepOcean, BiomeGenBase.extremeHillsPlus, BiomeGenBase.jungleEdge, BiomeGenBase.megaTaiga, BiomeGenBase.megaTaigaHills, BiomeGenBase.mesa, BiomeGenBase.mesaPlateau, BiomeGenBase.mesaPlateau_F, BiomeGenBase.roofedForest, BiomeGenBase.savanna, BiomeGenBase.savannaPlateau, BiomeGenBase.stoneBeach }; @EventHandler public void init(FMLInitializationEvent event) { MinecraftForge.EVENT_BUS.register(new LivingEventHandler()); FMLCommonHandler.instance().bus().register(new PlayerEventHandler()); MinecraftForge.EVENT_BUS.register(new PlayerEventHandler()); addEntity(EntityMonMob.class, "MobTuto", 125, 255, 100); addEntity(Darkheaven.class, "Darkheaven", 126, 255, 100); addEntity(Aznching.class, "Aznching", 127, 255, 100); addEntity(Oxilac.class, "Oxilac", 128, 255, 100); EntityRegistry.registerGlobalEntityID(EntityMonMob.class, "MobTuto", EntityRegistry.findGlobalUniqueEntityId(), new Color(97, 0, 255).getRGB(), new Color(146, 91, 255).getRGB()); EntityRegistry.registerModEntity(EntityMonMob.class, "MobTuto", 430, ModTest.instance, 40, 1, true); EntityRegistry.addSpawn(EntityMonMob.class, 9, 1, 3, EnumCreatureType.creature, allBiomes); proxy.registerRender(); ItemStack itemenchante = new ItemStack(swordTuto, 1, 0); itemenchante.addEnchantment(Enchantment.knockback, 5); itemenchante.addEnchantment(Enchantment.looting, 2); itemenchante.addEnchantment(Enchantment.baneOfArthropods, 2); itemenchante.addEnchantment(Enchantment.sharpness, 5); itemenchante.addEnchantment(Enchantment.smite, 4); //Recipes GameRegistry.addRecipe(new ItemStack(helmetTuto), new Object[]{"XXX", "X X", " ", 'X', ModTest.letest}); GameRegistry.addRecipe(new ItemStack(chestPlateTuto), new Object[]{"X X", "XXX", "XXX", 'X', ModTest.letest}); GameRegistry.addRecipe(new ItemStack(leggingsTuto), new Object[]{"XXX", "X X", "X X", 'X', ModTest.letest}); GameRegistry.addRecipe(new ItemStack(bootsTuto), new Object[]{" ", "X X", "X X", 'X', ModTest.letest}); GameRegistry.addRecipe(itemenchante, new Object[]{"X ", " Y ", " Z", 'X', ModTest.HautEpee, 'Y', new ItemStack(ModTest.MilieuEpee), 'Z', new ItemStack(ModTest.MancheEpee),}); GameRegistry.addRecipe(new ItemStack(pickaxeTuto), new Object[]{"XXX", " Y ", " Y ", 'X', ModTest.letest, 'Y', new ItemStack(Items.stick),}); GameRegistry.addRecipe(new ItemStack(axeTuto), new Object[]{" XX", " YX", " Y ", 'X', ModTest.letest, 'Y', new ItemStack(Items.stick),}); GameRegistry.addRecipe(new ItemStack(shovelTuto), new Object[]{" X ", " Y ", " Y ", 'X', ModTest.letest, 'Y', new ItemStack(Items.stick),}); GameRegistry.addRecipe(new ItemStack(hoeTuto), new Object[]{"XX ", " Y ", " Y ", 'X', ModTest.letest, 'Y', new ItemStack(Items.stick),}); GameRegistry.addRecipe(new ItemStack(blockTutoriel2), new Object[]{"XY ", "ZA ", " ", 'X', ModTest.fufuaple, 'Y', new ItemStack(Items.cooked_porkchop), 'Z', new ItemStack(Blocks.wool), 'A', new ItemStack(Blocks.wool, 1, 15),}); GameRegistry.addRecipe(new ItemStack(fufuaple), new Object[]{"XXX", "XYX", "XXX", 'X',ModTest.letest, 'Y', new ItemStack(Items.golden_apple),}); GameRegistry.addRecipe(new ItemStack(FantasyBlock), new Object[]{"XXX", "XXX", "XXX", 'X',ModTest.letest, }); GameRegistry.addRecipe(new ItemStack(letest, 9), new Object[]{"X ", " ", " ", 'X',ModTest.FantasyBlock, }); GameRegistry.addRecipe(new ItemStack(FantasyNugget , 9), new Object[]{"X ", " ", " ", 'X',ModTest.letest, }); GameRegistry.addRecipe(new ItemStack(letest), new Object[]{"XXX", "XXX", "XXX", 'X',ModTest.FantasyNugget, }); GameRegistry.addRecipe(new ItemStack(blockTutoriel3, 3), new Object[]{" ", "XYX", "XYX", 'X',ModTest.FantasyNugget, 'Y', new ItemStack(Items.stick),}); GameRegistry.addRecipe(new ItemStack(Wallblock, 6), new Object[]{" ", "XXX", "XXX", 'X',ModTest.FantasyNugget, }); GameRegistry.addRecipe(new ItemStack(blocktutorialstairs, 4), new Object[]{" X", " XX", "XXX", 'X',ModTest.FantasyNugget, }); GameRegistry.addRecipe(new ItemStack(blockMetadataTuto, 1, 0), new Object[]{"XY ", " ", " ", 'X',ModTest.FantasyBlock, 'Y', new ItemStack(Items.dye, 1, 1),}); GameRegistry.addRecipe(new ItemStack(blockMetadataTuto, 1, 1), new Object[]{"XY ", " ", " ", 'X',ModTest.FantasyBlock, 'Y', new ItemStack(Items.dye, 1, 9),}); GameRegistry.addRecipe(new ItemStack(blockMetadataTuto, 1, 2), new Object[]{"XY ", " ", " ", 'X',ModTest.FantasyBlock, 'Y', new ItemStack(Items.dye, 1, 14),}); GameRegistry.addRecipe(new ItemStack(blockMetadataTuto, 1, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.FantasyBlock, 'Y', new ItemStack(Items.dye, 1, 10),}); GameRegistry.addRecipe(new ItemStack(GreenWall, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.Wallblock, 'Y', new ItemStack(Items.dye, 3, 10),}); GameRegistry.addRecipe(new ItemStack(RedWall, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.Wallblock, 'Y', new ItemStack(Items.dye, 3, 1),}); GameRegistry.addRecipe(new ItemStack(PinkWall, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.Wallblock, 'Y', new ItemStack(Items.dye, 3, 9),}); GameRegistry.addRecipe(new ItemStack(OrangeWall, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.Wallblock, 'Y', new ItemStack(Items.dye, 3, 14),}); GameRegistry.addRecipe(new ItemStack(GreenFence, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.blockTutoriel3, 'Y', new ItemStack(Items.dye, 3, 10),}); GameRegistry.addRecipe(new ItemStack(RedFence, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.blockTutoriel3, 'Y', new ItemStack(Items.dye, 3, 1),}); GameRegistry.addRecipe(new ItemStack(PinkFence, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.blockTutoriel3, 'Y', new ItemStack(Items.dye, 3, 9),}); GameRegistry.addRecipe(new ItemStack(OrangeFence, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.blockTutoriel3, 'Y', new ItemStack(Items.dye, 3, 14),}); GameRegistry.addRecipe(new ItemStack(GreenStair, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.blocktutorialstairs, 'Y', new ItemStack(Items.dye, 3, 10),}); GameRegistry.addRecipe(new ItemStack(RedStair, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.blocktutorialstairs, 'Y', new ItemStack(Items.dye, 3, 1),}); GameRegistry.addRecipe(new ItemStack(PinkStair, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.blocktutorialstairs, 'Y', new ItemStack(Items.dye, 3, 9),}); GameRegistry.addRecipe(new ItemStack(OrangeStair, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.blocktutorialstairs, 'Y', new ItemStack(Items.dye, 3, 14),}); //Parts GameRegistry.addRecipe(new ItemStack(ModTest.MancheEpee), new Object[]{" Y", " Y ", "X ", 'X',ModTest.letest, 'Y', new ItemStack(Items.stick),}); // Manche Epee GameRegistry.addRecipe(new ItemStack(ModTest.MilieuEpee), new Object[]{"X X", " X ", " ", 'X',ModTest.letest,}); // Milieu Epee GameRegistry.addRecipe(new ItemStack(ModTest.HautEpee), new Object[]{" X ", "XYX", "XYX", 'X',ModTest.letest, 'Y', new ItemStack(Items.diamond),}); // Haut Epee } @EventHandler public void postInit(FMLPostInitializationEvent event) { } public void addEntity(Class entityClass, String name, int id, int backgroundEggColour,int foregroundEggColour) { EntityRegistry.registerGlobalEntityID(entityClass, name, EntityRegistry.findGlobalUniqueEntityId(), backgroundEggColour, foregroundEggColour); EntityRegistry.registerModEntity(entityClass, name, id, this, 40, 1, true); } }
:::
addEntity(EntityMonMob.class, "MobTuto", 125, 255, 100); addEntity(Darkheaven.class, "Darkheaven", 126, 255, 100); addEntity(Aznching.class, "Aznching", 127, 255, 100); addEntity(Oxilac.class, "Oxilac", 128, 255, 100); EntityRegistry.registerGlobalEntityID(EntityMonMob.class, "MobTuto", EntityRegistry.findGlobalUniqueEntityId(), new Color(97, 0, 255).getRGB(), new Color(146, 91, 255).getRGB()); EntityRegistry.registerModEntity(EntityMonMob.class, "MobTuto", 430, ModTest.instance, 40, 1, true);
Si t’enregistres ton mob plusieurs fois, ça risque pas de marcher.
Voilà la class corrigé et j’ai changé la méthode pour ajouter le spawn. Donc au passage ajotues les arguments et configure les pour tous les mobs enregistrés dans la méthode init
package com.google.monpetitflocon.modtest.common; import java.awt.Color; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.enchantment.Enchantment; import net.minecraft.entity.Entity; import net.minecraft.entity.EnumCreatureType; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.Item.ToolMaterial; import net.minecraft.item.ItemArmor.ArmorMaterial; import net.minecraft.item.ItemStack; import net.minecraft.world.biome.BiomeGenBase; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.util.EnumHelper; import com.google.monpetitflocon.modtest.common.blocks.BlockOreTutoriel; import com.google.monpetitflocon.modtest.common.blocks.BlockTutorialStairs; import com.google.monpetitflocon.modtest.common.blocks.BlockTutoriel; import com.google.monpetitflocon.modtest.common.blocks.BlockTutorielMetadata; import com.google.monpetitflocon.modtest.common.blocks.FantasyBlock; import com.google.monpetitflocon.modtest.common.blocks.FenceBlock; import com.google.monpetitflocon.modtest.common.blocks.GreenWall; import com.google.monpetitflocon.modtest.common.blocks.WallBlock; import com.google.monpetitflocon.modtest.common.entity.Aznching; import com.google.monpetitflocon.modtest.common.entity.Darkheaven; import com.google.monpetitflocon.modtest.common.entity.EntityMonMob; import com.google.monpetitflocon.modtest.common.entity.Oxilac; import com.google.monpetitflocon.modtest.common.items.FantasyNugget; import com.google.monpetitflocon.modtest.common.items.FufuAple; import com.google.monpetitflocon.modtest.common.items.HautEpee; import com.google.monpetitflocon.modtest.common.items.ItemTutoArmor; import com.google.monpetitflocon.modtest.common.items.ItemTutoAxe; import com.google.monpetitflocon.modtest.common.items.ItemTutoHoe; import com.google.monpetitflocon.modtest.common.items.ItemTutoPickaxe; import com.google.monpetitflocon.modtest.common.items.ItemTutoShovel; import com.google.monpetitflocon.modtest.common.items.ItemTutoSword; import com.google.monpetitflocon.modtest.common.items.Letest; import com.google.monpetitflocon.modtest.common.items.MancheEpee; import com.google.monpetitflocon.modtest.common.items.MilieuEpee; import com.google.monpetitflocon.modtest.proxy.CommonProxy; import cpw.mods.fml.common.FMLCommonHandler; 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.registry.EntityRegistry; import cpw.mods.fml.common.registry.GameRegistry; @Mod(modid = "modtest", name = "Fantasy Mod", version = "1.0.0") public class ModTest { public static final String MODID = "modtest"; @Instance("modtest") public static ModTest instance; @SidedProxy(clientSide = "com.google.monpetitflocon.modtest.proxy.ClientProxy", serverSide ="com.google.monpetitflocon.modtest.proxy.CommonProxy") public static CommonProxy proxy; public static Item letest, fufuaple, helmetTuto, chestPlateTuto, leggingsTuto, bootsTuto, swordTuto, pickaxeTuto, axeTuto, shovelTuto, hoeTuto, MancheEpee, MilieuEpee, HautEpee,FantasyNugget,record_tuto; public static Block blockTutoriel, blockTutoriel2, blockMetadataTuto, blockTutoriel3, blocktutorialstairs,Wallblock, FantasyBlock,GreenFence,GreenStair,GreenWall,RedFence,RedStair,RedWall,PinkFence,PinkStair,PinkWall,OrangeFence,OrangeStair,OrangeWall; public static ArmorMaterial armorTuto = EnumHelper.addArmorMaterial("armorTuto", 45, new int[] {4, 9, 7, 4}, 30); public static ToolMaterial toolTuto = EnumHelper.addToolMaterial("toolTuto", 3, 1000, 12.0F, 4.0F, 20); public static ToolMaterial toolsword = EnumHelper.addToolMaterial("toolTuto", 3, 1000, 12.0F, 14.0F, 20); public static CreativeTabs FantasyBlockCreativeTabs = new FantasyBlockCreativeTabs("fantasy_block_creative_tabs"); public static CreativeTabs tutorialCreativeTabs = new TutorialCreativeTabs("tutorial_creative_tabs"); WorldGeneration worldgeneration = new WorldGeneration(); @EventHandler public void preInit(FMLPreInitializationEvent event) { letest = new Letest().setUnlocalizedName("letest").setTextureName(MODID + ":Item_letest"); fufuaple = new FufuAple(5, 1.5F, false).setAlwaysEdible().setUnlocalizedName("fufuaple").setTextureName(MODID + ":Item_fufuaple"); helmetTuto = new ItemTutoArmor(armorTuto, 0).setUnlocalizedName("helmetTuto").setTextureName(MODID + ":helmet_tutoriel"); chestPlateTuto = new ItemTutoArmor(armorTuto, 1).setUnlocalizedName("chestPlateTuto").setTextureName(MODID + ":chestplate_tutoriel"); leggingsTuto = new ItemTutoArmor(armorTuto, 2).setUnlocalizedName("leggingsTuto").setTextureName(MODID + ":leggings_tutoriel"); bootsTuto = new ItemTutoArmor(armorTuto, 3).setUnlocalizedName("bootsTuto").setTextureName(MODID + ":boots_tutoriel"); swordTuto = new ItemTutoSword(toolsword).setUnlocalizedName("swordTuto").setTextureName(MODID + "Confusword_tutoriel"); pickaxeTuto = new ItemTutoPickaxe(toolTuto).setUnlocalizedName("pickaxeTuto").setTextureName(MODID + ":pickaxe_tutoriel"); axeTuto = new ItemTutoAxe(toolTuto).setUnlocalizedName("axeTuto").setTextureName(MODID + ":axe_tutoriel"); shovelTuto = new ItemTutoShovel(toolTuto).setUnlocalizedName("shovelTuto").setTextureName(MODID + "Confushovel_tutoriel"); hoeTuto = new ItemTutoHoe(toolTuto).setUnlocalizedName("hoeTuto").setTextureName(MODID + ":hoe_tutoriel"); MancheEpee = new MancheEpee().setUnlocalizedName("MancheEpee").setTextureName(MODID + ":manche_epee"); MilieuEpee = new MilieuEpee().setUnlocalizedName("MilieuEpee").setTextureName(MODID + ":milieu_epee"); HautEpee = new HautEpee().setUnlocalizedName("HautEpee").setTextureName(MODID + ":haut_epee"); FantasyNugget = new FantasyNugget().setUnlocalizedName("FantasyNugget").setTextureName(MODID + ":fantasy_nugget"); record_tuto = new MusicDisc("tutomusique").setUnlocalizedName("tutomusiqueRecord"); GameRegistry.registerItem(letest, "item_letest"); GameRegistry.registerItem(fufuaple, "item_fufuaple"); GameRegistry.registerItem(helmetTuto, "item_tuto_helmet"); GameRegistry.registerItem(chestPlateTuto, "item_tuto_chestplate"); GameRegistry.registerItem(leggingsTuto, "item_tuto_leggings"); GameRegistry.registerItem(bootsTuto, "item_tuto_boots"); GameRegistry.registerItem(swordTuto, "item_tuto_sword"); GameRegistry.registerItem(pickaxeTuto, "item_tuto_pickaxe"); GameRegistry.registerItem(axeTuto, "item_tuto_axe"); GameRegistry.registerItem(shovelTuto, "item_tuto_shovel"); GameRegistry.registerItem(hoeTuto, "item_tuto_hoe"); GameRegistry.registerItem(MancheEpee, "manche_epee"); GameRegistry.registerItem(MilieuEpee, "milieu_epee"); GameRegistry.registerItem(HautEpee, "haut_epee"); GameRegistry.registerItem(FantasyNugget, "fantasy_nugget"); GameRegistry.registerItem(record_tuto,"tutomusiqueRecord"); blockTutoriel = new BlockOreTutoriel(Material.rock).setHardness(15.0F).setResistance(10.0F).setBlockName("tutoriel").setBlockTextureName(MODID + ":block_tutoriel"); blockTutoriel2 = new BlockTutoriel(Material.wood).setHardness(1.5F).setResistance(10.0F).setBlockName("tutoriel2").setBlockTextureName(MODID + ":block_tutoriel2"); blockMetadataTuto = new BlockTutorielMetadata().setBlockName("metadataTuto").setHardness(1.5F).setResistance(10.0F).setCreativeTab(ModTest.FantasyBlockCreativeTabs); blockTutoriel3 = new FenceBlock(MODID +":fantasy_block", Material.wood).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood).setBlockName("tutoriel3"); blocktutorialstairs = new BlockTutorialStairs(ModTest.blockTutoriel3, 0, Material.wood).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood).setBlockName("TutorialStairs").setBlockTextureName(MODID + ":fantasy_block"); Wallblock = new WallBlock(blockTutoriel3).setBlockName("WallBlock"); FantasyBlock = new FantasyBlock(Material.rock).setHardness(5.0F).setResistance(10.0F).setBlockName("FantasyBlock").setBlockTextureName(MODID + ":fantasy_block"); GreenFence = new FenceBlock(MODID +":block4", Material.wood).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood).setBlockName("green_fence"); GreenStair = new BlockTutorialStairs(ModTest.GreenFence, 0, Material.wood).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood).setBlockName("green_stair").setBlockTextureName(MODID + ":block4"); GreenWall = new GreenWall(ModTest.GreenFence).setBlockName("GreenWall"); RedFence = new FenceBlock(MODID +":block1", Material.wood).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood).setBlockName("red_fence"); RedStair = new BlockTutorialStairs(ModTest.RedFence, 0, Material.wood).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood).setBlockName("red_stair").setBlockTextureName(MODID + ":block1"); RedWall = new com.google.monpetitflocon.modtest.common.blocks.RedWall(ModTest.RedFence).setBlockName("RedWall"); PinkFence = new FenceBlock(MODID +":block2", Material.wood).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood).setBlockName("pink_fence"); PinkStair = new BlockTutorialStairs(ModTest.PinkFence, 0, Material.wood).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood).setBlockName("pink_stair").setBlockTextureName(MODID + ":block2"); PinkWall = new com.google.monpetitflocon.modtest.common.blocks.PinkWall(ModTest.PinkFence).setBlockName("PinkWall"); OrangeFence = new FenceBlock(MODID +":block3", Material.wood).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood).setBlockName("orange_fence"); OrangeStair = new BlockTutorialStairs(ModTest.OrangeFence, 0, Material.wood).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood).setBlockName("orange_stair").setBlockTextureName(MODID + ":block3"); OrangeWall = new com.google.monpetitflocon.modtest.common.blocks.OrangeWall(ModTest.OrangeFence).setBlockName("OrangeWall"); GameRegistry.registerBlock(blockTutoriel, "block_tutoriel"); GameRegistry.registerBlock(blockTutoriel2, "block_tutoriel2"); GameRegistry.registerBlock(blockMetadataTuto, ItemBlockMetadataTutoriel.class, "block_tuto_metadata", new Object[]{BlockTutorielMetadata.subBlock}); GameRegistry.registerBlock(blockTutoriel3, "block_tutoriel3"); GameRegistry.registerBlock(blocktutorialstairs, "TutorialStairs"); GameRegistry.registerBlock(Wallblock, "Wall_block"); GameRegistry.registerBlock(FantasyBlock, "Fantasy_block"); GameRegistry.registerBlock(GreenFence, "green_fence"); GameRegistry.registerBlock(GreenStair, "green_stair"); GameRegistry.registerBlock(GreenWall, "green_wall"); GameRegistry.registerBlock(RedFence, "red_fence"); GameRegistry.registerBlock(RedStair, "red_stair"); GameRegistry.registerBlock(RedWall, "red_wall"); GameRegistry.registerBlock(PinkFence, "pink_fence"); GameRegistry.registerBlock(PinkStair, "pink_stair"); GameRegistry.registerBlock(PinkWall, "pink_wall"); GameRegistry.registerBlock(OrangeFence, "orange_fence"); GameRegistry.registerBlock(OrangeStair, "orange_stair"); GameRegistry.registerBlock(OrangeWall, "orange_wall"); GameRegistry.registerWorldGenerator(worldgeneration, 0); } public static BiomeGenBase[] allBiomes = { BiomeGenBase.plains, BiomeGenBase.extremeHills, BiomeGenBase.beach, BiomeGenBase.desert, BiomeGenBase.desertHills, BiomeGenBase.extremeHillsEdge, BiomeGenBase.forest, BiomeGenBase.forestHills, BiomeGenBase.icePlains, BiomeGenBase.iceMountains, BiomeGenBase.river, BiomeGenBase.birchForest, BiomeGenBase.birchForestHills, BiomeGenBase.coldBeach, BiomeGenBase.coldTaiga, BiomeGenBase.coldTaigaHills, BiomeGenBase.deepOcean, BiomeGenBase.extremeHillsPlus, BiomeGenBase.jungleEdge, BiomeGenBase.megaTaiga, BiomeGenBase.megaTaigaHills, BiomeGenBase.mesa, BiomeGenBase.mesaPlateau, BiomeGenBase.mesaPlateau_F, BiomeGenBase.roofedForest, BiomeGenBase.savanna, BiomeGenBase.savannaPlateau, BiomeGenBase.stoneBeach }; @EventHandler public void init(FMLInitializationEvent event) { MinecraftForge.EVENT_BUS.register(new LivingEventHandler()); FMLCommonHandler.instance().bus().register(new PlayerEventHandler()); MinecraftForge.EVENT_BUS.register(new PlayerEventHandler()); addEntity(EntityMonMob.class, "MobTuto", 125, 255, 100); addEntity(Darkheaven.class, "Darkheaven", 126, 255, 100); addEntity(Aznching.class, "Aznching", 127, 255, 100); addEntity(Oxilac.class, "Oxilac", 128, 255, 100); proxy.registerRender(); ItemStack itemenchante = new ItemStack(swordTuto, 1, 0); itemenchante.addEnchantment(Enchantment.knockback, 5); itemenchante.addEnchantment(Enchantment.looting, 2); itemenchante.addEnchantment(Enchantment.baneOfArthropods, 2); itemenchante.addEnchantment(Enchantment.sharpness, 5); itemenchante.addEnchantment(Enchantment.smite, 4); //Recipes GameRegistry.addRecipe(new ItemStack(helmetTuto), new Object[]{"XXX", "X X", " ", 'X', ModTest.letest}); GameRegistry.addRecipe(new ItemStack(chestPlateTuto), new Object[]{"X X", "XXX", "XXX", 'X', ModTest.letest}); GameRegistry.addRecipe(new ItemStack(leggingsTuto), new Object[]{"XXX", "X X", "X X", 'X', ModTest.letest}); GameRegistry.addRecipe(new ItemStack(bootsTuto), new Object[]{" ", "X X", "X X", 'X', ModTest.letest}); GameRegistry.addRecipe(itemenchante, new Object[]{"X ", " Y ", " Z", 'X', ModTest.HautEpee, 'Y', new ItemStack(ModTest.MilieuEpee), 'Z', new ItemStack(ModTest.MancheEpee),}); GameRegistry.addRecipe(new ItemStack(pickaxeTuto), new Object[]{"XXX", " Y ", " Y ", 'X', ModTest.letest, 'Y', new ItemStack(Items.stick),}); GameRegistry.addRecipe(new ItemStack(axeTuto), new Object[]{" XX", " YX", " Y ", 'X', ModTest.letest, 'Y', new ItemStack(Items.stick),}); GameRegistry.addRecipe(new ItemStack(shovelTuto), new Object[]{" X ", " Y ", " Y ", 'X', ModTest.letest, 'Y', new ItemStack(Items.stick),}); GameRegistry.addRecipe(new ItemStack(hoeTuto), new Object[]{"XX ", " Y ", " Y ", 'X', ModTest.letest, 'Y', new ItemStack(Items.stick),}); GameRegistry.addRecipe(new ItemStack(blockTutoriel2), new Object[]{"XY ", "ZA ", " ", 'X', ModTest.fufuaple, 'Y', new ItemStack(Items.cooked_porkchop), 'Z', new ItemStack(Blocks.wool), 'A', new ItemStack(Blocks.wool, 1, 15),}); GameRegistry.addRecipe(new ItemStack(fufuaple), new Object[]{"XXX", "XYX", "XXX", 'X',ModTest.letest, 'Y', new ItemStack(Items.golden_apple),}); GameRegistry.addRecipe(new ItemStack(FantasyBlock), new Object[]{"XXX", "XXX", "XXX", 'X',ModTest.letest, }); GameRegistry.addRecipe(new ItemStack(letest, 9), new Object[]{"X ", " ", " ", 'X',ModTest.FantasyBlock, }); GameRegistry.addRecipe(new ItemStack(FantasyNugget , 9), new Object[]{"X ", " ", " ", 'X',ModTest.letest, }); GameRegistry.addRecipe(new ItemStack(letest), new Object[]{"XXX", "XXX", "XXX", 'X',ModTest.FantasyNugget, }); GameRegistry.addRecipe(new ItemStack(blockTutoriel3, 3), new Object[]{" ", "XYX", "XYX", 'X',ModTest.FantasyNugget, 'Y', new ItemStack(Items.stick),}); GameRegistry.addRecipe(new ItemStack(Wallblock, 6), new Object[]{" ", "XXX", "XXX", 'X',ModTest.FantasyNugget, }); GameRegistry.addRecipe(new ItemStack(blocktutorialstairs, 4), new Object[]{" X", " XX", "XXX", 'X',ModTest.FantasyNugget, }); GameRegistry.addRecipe(new ItemStack(blockMetadataTuto, 1, 0), new Object[]{"XY ", " ", " ", 'X',ModTest.FantasyBlock, 'Y', new ItemStack(Items.dye, 1, 1),}); GameRegistry.addRecipe(new ItemStack(blockMetadataTuto, 1, 1), new Object[]{"XY ", " ", " ", 'X',ModTest.FantasyBlock, 'Y', new ItemStack(Items.dye, 1, 9),}); GameRegistry.addRecipe(new ItemStack(blockMetadataTuto, 1, 2), new Object[]{"XY ", " ", " ", 'X',ModTest.FantasyBlock, 'Y', new ItemStack(Items.dye, 1, 14),}); GameRegistry.addRecipe(new ItemStack(blockMetadataTuto, 1, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.FantasyBlock, 'Y', new ItemStack(Items.dye, 1, 10),}); GameRegistry.addRecipe(new ItemStack(GreenWall, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.Wallblock, 'Y', new ItemStack(Items.dye, 3, 10),}); GameRegistry.addRecipe(new ItemStack(RedWall, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.Wallblock, 'Y', new ItemStack(Items.dye, 3, 1),}); GameRegistry.addRecipe(new ItemStack(PinkWall, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.Wallblock, 'Y', new ItemStack(Items.dye, 3, 9),}); GameRegistry.addRecipe(new ItemStack(OrangeWall, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.Wallblock, 'Y', new ItemStack(Items.dye, 3, 14),}); GameRegistry.addRecipe(new ItemStack(GreenFence, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.blockTutoriel3, 'Y', new ItemStack(Items.dye, 3, 10),}); GameRegistry.addRecipe(new ItemStack(RedFence, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.blockTutoriel3, 'Y', new ItemStack(Items.dye, 3, 1),}); GameRegistry.addRecipe(new ItemStack(PinkFence, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.blockTutoriel3, 'Y', new ItemStack(Items.dye, 3, 9),}); GameRegistry.addRecipe(new ItemStack(OrangeFence, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.blockTutoriel3, 'Y', new ItemStack(Items.dye, 3, 14),}); GameRegistry.addRecipe(new ItemStack(GreenStair, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.blocktutorialstairs, 'Y', new ItemStack(Items.dye, 3, 10),}); GameRegistry.addRecipe(new ItemStack(RedStair, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.blocktutorialstairs, 'Y', new ItemStack(Items.dye, 3, 1),}); GameRegistry.addRecipe(new ItemStack(PinkStair, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.blocktutorialstairs, 'Y', new ItemStack(Items.dye, 3, 9),}); GameRegistry.addRecipe(new ItemStack(OrangeStair, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.blocktutorialstairs, 'Y', new ItemStack(Items.dye, 3, 14),}); //Parts GameRegistry.addRecipe(new ItemStack(ModTest.MancheEpee), new Object[]{" Y", " Y ", "X ", 'X',ModTest.letest, 'Y', new ItemStack(Items.stick),}); // Manche Epee GameRegistry.addRecipe(new ItemStack(ModTest.MilieuEpee), new Object[]{"X X", " X ", " ", 'X',ModTest.letest,}); // Milieu Epee GameRegistry.addRecipe(new ItemStack(ModTest.HautEpee), new Object[]{" X ", "XYX", "XYX", 'X',ModTest.letest, 'Y', new ItemStack(Items.diamond),}); // Haut Epee } @EventHandler public void postInit(FMLPostInitializationEvent event) { } public void addEntity(Class entityClass, String name, int id, int backgroundEggColour,int foregroundEggColour, int freq, int min, int max, EnumCreatureType typeOfTheCreature) { EntityRegistry.registerGlobalEntityID(entityClass, name, EntityRegistry.findGlobalUniqueEntityId(), backgroundEggColour, foregroundEggColour); EntityRegistry.registerModEntity(entityClass, name, id, this, 40, 1, true); EntityRegistry.addSpawn(entityClass.class, freq, min, max, typeOfTheCreature, allBiomes); } }
-
erreur ici il me dit de créer la classe entityclass.class ou de la remplacec par entity ou par entitycow parexemple
EntityRegistry.addSpawn(entityClass.class, freq, min, max, typeOfTheCreature, allBiomes);
scarex j’ai déja essayer de l’enregistrer q’une fois et pareil
-
@‘monpetitflocon’:
erreur ici il me dit de créer la classe entityclass.class ou de la remplacec par entity ou par entitycow parexemple
EntityRegistry.addSpawn(entityClass.class, freq, min, max, typeOfTheCreature, allBiomes);
scarex j’ai déja essayer de l’enregistrer q’une fois et pareil
Autant pour moi, eclipse te dit d’autres erreurs que je corrige ?
package com.google.monpetitflocon.modtest.common; import java.awt.Color; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.enchantment.Enchantment; import net.minecraft.entity.Entity; import net.minecraft.entity.EnumCreatureType; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.Item.ToolMaterial; import net.minecraft.item.ItemArmor.ArmorMaterial; import net.minecraft.item.ItemStack; import net.minecraft.world.biome.BiomeGenBase; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.util.EnumHelper; import com.google.monpetitflocon.modtest.common.blocks.BlockOreTutoriel; import com.google.monpetitflocon.modtest.common.blocks.BlockTutorialStairs; import com.google.monpetitflocon.modtest.common.blocks.BlockTutoriel; import com.google.monpetitflocon.modtest.common.blocks.BlockTutorielMetadata; import com.google.monpetitflocon.modtest.common.blocks.FantasyBlock; import com.google.monpetitflocon.modtest.common.blocks.FenceBlock; import com.google.monpetitflocon.modtest.common.blocks.GreenWall; import com.google.monpetitflocon.modtest.common.blocks.WallBlock; import com.google.monpetitflocon.modtest.common.entity.Aznching; import com.google.monpetitflocon.modtest.common.entity.Darkheaven; import com.google.monpetitflocon.modtest.common.entity.EntityMonMob; import com.google.monpetitflocon.modtest.common.entity.Oxilac; import com.google.monpetitflocon.modtest.common.items.FantasyNugget; import com.google.monpetitflocon.modtest.common.items.FufuAple; import com.google.monpetitflocon.modtest.common.items.HautEpee; import com.google.monpetitflocon.modtest.common.items.ItemTutoArmor; import com.google.monpetitflocon.modtest.common.items.ItemTutoAxe; import com.google.monpetitflocon.modtest.common.items.ItemTutoHoe; import com.google.monpetitflocon.modtest.common.items.ItemTutoPickaxe; import com.google.monpetitflocon.modtest.common.items.ItemTutoShovel; import com.google.monpetitflocon.modtest.common.items.ItemTutoSword; import com.google.monpetitflocon.modtest.common.items.Letest; import com.google.monpetitflocon.modtest.common.items.MancheEpee; import com.google.monpetitflocon.modtest.common.items.MilieuEpee; import com.google.monpetitflocon.modtest.proxy.CommonProxy; import cpw.mods.fml.common.FMLCommonHandler; 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.registry.EntityRegistry; import cpw.mods.fml.common.registry.GameRegistry; @Mod(modid = "modtest", name = "Fantasy Mod", version = "1.0.0") public class ModTest { public static final String MODID = "modtest"; @Instance("modtest") public static ModTest instance; @SidedProxy(clientSide = "com.google.monpetitflocon.modtest.proxy.ClientProxy", serverSide ="com.google.monpetitflocon.modtest.proxy.CommonProxy") public static CommonProxy proxy; public static Item letest, fufuaple, helmetTuto, chestPlateTuto, leggingsTuto, bootsTuto, swordTuto, pickaxeTuto, axeTuto, shovelTuto, hoeTuto, MancheEpee, MilieuEpee, HautEpee,FantasyNugget,record_tuto; public static Block blockTutoriel, blockTutoriel2, blockMetadataTuto, blockTutoriel3, blocktutorialstairs,Wallblock, FantasyBlock,GreenFence,GreenStair,GreenWall,RedFence,RedStair,RedWall,PinkFence,PinkStair,PinkWall,OrangeFence,OrangeStair,OrangeWall; public static ArmorMaterial armorTuto = EnumHelper.addArmorMaterial("armorTuto", 45, new int[] {4, 9, 7, 4}, 30); public static ToolMaterial toolTuto = EnumHelper.addToolMaterial("toolTuto", 3, 1000, 12.0F, 4.0F, 20); public static ToolMaterial toolsword = EnumHelper.addToolMaterial("toolTuto", 3, 1000, 12.0F, 14.0F, 20); public static CreativeTabs FantasyBlockCreativeTabs = new FantasyBlockCreativeTabs("fantasy_block_creative_tabs"); public static CreativeTabs tutorialCreativeTabs = new TutorialCreativeTabs("tutorial_creative_tabs"); WorldGeneration worldgeneration = new WorldGeneration(); @EventHandler public void preInit(FMLPreInitializationEvent event) { letest = new Letest().setUnlocalizedName("letest").setTextureName(MODID + ":Item_letest"); fufuaple = new FufuAple(5, 1.5F, false).setAlwaysEdible().setUnlocalizedName("fufuaple").setTextureName(MODID + ":Item_fufuaple"); helmetTuto = new ItemTutoArmor(armorTuto, 0).setUnlocalizedName("helmetTuto").setTextureName(MODID + ":helmet_tutoriel"); chestPlateTuto = new ItemTutoArmor(armorTuto, 1).setUnlocalizedName("chestPlateTuto").setTextureName(MODID + ":chestplate_tutoriel"); leggingsTuto = new ItemTutoArmor(armorTuto, 2).setUnlocalizedName("leggingsTuto").setTextureName(MODID + ":leggings_tutoriel"); bootsTuto = new ItemTutoArmor(armorTuto, 3).setUnlocalizedName("bootsTuto").setTextureName(MODID + ":boots_tutoriel"); swordTuto = new ItemTutoSword(toolsword).setUnlocalizedName("swordTuto").setTextureName(MODID + "Confusword_tutoriel"); pickaxeTuto = new ItemTutoPickaxe(toolTuto).setUnlocalizedName("pickaxeTuto").setTextureName(MODID + ":pickaxe_tutoriel"); axeTuto = new ItemTutoAxe(toolTuto).setUnlocalizedName("axeTuto").setTextureName(MODID + ":axe_tutoriel"); shovelTuto = new ItemTutoShovel(toolTuto).setUnlocalizedName("shovelTuto").setTextureName(MODID + "Confushovel_tutoriel"); hoeTuto = new ItemTutoHoe(toolTuto).setUnlocalizedName("hoeTuto").setTextureName(MODID + ":hoe_tutoriel"); MancheEpee = new MancheEpee().setUnlocalizedName("MancheEpee").setTextureName(MODID + ":manche_epee"); MilieuEpee = new MilieuEpee().setUnlocalizedName("MilieuEpee").setTextureName(MODID + ":milieu_epee"); HautEpee = new HautEpee().setUnlocalizedName("HautEpee").setTextureName(MODID + ":haut_epee"); FantasyNugget = new FantasyNugget().setUnlocalizedName("FantasyNugget").setTextureName(MODID + ":fantasy_nugget"); record_tuto = new MusicDisc("tutomusique").setUnlocalizedName("tutomusiqueRecord"); GameRegistry.registerItem(letest, "item_letest"); GameRegistry.registerItem(fufuaple, "item_fufuaple"); GameRegistry.registerItem(helmetTuto, "item_tuto_helmet"); GameRegistry.registerItem(chestPlateTuto, "item_tuto_chestplate"); GameRegistry.registerItem(leggingsTuto, "item_tuto_leggings"); GameRegistry.registerItem(bootsTuto, "item_tuto_boots"); GameRegistry.registerItem(swordTuto, "item_tuto_sword"); GameRegistry.registerItem(pickaxeTuto, "item_tuto_pickaxe"); GameRegistry.registerItem(axeTuto, "item_tuto_axe"); GameRegistry.registerItem(shovelTuto, "item_tuto_shovel"); GameRegistry.registerItem(hoeTuto, "item_tuto_hoe"); GameRegistry.registerItem(MancheEpee, "manche_epee"); GameRegistry.registerItem(MilieuEpee, "milieu_epee"); GameRegistry.registerItem(HautEpee, "haut_epee"); GameRegistry.registerItem(FantasyNugget, "fantasy_nugget"); GameRegistry.registerItem(record_tuto,"tutomusiqueRecord"); blockTutoriel = new BlockOreTutoriel(Material.rock).setHardness(15.0F).setResistance(10.0F).setBlockName("tutoriel").setBlockTextureName(MODID + ":block_tutoriel"); blockTutoriel2 = new BlockTutoriel(Material.wood).setHardness(1.5F).setResistance(10.0F).setBlockName("tutoriel2").setBlockTextureName(MODID + ":block_tutoriel2"); blockMetadataTuto = new BlockTutorielMetadata().setBlockName("metadataTuto").setHardness(1.5F).setResistance(10.0F).setCreativeTab(ModTest.FantasyBlockCreativeTabs); blockTutoriel3 = new FenceBlock(MODID +":fantasy_block", Material.wood).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood).setBlockName("tutoriel3"); blocktutorialstairs = new BlockTutorialStairs(ModTest.blockTutoriel3, 0, Material.wood).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood).setBlockName("TutorialStairs").setBlockTextureName(MODID + ":fantasy_block"); Wallblock = new WallBlock(blockTutoriel3).setBlockName("WallBlock"); FantasyBlock = new FantasyBlock(Material.rock).setHardness(5.0F).setResistance(10.0F).setBlockName("FantasyBlock").setBlockTextureName(MODID + ":fantasy_block"); GreenFence = new FenceBlock(MODID +":block4", Material.wood).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood).setBlockName("green_fence"); GreenStair = new BlockTutorialStairs(ModTest.GreenFence, 0, Material.wood).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood).setBlockName("green_stair").setBlockTextureName(MODID + ":block4"); GreenWall = new GreenWall(ModTest.GreenFence).setBlockName("GreenWall"); RedFence = new FenceBlock(MODID +":block1", Material.wood).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood).setBlockName("red_fence"); RedStair = new BlockTutorialStairs(ModTest.RedFence, 0, Material.wood).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood).setBlockName("red_stair").setBlockTextureName(MODID + ":block1"); RedWall = new com.google.monpetitflocon.modtest.common.blocks.RedWall(ModTest.RedFence).setBlockName("RedWall"); PinkFence = new FenceBlock(MODID +":block2", Material.wood).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood).setBlockName("pink_fence"); PinkStair = new BlockTutorialStairs(ModTest.PinkFence, 0, Material.wood).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood).setBlockName("pink_stair").setBlockTextureName(MODID + ":block2"); PinkWall = new com.google.monpetitflocon.modtest.common.blocks.PinkWall(ModTest.PinkFence).setBlockName("PinkWall"); OrangeFence = new FenceBlock(MODID +":block3", Material.wood).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood).setBlockName("orange_fence"); OrangeStair = new BlockTutorialStairs(ModTest.OrangeFence, 0, Material.wood).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood).setBlockName("orange_stair").setBlockTextureName(MODID + ":block3"); OrangeWall = new com.google.monpetitflocon.modtest.common.blocks.OrangeWall(ModTest.OrangeFence).setBlockName("OrangeWall"); GameRegistry.registerBlock(blockTutoriel, "block_tutoriel"); GameRegistry.registerBlock(blockTutoriel2, "block_tutoriel2"); GameRegistry.registerBlock(blockMetadataTuto, ItemBlockMetadataTutoriel.class, "block_tuto_metadata", new Object[]{BlockTutorielMetadata.subBlock}); GameRegistry.registerBlock(blockTutoriel3, "block_tutoriel3"); GameRegistry.registerBlock(blocktutorialstairs, "TutorialStairs"); GameRegistry.registerBlock(Wallblock, "Wall_block"); GameRegistry.registerBlock(FantasyBlock, "Fantasy_block"); GameRegistry.registerBlock(GreenFence, "green_fence"); GameRegistry.registerBlock(GreenStair, "green_stair"); GameRegistry.registerBlock(GreenWall, "green_wall"); GameRegistry.registerBlock(RedFence, "red_fence"); GameRegistry.registerBlock(RedStair, "red_stair"); GameRegistry.registerBlock(RedWall, "red_wall"); GameRegistry.registerBlock(PinkFence, "pink_fence"); GameRegistry.registerBlock(PinkStair, "pink_stair"); GameRegistry.registerBlock(PinkWall, "pink_wall"); GameRegistry.registerBlock(OrangeFence, "orange_fence"); GameRegistry.registerBlock(OrangeStair, "orange_stair"); GameRegistry.registerBlock(OrangeWall, "orange_wall"); GameRegistry.registerWorldGenerator(worldgeneration, 0); } public static BiomeGenBase[] allBiomes = { BiomeGenBase.plains, BiomeGenBase.extremeHills, BiomeGenBase.beach, BiomeGenBase.desert, BiomeGenBase.desertHills, BiomeGenBase.extremeHillsEdge, BiomeGenBase.forest, BiomeGenBase.forestHills, BiomeGenBase.icePlains, BiomeGenBase.iceMountains, BiomeGenBase.river, BiomeGenBase.birchForest, BiomeGenBase.birchForestHills, BiomeGenBase.coldBeach, BiomeGenBase.coldTaiga, BiomeGenBase.coldTaigaHills, BiomeGenBase.deepOcean, BiomeGenBase.extremeHillsPlus, BiomeGenBase.jungleEdge, BiomeGenBase.megaTaiga, BiomeGenBase.megaTaigaHills, BiomeGenBase.mesa, BiomeGenBase.mesaPlateau, BiomeGenBase.mesaPlateau_F, BiomeGenBase.roofedForest, BiomeGenBase.savanna, BiomeGenBase.savannaPlateau, BiomeGenBase.stoneBeach }; @EventHandler public void init(FMLInitializationEvent event) { MinecraftForge.EVENT_BUS.register(new LivingEventHandler()); FMLCommonHandler.instance().bus().register(new PlayerEventHandler()); MinecraftForge.EVENT_BUS.register(new PlayerEventHandler()); addEntity(EntityMonMob.class, "MobTuto", 125, 255, 100); addEntity(Darkheaven.class, "Darkheaven", 126, 255, 100); addEntity(Aznching.class, "Aznching", 127, 255, 100); addEntity(Oxilac.class, "Oxilac", 128, 255, 100); proxy.registerRender(); ItemStack itemenchante = new ItemStack(swordTuto, 1, 0); itemenchante.addEnchantment(Enchantment.knockback, 5); itemenchante.addEnchantment(Enchantment.looting, 2); itemenchante.addEnchantment(Enchantment.baneOfArthropods, 2); itemenchante.addEnchantment(Enchantment.sharpness, 5); itemenchante.addEnchantment(Enchantment.smite, 4); //Recipes GameRegistry.addRecipe(new ItemStack(helmetTuto), new Object[]{"XXX", "X X", " ", 'X', ModTest.letest}); GameRegistry.addRecipe(new ItemStack(chestPlateTuto), new Object[]{"X X", "XXX", "XXX", 'X', ModTest.letest}); GameRegistry.addRecipe(new ItemStack(leggingsTuto), new Object[]{"XXX", "X X", "X X", 'X', ModTest.letest}); GameRegistry.addRecipe(new ItemStack(bootsTuto), new Object[]{" ", "X X", "X X", 'X', ModTest.letest}); GameRegistry.addRecipe(itemenchante, new Object[]{"X ", " Y ", " Z", 'X', ModTest.HautEpee, 'Y', new ItemStack(ModTest.MilieuEpee), 'Z', new ItemStack(ModTest.MancheEpee),}); GameRegistry.addRecipe(new ItemStack(pickaxeTuto), new Object[]{"XXX", " Y ", " Y ", 'X', ModTest.letest, 'Y', new ItemStack(Items.stick),}); GameRegistry.addRecipe(new ItemStack(axeTuto), new Object[]{" XX", " YX", " Y ", 'X', ModTest.letest, 'Y', new ItemStack(Items.stick),}); GameRegistry.addRecipe(new ItemStack(shovelTuto), new Object[]{" X ", " Y ", " Y ", 'X', ModTest.letest, 'Y', new ItemStack(Items.stick),}); GameRegistry.addRecipe(new ItemStack(hoeTuto), new Object[]{"XX ", " Y ", " Y ", 'X', ModTest.letest, 'Y', new ItemStack(Items.stick),}); GameRegistry.addRecipe(new ItemStack(blockTutoriel2), new Object[]{"XY ", "ZA ", " ", 'X', ModTest.fufuaple, 'Y', new ItemStack(Items.cooked_porkchop), 'Z', new ItemStack(Blocks.wool), 'A', new ItemStack(Blocks.wool, 1, 15),}); GameRegistry.addRecipe(new ItemStack(fufuaple), new Object[]{"XXX", "XYX", "XXX", 'X',ModTest.letest, 'Y', new ItemStack(Items.golden_apple),}); GameRegistry.addRecipe(new ItemStack(FantasyBlock), new Object[]{"XXX", "XXX", "XXX", 'X',ModTest.letest, }); GameRegistry.addRecipe(new ItemStack(letest, 9), new Object[]{"X ", " ", " ", 'X',ModTest.FantasyBlock, }); GameRegistry.addRecipe(new ItemStack(FantasyNugget , 9), new Object[]{"X ", " ", " ", 'X',ModTest.letest, }); GameRegistry.addRecipe(new ItemStack(letest), new Object[]{"XXX", "XXX", "XXX", 'X',ModTest.FantasyNugget, }); GameRegistry.addRecipe(new ItemStack(blockTutoriel3, 3), new Object[]{" ", "XYX", "XYX", 'X',ModTest.FantasyNugget, 'Y', new ItemStack(Items.stick),}); GameRegistry.addRecipe(new ItemStack(Wallblock, 6), new Object[]{" ", "XXX", "XXX", 'X',ModTest.FantasyNugget, }); GameRegistry.addRecipe(new ItemStack(blocktutorialstairs, 4), new Object[]{" X", " XX", "XXX", 'X',ModTest.FantasyNugget, }); GameRegistry.addRecipe(new ItemStack(blockMetadataTuto, 1, 0), new Object[]{"XY ", " ", " ", 'X',ModTest.FantasyBlock, 'Y', new ItemStack(Items.dye, 1, 1),}); GameRegistry.addRecipe(new ItemStack(blockMetadataTuto, 1, 1), new Object[]{"XY ", " ", " ", 'X',ModTest.FantasyBlock, 'Y', new ItemStack(Items.dye, 1, 9),}); GameRegistry.addRecipe(new ItemStack(blockMetadataTuto, 1, 2), new Object[]{"XY ", " ", " ", 'X',ModTest.FantasyBlock, 'Y', new ItemStack(Items.dye, 1, 14),}); GameRegistry.addRecipe(new ItemStack(blockMetadataTuto, 1, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.FantasyBlock, 'Y', new ItemStack(Items.dye, 1, 10),}); GameRegistry.addRecipe(new ItemStack(GreenWall, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.Wallblock, 'Y', new ItemStack(Items.dye, 3, 10),}); GameRegistry.addRecipe(new ItemStack(RedWall, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.Wallblock, 'Y', new ItemStack(Items.dye, 3, 1),}); GameRegistry.addRecipe(new ItemStack(PinkWall, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.Wallblock, 'Y', new ItemStack(Items.dye, 3, 9),}); GameRegistry.addRecipe(new ItemStack(OrangeWall, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.Wallblock, 'Y', new ItemStack(Items.dye, 3, 14),}); GameRegistry.addRecipe(new ItemStack(GreenFence, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.blockTutoriel3, 'Y', new ItemStack(Items.dye, 3, 10),}); GameRegistry.addRecipe(new ItemStack(RedFence, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.blockTutoriel3, 'Y', new ItemStack(Items.dye, 3, 1),}); GameRegistry.addRecipe(new ItemStack(PinkFence, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.blockTutoriel3, 'Y', new ItemStack(Items.dye, 3, 9),}); GameRegistry.addRecipe(new ItemStack(OrangeFence, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.blockTutoriel3, 'Y', new ItemStack(Items.dye, 3, 14),}); GameRegistry.addRecipe(new ItemStack(GreenStair, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.blocktutorialstairs, 'Y', new ItemStack(Items.dye, 3, 10),}); GameRegistry.addRecipe(new ItemStack(RedStair, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.blocktutorialstairs, 'Y', new ItemStack(Items.dye, 3, 1),}); GameRegistry.addRecipe(new ItemStack(PinkStair, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.blocktutorialstairs, 'Y', new ItemStack(Items.dye, 3, 9),}); GameRegistry.addRecipe(new ItemStack(OrangeStair, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.blocktutorialstairs, 'Y', new ItemStack(Items.dye, 3, 14),}); //Parts GameRegistry.addRecipe(new ItemStack(ModTest.MancheEpee), new Object[]{" Y", " Y ", "X ", 'X',ModTest.letest, 'Y', new ItemStack(Items.stick),}); // Manche Epee GameRegistry.addRecipe(new ItemStack(ModTest.MilieuEpee), new Object[]{"X X", " X ", " ", 'X',ModTest.letest,}); // Milieu Epee GameRegistry.addRecipe(new ItemStack(ModTest.HautEpee), new Object[]{" X ", "XYX", "XYX", 'X',ModTest.letest, 'Y', new ItemStack(Items.diamond),}); // Haut Epee } @EventHandler public void postInit(FMLPostInitializationEvent event) { } public void addEntity(Class entityClass, String name, int id, int backgroundEggColour,int foregroundEggColour, int freq, int min, int max, EnumCreatureType typeOfTheCreature) { EntityRegistry.registerGlobalEntityID(entityClass, name, EntityRegistry.findGlobalUniqueEntityId(), backgroundEggColour, foregroundEggColour); EntityRegistry.registerModEntity(entityClass, name, id, this, 40, 1, true); EntityRegistry.addSpawn(entityClass, freq, min, max, typeOfTheCreature, allBiomes); } }
-
oui dernière ligne
-
@‘monpetitflocon’:
oui dernière ligne
Oups bien tu peux cliquer sur l’option 1, celle de cast l’argument
-
merci cela marche sauf le mob qui ne spawn pas donc voici la nouvelle classe principale (j’ai rajouter des trucs en attendant)
:::package com.google.monpetitflocon.modtest.common; import java.awt.Color; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.enchantment.Enchantment; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EnumCreatureType; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.Item.ToolMaterial; import net.minecraft.item.ItemArmor.ArmorMaterial; import net.minecraft.item.ItemStack; import net.minecraft.world.biome.BiomeGenBase; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.util.EnumHelper; import com.google.monpetitflocon.modtest.common.blocks.BlockOreTutoriel; import com.google.monpetitflocon.modtest.common.blocks.BlockTutorialStairs; import com.google.monpetitflocon.modtest.common.blocks.BlockTutoriel; import com.google.monpetitflocon.modtest.common.blocks.BlockTutorielMetadata; import com.google.monpetitflocon.modtest.common.blocks.FantasyBlock; import com.google.monpetitflocon.modtest.common.blocks.FenceBlock; import com.google.monpetitflocon.modtest.common.blocks.GreenWall; import com.google.monpetitflocon.modtest.common.blocks.WallBlock; import com.google.monpetitflocon.modtest.common.entity.Aznching; import com.google.monpetitflocon.modtest.common.entity.Darkheaven; import com.google.monpetitflocon.modtest.common.entity.EntityMonMob; import com.google.monpetitflocon.modtest.common.entity.Oxilac; import com.google.monpetitflocon.modtest.common.items.FantasyNugget; import com.google.monpetitflocon.modtest.common.items.FufuAple; import com.google.monpetitflocon.modtest.common.items.HautEpee; import com.google.monpetitflocon.modtest.common.items.ItemTutoArmor; import com.google.monpetitflocon.modtest.common.items.ItemTutoAxe; import com.google.monpetitflocon.modtest.common.items.ItemTutoHoe; import com.google.monpetitflocon.modtest.common.items.ItemTutoPickaxe; import com.google.monpetitflocon.modtest.common.items.ItemTutoShovel; import com.google.monpetitflocon.modtest.common.items.ItemTutoSword; import com.google.monpetitflocon.modtest.common.items.Letest; import com.google.monpetitflocon.modtest.common.items.MancheEpee; import com.google.monpetitflocon.modtest.common.items.MilieuEpee; import com.google.monpetitflocon.modtest.proxy.CommonProxy; import cpw.mods.fml.common.FMLCommonHandler; 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.registry.EntityRegistry; import cpw.mods.fml.common.registry.GameRegistry; @Mod(modid = "modtest", name = "Fantasy Mod", version = "1.0.0") public class ModTest { public static final String MODID = "modtest"; @Instance("modtest") public static ModTest instance; @SidedProxy(clientSide = "com.google.monpetitflocon.modtest.proxy.ClientProxy", serverSide ="com.google.monpetitflocon.modtest.proxy.CommonProxy") public static CommonProxy proxy; public static Item letest, fufuaple, helmetTuto, chestPlateTuto, leggingsTuto, bootsTuto, swordTuto, pickaxeTuto, axeTuto, shovelTuto, hoeTuto, MancheEpee, MilieuEpee, HautEpee,FantasyNugget,record_tuto; public static Block blockTutoriel, blockTutoriel2, blockMetadataTuto, blockTutoriel3, blocktutorialstairs,Wallblock, FantasyBlock,GreenFence,GreenStair,GreenWall,RedFence,RedStair,RedWall,PinkFence,PinkStair,PinkWall,OrangeFence,OrangeStair,OrangeWall; public static ArmorMaterial armorTuto = EnumHelper.addArmorMaterial("armorTuto", 45, new int[] {4, 9, 7, 4}, 30); public static ToolMaterial toolTuto = EnumHelper.addToolMaterial("toolTuto", 3, 1000, 12.0F, 4.0F, 20); public static ToolMaterial toolsword = EnumHelper.addToolMaterial("toolTuto", 3, 1000, 12.0F, 14.0F, 20); public static CreativeTabs FantasyBlockCreativeTabs = new FantasyBlockCreativeTabs("fantasy_block_creative_tabs"); public static CreativeTabs tutorialCreativeTabs = new TutorialCreativeTabs("tutorial_creative_tabs"); WorldGeneration worldgeneration = new WorldGeneration(); @EventHandler public void preInit(FMLPreInitializationEvent event) { letest = new Letest().setUnlocalizedName("letest").setTextureName(MODID + ":Item_letest"); fufuaple = new FufuAple(5, 1.5F, false).setAlwaysEdible().setUnlocalizedName("fufuaple").setTextureName(MODID + ":Item_fufuaple"); helmetTuto = new ItemTutoArmor(armorTuto, 0).setUnlocalizedName("helmetTuto").setTextureName(MODID + ":helmet_tutoriel"); chestPlateTuto = new ItemTutoArmor(armorTuto, 1).setUnlocalizedName("chestPlateTuto").setTextureName(MODID + ":chestplate_tutoriel"); leggingsTuto = new ItemTutoArmor(armorTuto, 2).setUnlocalizedName("leggingsTuto").setTextureName(MODID + ":leggings_tutoriel"); bootsTuto = new ItemTutoArmor(armorTuto, 3).setUnlocalizedName("bootsTuto").setTextureName(MODID + ":boots_tutoriel"); swordTuto = new ItemTutoSword(toolsword).setUnlocalizedName("swordTuto").setTextureName(MODID + "sword_tutoriel"); pickaxeTuto = new ItemTutoPickaxe(toolTuto).setUnlocalizedName("pickaxeTuto").setTextureName(MODID + ":pickaxe_tutoriel"); axeTuto = new ItemTutoAxe(toolTuto).setUnlocalizedName("axeTuto").setTextureName(MODID + ":axe_tutoriel"); shovelTuto = new ItemTutoShovel(toolTuto).setUnlocalizedName("shovelTuto").setTextureName(MODID + "shovel_tutoriel"); hoeTuto = new ItemTutoHoe(toolTuto).setUnlocalizedName("hoeTuto").setTextureName(MODID + ":hoe_tutoriel"); MancheEpee = new MancheEpee().setUnlocalizedName("MancheEpee").setTextureName(MODID + ":manche_epee"); MilieuEpee = new MilieuEpee().setUnlocalizedName("MilieuEpee").setTextureName(MODID + ":milieu_epee"); HautEpee = new HautEpee().setUnlocalizedName("HautEpee").setTextureName(MODID + ":haut_epee"); FantasyNugget = new FantasyNugget().setUnlocalizedName("FantasyNugget").setTextureName(MODID + ":fantasy_nugget"); record_tuto = new MusicDisc("tutomusique").setUnlocalizedName("tutomusiqueRecord"); GameRegistry.registerItem(letest, "item_letest"); GameRegistry.registerItem(fufuaple, "item_fufuaple"); GameRegistry.registerItem(helmetTuto, "item_tuto_helmet"); GameRegistry.registerItem(chestPlateTuto, "item_tuto_chestplate"); GameRegistry.registerItem(leggingsTuto, "item_tuto_leggings"); GameRegistry.registerItem(bootsTuto, "item_tuto_boots"); GameRegistry.registerItem(swordTuto, "item_tuto_sword"); GameRegistry.registerItem(pickaxeTuto, "item_tuto_pickaxe"); GameRegistry.registerItem(axeTuto, "item_tuto_axe"); GameRegistry.registerItem(shovelTuto, "item_tuto_shovel"); GameRegistry.registerItem(hoeTuto, "item_tuto_hoe"); GameRegistry.registerItem(MancheEpee, "manche_epee"); GameRegistry.registerItem(MilieuEpee, "milieu_epee"); GameRegistry.registerItem(HautEpee, "haut_epee"); GameRegistry.registerItem(FantasyNugget, "fantasy_nugget"); GameRegistry.registerItem(record_tuto,"tutomusiqueRecord"); blockTutoriel = new BlockOreTutoriel(Material.rock).setHardness(15.0F).setResistance(10.0F).setBlockName("tutoriel").setBlockTextureName(MODID + ":block_tutoriel"); blockTutoriel2 = new BlockTutoriel(Material.wood).setHardness(1.5F).setResistance(10.0F).setBlockName("tutoriel2").setBlockTextureName(MODID + ":block_tutoriel2"); blockMetadataTuto = new BlockTutorielMetadata().setBlockName("metadataTuto").setHardness(1.5F).setResistance(10.0F).setCreativeTab(ModTest.FantasyBlockCreativeTabs); blockTutoriel3 = new FenceBlock(MODID +":fantasy_block", Material.wood).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood).setBlockName("tutoriel3"); blocktutorialstairs = new BlockTutorialStairs(ModTest.blockTutoriel3, 0, Material.wood).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood).setBlockName("TutorialStairs").setBlockTextureName(MODID + ":fantasy_block"); Wallblock = new WallBlock(blockTutoriel3).setBlockName("WallBlock"); FantasyBlock = new FantasyBlock(Material.rock).setHardness(5.0F).setResistance(10.0F).setBlockName("FantasyBlock").setBlockTextureName(MODID + ":fantasy_block"); GreenFence = new FenceBlock(MODID +":block4", Material.wood).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood).setBlockName("green_fence"); GreenStair = new BlockTutorialStairs(ModTest.GreenFence, 0, Material.wood).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood).setBlockName("green_stair").setBlockTextureName(MODID + ":block4"); GreenWall = new GreenWall(ModTest.GreenFence).setBlockName("GreenWall"); RedFence = new FenceBlock(MODID +":block1", Material.wood).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood).setBlockName("red_fence"); RedStair = new BlockTutorialStairs(ModTest.RedFence, 0, Material.wood).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood).setBlockName("red_stair").setBlockTextureName(MODID + ":block1"); RedWall = new com.google.monpetitflocon.modtest.common.blocks.RedWall(ModTest.RedFence).setBlockName("RedWall"); PinkFence = new FenceBlock(MODID +":block2", Material.wood).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood).setBlockName("pink_fence"); PinkStair = new BlockTutorialStairs(ModTest.PinkFence, 0, Material.wood).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood).setBlockName("pink_stair").setBlockTextureName(MODID + ":block2"); PinkWall = new com.google.monpetitflocon.modtest.common.blocks.PinkWall(ModTest.PinkFence).setBlockName("PinkWall"); OrangeFence = new FenceBlock(MODID +":block3", Material.wood).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood).setBlockName("orange_fence"); OrangeStair = new BlockTutorialStairs(ModTest.OrangeFence, 0, Material.wood).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood).setBlockName("orange_stair").setBlockTextureName(MODID + ":block3"); OrangeWall = new com.google.monpetitflocon.modtest.common.blocks.OrangeWall(ModTest.OrangeFence).setBlockName("OrangeWall"); GameRegistry.registerBlock(blockTutoriel, "block_tutoriel"); GameRegistry.registerBlock(blockTutoriel2, "block_tutoriel2"); GameRegistry.registerBlock(blockMetadataTuto, ItemBlockMetadataTutoriel.class, "block_tuto_metadata", new Object[]{BlockTutorielMetadata.subBlock}); GameRegistry.registerBlock(blockTutoriel3, "block_tutoriel3"); GameRegistry.registerBlock(blocktutorialstairs, "TutorialStairs"); GameRegistry.registerBlock(Wallblock, "Wall_block"); GameRegistry.registerBlock(FantasyBlock, "Fantasy_block"); GameRegistry.registerBlock(GreenFence, "green_fence"); GameRegistry.registerBlock(GreenStair, "green_stair"); GameRegistry.registerBlock(GreenWall, "green_wall"); GameRegistry.registerBlock(RedFence, "red_fence"); GameRegistry.registerBlock(RedStair, "red_stair"); GameRegistry.registerBlock(RedWall, "red_wall"); GameRegistry.registerBlock(PinkFence, "pink_fence"); GameRegistry.registerBlock(PinkStair, "pink_stair"); GameRegistry.registerBlock(PinkWall, "pink_wall"); GameRegistry.registerBlock(OrangeFence, "orange_fence"); GameRegistry.registerBlock(OrangeStair, "orange_stair"); GameRegistry.registerBlock(OrangeWall, "orange_wall"); GameRegistry.registerWorldGenerator(worldgeneration, 0); } public static BiomeGenBase[] allBiomes = { BiomeGenBase.plains, BiomeGenBase.extremeHills, BiomeGenBase.beach, BiomeGenBase.desert, BiomeGenBase.desertHills, BiomeGenBase.extremeHillsEdge, BiomeGenBase.forest, BiomeGenBase.forestHills, BiomeGenBase.icePlains, BiomeGenBase.iceMountains, BiomeGenBase.river, BiomeGenBase.birchForest, BiomeGenBase.birchForestHills, BiomeGenBase.coldBeach, BiomeGenBase.coldTaiga, BiomeGenBase.coldTaigaHills, BiomeGenBase.deepOcean, BiomeGenBase.extremeHillsPlus, BiomeGenBase.jungleEdge, BiomeGenBase.megaTaiga, BiomeGenBase.megaTaigaHills, BiomeGenBase.mesa, BiomeGenBase.mesaPlateau, BiomeGenBase.mesaPlateau_F, BiomeGenBase.roofedForest, BiomeGenBase.savanna, BiomeGenBase.savannaPlateau, BiomeGenBase.stoneBeach }; @EventHandler public void init(FMLInitializationEvent event) { MinecraftForge.EVENT_BUS.register(new LivingEventHandler()); FMLCommonHandler.instance().bus().register(new PlayerEventHandler()); MinecraftForge.EVENT_BUS.register(new PlayerEventHandler()); EntityRegistry.registerGlobalEntityID(EntityMonMob.class, "MobTuto", EntityRegistry.findGlobalUniqueEntityId(), new Color(97, 0, 255).getRGB(), new Color(146, 91, 255).getRGB()); EntityRegistry.registerModEntity(EntityMonMob.class, "MobTuto", 430, ModTest.instance, 40, 1, true); EntityRegistry.addSpawn(EntityMonMob.class, 9, 1, 3, EnumCreatureType.creature, allBiomes); EntityRegistry.registerGlobalEntityID(Aznching.class, "Aznching", EntityRegistry.findGlobalUniqueEntityId(), new Color(97, 0, 255).getRGB(), new Color(146, 91, 255).getRGB()); EntityRegistry.registerModEntity(Aznching.class, "Aznching", 431, ModTest.instance, 40, 1, true); EntityRegistry.addSpawn(Aznching.class, 9, 1, 3, EnumCreatureType.creature, allBiomes); EntityRegistry.registerGlobalEntityID(Oxilac.class, "Oxilac", EntityRegistry.findGlobalUniqueEntityId(), new Color(97, 0, 255).getRGB(), new Color(146, 91, 255).getRGB()); EntityRegistry.registerModEntity(Oxilac.class, "Oxilac", 432, ModTest.instance, 40, 1, true); EntityRegistry.addSpawn(Oxilac.class, 9, 1, 3, EnumCreatureType.creature, allBiomes); EntityRegistry.registerGlobalEntityID(Darkheaven.class, "Darkheaven", EntityRegistry.findGlobalUniqueEntityId(), new Color(97, 0, 255).getRGB(), new Color(146, 91, 255).getRGB()); EntityRegistry.registerModEntity(Darkheaven.class, "Darkheaven", 433, ModTest.instance, 40, 1, true); EntityRegistry.addSpawn(Darkheaven.class, 9, 1, 3, EnumCreatureType.creature, allBiomes); proxy.registerRender(); ItemStack itemenchante = new ItemStack(swordTuto, 1, 0); itemenchante.addEnchantment(Enchantment.knockback, 5); itemenchante.addEnchantment(Enchantment.looting, 2); itemenchante.addEnchantment(Enchantment.baneOfArthropods, 2); itemenchante.addEnchantment(Enchantment.sharpness, 5); itemenchante.addEnchantment(Enchantment.smite, 4); //Recipes GameRegistry.addRecipe(new ItemStack(helmetTuto), new Object[]{"XXX", "X X", " ", 'X', ModTest.letest}); GameRegistry.addRecipe(new ItemStack(chestPlateTuto), new Object[]{"X X", "XXX", "XXX", 'X', ModTest.letest}); GameRegistry.addRecipe(new ItemStack(leggingsTuto), new Object[]{"XXX", "X X", "X X", 'X', ModTest.letest}); GameRegistry.addRecipe(new ItemStack(bootsTuto), new Object[]{" ", "X X", "X X", 'X', ModTest.letest}); GameRegistry.addRecipe(itemenchante, new Object[]{"X ", " Y ", " Z", 'X', ModTest.HautEpee, 'Y', new ItemStack(ModTest.MilieuEpee), 'Z', new ItemStack(ModTest.MancheEpee),}); GameRegistry.addRecipe(new ItemStack(pickaxeTuto), new Object[]{"XXX", " Y ", " Y ", 'X', ModTest.letest, 'Y', new ItemStack(Items.stick),}); GameRegistry.addRecipe(new ItemStack(axeTuto), new Object[]{" XX", " YX", " Y ", 'X', ModTest.letest, 'Y', new ItemStack(Items.stick),}); GameRegistry.addRecipe(new ItemStack(shovelTuto), new Object[]{" X ", " Y ", " Y ", 'X', ModTest.letest, 'Y', new ItemStack(Items.stick),}); GameRegistry.addRecipe(new ItemStack(hoeTuto), new Object[]{"XX ", " Y ", " Y ", 'X', ModTest.letest, 'Y', new ItemStack(Items.stick),}); GameRegistry.addRecipe(new ItemStack(blockTutoriel2), new Object[]{"XY ", "ZA ", " ", 'X', ModTest.fufuaple, 'Y', new ItemStack(Items.cooked_porkchop), 'Z', new ItemStack(Blocks.wool), 'A', new ItemStack(Blocks.wool, 1, 15),}); GameRegistry.addRecipe(new ItemStack(fufuaple), new Object[]{"XXX", "XYX", "XXX", 'X',ModTest.letest, 'Y', new ItemStack(Items.golden_apple),}); GameRegistry.addRecipe(new ItemStack(FantasyBlock), new Object[]{"XXX", "XXX", "XXX", 'X',ModTest.letest, }); GameRegistry.addRecipe(new ItemStack(letest, 9), new Object[]{"X ", " ", " ", 'X',ModTest.FantasyBlock, }); GameRegistry.addRecipe(new ItemStack(FantasyNugget , 9), new Object[]{"X ", " ", " ", 'X',ModTest.letest, }); GameRegistry.addRecipe(new ItemStack(letest), new Object[]{"XXX", "XXX", "XXX", 'X',ModTest.FantasyNugget, }); GameRegistry.addRecipe(new ItemStack(blockTutoriel3, 3), new Object[]{" ", "XYX", "XYX", 'X',ModTest.FantasyNugget, 'Y', new ItemStack(Items.stick),}); GameRegistry.addRecipe(new ItemStack(Wallblock, 6), new Object[]{" ", "XXX", "XXX", 'X',ModTest.FantasyNugget, }); GameRegistry.addRecipe(new ItemStack(blocktutorialstairs, 4), new Object[]{" X", " XX", "XXX", 'X',ModTest.FantasyNugget, }); GameRegistry.addRecipe(new ItemStack(blockMetadataTuto, 1, 0), new Object[]{"XY ", " ", " ", 'X',ModTest.FantasyBlock, 'Y', new ItemStack(Items.dye, 1, 1),}); GameRegistry.addRecipe(new ItemStack(blockMetadataTuto, 1, 1), new Object[]{"XY ", " ", " ", 'X',ModTest.FantasyBlock, 'Y', new ItemStack(Items.dye, 1, 9),}); GameRegistry.addRecipe(new ItemStack(blockMetadataTuto, 1, 2), new Object[]{"XY ", " ", " ", 'X',ModTest.FantasyBlock, 'Y', new ItemStack(Items.dye, 1, 14),}); GameRegistry.addRecipe(new ItemStack(blockMetadataTuto, 1, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.FantasyBlock, 'Y', new ItemStack(Items.dye, 1, 10),}); GameRegistry.addRecipe(new ItemStack(GreenWall, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.Wallblock, 'Y', new ItemStack(Items.dye, 3, 10),}); GameRegistry.addRecipe(new ItemStack(RedWall, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.Wallblock, 'Y', new ItemStack(Items.dye, 3, 1),}); GameRegistry.addRecipe(new ItemStack(PinkWall, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.Wallblock, 'Y', new ItemStack(Items.dye, 3, 9),}); GameRegistry.addRecipe(new ItemStack(OrangeWall, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.Wallblock, 'Y', new ItemStack(Items.dye, 3, 14),}); GameRegistry.addRecipe(new ItemStack(GreenFence, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.blockTutoriel3, 'Y', new ItemStack(Items.dye, 3, 10),}); GameRegistry.addRecipe(new ItemStack(RedFence, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.blockTutoriel3, 'Y', new ItemStack(Items.dye, 3, 1),}); GameRegistry.addRecipe(new ItemStack(PinkFence, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.blockTutoriel3, 'Y', new ItemStack(Items.dye, 3, 9),}); GameRegistry.addRecipe(new ItemStack(OrangeFence, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.blockTutoriel3, 'Y', new ItemStack(Items.dye, 3, 14),}); GameRegistry.addRecipe(new ItemStack(GreenStair, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.blocktutorialstairs, 'Y', new ItemStack(Items.dye, 3, 10),}); GameRegistry.addRecipe(new ItemStack(RedStair, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.blocktutorialstairs, 'Y', new ItemStack(Items.dye, 3, 1),}); GameRegistry.addRecipe(new ItemStack(PinkStair, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.blocktutorialstairs, 'Y', new ItemStack(Items.dye, 3, 9),}); GameRegistry.addRecipe(new ItemStack(OrangeStair, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.blocktutorialstairs, 'Y', new ItemStack(Items.dye, 3, 14),}); //Oeufs de mobs GameRegistry.addRecipe(new ItemStack(Items.spawn_egg, 1, 51), new Object[]{"XY ", " ", " ", 'X',Items.bone, 'Y', new ItemStack(Items.egg),}); //Squelette GameRegistry.addRecipe(new ItemStack(Items.spawn_egg, 1, 50), new Object[]{"XY ", " ", " ", 'X',Items.gunpowder, 'Y', new ItemStack(Items.egg),}); //Creeper GameRegistry.addRecipe(new ItemStack(Items.spawn_egg, 1, 52), new Object[]{"XY ", " ", " ", 'X',Items.spider_eye, 'Y', new ItemStack(Items.egg),}); //Araignée GameRegistry.addRecipe(new ItemStack(Items.spawn_egg, 1, 54), new Object[]{"XY ", " ", " ", 'X',Items.rotten_flesh, 'Y', new ItemStack(Items.egg),}); //Zombie GameRegistry.addRecipe(new ItemStack(Items.spawn_egg, 1, 55), new Object[]{"XY ", " ", " ", 'X',Items.slime_ball, 'Y', new ItemStack(Items.egg),}); GameRegistry.addRecipe(new ItemStack(Items.spawn_egg, 1, 56), new Object[]{"XY ", " ", " ", 'X',Items.ghast_tear, 'Y', new ItemStack(Items.egg),}); //Ghast GameRegistry.addRecipe(new ItemStack(Items.spawn_egg, 1, 57), new Object[]{"XY ", " ", " ", 'X',Items.golden_sword, 'Y', new ItemStack(Items.egg),}); //Cochon Zombie GameRegistry.addRecipe(new ItemStack(Items.spawn_egg, 1, 58), new Object[]{"XY ", " ", " ", 'X',Items.ender_pearl, 'Y', new ItemStack(Items.egg),}); //Enderman GameRegistry.addRecipe(new ItemStack(Items.spawn_egg, 1, 59), new Object[]{"XY ", " ", " ", 'X',Items.fermented_spider_eye, 'Y', new ItemStack(Items.egg),}); //Cave Spider GameRegistry.addRecipe(new ItemStack(Items.spawn_egg, 1, 61), new Object[]{"XY ", " ", " ", 'X',Items.blaze_rod, 'Y', new ItemStack(Items.egg),}); //Blaze GameRegistry.addRecipe(new ItemStack(Items.spawn_egg, 1, 62), new Object[]{"XY ", " ", " ", 'X',Items.magma_cream, 'Y', new ItemStack(Items.egg),}); // Cube de Magma GameRegistry.addRecipe(new ItemStack(Items.spawn_egg, 1, 66), new Object[]{"XY ", " ", " ", 'X',Items.glass_bottle, 'Y', new ItemStack(Items.egg),}); // Sorcière //Oeufs D'animaux GameRegistry.addRecipe(new ItemStack(Items.spawn_egg, 1, 90), new Object[]{"XY ", " ", " ", 'X',Items.porkchop, 'Y', new ItemStack(Items.egg),}); // Cochon GameRegistry.addRecipe(new ItemStack(Items.spawn_egg, 1, 91), new Object[]{"XY ", " ", " ", 'X',Blocks.wool, 'Y', new ItemStack(Items.egg),}); // Mouton GameRegistry.addRecipe(new ItemStack(Items.spawn_egg, 1, 92), new Object[]{"XY ", " ", " ", 'X',Items.beef, 'Y', new ItemStack(Items.egg),}); // Vache GameRegistry.addRecipe(new ItemStack(Items.spawn_egg, 1, 93), new Object[]{"XY ", " ", " ", 'X',Items.feather, 'Y', new ItemStack(Items.egg),}); // Poule GameRegistry.addRecipe(new ItemStack(Items.spawn_egg, 1, 94), new Object[]{"XY ", " ", " ", 'X',Items.dye, 'Y', new ItemStack(Items.egg),}); // Poulpe GameRegistry.addRecipe(new ItemStack(Items.spawn_egg, 1, 95), new Object[]{"XY ", " ", " ", 'X',Items.cooked_beef, 'Y', new ItemStack(Items.egg),}); // Loup GameRegistry.addRecipe(new ItemStack(Items.spawn_egg, 1, 96), new Object[]{"XY ", " ", " ", 'X',Items.mushroom_stew, 'Y', new ItemStack(Items.egg),}); // Champimeuh GameRegistry.addRecipe(new ItemStack(Items.spawn_egg, 1, 98), new Object[]{"XY ", " ", " ", 'X',Items.fish, 'Y', new ItemStack(Items.egg),}); // Ocelot GameRegistry.addRecipe(new ItemStack(Items.spawn_egg, 1, 100), new Object[]{"XY ", " ", " ", 'X',Items.leather, 'Y', new ItemStack(Items.egg),}); // Cheval GameRegistry.addRecipe(new ItemStack(Items.spawn_egg, 1, 120), new Object[]{"XY ", " ", " ", 'X',Items.emerald, 'Y', new ItemStack(Items.egg),}); // Villager //Parts GameRegistry.addRecipe(new ItemStack(ModTest.MancheEpee), new Object[]{" Y", " Y ", "X ", 'X',ModTest.letest, 'Y', new ItemStack(Items.stick),}); // Manche Epee GameRegistry.addRecipe(new ItemStack(ModTest.MilieuEpee), new Object[]{"X X", " X ", " ", 'X',ModTest.letest,}); // Milieu Epee GameRegistry.addRecipe(new ItemStack(ModTest.HautEpee), new Object[]{" X ", "XYX", "XYX", 'X',ModTest.letest, 'Y', new ItemStack(Items.diamond),}); // Haut Epee } @EventHandler public void postInit(FMLPostInitializationEvent event) { } public void addEntity(Class entityClass, String name, int id, int backgroundEggColour,int foregroundEggColour, int freq, int min, int max, EnumCreatureType typeOfTheCreature) { EntityRegistry.registerGlobalEntityID(entityClass, name, EntityRegistry.findGlobalUniqueEntityId(), backgroundEggColour, foregroundEggColour); EntityRegistry.registerModEntity(entityClass, name, id, this, 40, 1, true); EntityRegistry.addSpawn((Class) entityClass, freq, min, max, typeOfTheCreature, allBiomes); } }
:::
j’ai aussi un bug de texture sur l’épée et la pelle si tu trouve moi je suis en train de chercher mais sa devrait etre assez simple a trouver
sinon aucun spawn naturel sur ma superflatedit : dans la console il me dit quil ne trouve pas modtestsword_tutoriel alors que j’ai déclarer sword_tutoriel
vers la ligne 91 et pour la pelle sa doit etre pareil -
@‘monpetitflocon’:
merci cela marche sauf le mob qui ne spawn pas donc voici la nouvelle classe principale (j’ai rajouter des trucs en attendant)
:::
package com.google.monpetitflocon.modtest.common; import java.awt.Color; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.enchantment.Enchantment; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EnumCreatureType; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.Item.ToolMaterial; import net.minecraft.item.ItemArmor.ArmorMaterial; import net.minecraft.item.ItemStack; import net.minecraft.world.biome.BiomeGenBase; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.util.EnumHelper; import com.google.monpetitflocon.modtest.common.blocks.BlockOreTutoriel; import com.google.monpetitflocon.modtest.common.blocks.BlockTutorialStairs; import com.google.monpetitflocon.modtest.common.blocks.BlockTutoriel; import com.google.monpetitflocon.modtest.common.blocks.BlockTutorielMetadata; import com.google.monpetitflocon.modtest.common.blocks.FantasyBlock; import com.google.monpetitflocon.modtest.common.blocks.FenceBlock; import com.google.monpetitflocon.modtest.common.blocks.GreenWall; import com.google.monpetitflocon.modtest.common.blocks.WallBlock; import com.google.monpetitflocon.modtest.common.entity.Aznching; import com.google.monpetitflocon.modtest.common.entity.Darkheaven; import com.google.monpetitflocon.modtest.common.entity.EntityMonMob; import com.google.monpetitflocon.modtest.common.entity.Oxilac; import com.google.monpetitflocon.modtest.common.items.FantasyNugget; import com.google.monpetitflocon.modtest.common.items.FufuAple; import com.google.monpetitflocon.modtest.common.items.HautEpee; import com.google.monpetitflocon.modtest.common.items.ItemTutoArmor; import com.google.monpetitflocon.modtest.common.items.ItemTutoAxe; import com.google.monpetitflocon.modtest.common.items.ItemTutoHoe; import com.google.monpetitflocon.modtest.common.items.ItemTutoPickaxe; import com.google.monpetitflocon.modtest.common.items.ItemTutoShovel; import com.google.monpetitflocon.modtest.common.items.ItemTutoSword; import com.google.monpetitflocon.modtest.common.items.Letest; import com.google.monpetitflocon.modtest.common.items.MancheEpee; import com.google.monpetitflocon.modtest.common.items.MilieuEpee; import com.google.monpetitflocon.modtest.proxy.CommonProxy; import cpw.mods.fml.common.FMLCommonHandler; 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.registry.EntityRegistry; import cpw.mods.fml.common.registry.GameRegistry; @Mod(modid = "modtest", name = "Fantasy Mod", version = "1.0.0") public class ModTest { public static final String MODID = "modtest"; @Instance("modtest") public static ModTest instance; @SidedProxy(clientSide = "com.google.monpetitflocon.modtest.proxy.ClientProxy", serverSide ="com.google.monpetitflocon.modtest.proxy.CommonProxy") public static CommonProxy proxy; public static Item letest, fufuaple, helmetTuto, chestPlateTuto, leggingsTuto, bootsTuto, swordTuto, pickaxeTuto, axeTuto, shovelTuto, hoeTuto, MancheEpee, MilieuEpee, HautEpee,FantasyNugget,record_tuto; public static Block blockTutoriel, blockTutoriel2, blockMetadataTuto, blockTutoriel3, blocktutorialstairs,Wallblock, FantasyBlock,GreenFence,GreenStair,GreenWall,RedFence,RedStair,RedWall,PinkFence,PinkStair,PinkWall,OrangeFence,OrangeStair,OrangeWall; public static ArmorMaterial armorTuto = EnumHelper.addArmorMaterial("armorTuto", 45, new int[] {4, 9, 7, 4}, 30); public static ToolMaterial toolTuto = EnumHelper.addToolMaterial("toolTuto", 3, 1000, 12.0F, 4.0F, 20); public static ToolMaterial toolsword = EnumHelper.addToolMaterial("toolTuto", 3, 1000, 12.0F, 14.0F, 20); public static CreativeTabs FantasyBlockCreativeTabs = new FantasyBlockCreativeTabs("fantasy_block_creative_tabs"); public static CreativeTabs tutorialCreativeTabs = new TutorialCreativeTabs("tutorial_creative_tabs"); WorldGeneration worldgeneration = new WorldGeneration(); @EventHandler public void preInit(FMLPreInitializationEvent event) { letest = new Letest().setUnlocalizedName("letest").setTextureName(MODID + ":Item_letest"); fufuaple = new FufuAple(5, 1.5F, false).setAlwaysEdible().setUnlocalizedName("fufuaple").setTextureName(MODID + ":Item_fufuaple"); helmetTuto = new ItemTutoArmor(armorTuto, 0).setUnlocalizedName("helmetTuto").setTextureName(MODID + ":helmet_tutoriel"); chestPlateTuto = new ItemTutoArmor(armorTuto, 1).setUnlocalizedName("chestPlateTuto").setTextureName(MODID + ":chestplate_tutoriel"); leggingsTuto = new ItemTutoArmor(armorTuto, 2).setUnlocalizedName("leggingsTuto").setTextureName(MODID + ":leggings_tutoriel"); bootsTuto = new ItemTutoArmor(armorTuto, 3).setUnlocalizedName("bootsTuto").setTextureName(MODID + ":boots_tutoriel"); swordTuto = new ItemTutoSword(toolsword).setUnlocalizedName("swordTuto").setTextureName(MODID + "sword_tutoriel"); pickaxeTuto = new ItemTutoPickaxe(toolTuto).setUnlocalizedName("pickaxeTuto").setTextureName(MODID + ":pickaxe_tutoriel"); axeTuto = new ItemTutoAxe(toolTuto).setUnlocalizedName("axeTuto").setTextureName(MODID + ":axe_tutoriel"); shovelTuto = new ItemTutoShovel(toolTuto).setUnlocalizedName("shovelTuto").setTextureName(MODID + "shovel_tutoriel"); hoeTuto = new ItemTutoHoe(toolTuto).setUnlocalizedName("hoeTuto").setTextureName(MODID + ":hoe_tutoriel"); MancheEpee = new MancheEpee().setUnlocalizedName("MancheEpee").setTextureName(MODID + ":manche_epee"); MilieuEpee = new MilieuEpee().setUnlocalizedName("MilieuEpee").setTextureName(MODID + ":milieu_epee"); HautEpee = new HautEpee().setUnlocalizedName("HautEpee").setTextureName(MODID + ":haut_epee"); FantasyNugget = new FantasyNugget().setUnlocalizedName("FantasyNugget").setTextureName(MODID + ":fantasy_nugget"); record_tuto = new MusicDisc("tutomusique").setUnlocalizedName("tutomusiqueRecord"); GameRegistry.registerItem(letest, "item_letest"); GameRegistry.registerItem(fufuaple, "item_fufuaple"); GameRegistry.registerItem(helmetTuto, "item_tuto_helmet"); GameRegistry.registerItem(chestPlateTuto, "item_tuto_chestplate"); GameRegistry.registerItem(leggingsTuto, "item_tuto_leggings"); GameRegistry.registerItem(bootsTuto, "item_tuto_boots"); GameRegistry.registerItem(swordTuto, "item_tuto_sword"); GameRegistry.registerItem(pickaxeTuto, "item_tuto_pickaxe"); GameRegistry.registerItem(axeTuto, "item_tuto_axe"); GameRegistry.registerItem(shovelTuto, "item_tuto_shovel"); GameRegistry.registerItem(hoeTuto, "item_tuto_hoe"); GameRegistry.registerItem(MancheEpee, "manche_epee"); GameRegistry.registerItem(MilieuEpee, "milieu_epee"); GameRegistry.registerItem(HautEpee, "haut_epee"); GameRegistry.registerItem(FantasyNugget, "fantasy_nugget"); GameRegistry.registerItem(record_tuto,"tutomusiqueRecord"); blockTutoriel = new BlockOreTutoriel(Material.rock).setHardness(15.0F).setResistance(10.0F).setBlockName("tutoriel").setBlockTextureName(MODID + ":block_tutoriel"); blockTutoriel2 = new BlockTutoriel(Material.wood).setHardness(1.5F).setResistance(10.0F).setBlockName("tutoriel2").setBlockTextureName(MODID + ":block_tutoriel2"); blockMetadataTuto = new BlockTutorielMetadata().setBlockName("metadataTuto").setHardness(1.5F).setResistance(10.0F).setCreativeTab(ModTest.FantasyBlockCreativeTabs); blockTutoriel3 = new FenceBlock(MODID +":fantasy_block", Material.wood).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood).setBlockName("tutoriel3"); blocktutorialstairs = new BlockTutorialStairs(ModTest.blockTutoriel3, 0, Material.wood).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood).setBlockName("TutorialStairs").setBlockTextureName(MODID + ":fantasy_block"); Wallblock = new WallBlock(blockTutoriel3).setBlockName("WallBlock"); FantasyBlock = new FantasyBlock(Material.rock).setHardness(5.0F).setResistance(10.0F).setBlockName("FantasyBlock").setBlockTextureName(MODID + ":fantasy_block"); GreenFence = new FenceBlock(MODID +":block4", Material.wood).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood).setBlockName("green_fence"); GreenStair = new BlockTutorialStairs(ModTest.GreenFence, 0, Material.wood).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood).setBlockName("green_stair").setBlockTextureName(MODID + ":block4"); GreenWall = new GreenWall(ModTest.GreenFence).setBlockName("GreenWall"); RedFence = new FenceBlock(MODID +":block1", Material.wood).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood).setBlockName("red_fence"); RedStair = new BlockTutorialStairs(ModTest.RedFence, 0, Material.wood).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood).setBlockName("red_stair").setBlockTextureName(MODID + ":block1"); RedWall = new com.google.monpetitflocon.modtest.common.blocks.RedWall(ModTest.RedFence).setBlockName("RedWall"); PinkFence = new FenceBlock(MODID +":block2", Material.wood).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood).setBlockName("pink_fence"); PinkStair = new BlockTutorialStairs(ModTest.PinkFence, 0, Material.wood).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood).setBlockName("pink_stair").setBlockTextureName(MODID + ":block2"); PinkWall = new com.google.monpetitflocon.modtest.common.blocks.PinkWall(ModTest.PinkFence).setBlockName("PinkWall"); OrangeFence = new FenceBlock(MODID +":block3", Material.wood).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood).setBlockName("orange_fence"); OrangeStair = new BlockTutorialStairs(ModTest.OrangeFence, 0, Material.wood).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood).setBlockName("orange_stair").setBlockTextureName(MODID + ":block3"); OrangeWall = new com.google.monpetitflocon.modtest.common.blocks.OrangeWall(ModTest.OrangeFence).setBlockName("OrangeWall"); GameRegistry.registerBlock(blockTutoriel, "block_tutoriel"); GameRegistry.registerBlock(blockTutoriel2, "block_tutoriel2"); GameRegistry.registerBlock(blockMetadataTuto, ItemBlockMetadataTutoriel.class, "block_tuto_metadata", new Object[]{BlockTutorielMetadata.subBlock}); GameRegistry.registerBlock(blockTutoriel3, "block_tutoriel3"); GameRegistry.registerBlock(blocktutorialstairs, "TutorialStairs"); GameRegistry.registerBlock(Wallblock, "Wall_block"); GameRegistry.registerBlock(FantasyBlock, "Fantasy_block"); GameRegistry.registerBlock(GreenFence, "green_fence"); GameRegistry.registerBlock(GreenStair, "green_stair"); GameRegistry.registerBlock(GreenWall, "green_wall"); GameRegistry.registerBlock(RedFence, "red_fence"); GameRegistry.registerBlock(RedStair, "red_stair"); GameRegistry.registerBlock(RedWall, "red_wall"); GameRegistry.registerBlock(PinkFence, "pink_fence"); GameRegistry.registerBlock(PinkStair, "pink_stair"); GameRegistry.registerBlock(PinkWall, "pink_wall"); GameRegistry.registerBlock(OrangeFence, "orange_fence"); GameRegistry.registerBlock(OrangeStair, "orange_stair"); GameRegistry.registerBlock(OrangeWall, "orange_wall"); GameRegistry.registerWorldGenerator(worldgeneration, 0); } public static BiomeGenBase[] allBiomes = { BiomeGenBase.plains, BiomeGenBase.extremeHills, BiomeGenBase.beach, BiomeGenBase.desert, BiomeGenBase.desertHills, BiomeGenBase.extremeHillsEdge, BiomeGenBase.forest, BiomeGenBase.forestHills, BiomeGenBase.icePlains, BiomeGenBase.iceMountains, BiomeGenBase.river, BiomeGenBase.birchForest, BiomeGenBase.birchForestHills, BiomeGenBase.coldBeach, BiomeGenBase.coldTaiga, BiomeGenBase.coldTaigaHills, BiomeGenBase.deepOcean, BiomeGenBase.extremeHillsPlus, BiomeGenBase.jungleEdge, BiomeGenBase.megaTaiga, BiomeGenBase.megaTaigaHills, BiomeGenBase.mesa, BiomeGenBase.mesaPlateau, BiomeGenBase.mesaPlateau_F, BiomeGenBase.roofedForest, BiomeGenBase.savanna, BiomeGenBase.savannaPlateau, BiomeGenBase.stoneBeach }; @EventHandler public void init(FMLInitializationEvent event) { MinecraftForge.EVENT_BUS.register(new LivingEventHandler()); FMLCommonHandler.instance().bus().register(new PlayerEventHandler()); MinecraftForge.EVENT_BUS.register(new PlayerEventHandler()); EntityRegistry.registerGlobalEntityID(EntityMonMob.class, "MobTuto", EntityRegistry.findGlobalUniqueEntityId(), new Color(97, 0, 255).getRGB(), new Color(146, 91, 255).getRGB()); EntityRegistry.registerModEntity(EntityMonMob.class, "MobTuto", 430, ModTest.instance, 40, 1, true); EntityRegistry.addSpawn(EntityMonMob.class, 9, 1, 3, EnumCreatureType.creature, allBiomes); EntityRegistry.registerGlobalEntityID(Aznching.class, "Aznching", EntityRegistry.findGlobalUniqueEntityId(), new Color(97, 0, 255).getRGB(), new Color(146, 91, 255).getRGB()); EntityRegistry.registerModEntity(Aznching.class, "Aznching", 431, ModTest.instance, 40, 1, true); EntityRegistry.addSpawn(Aznching.class, 9, 1, 3, EnumCreatureType.creature, allBiomes); EntityRegistry.registerGlobalEntityID(Oxilac.class, "Oxilac", EntityRegistry.findGlobalUniqueEntityId(), new Color(97, 0, 255).getRGB(), new Color(146, 91, 255).getRGB()); EntityRegistry.registerModEntity(Oxilac.class, "Oxilac", 432, ModTest.instance, 40, 1, true); EntityRegistry.addSpawn(Oxilac.class, 9, 1, 3, EnumCreatureType.creature, allBiomes); EntityRegistry.registerGlobalEntityID(Darkheaven.class, "Darkheaven", EntityRegistry.findGlobalUniqueEntityId(), new Color(97, 0, 255).getRGB(), new Color(146, 91, 255).getRGB()); EntityRegistry.registerModEntity(Darkheaven.class, "Darkheaven", 433, ModTest.instance, 40, 1, true); EntityRegistry.addSpawn(Darkheaven.class, 9, 1, 3, EnumCreatureType.creature, allBiomes); proxy.registerRender(); ItemStack itemenchante = new ItemStack(swordTuto, 1, 0); itemenchante.addEnchantment(Enchantment.knockback, 5); itemenchante.addEnchantment(Enchantment.looting, 2); itemenchante.addEnchantment(Enchantment.baneOfArthropods, 2); itemenchante.addEnchantment(Enchantment.sharpness, 5); itemenchante.addEnchantment(Enchantment.smite, 4); //Recipes GameRegistry.addRecipe(new ItemStack(helmetTuto), new Object[]{"XXX", "X X", " ", 'X', ModTest.letest}); GameRegistry.addRecipe(new ItemStack(chestPlateTuto), new Object[]{"X X", "XXX", "XXX", 'X', ModTest.letest}); GameRegistry.addRecipe(new ItemStack(leggingsTuto), new Object[]{"XXX", "X X", "X X", 'X', ModTest.letest}); GameRegistry.addRecipe(new ItemStack(bootsTuto), new Object[]{" ", "X X", "X X", 'X', ModTest.letest}); GameRegistry.addRecipe(itemenchante, new Object[]{"X ", " Y ", " Z", 'X', ModTest.HautEpee, 'Y', new ItemStack(ModTest.MilieuEpee), 'Z', new ItemStack(ModTest.MancheEpee),}); GameRegistry.addRecipe(new ItemStack(pickaxeTuto), new Object[]{"XXX", " Y ", " Y ", 'X', ModTest.letest, 'Y', new ItemStack(Items.stick),}); GameRegistry.addRecipe(new ItemStack(axeTuto), new Object[]{" XX", " YX", " Y ", 'X', ModTest.letest, 'Y', new ItemStack(Items.stick),}); GameRegistry.addRecipe(new ItemStack(shovelTuto), new Object[]{" X ", " Y ", " Y ", 'X', ModTest.letest, 'Y', new ItemStack(Items.stick),}); GameRegistry.addRecipe(new ItemStack(hoeTuto), new Object[]{"XX ", " Y ", " Y ", 'X', ModTest.letest, 'Y', new ItemStack(Items.stick),}); GameRegistry.addRecipe(new ItemStack(blockTutoriel2), new Object[]{"XY ", "ZA ", " ", 'X', ModTest.fufuaple, 'Y', new ItemStack(Items.cooked_porkchop), 'Z', new ItemStack(Blocks.wool), 'A', new ItemStack(Blocks.wool, 1, 15),}); GameRegistry.addRecipe(new ItemStack(fufuaple), new Object[]{"XXX", "XYX", "XXX", 'X',ModTest.letest, 'Y', new ItemStack(Items.golden_apple),}); GameRegistry.addRecipe(new ItemStack(FantasyBlock), new Object[]{"XXX", "XXX", "XXX", 'X',ModTest.letest, }); GameRegistry.addRecipe(new ItemStack(letest, 9), new Object[]{"X ", " ", " ", 'X',ModTest.FantasyBlock, }); GameRegistry.addRecipe(new ItemStack(FantasyNugget , 9), new Object[]{"X ", " ", " ", 'X',ModTest.letest, }); GameRegistry.addRecipe(new ItemStack(letest), new Object[]{"XXX", "XXX", "XXX", 'X',ModTest.FantasyNugget, }); GameRegistry.addRecipe(new ItemStack(blockTutoriel3, 3), new Object[]{" ", "XYX", "XYX", 'X',ModTest.FantasyNugget, 'Y', new ItemStack(Items.stick),}); GameRegistry.addRecipe(new ItemStack(Wallblock, 6), new Object[]{" ", "XXX", "XXX", 'X',ModTest.FantasyNugget, }); GameRegistry.addRecipe(new ItemStack(blocktutorialstairs, 4), new Object[]{" X", " XX", "XXX", 'X',ModTest.FantasyNugget, }); GameRegistry.addRecipe(new ItemStack(blockMetadataTuto, 1, 0), new Object[]{"XY ", " ", " ", 'X',ModTest.FantasyBlock, 'Y', new ItemStack(Items.dye, 1, 1),}); GameRegistry.addRecipe(new ItemStack(blockMetadataTuto, 1, 1), new Object[]{"XY ", " ", " ", 'X',ModTest.FantasyBlock, 'Y', new ItemStack(Items.dye, 1, 9),}); GameRegistry.addRecipe(new ItemStack(blockMetadataTuto, 1, 2), new Object[]{"XY ", " ", " ", 'X',ModTest.FantasyBlock, 'Y', new ItemStack(Items.dye, 1, 14),}); GameRegistry.addRecipe(new ItemStack(blockMetadataTuto, 1, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.FantasyBlock, 'Y', new ItemStack(Items.dye, 1, 10),}); GameRegistry.addRecipe(new ItemStack(GreenWall, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.Wallblock, 'Y', new ItemStack(Items.dye, 3, 10),}); GameRegistry.addRecipe(new ItemStack(RedWall, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.Wallblock, 'Y', new ItemStack(Items.dye, 3, 1),}); GameRegistry.addRecipe(new ItemStack(PinkWall, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.Wallblock, 'Y', new ItemStack(Items.dye, 3, 9),}); GameRegistry.addRecipe(new ItemStack(OrangeWall, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.Wallblock, 'Y', new ItemStack(Items.dye, 3, 14),}); GameRegistry.addRecipe(new ItemStack(GreenFence, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.blockTutoriel3, 'Y', new ItemStack(Items.dye, 3, 10),}); GameRegistry.addRecipe(new ItemStack(RedFence, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.blockTutoriel3, 'Y', new ItemStack(Items.dye, 3, 1),}); GameRegistry.addRecipe(new ItemStack(PinkFence, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.blockTutoriel3, 'Y', new ItemStack(Items.dye, 3, 9),}); GameRegistry.addRecipe(new ItemStack(OrangeFence, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.blockTutoriel3, 'Y', new ItemStack(Items.dye, 3, 14),}); GameRegistry.addRecipe(new ItemStack(GreenStair, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.blocktutorialstairs, 'Y', new ItemStack(Items.dye, 3, 10),}); GameRegistry.addRecipe(new ItemStack(RedStair, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.blocktutorialstairs, 'Y', new ItemStack(Items.dye, 3, 1),}); GameRegistry.addRecipe(new ItemStack(PinkStair, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.blocktutorialstairs, 'Y', new ItemStack(Items.dye, 3, 9),}); GameRegistry.addRecipe(new ItemStack(OrangeStair, 3), new Object[]{"XY ", " ", " ", 'X',ModTest.blocktutorialstairs, 'Y', new ItemStack(Items.dye, 3, 14),}); //Oeufs de mobs GameRegistry.addRecipe(new ItemStack(Items.spawn_egg, 1, 51), new Object[]{"XY ", " ", " ", 'X',Items.bone, 'Y', new ItemStack(Items.egg),}); //Squelette GameRegistry.addRecipe(new ItemStack(Items.spawn_egg, 1, 50), new Object[]{"XY ", " ", " ", 'X',Items.gunpowder, 'Y', new ItemStack(Items.egg),}); //Creeper GameRegistry.addRecipe(new ItemStack(Items.spawn_egg, 1, 52), new Object[]{"XY ", " ", " ", 'X',Items.spider_eye, 'Y', new ItemStack(Items.egg),}); //Araignée GameRegistry.addRecipe(new ItemStack(Items.spawn_egg, 1, 54), new Object[]{"XY ", " ", " ", 'X',Items.rotten_flesh, 'Y', new ItemStack(Items.egg),}); //Zombie GameRegistry.addRecipe(new ItemStack(Items.spawn_egg, 1, 55), new Object[]{"XY ", " ", " ", 'X',Items.slime_ball, 'Y', new ItemStack(Items.egg),}); GameRegistry.addRecipe(new ItemStack(Items.spawn_egg, 1, 56), new Object[]{"XY ", " ", " ", 'X',Items.ghast_tear, 'Y', new ItemStack(Items.egg),}); //Ghast GameRegistry.addRecipe(new ItemStack(Items.spawn_egg, 1, 57), new Object[]{"XY ", " ", " ", 'X',Items.golden_sword, 'Y', new ItemStack(Items.egg),}); //Cochon Zombie GameRegistry.addRecipe(new ItemStack(Items.spawn_egg, 1, 58), new Object[]{"XY ", " ", " ", 'X',Items.ender_pearl, 'Y', new ItemStack(Items.egg),}); //Enderman GameRegistry.addRecipe(new ItemStack(Items.spawn_egg, 1, 59), new Object[]{"XY ", " ", " ", 'X',Items.fermented_spider_eye, 'Y', new ItemStack(Items.egg),}); //Cave Spider GameRegistry.addRecipe(new ItemStack(Items.spawn_egg, 1, 61), new Object[]{"XY ", " ", " ", 'X',Items.blaze_rod, 'Y', new ItemStack(Items.egg),}); //Blaze GameRegistry.addRecipe(new ItemStack(Items.spawn_egg, 1, 62), new Object[]{"XY ", " ", " ", 'X',Items.magma_cream, 'Y', new ItemStack(Items.egg),}); // Cube de Magma GameRegistry.addRecipe(new ItemStack(Items.spawn_egg, 1, 66), new Object[]{"XY ", " ", " ", 'X',Items.glass_bottle, 'Y', new ItemStack(Items.egg),}); // Sorcière //Oeufs D'animaux GameRegistry.addRecipe(new ItemStack(Items.spawn_egg, 1, 90), new Object[]{"XY ", " ", " ", 'X',Items.porkchop, 'Y', new ItemStack(Items.egg),}); // Cochon GameRegistry.addRecipe(new ItemStack(Items.spawn_egg, 1, 91), new Object[]{"XY ", " ", " ", 'X',Blocks.wool, 'Y', new ItemStack(Items.egg),}); // Mouton GameRegistry.addRecipe(new ItemStack(Items.spawn_egg, 1, 92), new Object[]{"XY ", " ", " ", 'X',Items.beef, 'Y', new ItemStack(Items.egg),}); // Vache GameRegistry.addRecipe(new ItemStack(Items.spawn_egg, 1, 93), new Object[]{"XY ", " ", " ", 'X',Items.feather, 'Y', new ItemStack(Items.egg),}); // Poule GameRegistry.addRecipe(new ItemStack(Items.spawn_egg, 1, 94), new Object[]{"XY ", " ", " ", 'X',Items.dye, 'Y', new ItemStack(Items.egg),}); // Poulpe GameRegistry.addRecipe(new ItemStack(Items.spawn_egg, 1, 95), new Object[]{"XY ", " ", " ", 'X',Items.cooked_beef, 'Y', new ItemStack(Items.egg),}); // Loup GameRegistry.addRecipe(new ItemStack(Items.spawn_egg, 1, 96), new Object[]{"XY ", " ", " ", 'X',Items.mushroom_stew, 'Y', new ItemStack(Items.egg),}); // Champimeuh GameRegistry.addRecipe(new ItemStack(Items.spawn_egg, 1, 98), new Object[]{"XY ", " ", " ", 'X',Items.fish, 'Y', new ItemStack(Items.egg),}); // Ocelot GameRegistry.addRecipe(new ItemStack(Items.spawn_egg, 1, 100), new Object[]{"XY ", " ", " ", 'X',Items.leather, 'Y', new ItemStack(Items.egg),}); // Cheval GameRegistry.addRecipe(new ItemStack(Items.spawn_egg, 1, 120), new Object[]{"XY ", " ", " ", 'X',Items.emerald, 'Y', new ItemStack(Items.egg),}); // Villager //Parts GameRegistry.addRecipe(new ItemStack(ModTest.MancheEpee), new Object[]{" Y", " Y ", "X ", 'X',ModTest.letest, 'Y', new ItemStack(Items.stick),}); // Manche Epee GameRegistry.addRecipe(new ItemStack(ModTest.MilieuEpee), new Object[]{"X X", " X ", " ", 'X',ModTest.letest,}); // Milieu Epee GameRegistry.addRecipe(new ItemStack(ModTest.HautEpee), new Object[]{" X ", "XYX", "XYX", 'X',ModTest.letest, 'Y', new ItemStack(Items.diamond),}); // Haut Epee } @EventHandler public void postInit(FMLPostInitializationEvent event) { } public void addEntity(Class entityClass, String name, int id, int backgroundEggColour,int foregroundEggColour, int freq, int min, int max, EnumCreatureType typeOfTheCreature) { EntityRegistry.registerGlobalEntityID(entityClass, name, EntityRegistry.findGlobalUniqueEntityId(), backgroundEggColour, foregroundEggColour); EntityRegistry.registerModEntity(entityClass, name, id, this, 40, 1, true); EntityRegistry.addSpawn((Class) entityClass, freq, min, max, typeOfTheCreature, allBiomes); } }
:::
j’ai aussi un bug de texture sur l’épée et la pelle si tu trouve moi je suis en train de chercher mais sa devrait etre assez simple a trouver
sinon aucun spawn naturel sur ma superflatedit : dans la console il me dit quil ne trouve pas modtestsword_tutoriel alors que j’ai déclarer sword_tutoriel
vers la ligne 91 et pour la pelle sa doit etre pareilC’est sûrement car tu as dû te tromper de nom pour la texture : -elel doit se trouver dans assets/textures/items/taTexture.png
Et surtout ses dimensions doivent être des carrés de deux et identiques ! (16x16), (32x32), (128x128), (1024x1024), etc……
Quant au problème des mobs, je ne sais pas trop je n’ai pas regardé + que ça mais vérifies tout de même que tu n’es pas en peaceful ^^ -
pour la texture c’est bon j’avais oublier de remetre les deux point apres le + sinon je suis en normal
et scarex a parler de .monster a la place de .creature mais monster dapres ce que j’ai vu c’est spawn dans les caves bon je test ça
edit : ne change absolument rien -
@‘monpetitflocon’:
pour la texture c’est bon j’avais oublier de remetre les deux point apres le + sinon je suis en normal
et scarex a parler de .monster a la place de .creature mais monster dapres ce que j’ai vu c’est spawn dans les caves bon je test ça
edit : ne change absolument rienQuel est le type de ton mob ?
-
c’est un mob basic un steve le meme qu’elias 54 a fait dans sa vidéo la meme classe
bon ok tient :classe du mob:
:::package com.google.monpetitflocon.modtest.common.entity; import com.google.monpetitflocon.modtest.common.ModTest; import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.monster.EntityMob; import net.minecraft.item.Item; import net.minecraft.world.World; public class EntityMonMob extends EntityMob { public EntityMonMob(World world) { super(world); this.setCustomNameTag("Furious Jumper"); } public void applyEntityAttributes() { super.applyEntityAttributes(); this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(50D); this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(8.0D); this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(1.0D); } protected void dropFewItems(boolean p_70628_1_, int p_70628_2_) { // un item this.dropItem(ModTest.letest, 1); this.dropItem(ModTest.fufuaple, 1); // un block this.dropItem(Item.getItemFromBlock(ModTest.FantasyBlock), 1); } }
:::
render du mob :
:::package com.google.monpetitflocon.modtest.client; import com.google.monpetitflocon.modtest.common.ModTest; import com.google.monpetitflocon.modtest.common.entity.EntityMonMob; import net.minecraft.client.model.ModelBiped; import net.minecraft.client.renderer.entity.RenderBiped; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLiving; import net.minecraft.item.Item; import net.minecraft.util.ResourceLocation; public class RenderMonMob extends RenderBiped { public final ResourceLocation texture = new ResourceLocation (ModTest.MODID, "textures/entity/mob_tutoriel.png"); public RenderMonMob(ModelBiped par1ModelBiped) { super(par1ModelBiped, 0.5F); } public ResourceLocation bindEntityTexture(EntityMonMob mob) { return texture; } protected ResourceLocation getEntityTexture(EntityLiving entity) { return bindEntityTexture((EntityMonMob)entity); } }
:::
-
Il vaut mieux mettre monster ou ambient alors.
-
monster ne change rien et ambient c’est pour les caves et je suis pas sur que sa joue j’irais test dans les autres biomes des que je pourrais
edit : ambient marche trop bien la nuit j’ai des mobs partout trop meme pour monster j’en ai vu que 1! et pour créature 0 ! je cromprends rien sauf pour l’ambient le spawn est trop eleverr et le taux et le meme pour tout mes mobs donc je comprends rien du tout -
monster -> monstres (type zombie)
ambient -> bestioles qui ne servent à rien (type chauve souris)
creature -> animaux (type cochon) -
merci beaucoup a toi et ambient c si tu est dans la nuit ton mob sera partout