Le kit d'outils et une épée
-
@‘robin4002’:
Il nous faut tes codes, sinon on ne peut pas deviner d’où vient le problème.
Exacte, sens code on ne peu strictement rien faire, et comme superloup10 la dit, regarde dans toutes les tables créatives, sinon, regarde bien les register si il son fais ^^'.
-
J’ai recommencé le tutoriel à zéro pour essayer (tout depuis le début) et je vous dis cela si sa marche !
PS: Superloup10, j’ai regardé dans toutes les tables créatives mais rien !
PS²: sevenno07, les registers étaient bien présents !Bye !
-
Bonsoir, voila j’ai mis mon mode pour rajouter des armes et armures sur un serveur cauldron, tout marche. Cependant j’aimerait savoir si il est possible de réparer les items grace a la commande
/repair hand
et
/repair all
Merci de votre réponse
-
Oui normalement.
-
Bonjour, connaisez-vous le morceaux de code a rajouté ? Si oui je le veux bien car actuellement les items ne peuvent etre réparé que grace a une enclume
Merci d’avance
-
Essaye avec cette fonction dans la classe de ton Item :
public boolean isRepairable() { return true; }
-
Sa ne marche pas Sa met que aucun objet nécessite de réparation
-
Je ne crois pas qu’essential soit compatible avec les mods custom.
-
Je suis sur que il y a un moyen car j’ai déjà vu un serveur moddé ou les armures sont réparables avec le repair all
-
https://github.com/essentials/Essentials/blob/2.x/Essentials/src/com/earth2me/essentials/commands/Commandrepair.java
Visiblement il est sensé réparer tout items damageable, donc il est sensé réparer n’importe quel outil.
Essayes de mettre à jour essentials. -
Je viens d’installer essentials la derniere version et cela ne marche toujours pas. Voici un screen pour plus d’infos :
-
Il n’existe pas une version d’essentials pour Cauldron ?
-
Je n’en ai pas trouvé
-
Non, il n’y a pas de version pour cauldron. Dans ce cas je ne sais pas pourquoi ça ne fonctionne pas.
-
Je vous donne un bout de mon code si sa peu aider :
Classe principale :
package fr.volario.mod.common; import java.awt.Color; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.EnumCreatureType; import net.minecraft.item.EnumArmorMaterial; import net.minecraft.item.EnumToolMaterial; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.common.EnumHelper; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.Mod.Instance; import cpw.mods.fml.common.SidedProxy; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.network.NetworkRegistry; import cpw.mods.fml.common.registry.EntityRegistry; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.LanguageRegistry; import fr.volario.mod.proxy.CommonProxy; import net.minecraftforge.common.MinecraftForge; import net.minecraft.block.Block; import cpw.mods.fml.common.registry.GameRegistry; @Mod(modid = "modnexusfight", name = "ModNexusFight", version = "1.0.0") public class ModNexusFight { @Instance("ModNexusFight") public static ModNexusFight Instance; public static final String MODID = "ModNexusFight"; @SidedProxy(clientSide = "fr.volario.mod.proxy.ClientProxy", serverSide = "fr.volario.mod.proxy.CommonProxy") public static CommonProxy proxy; //Je declare mes Blocks public static Block RubyOre; public static Block SapphireOre; public static Block RubyBlock; public static Block SapphireBlock; public static Block CompressedObsidian; public static Block BlockXp; //Je declare mes Items public static Item Sapphire; public static Item Ruby; public static Item helmetEmerald; public static Item chestPlateEmerald; public static Item leggingsEmerald; public static Item bootsEmerald; public static Item helmetRuby; public static Item chestPlateRuby; public static Item leggingsRuby; public static Item bootsRuby; public static Item helmetSapphire; public static Item chestPlateSapphire; public static Item leggingsSapphire; public static Item bootsSapphire; public static Item HoeRuby; public static Item HoeSapphire; public static Item HoeEmerald; public static Item HoeObsidian; public static Item ShovelRuby; public static Item ShovelSapphire; public static Item ShovelEmerald; public static Item ShovelObsidian; public static Item AxeRuby; public static Item AxeSapphire; public static Item AxeEmerald; public static Item AxeObsidian; public static Item PickAxeRuby; public static Item PickAxeSapphire; public static Item PickAxeEmerald; public static Item PickAxeObsidian; public static Item SwordRuby; public static Item SwordSapphire; public static Item SwordEmerald; public static Item SwordObsidian; public static Item helmetObsidian; public static Item chestPlateObsidian; public static Item leggingsObsidian; public static Item bootsObsidian; //Je declare mes outils public static EnumToolMaterial toolEmerald = EnumHelper.addToolMaterial("toolEmerald", 3, 2000, 13.0F, 4.0F, 15); public static EnumToolMaterial toolRuby = EnumHelper.addToolMaterial("toolRuby", 3, 2500, 18.0F, 6.0F, 15); public static EnumToolMaterial toolSapphire = EnumHelper.addToolMaterial("toolSapphire", 3, 3000, 23.0F, 8.0F, 15); public static EnumToolMaterial toolObsidian = EnumHelper.addToolMaterial("toolObsidian", 3, 4000, 13.0F, 4.0F, 15); //Je declare mes armures public static EnumArmorMaterial ItemEmeraldArmor = EnumHelper.addArmorMaterial("armorEmerald", 35, new int[] {4, 8, 6, 4}, 10); //22 Armor public static EnumArmorMaterial ItemRubyArmor = EnumHelper.addArmorMaterial("armorRuby", 35, new int[] {4, 9, 7, 4}, 10); //24 Armor public static EnumArmorMaterial ItemSapphireArmor = EnumHelper.addArmorMaterial("armorSapphire", 35, new int[] {4, 10, 8, 4}, 10); //26 Armor public static EnumArmorMaterial ItemObsidianArmor = EnumHelper.addArmorMaterial("armorObsidian", 42, new int[] {3, 8, 6, 3}, 15); @EventHandler public void preInit(FMLPreInitializationEvent event) { proxy.registerRender(); } @EventHandler public void init(FMLInitializationEvent event) { //Je decrit les Items et Blocks int var1 = Block.beacon.blockID; Block.blocksList[138] = null; Block blockBeaconmodded = new BlockBeaconModded(138); BlockXp = new BlockXp(2305) .setHardness(0.5F) .setResistance(15) .setUnlocalizedName("BlockXp") .setTextureName(ModNexusFight.MODID + ":blockxp") .setCreativeTab(CreativeTabs.tabBlock); CompressedObsidian = new CompressedObsidian(2304) .setHardness(65.0F) .setResistance(2300.0F) .setUnlocalizedName("CompressedObsidian") .setTextureName(ModNexusFight.MODID + ":CompressedObsidian"); RubyBlock = new RubyBlock(2302) .setHardness(10.0F) .setResistance(20.0F) .setUnlocalizedName("RubyBlock") .setTextureName(ModNexusFight.MODID + ":RubyBlock"); SapphireBlock = new SapphireBlock(2303) .setHardness(10.0F) .setResistance(20.0F) .setUnlocalizedName("SapphireBlock") .setTextureName(ModNexusFight.MODID + ":SapphireBlock"); RubyOre = new RubyOre(2300) .setHardness(8.0F) .setResistance(15.0F) .setUnlocalizedName("RubyOre") .setTextureName(ModNexusFight.MODID + ":RubyOre"); SapphireOre = new SapphireOre(2301) .setHardness(8.0F) .setResistance(15.0F) .setUnlocalizedName("SapphireOre") .setTextureName(ModNexusFight.MODID + ":SapphireOre"); Sapphire = new Sapphire(10015) .setUnlocalizedName("Sapphire") .setTextureName(ModNexusFight.MODID + ":Sapphire") .setCreativeTab(CreativeTabs.tabMaterials); Ruby = new Ruby(10014) .setUnlocalizedName("Ruby") .setTextureName(ModNexusFight.MODID + ":Ruby") .setCreativeTab(CreativeTabs.tabMaterials); HoeRuby = new HoeRuby(10016, toolRuby) .setUnlocalizedName("HoeRuby") .setTextureName(ModNexusFight.MODID + ":HoeRuby") .setCreativeTab(CreativeTabs.tabTools); HoeEmerald = new HoeEmerald(10017, toolEmerald) .setUnlocalizedName("HoeEmerald") .setTextureName(ModNexusFight.MODID + ":HoeEmerald") .setCreativeTab(CreativeTabs.tabTools); HoeSapphire = new HoeSapphire(10018, toolSapphire) .setUnlocalizedName("HoeSapphire") .setTextureName(ModNexusFight.MODID + ":HoeSapphire") .setCreativeTab(CreativeTabs.tabTools); HoeObsidian = new HoeObsidian(10031, toolObsidian) .setUnlocalizedName("HoeObsidian") .setTextureName(ModNexusFight.MODID + ":HoeObsidian") .setCreativeTab(CreativeTabs.tabTools); AxeRuby = new AxeRuby(10019, toolRuby) .setUnlocalizedName("AxeRuby") .setTextureName(ModNexusFight.MODID + ":AxeRuby") .setCreativeTab(CreativeTabs.tabTools); AxeEmerald = new AxeEmerald(10020, toolEmerald) .setUnlocalizedName("AxeEmerald") .setTextureName(ModNexusFight.MODID + ":AxeEmerald") .setCreativeTab(CreativeTabs.tabTools); AxeSapphire = new AxeSapphire(10021, toolSapphire) .setUnlocalizedName("AxeSapphire") .setTextureName(ModNexusFight.MODID + ":AxeSapphire") .setCreativeTab(CreativeTabs.tabTools); AxeObsidian = new AxeObsidian(10032, toolObsidian) .setUnlocalizedName("AxeObsidian") .setTextureName(ModNexusFight.MODID + ":AxeObsidian") .setCreativeTab(CreativeTabs.tabTools); ShovelRuby = new ShovelRuby(10022, toolRuby) .setUnlocalizedName("ShovelRuby") .setTextureName(ModNexusFight.MODID + ":ShovelRuby") .setCreativeTab(CreativeTabs.tabTools); ShovelEmerald = new ShovelEmerald(10023, toolEmerald) .setUnlocalizedName("ShovelEmerald") .setTextureName(ModNexusFight.MODID + ":ShovelEmerald") .setCreativeTab(CreativeTabs.tabTools); ShovelSapphire = new ShovelSapphire(10024, toolSapphire) .setUnlocalizedName("ShovelSapphire") .setTextureName(ModNexusFight.MODID + ":ShovelSapphire") .setCreativeTab(CreativeTabs.tabTools); ShovelObsidian = new ShovelObsidian(10033, toolObsidian) .setUnlocalizedName("ShovelObsidian") .setTextureName(ModNexusFight.MODID + ":ShovelObsidian") .setCreativeTab(CreativeTabs.tabTools); PickAxeRuby = new PickAxeRuby(10025, toolRuby) .setUnlocalizedName("PickAxeRuby") .setTextureName(ModNexusFight.MODID + ":PickAxeRuby") .setCreativeTab(CreativeTabs.tabTools); PickAxeEmerald = new PickAxeEmerald(10026, toolEmerald) .setUnlocalizedName("PickAxeEmerald") .setTextureName(ModNexusFight.MODID + ":PickAxeEmerald") .setCreativeTab(CreativeTabs.tabTools); PickAxeSapphire = new PickAxeSapphire(10027, toolSapphire) .setUnlocalizedName("PickAxeSapphire") .setTextureName(ModNexusFight.MODID + ":PickAxeSapphire") .setCreativeTab(CreativeTabs.tabTools); PickAxeObsidian = new PickAxeObsidian(10034, toolObsidian) .setUnlocalizedName("PickAxeObsidian") .setTextureName(ModNexusFight.MODID + ":PickAxeObsidian") .setCreativeTab(CreativeTabs.tabTools); SwordRuby = new SwordRuby(10028, toolRuby) .setUnlocalizedName("SwordRuby") .setTextureName(ModNexusFight.MODID + ":SwordRuby") .setCreativeTab(CreativeTabs.tabCombat); SwordEmerald = new SwordEmerald(10029, toolEmerald) .setUnlocalizedName("SwordEmerald") .setTextureName(ModNexusFight.MODID + ":SwordEmerald") .setCreativeTab(CreativeTabs.tabCombat); SwordSapphire = new SwordSapphire(10030, toolSapphire) .setUnlocalizedName("SwordSapphire") .setTextureName(ModNexusFight.MODID + ":SwordSapphire") .setCreativeTab(CreativeTabs.tabCombat); SwordObsidian = new SwordObsidian(10036, toolObsidian) .setUnlocalizedName("SwordObsidian") .setTextureName(ModNexusFight.MODID + ":SwordObsidian") .setCreativeTab(CreativeTabs.tabCombat); helmetEmerald = new EmeraldArmor(12002, ItemEmeraldArmor, 0,0) .setUnlocalizedName("EmeraldHelmet") .setTextureName("modnexusfight:EmeraldHelmet"); chestPlateEmerald = new EmeraldArmor(12003, ItemEmeraldArmor, 0, 1) .setUnlocalizedName("EmeraldChestPlate") .setTextureName("modnexusfight:EmeraldChestplate"); leggingsEmerald = new EmeraldArmor(12004, ItemEmeraldArmor, 0, 2) .setUnlocalizedName("EmeraldLeggings") .setTextureName("modnexusfight:EmeraldLeggings"); bootsEmerald = new EmeraldArmor(12005, ItemEmeraldArmor, 0, 3) .setUnlocalizedName("EmeraldBoots") .setTextureName("modnexusfight:EmeraldBoots"); helmetRuby = new RubyArmor(12006, ItemRubyArmor, 0,0) .setUnlocalizedName("RubyHelmet") .setTextureName("modnexusfight:RubyHelmet"); chestPlateRuby = new RubyArmor(12007, ItemRubyArmor, 0, 1) .setUnlocalizedName("RubyChestPlate") .setTextureName("modnexusfight:RubyChestplate"); leggingsRuby = new RubyArmor(12008, ItemRubyArmor, 0, 2) .setUnlocalizedName("RubyLeggings") .setTextureName("modnexusfight:RubyLeggings"); bootsRuby = new RubyArmor(12009, ItemRubyArmor, 0, 3) .setUnlocalizedName("RubyBoots") .setTextureName("modnexusfight:RubyBoots"); helmetSapphire = new SapphireArmor(12010, ItemSapphireArmor, 0,0) .setUnlocalizedName("SapphireHelmet") .setTextureName("modnexusfight:SapphireHelmet"); chestPlateSapphire = new SapphireArmor(12011, ItemSapphireArmor, 0, 1) .setUnlocalizedName("SapphireChestPlate") .setTextureName("modnexusfight:SapphireChestplate"); leggingsSapphire = new SapphireArmor(12012, ItemSapphireArmor, 0, 2) .setUnlocalizedName("SapphireLeggings") .setTextureName("modnexusfight:SapphireLeggings"); bootsSapphire = new SapphireArmor(12013, ItemSapphireArmor, 0, 3) .setUnlocalizedName("SapphireBoots") .setTextureName("modnexusfight:SapphireBoots"); helmetObsidian = new ObsidianArmor(12037, ItemObsidianArmor, 0,0) .setUnlocalizedName("ObsidianHelmet") .setTextureName("modnexusfight:ObsidianHelmet"); chestPlateObsidian = new ObsidianArmor(12038, ItemObsidianArmor, 0, 1) .setUnlocalizedName("ObsidianChestPlate") .setTextureName("modnexusfight:ObsidianChestplate"); leggingsObsidian = new ObsidianArmor(12039, ItemObsidianArmor, 0, 2) .setUnlocalizedName("ObsidianLeggings") .setTextureName("modnexusfight:ObsidianLeggings"); bootsObsidian = new ObsidianArmor(12040, ItemObsidianArmor, 0, 3) .setUnlocalizedName("ObsidianBoots") .setTextureName("modnexusfight:ObsidianBoots"); //J'enregistre mes item(Non obligatoire) GameRegistry.registerBlock(blockBeaconmodded, "Beacon"); GameRegistry.registerBlock(BlockXp, "BlockXp"); GameRegistry.registerBlock(CompressedObsidian, "CompressedObsidian"); GameRegistry.registerBlock(SapphireOre, "SapphireOre"); GameRegistry.registerBlock(RubyOre, "RubyOre"); GameRegistry.registerBlock(RubyBlock, "RubyBlock"); GameRegistry.registerBlock(SapphireBlock, "SapphireBlock"); GameRegistry.registerItem(AxeEmerald, "AxeEmerald"); GameRegistry.registerItem(AxeRuby, "AxeRuby"); GameRegistry.registerItem(AxeSapphire, "AxeSapphire"); GameRegistry.registerItem(ShovelEmerald, "ShovelEmerald"); GameRegistry.registerItem(ShovelRuby, "ShovelRuby"); GameRegistry.registerItem(ShovelSapphire, "ShovelSapphire"); GameRegistry.registerItem(PickAxeEmerald, "PickAxeEmerald"); GameRegistry.registerItem(PickAxeRuby, "PickAxeRuby"); GameRegistry.registerItem(PickAxeSapphire, "PickAxeSapphire"); GameRegistry.registerItem(HoeEmerald, "HoeEmerald"); GameRegistry.registerItem(HoeRuby, "HoeRuby"); GameRegistry.registerItem(HoeSapphire, "HoeSapphire"); GameRegistry.registerItem(SwordEmerald, "SwordEmerald"); GameRegistry.registerItem(SwordRuby, "SwordRuby"); GameRegistry.registerItem(SwordSapphire, "SwordSapphire"); GameRegistry.registerItem(Ruby, "Ruby"); GameRegistry.registerItem(Sapphire, "Sapphire"); GameRegistry.registerItem(helmetEmerald, "helmetEmerald"); GameRegistry.registerItem(chestPlateEmerald, "chestPlateEmerald"); GameRegistry.registerItem(leggingsEmerald, "leggingsEmerald"); GameRegistry.registerItem(bootsEmerald, "bootsEmerald"); GameRegistry.registerItem(helmetSapphire, "helmetSapphire"); GameRegistry.registerItem(chestPlateSapphire, "chestPlateSapphire"); GameRegistry.registerItem(leggingsSapphire, "leggingsSapphire"); GameRegistry.registerItem(bootsSapphire, "bootsSapphire"); GameRegistry.registerItem(helmetRuby, "helmetRuby"); GameRegistry.registerItem(chestPlateRuby, "chestPlateRuby"); GameRegistry.registerItem(leggingsRuby, "leggingsRuby"); GameRegistry.registerItem(bootsRuby, "bootsRuby"); GameRegistry.registerItem(helmetObsidian, "helmetObsidian"); GameRegistry.registerItem(chestPlateObsidian, "chestPlateObsidian"); GameRegistry.registerItem(leggingsObsidian, "leggingsObsidian"); GameRegistry.registerItem(bootsObsidian, "bootsObsidian"); GameRegistry.registerItem(PickAxeObsidian, "PickAxeObsidian"); GameRegistry.registerItem(HoeObsidian, "HoeObsidian"); GameRegistry.registerItem(SwordObsidian, "SwordObsidian"); GameRegistry.registerItem(AxeObsidian, "AxeObsidian"); GameRegistry.registerItem(ShovelObsidian, "ShovelObsidian"); //Les recettes de mes items GameRegistry.addRecipe(new ItemStack(helmetEmerald), new Object[]{"XXX", "X X", 'X', Item.emerald,}); GameRegistry.addRecipe(new ItemStack(chestPlateEmerald), new Object[]{"X X", "XXX", "XXX", 'X', Item.emerald,}); GameRegistry.addRecipe(new ItemStack(leggingsEmerald), new Object[]{"XXX", "X X", "X X", 'X', Item.emerald,}); GameRegistry.addRecipe(new ItemStack(bootsEmerald), new Object[]{"X X", "X X", 'X', Item.emerald,}); GameRegistry.addRecipe(new ItemStack(PickAxeEmerald), new Object[]{"XXX", " S ", " S ", 'X', Item.emerald, 'S', Item.stick}); GameRegistry.addRecipe(new ItemStack(SwordEmerald), new Object[]{"X", "X", "S", 'X', Item.emerald, 'S', Item.stick}); GameRegistry.addRecipe(new ItemStack(HoeEmerald), new Object[]{"XX", " #", " #", 'X', Item.emerald, '#', Item.stick}); GameRegistry.addRecipe(new ItemStack(ShovelEmerald), new Object[]{"X", "#", "#", 'X', Item.emerald, '#', Item.stick}); GameRegistry.addRecipe(new ItemStack(AxeEmerald), new Object[]{"XX", "X#", " #", 'X', Item.emerald, '#', Item.stick}); GameRegistry.addRecipe(new ItemStack(helmetRuby), new Object[]{"XXX", "X X", 'X', Ruby,}); GameRegistry.addRecipe(new ItemStack(chestPlateRuby), new Object[]{"X X", "XXX", "XXX", 'X', Ruby,}); GameRegistry.addRecipe(new ItemStack(leggingsRuby), new Object[]{"XXX", "X X", "X X", 'X', Ruby,}); GameRegistry.addRecipe(new ItemStack(bootsRuby), new Object[]{"X X", "X X", 'X', Ruby,}); GameRegistry.addRecipe(new ItemStack(PickAxeRuby), new Object[]{"XXX", " S ", " S ", 'X', Ruby, 'S', Item.stick}); GameRegistry.addRecipe(new ItemStack(SwordRuby), new Object[]{"X", "X", "S", 'X', Ruby, 'S', Item.stick}); GameRegistry.addRecipe(new ItemStack(HoeRuby), new Object[]{"XX", " #", " #", 'X', Ruby, '#', Item.stick}); GameRegistry.addRecipe(new ItemStack(ShovelRuby), new Object[]{"X", "#", "#", 'X', Ruby, '#', Item.stick}); GameRegistry.addRecipe(new ItemStack(AxeRuby), new Object[]{"XX", "X#", " #", 'X', Ruby, '#', Item.stick}); GameRegistry.addRecipe(new ItemStack(RubyBlock), new Object[]{"XXX", "XXX", "XXX", 'X', Ruby}); GameRegistry.addRecipe(new ItemStack(Ruby), new Object[]{"X", 'X', RubyBlock}); GameRegistry.addRecipe(new ItemStack(helmetSapphire), new Object[]{"XXX", "X X", 'X', Sapphire,}); GameRegistry.addRecipe(new ItemStack(chestPlateSapphire), new Object[]{"X X", "XXX", "XXX", 'X', Sapphire,}); GameRegistry.addRecipe(new ItemStack(leggingsSapphire), new Object[]{"XXX", "X X", "X X", 'X', Sapphire,}); GameRegistry.addRecipe(new ItemStack(bootsSapphire), new Object[]{"X X", "X X", 'X', Sapphire,}); GameRegistry.addRecipe(new ItemStack(PickAxeSapphire), new Object[]{"XXX", " S ", " S ", 'X', Sapphire, 'S', Item.stick}); GameRegistry.addRecipe(new ItemStack(SwordSapphire), new Object[]{"X", "X", "S", 'X', Sapphire, 'S', Item.stick}); GameRegistry.addRecipe(new ItemStack(HoeSapphire), new Object[]{"XX", " #", " #", 'X', Sapphire, '#', Item.stick}); GameRegistry.addRecipe(new ItemStack(ShovelSapphire), new Object[]{"X", "#", "#", 'X', Sapphire, '#', Item.stick}); GameRegistry.addRecipe(new ItemStack(AxeSapphire), new Object[]{"XX", "X#", " #", 'X', Sapphire, '#', Item.stick}); GameRegistry.addRecipe(new ItemStack(SapphireBlock), new Object[]{"XXX", "XXX", "XXX", 'X', Sapphire}); GameRegistry.addRecipe(new ItemStack(Sapphire, 9), new Object[]{"X", 'X', SapphireBlock}); GameRegistry.addRecipe(new ItemStack(CompressedObsidian), new Object[]{"XXX", "XXX", "XXX", 'X', Block.obsidian}); GameRegistry.addRecipe(new ItemStack(Block.obsidian, 9), new Object[]{"X", 'X', CompressedObsidian}); GameRegistry.addRecipe(new ItemStack(helmetObsidian), new Object[]{"XXX", "X X", 'X', CompressedObsidian,}); GameRegistry.addRecipe(new ItemStack(chestPlateObsidian), new Object[]{"X X", "XXX", "XXX", 'X', CompressedObsidian,}); GameRegistry.addRecipe(new ItemStack(leggingsObsidian), new Object[]{"XXX", "X X", "X X", 'X', CompressedObsidian,}); GameRegistry.addRecipe(new ItemStack(bootsObsidian), new Object[]{"X X", "X X", 'X', CompressedObsidian,}); GameRegistry.addRecipe(new ItemStack(PickAxeObsidian), new Object[]{"XXX", " S ", " S ", 'X', CompressedObsidian, 'S', Item.stick}); GameRegistry.addRecipe(new ItemStack(SwordObsidian), new Object[]{"X", "X", "S", 'X', CompressedObsidian, 'S', Item.stick}); GameRegistry.addRecipe(new ItemStack(HoeObsidian), new Object[]{"XX", " #", " #", 'X', CompressedObsidian, '#', Item.stick}); GameRegistry.addRecipe(new ItemStack(ShovelObsidian), new Object[]{"X", "#", "#", 'X', CompressedObsidian, '#', Item.stick}); GameRegistry.addRecipe(new ItemStack(AxeObsidian), new Object[]{"XX", "X#", " #", 'X', CompressedObsidian, '#', Item.stick}); } private void setCreativeTab(CreativeTabs tabcombat) { // TODO Auto-generated method stub } @EventHandler public void postInit(FMLPostInitializationEvent event) { } }
Classe d’une de mes armures :
package fr.volario.mod.common; import net.minecraft.item.ItemArmor; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumArmorMaterial; import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemStack; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.util.MathHelper; import net.minecraft.world.World; public class RubyArmor extends ItemArmor { public RubyArmor(int id, EnumArmorMaterial armorMaterial, int type, int layer) { super(id, armorMaterial, type, layer); } public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) { if(slot == 2) { return ModNexusFight.MODID + ":textures/models/armor/armorruby_layer_2.png"; } return ModNexusFight.MODID + ":textures/models/armor/armorruby_layer_1.png"; } public boolean getIsRepairable(ItemStack input, ItemStack repair) { if(repair.getItem() == ModNexusFight.Ruby) { return true; } return false; } public boolean isRepairable() { return true; } }
HS : D’ailleurs j’aimerait réduire la hardness du beacon, ce que j’ai réussi mais cependant les texture ne marche pas, voici mon bout de code de la classe du beacon :
package fr.volario.mod.common; import java.util.Random; import net.minecraft.block.Block; import net.minecraft.block.BlockBeacon; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; public class BlockBeaconModded extends BlockBeacon { public BlockBeaconModded(int id) { super(id); setHardness(0.10F); setResistance(20.0F); setUnlocalizedName("beacon"); setTextureName("beacon"); // TODO Auto-generated constructor stub } public int idDropped(int metadata, Random rand, int fortune) { return Block.beacon.blockID; } }
-
Pour le repair, j’ai peut être une solution à l’arrache certes mais elle peut marcher.
Dans le plugin.yml du plugin Essentials, tu enlève la commande repair (je crois qu’elle y est), tu te fais ton propre plugin bukkit en copiant la fonction de la commande repair du plugin Essentials et tu ajoutes les ids de tes armures que tu veux reparer (je sais pas si tu as compris, et je ne sais pas si tu t’y connais avec Bukkit). -
Non, il y a beaucoup plus simple.
Dans la fonction init du mod, tu mets Block.beacon.setHardness(0.10F);
ET NON IL NE FAUT PAS MODIFIER LES CLASSES DE MINECRAFT, ÇA CAUSE DES INCOMPATIBILITÉ.Pour essential, je ne vois pas quoi faire.
-
@‘MrAzErTy31’:
Pour le repair, j’ai peut être une solution à l’arrache certes mais elle peut marcher.
Dans le plugin.yml du plugin Essentials, tu enlève la commande repair (je crois qu’elle y est), tu te fais ton propre plugin bukkit en copiant la fonction de la commande repair du plugin Essentials et tu ajoutes les ids de tes armures que tu veux reparer (je sais pas si tu as compris, et je ne sais pas si tu t’y connais avec Bukkit).Bonsoir,
Je débute seulement en programation et je n’ai vu que les mods pour l’instant donc malheuresement je ne connais pas du tout Je sais jute les configs (le minimum et simple) -
Bonjour, voila j’ai était sur le chat IRC de essentials et j’ai posé la question :
<volario>: my server use custom mods with new items but the repair don’t work for the new items (i’m french) and i use the last version 2.13.1
<necrodoom>: well, yeah, essentials doesnt know about these
<volario>: Essentials doesn’t have repair items list ?
<necrodoom>: it uses a bukkit method to check if its a tool
<necrodoom>: er, repairable
<necrodoom>: getMaxDurability
<necrodoom>: if returns 0, its not repairable
<necrodoom>: nothing we can do
<volario>: TyVoila ce qu’ils m’ont dit si quelqu’un serait comment faire.</volario></necrodoom></necrodoom></necrodoom></necrodoom></necrodoom></volario></necrodoom></volario>
-
Visiblement c’est ça : https://github.com/Bukkit/CraftBukkit/blob/master/src/main/java/net/minecraft/server/Item.java#L341
Ajoute ça dans la classe de tes outils :public int getMaxDurability() { return this.getMaxDamage() + 1; }
ça devrait fonctionner.