Résolu Probleme résolu + explication a bush à XP
-
Le @Override est bien présent et eclipse n’indique aucune erreur ? Si oui envoi le code de l’item et de la classe principale
-
@Override est présent mais eclipse veut l’enlever
Je te passe tout ça !
Classe principale :
package fr.xperiaonline.xperiamod.common; 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.GameRegistry; import fr.xperiaonline.xperiamod.proxy.CommonProxy; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; 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.minecraftforge.common.util.EnumHelper; @Mod(modid = "xperiamod", name = "Xpéria Mod", version = "1.0") public class XperiaMod { @Instance("xperiamod") public static XperiaMod instance; @SidedProxy(clientSide = "fr.xperiaonline.xperiamod.proxy.ClientProxy", serverSide = "fr.xperiaonline.xperiamod.proxy.CommonProxy") public static CommonProxy proxy; public static Item rubyIngot, topazIngot, synisiteIngot, jadeIngot, xperiteIngot, helmetRuby, chestPlateRuby, leggingsRuby, bootsRuby, helmettopaz, chestPlatetopaz, leggingstopaz, bootstopaz, helmetsynisite, chestPlatesynisite, leggingssynisite, bootssynisite,helmetjade,chestPlatejade,leggingsjade,bootsjade,helmetxperite,chestPlatexperite,leggingsxperite,bootsxperite; public static Item rubySword, rubyPickaxe, rubyAxe, rubyShovel; public static Item topazSword, topazPickaxe, topazAxe, topazShovel; public static Item synisiteSword, synisitePickaxe, synisiteAxe, synisiteShovel; public static Item jadeSword, jadePickaxe, jadeAxe, jadeShovel; public static Item xperiteSword, xperitePickaxe, xperiteAxe, xperiteShovel; public static Item ironStick, xpDust; public static Item xperiteHammer; public static Block rubyOre, topazOre, synisiteOre, jadeOre, xperiteOre, rubyBlock, topazBlock, synisiteBlock, jadeBlock, xperiteBlock, xpBush; public static ArmorMaterial ruby = EnumHelper.addArmorMaterial("ruby", 17, new int[]{3, 6, 5, 3}, 10); public static ArmorMaterial topaz = EnumHelper.addArmorMaterial("topaz", 18, new int[]{3, 6, 6, 3}, 10); public static ArmorMaterial synisite = EnumHelper.addArmorMaterial("synisite", 18, new int[]{4, 6, 6, 4}, 12); public static ArmorMaterial jade = EnumHelper.addArmorMaterial("jade", 25, new int[]{6, 6, 6, 5}, 12); public static ArmorMaterial xperite = EnumHelper.addArmorMaterial("xperite", 30, new int[]{6, 6, 6, 6}, 14); public static ToolMaterial rubyTool = EnumHelper.addToolMaterial("ruby", 2, 300, 7.0F, 2.5F, 14); public static ToolMaterial topazTool = EnumHelper.addToolMaterial("topaz", 2, 700, 9.0F, 3F, 14); public static ToolMaterial synisiteTool = EnumHelper.addToolMaterial("synisite", 900, 300, 3F, 4F, 14); public static ToolMaterial jadeTool = EnumHelper.addToolMaterial("jade", 3, 1200, 14F, 6F, 14); public static ToolMaterial wperiteTool = EnumHelper.addToolMaterial("xperite", 3, 2100, 22F, 8F, 14); @EventHandler public void preInit(FMLPreInitializationEvent event) { //La generation WorldRegister.mainRegsitry(); //Les outils ! rubySword = new ItemRubySword(rubyTool).setUnlocalizedName("rubySword").setTextureName("xperiamod:ruby_sword"); rubyPickaxe = new ItemRubyPickaxe(rubyTool).setUnlocalizedName("rubyPickaxe").setTextureName("xperiamod:ruby_pickaxe"); rubyAxe = new ItemRubyAxe(rubyTool).setUnlocalizedName("rubyAxe").setTextureName("xperiamod:ruby_axe"); rubyShovel = new ItemRubyShovel(rubyTool).setUnlocalizedName("rubyShovel").setTextureName("xperiamod:ruby_shovel"); topazSword = new ItemTopazSword(topazTool).setUnlocalizedName("topazSword").setTextureName("xperiamod:topaz_sword"); topazPickaxe = new ItemTopazPickaxe(topazTool).setUnlocalizedName("topazickaxe").setTextureName("xperiamod:topaz_pickaxe"); topazAxe = new ItemTopazAxe(topazTool).setUnlocalizedName("topazAxe").setTextureName("xperiamod:topaz_axe"); topazShovel = new ItemTopazShovel(topazTool).setUnlocalizedName("topazShovel").setTextureName("xperiamod:topaz_shovel"); synisiteSword = new ItemSynisiteSword(synisiteTool).setUnlocalizedName("synisiteSword").setTextureName("xperiamod:synisite_sword"); synisitePickaxe = new ItemSynisitePickaxe(synisiteTool).setUnlocalizedName("synisitePickaxe").setTextureName("xperiamod:synisite_pickaxe"); synisiteAxe = new ItemSynisiteAxe(synisiteTool).setUnlocalizedName("synisiteAxe").setTextureName("xperiamod:synisite_axe"); synisiteShovel = new ItemSynisiteShovel(synisiteTool).setUnlocalizedName("synisiteShovel").setTextureName("xperiamod:synisite_shovel"); jadeSword = new ItemJadeSword(jadeTool).setUnlocalizedName("jadeSword").setTextureName("xperiamod:jade_sword"); jadePickaxe = new ItemJadePickaxe(jadeTool).setUnlocalizedName("jadePickaxe").setTextureName("xperiamod:jade_pickaxe"); jadeAxe = new ItemJadeAxe(jadeTool).setUnlocalizedName("jadeAxe").setTextureName("xperiamod:jade_axe"); jadeShovel = new ItemJadeShovel(jadeTool).setUnlocalizedName("jadeShovel").setTextureName("xperiamod:jade_shovel"); xperiteSword = new ItemXperiteSword(wperiteTool).setUnlocalizedName("xperiteSword").setTextureName("xperiamod:xperite_sword");; xperitePickaxe = new ItemXperitePickaxe(wperiteTool).setUnlocalizedName("xperitePickaxe").setTextureName("xperiamod:xperite_pickaxe"); xperiteAxe = new ItemXperiteAxe(wperiteTool).setUnlocalizedName("xperiteAxe").setTextureName("xperiamod:xperite_axe"); xperiteShovel = new ItemXperiteShovel(wperiteTool).setUnlocalizedName("xperiteShovel").setTextureName("xperiamod:xperite_shovel"); //Le HAMMER !!!! xperiteHammer = new ItemXperiteHammer(wperiteTool).setUnlocalizedName("xperiteHammer").setTextureName("xperiamod:xperite_hammer"); //XPDust xpDust = new Item().setUnlocalizedName("xpDust").setTextureName("xperiamod:xp_dust").setCreativeTab(CreativeTabs.tabMaterials); GameRegistry.registerItem(xpDust, "item.xp.dust"); GameRegistry.registerItem(rubySword, "item.ruby.sword"); GameRegistry.registerItem(rubyPickaxe, "item.ruby.pickaxe"); GameRegistry.registerItem(rubyAxe, "item.ruby.axe"); GameRegistry.registerItem(rubyShovel, "item.ruby.shovel"); GameRegistry.registerItem(topazSword, "item.topaz.sword"); GameRegistry.registerItem(topazPickaxe, "item.topaz.pickaxe"); GameRegistry.registerItem(topazAxe, "item.topaz.axe"); GameRegistry.registerItem(topazShovel, "item.topaz.shovel"); GameRegistry.registerItem(synisiteSword, "item.synisite.sword"); GameRegistry.registerItem(synisitePickaxe, "item.synisite.pickaxe"); GameRegistry.registerItem(synisiteAxe, "item.synisite.axe"); GameRegistry.registerItem(synisiteShovel, "item.synisite.shovel"); GameRegistry.registerItem(jadeSword, "item.jade.sword"); GameRegistry.registerItem(jadePickaxe, "item.jade.pickaxe"); GameRegistry.registerItem(jadeAxe, "item.jade.axe"); GameRegistry.registerItem(jadeShovel, "item.jade.shovel"); GameRegistry.registerItem(xperiteSword, "item.xperite.sword"); GameRegistry.registerItem(xperitePickaxe, "item.xperite.pickaxe"); GameRegistry.registerItem(xperiteAxe, "item.xperite.axe"); GameRegistry.registerItem(xperiteShovel, "item.xperite.shovel"); GameRegistry.registerItem(xperiteHammer, "item.xperite.hammer"); //Les armures helmetRuby = new ItemArmorRuby(ruby, 0).setUnlocalizedName("helmetRuby").setTextureName("xperiamod:ruby_helmet"); chestPlateRuby = new ItemArmorRuby(ruby, 1).setUnlocalizedName("chestPlateRuby").setTextureName("xperiamod:ruby_chestplate"); leggingsRuby = new ItemArmorRuby(ruby, 2).setUnlocalizedName("leggingsRuby").setTextureName("xperiamod:ruby_leggings"); bootsRuby = new ItemArmorRuby(ruby, 3).setUnlocalizedName("bootsRuby").setTextureName("xperiamod:ruby_boots"); helmettopaz = new ItemArmorTopaz(topaz, 0).setUnlocalizedName("helmetTopaz").setTextureName("xperiamod:topaz_helmet"); chestPlatetopaz = new ItemArmorTopaz(topaz, 1).setUnlocalizedName("chestTopaz").setTextureName("xperiamod:topaz_chestplate"); leggingstopaz = new ItemArmorTopaz(topaz, 2).setUnlocalizedName("leggingsTopaz").setTextureName("xperiamod:topaz_leggings"); bootstopaz = new ItemArmorTopaz(topaz, 3).setUnlocalizedName("bootsTopaz").setTextureName("xperiamod:topaz_boots"); helmetsynisite = new ItemArmorSynisite(synisite, 0).setUnlocalizedName("helmetSynisite").setTextureName("xperiamod:synisite_helmet"); chestPlatesynisite = new ItemArmorSynisite(synisite, 1).setUnlocalizedName("chestSynisite").setTextureName("xperiamod:synisite_chestplate"); leggingssynisite = new ItemArmorSynisite(synisite, 2).setUnlocalizedName("leggingsSynisite").setTextureName("xperiamod:synisite_leggings"); bootssynisite = new ItemArmorSynisite(synisite, 3).setUnlocalizedName("bootsSynisite").setTextureName("xperiamod:synisite_boots"); helmetjade = new ItemArmorJade(jade, 0).setUnlocalizedName("helmetJade").setTextureName("xperiamod:jade_helmet"); chestPlatejade = new ItemArmorJade(jade, 1).setUnlocalizedName("chestJade").setTextureName("xperiamod:jade_chestplate"); leggingsjade = new ItemArmorJade(jade, 2).setUnlocalizedName("leggingsJade").setTextureName("xperiamod:jade_leggings"); bootsjade = new ItemArmorJade(jade, 3).setUnlocalizedName("bootsJade").setTextureName("xperiamod:jade_boots"); helmetxperite = new ItemArmorXperite(xperite, 0).setUnlocalizedName("helmetXperite").setTextureName("xperiamod:xperite_helmet"); chestPlatexperite = new ItemArmorXperite(xperite, 1).setUnlocalizedName("chestXperite").setTextureName("xperiamod:xperite_chestplate"); leggingsxperite = new ItemArmorXperite(xperite, 2).setUnlocalizedName("leggingsXperite").setTextureName("xperiamod:xperite_leggings"); bootsxperite = new ItemArmorXperite(xperite, 3).setUnlocalizedName("bootsXperite").setTextureName("xperiamod:xperite_boots"); GameRegistry.registerItem(helmetRuby, "item_ruby_helmet"); GameRegistry.registerItem(chestPlateRuby, "item_ruby_chestplate"); GameRegistry.registerItem(leggingsRuby, "item_ruby_leggings"); GameRegistry.registerItem(bootsRuby, "item_ruby_boots"); GameRegistry.registerItem(helmettopaz, "item_topaz_helmet"); GameRegistry.registerItem(chestPlatetopaz, "item_topaz_chestplate"); GameRegistry.registerItem(leggingstopaz, "item_topaz_leggings"); GameRegistry.registerItem(bootstopaz, "item_topaz_boots"); GameRegistry.registerItem(helmetsynisite, "item_synisite_helmet"); GameRegistry.registerItem(chestPlatesynisite, "item_synisite_chestplate"); GameRegistry.registerItem(leggingssynisite, "item_synisite_leggings"); GameRegistry.registerItem(bootssynisite, "item_synisite_boots"); GameRegistry.registerItem(helmetjade, "item_jade_helmet"); GameRegistry.registerItem(chestPlatejade, "item_jade_chestplate"); GameRegistry.registerItem(leggingsjade, "item_jade_leggings"); GameRegistry.registerItem(bootsjade, "item_jade_boots"); GameRegistry.registerItem(helmetxperite, "item_xperite_helmet"); GameRegistry.registerItem(chestPlatexperite, "item_xperite_chestplate"); GameRegistry.registerItem(leggingsxperite, "item_xperite_leggings"); GameRegistry.registerItem(bootsxperite, "item_xperite_boots"); //Les items rubyIngot = new Ingot().setUnlocalizedName("rubyIngot").setTextureName("xperiamod:ruby_ingot").setCreativeTab(CreativeTabs.tabMaterials); topazIngot = new Ingot().setUnlocalizedName("topazIngot").setTextureName("xperiamod:topaz_ingot").setCreativeTab(CreativeTabs.tabMaterials); synisiteIngot = new Ingot().setUnlocalizedName("synisiteIngot").setTextureName("xperiamod:synisite_ingot").setCreativeTab(CreativeTabs.tabMaterials); jadeIngot = new Ingot().setUnlocalizedName("jadeIngot").setTextureName("xperiamod:jade_ingot").setCreativeTab(CreativeTabs.tabMaterials); xperiteIngot = new Ingot().setUnlocalizedName("xperiteIngot").setTextureName("xperiamod:xperite_ingot").setCreativeTab(CreativeTabs.tabMaterials); ironStick = new Item().setUnlocalizedName("ironStick").setTextureName("xperiamod:iron_stick").setCreativeTab(CreativeTabs.tabMaterials); GameRegistry.registerItem(rubyIngot, "xperiaModRI"); GameRegistry.registerItem(topazIngot, "xperiaModTI"); GameRegistry.registerItem(synisiteIngot, "xperiaModSI"); GameRegistry.registerItem(jadeIngot, "xperiaModJI"); GameRegistry.registerItem(xperiteIngot, "xperiaModXI"); GameRegistry.registerItem(ironStick, "item.iron_stick"); //Les blocks rubyOre = new BlockMod(Material.rock).setBlockName("rubyOre").setBlockTextureName("xperiamod:ruby_ore").setCreativeTab(CreativeTabs.tabBlock); topazOre = new BlockMod(Material.rock).setBlockName("topazOre").setBlockTextureName("xperiamod:topaz_ore").setCreativeTab(CreativeTabs.tabBlock); synisiteOre = new BlockMod(Material.rock).setBlockName("synisiteOre").setBlockTextureName("xperiamod:synisite_ore").setCreativeTab(CreativeTabs.tabBlock); jadeOre = new BlockMod(Material.rock).setBlockName("jadeOre").setBlockTextureName("xperiamod:jade_ore").setCreativeTab(CreativeTabs.tabBlock); xperiteOre = new BlockMod(Material.rock).setBlockName("xperiteOre").setBlockTextureName("xperiamod:xperite_ore").setCreativeTab(CreativeTabs.tabBlock); rubyBlock = new BlockMod(Material.rock).setBlockName("rubyBlock").setBlockTextureName("xperiamod:ruby_Block").setCreativeTab(CreativeTabs.tabBlock); topazBlock = new BlockMod(Material.rock).setBlockName("topazBlock").setBlockTextureName("xperiamod:topaz_Block").setCreativeTab(CreativeTabs.tabBlock); synisiteBlock = new BlockMod(Material.rock).setBlockName("synisiteBlock").setBlockTextureName("xperiamod:synisite_Block").setCreativeTab(CreativeTabs.tabBlock); jadeBlock = new BlockMod(Material.rock).setBlockName("jadeBlock").setBlockTextureName("xperiamod:jade_Block").setCreativeTab(CreativeTabs.tabBlock); xperiteBlock = new BlockMod(Material.rock).setBlockName("xperiteBlock").setBlockTextureName("xperiamod:xperite_block").setCreativeTab(CreativeTabs.tabBlock); xpBush = new BlockModBush().setBlockName("xpBush").setCreativeTab(CreativeTabs.tabBlock); GameRegistry.registerBlock(rubyOre, "xperiamodRO"); GameRegistry.registerBlock(topazOre, "xperiamodTO"); GameRegistry.registerBlock(synisiteOre, "xperiamodSO"); GameRegistry.registerBlock(jadeOre, "xperiamodJO"); GameRegistry.registerBlock(xperiteOre, "xperiamodXO"); GameRegistry.registerBlock(rubyBlock, "xperiamodRB"); GameRegistry.registerBlock(topazBlock, "xperiamodTB"); GameRegistry.registerBlock(synisiteBlock, "xperiamodSB"); GameRegistry.registerBlock(jadeBlock, "xperiamodJB"); GameRegistry.registerBlock(xperiteBlock, "xperiamodXB"); GameRegistry.registerBlock(xpBush, ItemBlockModBush.class, "xp_Bush"); } @EventHandler public void init(FMLInitializationEvent event) { //les cuissons GameRegistry.addSmelting(rubyOre, new ItemStack(rubyIngot, 1), 1.0f); GameRegistry.addSmelting(topazOre, new ItemStack(topazIngot, 1), 3.1f); GameRegistry.addSmelting(synisiteOre, new ItemStack(synisiteIngot, 1), 5.1f); GameRegistry.addSmelting(jadeOre, new ItemStack(jadeIngot, 1), 8.1f); GameRegistry.addSmelting(xperiteOre, new ItemStack(xperiteIngot, 1), 10.1f); //Les craft des block GameRegistry.addRecipe(new ItemStack(rubyBlock), new Object[] { "XXX", "XXX", "XXX", 'X', rubyIngot }); GameRegistry.addRecipe(new ItemStack(topazBlock), new Object[] { "XXX", "XXX", "XXX", 'X', topazIngot }); GameRegistry.addRecipe(new ItemStack(synisiteBlock), new Object[] { "XXX", "XXX", "XXX", 'X', synisiteIngot }); GameRegistry.addRecipe(new ItemStack(jadeBlock), new Object[] { "XXX", "XXX", "XXX", 'X', jadeIngot }); GameRegistry.addRecipe(new ItemStack(xperiteBlock), new Object[] { "XXX", "XXX", "XXX", 'X', xperiteIngot }); //Les crafts des armures ! //ruby GameRegistry.addRecipe(new ItemStack(helmetRuby), new Object[]{"XXX", "X X", 'X', rubyIngot}); GameRegistry.addRecipe(new ItemStack(chestPlateRuby), new Object[]{"X X", "XXX", "XXX", 'X', rubyIngot}); GameRegistry.addRecipe(new ItemStack(leggingsRuby), new Object[]{"XXX", "X X","X X", 'X', rubyIngot}); GameRegistry.addRecipe(new ItemStack(bootsRuby), new Object[]{"X X", "X X", 'X', rubyIngot}); //Topaz GameRegistry.addRecipe(new ItemStack(helmettopaz), new Object[]{"XXX", "X X", 'X', topazIngot}); GameRegistry.addRecipe(new ItemStack(chestPlatetopaz), new Object[]{"X X", "XXX", "XXX", 'X', topazIngot}); GameRegistry.addRecipe(new ItemStack(leggingstopaz), new Object[]{"XXX", "X X","X X", 'X', topazIngot}); GameRegistry.addRecipe(new ItemStack(bootstopaz), new Object[]{"X X", "X X", 'X', topazIngot}); //Synisite GameRegistry.addRecipe(new ItemStack(helmetsynisite), new Object[]{"XXX", "X X", 'X', synisiteIngot}); GameRegistry.addRecipe(new ItemStack(chestPlatesynisite), new Object[]{"X X", "XXX", "XXX", 'X', synisiteIngot}); GameRegistry.addRecipe(new ItemStack(leggingssynisite), new Object[]{"XXX", "X X","X X", 'X', synisiteIngot}); GameRegistry.addRecipe(new ItemStack(bootssynisite), new Object[]{"X X", "X X", 'X', synisiteIngot}); //jade GameRegistry.addRecipe(new ItemStack(helmetjade), new Object[]{"XXX", "X X", 'X', jadeIngot}); GameRegistry.addRecipe(new ItemStack(chestPlatejade), new Object[]{"X X", "XXX", "XXX", 'X', jadeIngot}); GameRegistry.addRecipe(new ItemStack(leggingsjade), new Object[]{"XXX", "X X","X X", 'X', jadeIngot}); GameRegistry.addRecipe(new ItemStack(bootsjade), new Object[]{"X X", "X X", 'X', jadeIngot}); //xperite GameRegistry.addRecipe(new ItemStack(helmetxperite), new Object[]{"XXX", "X X", 'X', xperiteIngot}); GameRegistry.addRecipe(new ItemStack(chestPlatexperite), new Object[]{"X X", "XXX", "XXX", 'X', xperiteIngot}); GameRegistry.addRecipe(new ItemStack(leggingsxperite), new Object[]{"XXX", "X X","X X", 'X', xperiteIngot}); GameRegistry.addRecipe(new ItemStack(bootsxperite), new Object[]{"X X", "X X", 'X', xperiteIngot}); //Les craft des outils ! //Ruby GameRegistry.addRecipe(new ItemStack(rubySword), new Object[]{" X ", " X "," O ", 'X', rubyIngot, 'O', ironStick}); GameRegistry.addRecipe(new ItemStack(rubyPickaxe), new Object[]{"XXX", " O "," O ", 'X', rubyIngot, 'O', ironStick}); GameRegistry.addRecipe(new ItemStack(rubyAxe), new Object[]{"XX ", "XO "," O ", 'X', rubyIngot, 'O', ironStick}); GameRegistry.addRecipe(new ItemStack(rubyShovel), new Object[]{" X ", " O "," O ", 'X', rubyIngot, 'O', ironStick}); //topaz GameRegistry.addRecipe(new ItemStack(topazSword), new Object[]{" X ", " X "," O ", 'X', topazIngot, 'O', ironStick}); GameRegistry.addRecipe(new ItemStack(topazPickaxe), new Object[]{"XXX", " O "," O ", 'X', topazIngot, 'O', ironStick}); GameRegistry.addRecipe(new ItemStack(topazAxe), new Object[]{"XX ", "XO "," O ", 'X', topazIngot, 'O', ironStick}); GameRegistry.addRecipe(new ItemStack(topazShovel), new Object[]{" X ", " O "," O ", 'X', topazIngot, 'O', ironStick}); //synisite GameRegistry.addRecipe(new ItemStack(synisiteSword), new Object[]{" X ", " X "," O ", 'X', synisiteIngot, 'O', ironStick}); GameRegistry.addRecipe(new ItemStack(synisitePickaxe), new Object[]{"XXX", " O "," O ", 'X', synisiteIngot, 'O', ironStick}); GameRegistry.addRecipe(new ItemStack(synisiteAxe), new Object[]{"XX ", "XO "," O ", 'X', synisiteIngot, 'O', ironStick}); GameRegistry.addRecipe(new ItemStack(synisiteShovel), new Object[]{" X ", " O "," O ", 'X', synisiteIngot, 'O', ironStick}); //jade GameRegistry.addRecipe(new ItemStack(jadeSword), new Object[]{" X ", " X "," O ", 'X', jadeIngot, 'O', ironStick}); GameRegistry.addRecipe(new ItemStack(jadePickaxe), new Object[]{"XXX", " O "," O ", 'X', jadeIngot, 'O', ironStick}); GameRegistry.addRecipe(new ItemStack(jadeAxe), new Object[]{"XX ", "XO "," O ", 'X', jadeIngot, 'O', ironStick}); GameRegistry.addRecipe(new ItemStack(jadeShovel), new Object[]{" X ", " O "," O ", 'X', jadeIngot, 'O', ironStick}); //xperite GameRegistry.addRecipe(new ItemStack(xperiteSword), new Object[]{" X ", " X "," O ", 'X', xperiteIngot, 'O', ironStick}); GameRegistry.addRecipe(new ItemStack(xperitePickaxe), new Object[]{"XXX", " O "," O ", 'X', xperiteIngot, 'O', ironStick}); GameRegistry.addRecipe(new ItemStack(xperiteAxe), new Object[]{"XX ", "XO "," O ", 'X', xperiteIngot, 'O', ironStick}); GameRegistry.addRecipe(new ItemStack(xperiteShovel), new Object[]{" X ", " O "," O ", 'X', xperiteIngot, 'O', ironStick}); //Hammer GameRegistry.addRecipe(new ItemStack(xperiteHammer), new Object[]{"XXX", "XXX"," O ", 'X', xperiteIngot, 'O', ironStick}); //IronStick GameRegistry.addRecipe(new ItemStack(ironStick), new Object[]{" X ", " X ", 'X', new ItemStack(Items.iron_ingot)}); proxy.registerRender(); } @EventHandler public void postInit(FMLPostInitializationEvent event) { } }
Class de mon item :
package fr.xperiaonline.xperiamod.common; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.world.World; public class ItemXpDust { @Override public ItemStack onItemRightClick(World world, ItemStack stack, EntityPlayer player) { player.addExperience(5); System.out.println("quelque chose"); return stack; } }
-
Voilà pourquoi… Si eclipse te dit de l’enlever c’est que tu n’as pas les bons paramètres : fait Alt + shift + S puis override or implement methods et choisis la fonction onItemRightClick et tu auras les bons paramètres
-
Euh… je fait quoi la ?
-
Tu revois le tutoriel depuis le début…
Il faut que ta classe soit extends Item sinon tu risques pas de faire grand chose et je ne sais même pas comment tu as fait pour arriver à enregistrer ton item
-
Il manque le extends Item
Et si sans le extends Item tu n’as pas d’erreur c’est que l’item n’est pas bon non plus dans ta classe principale. -
ah oui !!! Désolé ! Je suis tellement débile ! Quand j’ai creer la class c’est oublier !
EDIT : C’est bon j’ai trouver voici se que j’ai dans ma classe au final !
package fr.xperiaonline.xperiamod.common; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.world.World; public class ItemXpDust extends Item { @Override public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) { player.addExperience(5); return super.onItemRightClick(stack, world, player); } }
(désolé pour l’extend item j’avais complètement oublié !)
Par contre j’aimerais que mon item se supprimer après utilisation je devrais faire comment ?
EDIT : j’ai tapper ceci et ça à marcher !
player.addExperience(5); –stack.stackSize; return super.onItemRightClick(stack, world, player);
-
Eclipse ne te mettait aucune erreur sans le extends ?!?
-
Whut ?
-
Sorry, mon portable avait absolument voulu envoyer le post avant que je le termine ^^
-
Résolu ?
-
nop aucune erreur me fesant penser a extend non
-
Oui c’est résolu
En tout cas merci à tous !
Vous avez des réseaux sociaux que je vienne vous faire un peut de pub pour le lancement de mon serveur qui utilisera se mod ? -
En haut à droite
Le réseau le plus utilisé est youtube je pense
-
Oki !
En fait j’ai un soucis !
Quand je gradlew build mon projet toute les texture fonctionnes sauf les block (les block crafter avec mes lingots, et en fait il y’en a que 4 qui ne trouve pas la texture, le xperite_block est bien texturé)
Je ne comprend pas. Sachant que dans mon IDE le mod a bien toutes les texture. Quand je lance le test du mod via eclipse les texture sont la.J’ai été voir avec winrar dans le mod pour voir si les texture avais changer de nom mais non.
Une idée pour régler le probleme ? -
Si tu es sous windows : fait attention aux majuscules car dans l’environnement de dev les majuscules sont ignorés mais une fois compilé les textures sont sensibles à la casse
-
Ah oui ! effectivement ! j’avais mis une majuscule à …._Block !
Merci beaucoup !
Je met en résolu !
-
Voici la vidéo !
Je vous lance un remerciement publique c’est la moindre des choses !http://https://www.youtube.com/watch?v=ojQJtw6Dzxo
encore merci a vous tous !