[1.4.x] Textures n'apparaissent pas dans le jeu mais apparaissent sous Eclipse
-
@‘Dylem’:
Tes textures sont bien en format PNG ?
Sinon, apparemment il faut utiliser MinecraftForgeClient.preloadTexture dans cette version, ça vient surement de là.
Oui les textures sont bien au format png.
J’avais essayé la fonction MinecraftForgeClient.preloadTexture(“/…/moditems.png”) mais je ne sais pas vraiment ou la mettre.
-
Sûrement dans ta méthode initConfig.
-
@‘Plaigon’:
Sûrement dans ta méthode initConfig.
C’est justement là que je l’avais placé mais ça ne fonctionne toujours pas.
@PreInit public void initConfig(FMLPreInitializationEvent event) { proxy.registerRender(); MinecraftForgeClient.preloadTexture("/modaddedfoods/textures/items/moditems.png"); MinecraftForgeClient.preloadTexture("/modaddedfoods/textures/blocks/modblocks.png"); } -
mets le directement dans le constructeur de ton block/item
public BlockMod (…) { super(...); // ton code MinecraftForgeClient.preloadTexture(texture); } -
@‘Dylem’:
mets le directement dans le constructeur de ton block/item
public BlockMod (…) { super(...); // ton code MinecraftForgeClient.preloadTexture(texture); }Je viens d’essayer mais ça n’a pas fonctionné :
package ModAddedFoods.Blocks; import ModAddedFoods.ModDeclare; import net.minecraft.block.BlockCrops; import net.minecraftforge.client.MinecraftForgeClient; public class BlockFraise extends BlockCrops { public BlockFraise(int par1, int par2) { super(par1, par2); MinecraftForgeClient.preloadTexture("/modaddedfoods/textures/blocks/modblocks.png"); } /** * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata */ public int getBlockTextureFromSideAndMetadata(int par1, int par2) { if (par2 < 7) { if (par2 == 6) { par2 = 5; } return this.blockIndexInTexture + (par2 >> 1); } else { return this.blockIndexInTexture + 3; } } /** * Generate a seed ItemStack for this crop. */ protected int getSeedItem() { return ModDeclare.fraise.shiftedIndex; } /** * Generate a crop produce ItemStack for this crop. */ protected int getCropItem() { return ModDeclare.fraise.shiftedIndex; } public String getTextureFile() { return "/modaddedfoods/textures/blocks/modblocks.png"; } } -
Je viens de tester la première version de mon mod qui contient tous les items, blocs et armures que j’ai fait et pour une raison que j’ignore la texture des armures et des blocks fonctionnent. Les items restent blanches.

J’ai du faire quelque chose dans le code qui a empêché la texture de charger correctement.
Si on trouve pourquoi la texture n’est pas chargé correctement dans la version plus courte du mod alors le problème sera définitivement réglé.Code de la version complète :
package ModAddedItems; import net.minecraft.block.Block; import net.minecraft.block.BlockBed; import net.minecraft.block.BlockCarrot; import net.minecraft.block.BlockCloth; import net.minecraft.block.BlockLeaves; import net.minecraft.block.StepSound; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.EnumArmorMaterial; import net.minecraft.item.Item; import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemBed; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemCloth; import net.minecraft.item.ItemFood; import net.minecraft.item.ItemRecord; import net.minecraft.item.ItemSeedFood; import net.minecraft.item.ItemStack; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionHelper; import net.minecraftforge.common.EnumHelper; import ModAddedItems.Blocks.BlockBlueBed; import ModAddedItems.Blocks.BlockFraise; import ModAddedItems.Blocks.BlockOignon; import ModAddedItems.Blocks.BlockRadis; import ModAddedItems.Blocks.BlockSalade; import ModAddedItems.Blocks.BlockTomate; import ModAddedItems.Blocks.ModBlockLeaves; import ModAddedItems.Blocks.ModBlockOre; import ModAddedItems.Items.ItemNinjastars; import ModAddedItems.Items.ItemPearGold; import ModAddedItems.Items.ItemPin; import ModAddedItems.Items.ItemShields; import ModAddedItems.Items.ItemSpeardiamond; import ModAddedItems.Items.ItemSpeargold; import ModAddedItems.Items.ItemSpeariron; import ModAddedItems.Items.ItemSpearstone; import ModAddedItems.Items.ItemSpearwood; import ModAddedItems.Items.ModEnumToolMaterial; import ModAddedItems.Items.ModItemArmor; import ModAddedItems.Items.ModItemRecord; import ModAddedItems.Items.ModItemSword; import ModAddedItems.Potion.ModPotionHelper; import ModAddedItems.common.CommonProxy; import ModAddedItems.world.WorldRegister; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.Init; import cpw.mods.fml.common.Mod.Instance; import cpw.mods.fml.common.Mod.PreInit; import cpw.mods.fml.common.SidedProxy; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.network.NetworkMod; import cpw.mods.fml.common.registry.GameData; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.LanguageRegistry; @Mod(modid = Reference.MOD_ID, name = Reference.MOD_NAME, version = Reference.VERSION) @NetworkMod(clientSideRequired = true, serverSideRequired = false) public class ModDeclare { @Instance("ModItems") public static ModDeclare modInstance; @SidedProxy(clientSide=Reference.CLIENT_PROXY, serverSide=Reference.SERVER_PROXY, bukkitSide=Reference.BUKKIT) public static CommonProxy proxy; //Blocks public static Block OreMarinestone; public static Block BlkBlueBed; public static Block BlkGreenBed; public static ModBlockLeaves leavesAppleGreen; public static Block Block_fraise; public static Block Block_radis; public static Block Block_tomate; public static Block Block_salade; public static Block Block_oignon; //Items public static Item KinghelmetGold; public static Item KingplateGold; public static Item KinglegsGold; public static Item KingbootsGold; public static Item helmetEmerald; public static Item plateEmerald; public static Item legsEmerald; public static Item bootsEmerald; public static Item BlueEmerald; public static Item RedEmerald; public static Item Rubis; public static Item helmetRedEmerald; public static Item plateRedEmerald; public static Item legsRedEmerald; public static Item bootsRedEmerald; public static Item Darksword; public static Item Lightsword; public static Item Nethersword; public static Item BigIronsword; public static Item Excalibur; public static Item KokutoYoru; public static Item Emeraldsword; public static Item BlueEmeraldsword; public static Item RedEmeraldsword; public static Item woodspear; public static Item stonespear; public static Item ironspear; public static Item goldspear; public static Item diamondspear; public static Item recordGold; public static Item LeatherShield; public static Item StoneShield; public static Item IronShield; public static Item GoldShield; public static Item DiamondShield; public static Item BlueBed; public static Item GreenBed; public static Item marinestone; public static Item witherTear; public static Item ninjastars; public static Item appleGreen; public static Item appleRed_Perime; public static Item appleGreen_Perime; public static Item pear; public static Item pearGold; public static Item pear_Perime; public static Item compote; public static Item banane; public static Item banane_Perime; public static Item orange; public static Item orange_Perime; public static Item jus_Orange; public static Item cerise; public static Item cerise_Perime; public static Item fraise; public static Item confiture; public static Item citron; public static Item radis; public static Item tomate; public static Item LobsterRaw; public static Item LobsterCooked; public static Item salade; public static Item oignon; public static Item Pin; // ARMORS public static EnumArmorMaterial GOLD2 = EnumHelper.addArmorMaterial("GOLD2", 7, new int[]{2, 5, 3, 1}, 25); // Nom, Durabilite, new int[] {Helmet,Plastron,Legs,boots}, Enchantment public static EnumArmorMaterial EMERALD = EnumHelper.addArmorMaterial("EMERALD", 22, new int[]{2, 7, 6, 2}, 12); public static EnumArmorMaterial REDEMERALD = EnumHelper.addArmorMaterial("REDEMERALD", 26, new int[]{3, 7, 7, 2}, 11); @PreInit public void initConfig(FMLPreInitializationEvent event) { proxy.registerRender(); } @Init public void load(FMLInitializationEvent event) { StepSound soundGrassFootstep = new StepSound("grass", 1.0F, 1.0F); //Blocks OreMarinestone = new ModBlockOre(2050, 0).setHardness(3.0F).setResistance(5.0F).setBlockName("OreMarinestone").setTextureFile(currentBlocksTexture); BlkBlueBed = new BlockBlueBed(2051, 134).setHardness(0.2F).setBlockName("BlkBlueBed").setRequiresSelfNotify().setTextureFile(currentBlocksTexture).setCreativeTab(CreativeTabs.tabDecorations); BlkGreenBed = new BlockBlueBed(2052, 166).setHardness(0.2F).setBlockName("BlkGreenBed").setRequiresSelfNotify().setTextureFile(currentBlocksTexture).setCreativeTab(CreativeTabs.tabDecorations); leavesAppleGreen = (ModBlockLeaves)new ModBlockLeaves(2053, 52).setHardness(0.2F).setLightOpacity(1).setStepSound(soundGrassFootstep).setBlockName("leavesAppleGreen").setRequiresSelfNotify(); Block_fraise = new BlockFraise(2054, 200).setBlockName("Block_fraise").setTextureFile(currentBlocksTexture); Block_radis = new BlockRadis(2055, 216).setBlockName("Block_radis").setTextureFile(currentBlocksTexture); Block_tomate = new BlockTomate(2056, 232).setBlockName("Block_tomate").setTextureFile(currentBlocksTexture); Block_salade = new BlockSalade(2057, 248).setBlockName("Block_salade").setTextureFile(currentBlocksTexture); Block_oignon = new BlockOignon(2058, 184).setBlockName("Block_oignon").setTextureFile(currentBlocksTexture); //GAMEREGISTRY GameRegistry.registerBlock(OreMarinestone, "OreMarinestone"); GameRegistry.registerBlock(BlkBlueBed, "BlkBlueBed"); GameRegistry.registerBlock(BlkGreenBed, "BlkGreenBed"); GameRegistry.registerBlock(leavesAppleGreen, "leavesAppleGreen"); GameRegistry.registerBlock(Block_fraise, "Block_fraise"); GameRegistry.registerBlock(Block_radis, "Block_radis"); GameRegistry.registerBlock(Block_tomate, "Block_tomate"); GameRegistry.registerBlock(Block_salade, "Block_salade"); GameRegistry.registerBlock(Block_oignon, "Block_oignon"); //LANGUAGE LanguageRegistry.addName(OreMarinestone, "Minerai de pierre marine"); LanguageRegistry.addName(BlkBlueBed, "Lit Bleu Test"); LanguageRegistry.addName(BlkGreenBed, "Lit Vert Test"); LanguageRegistry.addName(Block_fraise, "Plantation de fraises"); LanguageRegistry.addName(Block_radis, "Plantation de radis"); LanguageRegistry.addName(Block_tomate, "Plantation de tomates"); LanguageRegistry.addName(Block_salade, "Plantation de salades"); LanguageRegistry.addName(Block_oignon, "Plantation d'oignons"); //ModBlocks.init(); //ModBlocks.register(); //ModBlocks.language(); //Items KinghelmetGold = new ModItemArmor(5050, GOLD2, 0).setTextureFile(currentItemsTexture).setIconCoord(0, 0).setItemName("KinghelmetGold"); KingplateGold = new ModItemArmor(5051, GOLD2, 1).setTextureFile(currentItemsTexture).setIconCoord(0, 1).setItemName("KingplateGold"); KinglegsGold = new ModItemArmor(5052, GOLD2, 2).setTextureFile(currentItemsTexture).setIconCoord(0, 2).setItemName("KinglegsGold"); KingbootsGold = new ModItemArmor(5053, GOLD2, 3).setTextureFile(currentItemsTexture).setIconCoord(0, 3).setItemName("KingbootsGold"); helmetEmerald = new ModItemArmor(5054, EMERALD, 0).setTextureFile(currentItemsTexture).setIconCoord(1, 0).setItemName("helmetEmerald"); plateEmerald = new ModItemArmor(5055, EMERALD, 1).setTextureFile(currentItemsTexture).setIconCoord(1, 1).setItemName("chestplateEmerald"); legsEmerald = new ModItemArmor(5056, EMERALD, 2).setTextureFile(currentItemsTexture).setIconCoord(1, 2).setItemName("leggingsEmerald"); bootsEmerald = new ModItemArmor(5057, EMERALD, 3).setTextureFile(currentItemsTexture).setIconCoord(1, 3).setItemName("bootsEmerald"); BlueEmerald = new Item(5058).setItemName("BlueEmerald").setCreativeTab(CreativeTabs.tabMaterials).setTextureFile(currentItemsTexture).setIconCoord(11, 11); RedEmerald = new Item(5059).setItemName("RedEmerald").setCreativeTab(CreativeTabs.tabMaterials).setTextureFile(currentItemsTexture).setIconCoord(10, 11); Rubis = new Item(5060).setItemName("Rubis").setCreativeTab(CreativeTabs.tabMaterials).setIconCoord(10, 10); helmetRedEmerald = new ModItemArmor(5061, REDEMERALD, 0).setTextureFile(currentItemsTexture).setIconCoord(2, 0).setItemName("helmetRedEmerald"); plateRedEmerald = new ModItemArmor(5062, REDEMERALD, 1).setTextureFile(currentItemsTexture).setIconCoord(2, 1).setItemName("chestplateRedEmerald"); legsRedEmerald = new ModItemArmor(5063, REDEMERALD, 2).setTextureFile(currentItemsTexture).setIconCoord(2, 2).setItemName("leggingsRedEmerald"); bootsRedEmerald = new ModItemArmor(5064, REDEMERALD, 3).setTextureFile(currentItemsTexture).setIconCoord(2, 3).setItemName("bootsRedEmerald"); Darksword = new ModItemSword(5065, ModEnumToolMaterial.DARKSWORD).setItemName("Darksword").setTextureFile(currentItemsTexture).setIconCoord(0, 4); Lightsword = new ModItemSword(5066, ModEnumToolMaterial.LIGHTSWORD).setItemName("Lightsword").setTextureFile(currentItemsTexture).setIconCoord(1, 4); Nethersword = new ModItemSword(5067, ModEnumToolMaterial.NETHERSWORD).setItemName("Nethersword").setTextureFile(currentItemsTexture).setIconCoord(2, 4); BigIronsword = new ModItemSword(5068, ModEnumToolMaterial.BIGIRONSWORD).setItemName("BigIronsword").setTextureFile(currentItemsTexture).setIconCoord(3, 4); Excalibur = new ModItemSword(5069, ModEnumToolMaterial.EXCALIBUR).setItemName("Excalibur").setTextureFile(currentItemsTexture).setIconCoord(4, 4); KokutoYoru = new ModItemSword(5070, ModEnumToolMaterial.KOKUTOYORU).setItemName("KokutoYoru").setTextureFile(currentItemsTexture).setIconCoord(0, 5); Emeraldsword = new ModItemSword(5071, ModEnumToolMaterial.EMERALDSWORD).setItemName("Emeraldsword").setTextureFile(currentItemsTexture).setIconCoord(1, 5); BlueEmeraldsword = new ModItemSword(5072, ModEnumToolMaterial.BLUEEMERALDSWORD).setItemName("BlueEmeraldsword").setTextureFile(currentItemsTexture).setIconCoord(3, 5); RedEmeraldsword = new ModItemSword(5073, ModEnumToolMaterial.REDEMERALDSWORD).setItemName("RedEmeraldsword").setTextureFile(currentItemsTexture).setIconCoord(2, 5); woodspear = new ItemSpearwood(5074, ModEnumToolMaterial.WOODSPEAR).setItemName("woodspear").setTextureFile(currentItemsTexture).setIconCoord(0, 6); stonespear = new ItemSpearstone(5075, ModEnumToolMaterial.STONESPEAR).setItemName("stonespear").setTextureFile(currentItemsTexture).setIconCoord(1, 6); ironspear = new ItemSpeariron(5076, ModEnumToolMaterial.IRONSPEAR).setItemName("ironspear").setTextureFile(currentItemsTexture).setIconCoord(2, 6); goldspear = new ItemSpeargold(5077, ModEnumToolMaterial.GOLDSPEAR).setItemName("goldspear").setTextureFile(currentItemsTexture).setIconCoord(3, 6); diamondspear = new ItemSpeardiamond(5078, ModEnumToolMaterial.DIAMONDSPEAR).setItemName("diamondspear").setTextureFile(currentItemsTexture).setIconCoord(4, 6); recordGold = new ModItemRecord(5079, "cat").setItemName("record").setTextureFile(currentItemsTexture).setIconCoord(0, 15); LeatherShield = new ItemShields(5080, ModEnumToolMaterial.LEATHERSHIELD).setItemName("LeatherShield").setTextureFile(currentItemsTexture).setIconCoord(0, 7); StoneShield = new ItemShields(5081, ModEnumToolMaterial.STONESHIELD).setItemName("StoneShield").setTextureFile(currentItemsTexture).setIconCoord(1, 7); IronShield = new ItemShields(5082, ModEnumToolMaterial.IRONSHIELD).setItemName("IronShield").setTextureFile(currentItemsTexture).setIconCoord(2, 7); GoldShield = new ItemShields(5083, ModEnumToolMaterial.GOLDSHIELD).setItemName("GoldShield").setTextureFile(currentItemsTexture).setIconCoord(3, 7); DiamondShield = new ItemShields(5084, ModEnumToolMaterial.DIAMONDSHIELD).setItemName("DiamondShield").setTextureFile(currentItemsTexture).setIconCoord(4, 7); BlueBed = new ItemBed(5085).setMaxStackSize(1).setTextureFile(currentItemsTexture).setIconCoord(13, 2).setItemName("BlueBed"); GreenBed = new ItemBed(5086).setMaxStackSize(1).setTextureFile(currentItemsTexture).setIconCoord(13, 3).setItemName("GreenBed"); marinestone = new Item(5087).setItemName("marinestone").setCreativeTab(CreativeTabs.tabMaterials).setTextureFile(currentItemsTexture).setIconCoord(7, 0); witherTear = new Item(5088).setItemName("witherTear").setCreativeTab(CreativeTabs.tabBrewing).setTextureFile(currentItemsTexture).setIconCoord(11, 7); ninjastars = new ItemNinjastars(5089).setIconCoord(8, 11).setItemName("ninjastars").setTextureFile(currentItemsTexture).setIconCoord(5, 0); appleGreen = new ItemFood(5090, 4, 0.3F, false).setItemName("apple").setTextureFile(currentItemsTexture).setIconCoord(10, 1); appleRed_Perime = new ItemFood(5091, 2, 0.1F, false).setItemName("apple_Perime").setTextureFile(currentItemsTexture).setIconCoord(10, 2); appleGreen_Perime = new ItemFood(5092, 2, 0.1F, false).setItemName("apple_Perime").setTextureFile(currentItemsTexture).setIconCoord(11, 2); pear = new ItemFood(5093, 4, 0.3F, false).setItemName("pear").setTextureFile(currentItemsTexture).setIconCoord(10, 0); pearGold = new ItemPearGold(5094, 4, 1.2F, false).setAlwaysEdible().setPotionEffect(Potion.regeneration.id, 5, 0, 1.0F).setItemName("pearGold").setTextureFile(currentItemsTexture).setIconCoord(11, 0); pear_Perime = new ItemFood(5095, 2, 0.1F, false).setItemName("pear_Perime").setTextureFile(currentItemsTexture).setIconCoord(12, 0); compote = new ItemFood(5096, 4, 0.3F, false).setItemName("compote").setTextureFile(currentItemsTexture).setIconCoord(11, 10); banane = new ItemFood(5097, 3, 0.3F, false).setItemName("banane").setTextureFile(currentItemsTexture).setIconCoord(11, 1); banane_Perime = new ItemFood(5098, 2, 0.1F, false).setItemName("banane_Perime").setTextureFile(currentItemsTexture).setIconCoord(12, 1); orange = new ItemFood(5099, 3, 0.3F, false).setItemName("orange").setTextureFile(currentItemsTexture).setIconCoord(10, 3); orange_Perime = new ItemFood(5100, 2, 0.1F, false).setItemName("orange_Perime").setTextureFile(currentItemsTexture).setIconCoord(12, 2); jus_Orange = new ItemFood(5101, 4, 0.5F, false).setItemName("jus_Orange").setTextureFile(currentItemsTexture).setIconCoord(13, 10); cerise = new ItemFood(5102, 2, 0.2F, false).setItemName("cerise").setTextureFile(currentItemsTexture).setIconCoord(11, 3); cerise_Perime = new ItemFood(5103, 1, 0.1F, false).setItemName("cerise_Perime").setTextureFile(currentItemsTexture).setIconCoord(12, 3); fraise = new ItemSeedFood(5104, 2, 0.2F, Block_fraise.blockID, Block.tilledField.blockID).setItemName("fraise").setTextureFile(currentItemsTexture).setIconCoord(10, 4); confiture = new ItemFood(5105, 4, 0.3F, false).setItemName("confiture").setTextureFile(currentItemsTexture).setIconCoord(12, 10); citron = new ItemFood(5106, 3, 0.2F, false).setItemName("citron").setTextureFile(currentItemsTexture).setIconCoord(11, 5); radis = new ItemSeedFood(5107, 2, 0.2F, Block_radis.blockID, Block.tilledField.blockID).setItemName("radis").setTextureFile(currentItemsTexture).setIconCoord(11, 4); tomate = new ItemSeedFood(5108, 3, 0.3F, Block_tomate.blockID, Block.tilledField.blockID).setItemName("tomate").setTextureFile(currentItemsTexture).setIconCoord(12, 4); salade = new ItemSeedFood(5109, 5, 0.3F, Block_salade.blockID, Block.tilledField.blockID).setItemName("salade").setTextureFile(currentItemsTexture).setIconCoord(12, 5); oignon = new ItemSeedFood(5110, 3, 0.2F, Block_oignon.blockID, Block.tilledField.blockID).setItemName("oignon").setTextureFile(currentItemsTexture).setIconCoord(10, 6); LobsterRaw = new ItemFood(5111, 2, 0.3F, false).setTextureFile(currentItemsTexture).setIconCoord(9, 5).setItemName("LobsterRaw"); LobsterCooked = new ItemFood(5112, 5, 0.6F, false).setTextureFile(currentItemsTexture).setIconCoord(10, 5).setItemName("LobsterCooked"); Pin = new ItemPin(5113).setTextureFile(currentItemsTexture).setIconCoord(6, 0).setItemName("Pin"); //GAMEREGISTRY GameRegistry.registerItem(KinghelmetGold, "KinghelmetGold"); GameRegistry.registerItem(KingplateGold, "KingplateGold"); GameRegistry.registerItem(KinglegsGold, "KinglegsGold"); GameRegistry.registerItem(KingbootsGold, "KingbootsGold"); GameRegistry.registerItem(helmetEmerald, "helmetEmerald"); GameRegistry.registerItem(plateEmerald, "plateEmerald"); GameRegistry.registerItem(legsEmerald, "legsEmerald"); GameRegistry.registerItem(bootsEmerald, "bootsEmerald"); GameRegistry.registerItem(BlueEmerald, "BlueEmerald"); GameRegistry.registerItem(RedEmerald, "RedEmerald"); GameRegistry.registerItem(Rubis, "Rubis"); GameRegistry.registerItem(helmetRedEmerald, "helmetRedEmerald"); GameRegistry.registerItem(plateRedEmerald, "plateRedEmerald"); GameRegistry.registerItem(legsRedEmerald, "legsRedEmerald"); GameRegistry.registerItem(bootsRedEmerald, "bootsRedEmerald"); GameRegistry.registerItem(Darksword, "Darksword"); GameRegistry.registerItem(Lightsword, "Lightsword"); GameRegistry.registerItem(Nethersword, "Nethersword"); GameRegistry.registerItem(BigIronsword, "BigIronsword"); GameRegistry.registerItem(Excalibur, "Excalibur"); GameRegistry.registerItem(KokutoYoru, "KokutoYoru"); GameRegistry.registerItem(Emeraldsword, "Emeraldsword"); GameRegistry.registerItem(BlueEmeraldsword, "BlueEmeraldsword"); GameRegistry.registerItem(RedEmeraldsword, "RedEmeraldsword"); GameRegistry.registerItem(woodspear, "woodspear"); GameRegistry.registerItem(stonespear, "stonespear"); GameRegistry.registerItem(ironspear, "ironspear"); GameRegistry.registerItem(goldspear, "goldspear"); GameRegistry.registerItem(diamondspear, "diamondspear"); GameRegistry.registerItem(recordGold, "record"); GameRegistry.registerItem(LeatherShield, "LeatherShield"); GameRegistry.registerItem(StoneShield, "StoneShield"); GameRegistry.registerItem(IronShield, "IronShield"); GameRegistry.registerItem(GoldShield, "GoldShield"); GameRegistry.registerItem(DiamondShield, "DiamondShield"); GameRegistry.registerItem(BlueBed, "BlueBed"); GameRegistry.registerItem(GreenBed, "GreenBed"); GameRegistry.registerItem(marinestone, "marinestone"); GameRegistry.registerItem(witherTear, "witherTear"); GameRegistry.registerItem(ninjastars, "ninjastars"); GameRegistry.registerItem(appleGreen, "appleGreen"); GameRegistry.registerItem(appleRed_Perime, "appleRed_Perime"); GameRegistry.registerItem(appleGreen_Perime, "appleGreen_Perime"); GameRegistry.registerItem(pear, "pear"); GameRegistry.registerItem(pearGold, "pearGold"); GameRegistry.registerItem(pear_Perime, "pear_Perime"); GameRegistry.registerItem(compote, "compote"); GameRegistry.registerItem(banane, "banane"); GameRegistry.registerItem(banane_Perime, "banane_Perime"); GameRegistry.registerItem(orange, "orange"); GameRegistry.registerItem(orange_Perime, "orange_Perime"); GameRegistry.registerItem(jus_Orange, "jus_Orange"); GameRegistry.registerItem(cerise, "cerise"); GameRegistry.registerItem(cerise_Perime, "cerise_Perime"); GameRegistry.registerItem(fraise, "fraise"); GameRegistry.registerItem(confiture, "confiture"); GameRegistry.registerItem(citron, "citron"); GameRegistry.registerItem(radis, "radis"); GameRegistry.registerItem(tomate, "tomate"); GameRegistry.registerItem(salade, "salade"); GameRegistry.registerItem(oignon, "oignon"); GameRegistry.registerItem(LobsterRaw, "LobsterRaw"); GameRegistry.registerItem(LobsterCooked, "LobsterCooked"); GameRegistry.registerItem(Pin, "Pin"); WorldRegister.MainRegistry(); //LANGUAGE LanguageRegistry.addName(KinghelmetGold, "Couronne"); LanguageRegistry.addName(KingplateGold, "Plastron royale"); LanguageRegistry.addName(KinglegsGold, "Jambieres royale"); LanguageRegistry.addName(KingbootsGold, "Bottes royale"); LanguageRegistry.addName(helmetEmerald, "Casque en emeraude"); LanguageRegistry.addName(plateEmerald, "Plastron en emeraude"); LanguageRegistry.addName(legsEmerald, "Jambieres en emeraude"); LanguageRegistry.addName(bootsEmerald, "Bottes en emeraude"); LanguageRegistry.addName(BlueEmerald, "Emeraude bleu"); LanguageRegistry.addName(RedEmerald, "Emeraude rouge"); LanguageRegistry.addName(Rubis, "Rubis"); LanguageRegistry.addName(helmetRedEmerald, "Casque en emeraude rouge"); LanguageRegistry.addName(plateRedEmerald, "Plastron en emeraude rouge"); LanguageRegistry.addName(legsRedEmerald, "Jambieres en emeraude rouge"); LanguageRegistry.addName(bootsRedEmerald, "Bottes en emeraude rouge"); LanguageRegistry.addName(Darksword, "Dark Sword"); LanguageRegistry.addName(Lightsword, "Light Sword"); LanguageRegistry.addName(Nethersword, "Nether Sword"); LanguageRegistry.addName(BigIronsword, "Big Iron Sword"); LanguageRegistry.addName(Excalibur, "Excalibur"); LanguageRegistry.addName(KokutoYoru, "KokutoYoru"); LanguageRegistry.addName(Emeraldsword, "Epee en emeraude"); LanguageRegistry.addName(BlueEmeraldsword, "Epee en emeraude bleu"); LanguageRegistry.addName(RedEmeraldsword, "Epee en emeraude rouge"); LanguageRegistry.addName(woodspear, "Lance en bois"); LanguageRegistry.addName(stonespear, "Lance en pierre"); LanguageRegistry.addName(ironspear, "Lance en fer"); LanguageRegistry.addName(goldspear, "Lance en or"); LanguageRegistry.addName(diamondspear, "Lance en diamant"); LanguageRegistry.addName(LeatherShield, "Bouclier en cuir"); LanguageRegistry.addName(StoneShield, "Bouclier en pierre"); LanguageRegistry.addName(IronShield, "Bouclier en fer"); LanguageRegistry.addName(GoldShield, "Bouclier en or"); LanguageRegistry.addName(DiamondShield, "Bouclier en diamant"); LanguageRegistry.addName(BlueBed, "Lit bleu"); LanguageRegistry.addName(GreenBed, "Lit vert"); LanguageRegistry.addName(marinestone, "Pierre marine"); LanguageRegistry.addName(witherTear, "Larme de Wither"); LanguageRegistry.addName(ninjastars, "etoile ninja"); LanguageRegistry.addName(appleRed_Perime, "Pomme pourite"); LanguageRegistry.addName(appleGreen_Perime, "Pomme pourite"); LanguageRegistry.addName(pear, "Poire"); LanguageRegistry.addName(pearGold, "Poire doree"); LanguageRegistry.addName(pear_Perime, "Poire pourite"); LanguageRegistry.addName(compote, "Compote"); LanguageRegistry.addName(banane, "Banane"); LanguageRegistry.addName(banane_Perime, "Banane pourite"); LanguageRegistry.addName(orange, "Orange"); LanguageRegistry.addName(orange_Perime, "Orange pourite"); LanguageRegistry.addName(jus_Orange, "Jus d'orange"); LanguageRegistry.addName(cerise, "Cerise"); LanguageRegistry.addName(cerise_Perime, "Cerise pourite"); LanguageRegistry.addName(fraise, "fraise"); LanguageRegistry.addName(confiture, "Confiture"); LanguageRegistry.addName(citron, "citron"); LanguageRegistry.addName(radis, "Radis"); LanguageRegistry.addName(tomate, "Tomate"); LanguageRegistry.addName(salade, "Salade"); LanguageRegistry.addName(oignon, "Oignon"); LanguageRegistry.addName(LobsterRaw, "Homard cru"); LanguageRegistry.addName(LobsterCooked, "Homard cuit"); LanguageRegistry.addName(Pin, "Pomme de pin"); //CRAFTS GameRegistry.addRecipe(new ItemStack(KinghelmetGold, 1), new Object[] {"GEG", "GGG", 'G', Item.ingotGold, 'E', Item.emerald}); GameRegistry.addRecipe(new ItemStack(KingplateGold, 1), new Object[] {"GEG", "GGG", "GGG", 'G', Item.ingotGold, 'E', Item.emerald}); GameRegistry.addRecipe(new ItemStack(KinglegsGold, 1), new Object[] {"GGG", "GEG", "G G", 'G', Item.ingotGold, 'E', Item.emerald}); GameRegistry.addRecipe(new ItemStack(KingbootsGold, 1), new Object[] {"GEG", "G G", 'G', Item.ingotGold, 'E', Item.emerald}); GameRegistry.addRecipe(new ItemStack(helmetEmerald, 1), new Object[] {"EEE", "E E", 'E', Item.emerald}); GameRegistry.addRecipe(new ItemStack(plateEmerald, 1), new Object[] {"E E", "EEE", "EEE", 'E', Item.emerald}); GameRegistry.addRecipe(new ItemStack(legsEmerald, 1), new Object[] {"EEE", "E E", "E E", 'E', Item.emerald}); GameRegistry.addRecipe(new ItemStack(bootsEmerald, 1), new Object[] {"E E", "E E", 'E', Item.emerald}); GameRegistry.addRecipe(new ItemStack(helmetRedEmerald, 1), new Object[] {"RRR", "R R", 'R', ModDeclare.RedEmerald}); GameRegistry.addRecipe(new ItemStack(plateRedEmerald, 1), new Object[] {"R R", "RRR", "RRR", 'R', ModDeclare.RedEmerald}); GameRegistry.addRecipe(new ItemStack(legsRedEmerald, 1), new Object[] {"RRR", "R R", "R R", 'R', ModDeclare.RedEmerald}); GameRegistry.addRecipe(new ItemStack(bootsRedEmerald, 1), new Object[] {"R R", "R R", 'R', ModDeclare.RedEmerald}); GameRegistry.addRecipe(new ItemStack(Rubis, 2), new Object[] {"R", 'R', ModDeclare.RedEmerald}); GameRegistry.addRecipe(new ItemStack(Darksword, 1), new Object[] {"WI ", "PI ", " S ", 'I', Item.ingotIron, 'W', ModDeclare.witherTear, 'P', Item.potion, 'S', Item.stick}); GameRegistry.addRecipe(new ItemStack(Lightsword, 1), new Object[] {"GI ", "PI ", " S ", 'I', Item.ingotIron, 'G', Item.ghastTear, 'P', Item.potion, 'S', Item.stick}); GameRegistry.addRecipe(new ItemStack(Nethersword, 1), new Object[] {"NIN", "NIN", "GSG", 'I', Item.ingotIron, 'N', Item.netherStalkSeeds, 'G', Item.goldNugget, 'S', Item.stick}); GameRegistry.addRecipe(new ItemStack(BigIronsword, 1), new Object[] {" I ", " I ", " S ", 'I', Block.blockSteel, 'S', Item.stick}); GameRegistry.addRecipe(new ItemStack(Excalibur, 1), new Object[] {" I ", " I ", "DSD", 'I', Item.ingotIron, 'S', Item.netherStar, 'D', Item.diamond}); GameRegistry.addRecipe(new ItemStack(KokutoYoru, 1), new Object[] {"EME", "DMD", "GIG", 'I', Item.ingotIron, 'G', Item.ingotGold, 'D', Item.diamond, 'E', Item.emerald, 'M', ModDeclare.marinestone}); GameRegistry.addRecipe(new ItemStack(Emeraldsword, 1), new Object[] {" E ", " E ", " S ", 'E', Item.emerald, 'S', Item.stick}); GameRegistry.addRecipe(new ItemStack(BlueEmeraldsword, 1), new Object[] {" B ", " B ", " S ", 'B', ModDeclare.BlueEmerald, 'S', Item.stick}); GameRegistry.addRecipe(new ItemStack(RedEmeraldsword, 1), new Object[] {" R ", " R ", " S ", 'R', ModDeclare.RedEmerald, 'S', Item.stick}); GameRegistry.addRecipe(new ItemStack(woodspear, 1), new Object[] {"S ", " S ", " S", 'S', Item.stick}); GameRegistry.addRecipe(new ItemStack(stonespear, 1), new Object[] {"C ", " S ", " S", 'S', Item.stick, 'C', Block.cobblestone}); GameRegistry.addRecipe(new ItemStack(ironspear, 1), new Object[] {"I ", " S ", " S", 'S', Item.stick, 'I', Item.ingotIron}); GameRegistry.addRecipe(new ItemStack(diamondspear, 1), new Object[] {"D ", " S ", " S", 'S', Item.stick, 'D', Item.diamond}); GameRegistry.addRecipe(new ItemStack(goldspear, 1), new Object[] {"G ", " S ", " S", 'S', Item.stick, 'G', Item.ingotGold}); GameRegistry.addRecipe(new ItemStack(LeatherShield, 1), new Object[] {" L ", "LNL", " L ", 'L', Item.leather, 'N', Item.goldNugget}); GameRegistry.addRecipe(new ItemStack(StoneShield, 1), new Object[] {"SS", "SS", "SS", 'S', Block.cobblestone}); GameRegistry.addRecipe(new ItemStack(IronShield, 1), new Object[] {"III", "INI", " I ", 'I', Item.ingotIron, 'N', Item.goldNugget}); GameRegistry.addRecipe(new ItemStack(GoldShield, 1), new Object[] {"GGG", "GDG", " G ", 'G', Item.ingotGold, 'D', Item.diamond}); GameRegistry.addRecipe(new ItemStack(DiamondShield, 1), new Object[] {"DDD", "DND", " D ", 'D', Item.diamond, 'N', Item.goldNugget}); GameRegistry.addRecipe(new ItemStack(compote, 1), new Object[] {"P", "B", 'B', Item.glassBottle, 'P', ModDeclare.appleRed_Perime}); GameRegistry.addRecipe(new ItemStack(compote, 1), new Object[] {"P", "B", 'B', Item.glassBottle, 'P', ModDeclare.appleGreen_Perime}); GameRegistry.addRecipe(new ItemStack(compote, 1), new Object[] {"P", "B", 'B', Item.glassBottle, 'P', ModDeclare.pear_Perime}); GameRegistry.addRecipe(new ItemStack(confiture, 1), new Object[] {"C", "C", "B", 'B', Item.glassBottle, 'C', ModDeclare.cerise}); GameRegistry.addRecipe(new ItemStack(confiture, 1), new Object[] {"F", "F", "B", 'B', Item.glassBottle, 'F', ModDeclare.fraise}); GameRegistry.addRecipe(new ItemStack(jus_Orange, 1), new Object[] {"O", "B", 'B', Item.glassBottle, 'O', ModDeclare.orange}); GameRegistry.addRecipe(new ItemStack(jus_Orange, 1), new Object[] {"P", "P", "B", 'B', Item.glassBottle, 'P', ModDeclare.orange_Perime}); //GameRegistry.addShapelessRecipe(new ItemStack(BlueBed, 1), new Object[] {new ItemStack(Item.itemsList[Block.cloth.blockID], 1, 11), Block.planks}); //GameRegistry.addShapelessRecipe(new ItemStack(GreenBed, 1), new Object[] {new ItemStack(Item.itemsList[Block.cloth.blockID], 1, 13), Block.planks}); // RedBed GameRegistry.addShapelessRecipe(new ItemStack(BlueBed, 1), new Object[] {Item.bed, new ItemStack(Item.dyePowder, 1, 4)}); GameRegistry.addShapelessRecipe(new ItemStack(GreenBed, 1), new Object[] {Item.bed, new ItemStack(Item.dyePowder, 1, 2)}); // BlueBed GameRegistry.addShapelessRecipe(new ItemStack(Item.bed, 1), new Object[] {BlueBed, new ItemStack(Item.dyePowder, 1, 1)}); GameRegistry.addShapelessRecipe(new ItemStack(GreenBed, 1), new Object[] {BlueBed, new ItemStack(Item.dyePowder, 1, 2)}); // GreenBed GameRegistry.addShapelessRecipe(new ItemStack(Item.bed, 1), new Object[] {GreenBed, new ItemStack(Item.dyePowder, 1, 1)}); GameRegistry.addShapelessRecipe(new ItemStack(BlueBed, 1), new Object[] {GreenBed, new ItemStack(Item.dyePowder, 1, 4)}); // CUISSON GameRegistry.addSmelting(LobsterRaw.shiftedIndex, new ItemStack(LobsterCooked, 1), 1.0F); // LobsterRaw } private String currentItemsTexture = "/ModAddedItems/textures/items/ModItems.png"; private String currentBlocksTexture = "/ModAddedItems/textures/blocks/ModBlocks.png"; }Code de la version contenant uniquement la nourriture :
package ModAddedFoods; import net.minecraft.block.Block; import net.minecraft.block.StepSound; import net.minecraft.item.Item; import net.minecraft.item.ItemFood; import net.minecraft.item.ItemSeedFood; import net.minecraft.item.ItemStack; import net.minecraft.potion.Potion; import net.minecraftforge.client.MinecraftForgeClient; import ModAddedFoods.Blocks.BlockFraise; import ModAddedFoods.Blocks.BlockOignon; import ModAddedFoods.Blocks.BlockRadis; import ModAddedFoods.Blocks.BlockSalade; import ModAddedFoods.Blocks.BlockTomate; import ModAddedFoods.Items.ItemAddedFood; import ModAddedFoods.Items.ItemAddedSeedFood; //import ModAddedFoods.Blocks.ModBlockLeaves; import ModAddedFoods.Items.ItemPearGold; import ModAddedFoods.Items.ItemPin; import ModAddedFoods.common.CommonProxy; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.Init; import cpw.mods.fml.common.Mod.Instance; import cpw.mods.fml.common.Mod.PreInit; import cpw.mods.fml.common.SidedProxy; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.network.NetworkMod; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.LanguageRegistry; @Mod(modid = Reference.MOD_ID, name = Reference.MOD_NAME, version = Reference.VERSION) @NetworkMod(clientSideRequired = true, serverSideRequired = false) public class ModDeclare { @Instance("modaddedfoods") public static ModDeclare modInstance; @SidedProxy(clientSide=Reference.CLIENT_PROXY, serverSide=Reference.SERVER_PROXY, bukkitSide=Reference.BUKKIT) public static CommonProxy proxy; //Blocks //public static ModBlockLeaves leavesAppleGreen; public static Block block_fraise; public static Block block_radis; public static Block block_tomate; public static Block block_salade; public static Block block_oignon; //Items public static Item applegreen; public static Item applered_perime; public static Item applegreen_perime; public static Item pear; public static Item peargold; public static Item pear_perime; public static Item compote; public static Item banane; public static Item banane_perime; public static Item orange; public static Item orange_perime; public static Item jus_orange; public static Item cerise; public static Item cerise_perime; public static Item fraise; public static Item confiture; public static Item citron; public static Item radis; public static Item tomate; public static Item salade; public static Item oignon; public static Item lobsterraw; public static Item lobstercooked; public static Item pin; @PreInit public void initConfig(FMLPreInitializationEvent event) { proxy.registerRender(); } @Init public void load(FMLInitializationEvent event) { StepSound soundGrassFootstep = new StepSound("grass", 1.0F, 1.0F); //Blocks //leavesAppleGreen = (ModBlockLeaves)new ModBlockLeaves(2053, 52).setHardness(0.2F).setLightOpacity(1).setStepSound(soundGrassFootstep).setBlockName("leavesAppleGreen").setRequiresSelfNotify(); block_fraise = new BlockFraise(2054, 200).setBlockName("block_fraise"); block_radis = new BlockRadis(2055, 216).setBlockName("block_radis"); block_tomate = new BlockTomate(2056, 232).setBlockName("block_tomate"); block_salade = new BlockSalade(2057, 248).setBlockName("block_salade"); block_oignon = new BlockOignon(2058, 184).setBlockName("block_oignon"); //GAMEREGISTRY //GameRegistry.registerBlock(leavesAppleGreen, "leavesAppleGreen"); GameRegistry.registerBlock(block_fraise, "block_fraise"); GameRegistry.registerBlock(block_radis, "block_radis"); GameRegistry.registerBlock(block_tomate, "block_tomate"); GameRegistry.registerBlock(block_salade, "block_salade"); GameRegistry.registerBlock(block_oignon, "block_oignon"); //LANGUAGE LanguageRegistry.addName(block_fraise, "Plantation de fraises"); LanguageRegistry.addName(block_radis, "Plantation de radis"); LanguageRegistry.addName(block_tomate, "Plantation de tomates"); LanguageRegistry.addName(block_salade, "Plantation de salades"); LanguageRegistry.addName(block_oignon, "Plantation d'oignons"); //ModBlocks.init(); //ModBlocks.register(); //ModBlocks.language(); //Items applegreen = new ItemAddedFood(5090, 4, 0.3F, false).setItemName("apple").setIconCoord(10, 1); applered_perime = new ItemAddedFood(5091, 2, 0.1F, false).setItemName("apple_perime").setIconCoord(10, 2); applegreen_perime = new ItemAddedFood(5092, 2, 0.1F, false).setItemName("apple_perime").setIconCoord(11, 2); pear = new ItemAddedFood(5093, 4, 0.3F, false).setItemName("pear").setIconCoord(10, 0); peargold = new ItemPearGold(5094, 4, 1.2F, false).setAlwaysEdible().setPotionEffect(Potion.regeneration.id, 5, 0, 1.0F).setItemName("peargold").setIconCoord(11, 0); pear_perime = new ItemAddedFood(5095, 2, 0.1F, false).setItemName("pear_perime").setIconCoord(12, 0); compote = new ItemAddedFood(5096, 4, 0.3F, false).setItemName("compote").setIconCoord(11, 10); banane = new ItemAddedFood(5097, 3, 0.3F, false).setItemName("banane").setIconCoord(11, 1); banane_perime = new ItemAddedFood(5098, 2, 0.1F, false).setItemName("banane_perime").setIconCoord(12, 1); orange = new ItemAddedFood(5099, 3, 0.3F, false).setItemName("orange").setIconCoord(10, 3); orange_perime = new ItemAddedFood(5100, 2, 0.1F, false).setItemName("orange_perime").setIconCoord(12, 2); jus_orange = new ItemAddedFood(5101, 4, 0.5F, false).setItemName("jus_orange").setIconCoord(13, 10); cerise = new ItemAddedFood(5102, 2, 0.2F, false).setItemName("cerise").setIconCoord(11, 3); cerise_perime = new ItemAddedFood(5103, 1, 0.1F, false).setItemName("cerise_perime").setIconCoord(12, 3); fraise = new ItemAddedSeedFood(5104, 2, 0.2F, block_fraise.blockID, Block.tilledField.blockID).setItemName("fraise").setIconCoord(10, 4); confiture = new ItemAddedFood(5105, 4, 0.3F, false).setItemName("confiture").setIconCoord(12, 10); citron = new ItemAddedFood(5106, 3, 0.2F, false).setItemName("citron").setIconCoord(11, 5); radis = new ItemAddedSeedFood(5107, 2, 0.2F, block_radis.blockID, Block.tilledField.blockID).setItemName("radis").setIconCoord(11, 4); tomate = new ItemAddedSeedFood(5108, 3, 0.3F, block_tomate.blockID, Block.tilledField.blockID).setItemName("tomate").setIconCoord(12, 4); salade = new ItemAddedSeedFood(5109, 5, 0.3F, block_salade.blockID, Block.tilledField.blockID).setItemName("salade").setIconCoord(12, 5); oignon = new ItemAddedSeedFood(5110, 3, 0.2F, block_oignon.blockID, Block.tilledField.blockID).setItemName("oignon").setIconCoord(10, 6); lobsterraw = new ItemAddedFood(5111, 2, 0.3F, false).setIconCoord(9, 5).setItemName("lobsterraw"); lobstercooked = new ItemAddedFood(5112, 5, 0.6F, false).setIconCoord(10, 5).setItemName("lobstercooked"); pin = new ItemPin(5113).setIconCoord(6, 0).setItemName("pin"); //GAMEREGISTRY GameRegistry.registerItem(applegreen, "applegreen"); GameRegistry.registerItem(applered_perime, "applered_perime"); GameRegistry.registerItem(applegreen_perime, "applegreen_perime"); GameRegistry.registerItem(pear, "pear"); GameRegistry.registerItem(peargold, "peargold"); GameRegistry.registerItem(pear_perime, "pear_perime"); GameRegistry.registerItem(compote, "compote"); GameRegistry.registerItem(banane, "banane"); GameRegistry.registerItem(banane_perime, "banane_perime"); GameRegistry.registerItem(orange, "orange"); GameRegistry.registerItem(orange_perime, "orange_perime"); GameRegistry.registerItem(jus_orange, "jus_orange"); GameRegistry.registerItem(cerise, "cerise"); GameRegistry.registerItem(cerise_perime, "cerise_perime"); GameRegistry.registerItem(fraise, "fraise"); GameRegistry.registerItem(confiture, "confiture"); GameRegistry.registerItem(citron, "citron"); GameRegistry.registerItem(radis, "radis"); GameRegistry.registerItem(tomate, "tomate"); GameRegistry.registerItem(salade, "salade"); GameRegistry.registerItem(oignon, "oignon"); GameRegistry.registerItem(lobsterraw, "lobsterraw"); GameRegistry.registerItem(lobstercooked, "lobstercooked"); GameRegistry.registerItem(pin, "pin"); //LANGUAGE LanguageRegistry.addName(applered_perime, "Pomme pourite"); LanguageRegistry.addName(applegreen_perime, "Pomme pourite"); LanguageRegistry.addName(pear, "Poire"); LanguageRegistry.addName(peargold, "Poire doree"); LanguageRegistry.addName(pear_perime, "Poire pourite"); LanguageRegistry.addName(compote, "Compote"); LanguageRegistry.addName(banane, "Banane"); LanguageRegistry.addName(banane_perime, "Banane pourite"); LanguageRegistry.addName(orange, "Orange"); LanguageRegistry.addName(orange_perime, "Orange pourite"); LanguageRegistry.addName(jus_orange, "Jus d'orange"); LanguageRegistry.addName(cerise, "Cerise"); LanguageRegistry.addName(cerise_perime, "Cerise pourite"); LanguageRegistry.addName(fraise, "fraise"); LanguageRegistry.addName(confiture, "Confiture"); LanguageRegistry.addName(citron, "citron"); LanguageRegistry.addName(radis, "Radis"); LanguageRegistry.addName(tomate, "Tomate"); LanguageRegistry.addName(salade, "Salade"); LanguageRegistry.addName(oignon, "Oignon"); LanguageRegistry.addName(lobsterraw, "Homard cru"); LanguageRegistry.addName(lobstercooked, "Homard cuit"); LanguageRegistry.addName(pin, "Pomme de pin"); //CRAFTS GameRegistry.addRecipe(new ItemStack(Item.appleGold, 1), new Object[] {"OOO", "OPO", "OOO", 'P', ModDeclare.applegreen, 'O', Item.goldNugget}); GameRegistry.addRecipe(new ItemStack(peargold, 1), new Object[] {"OOO", "OPO", "OOO", 'P', ModDeclare.pear, 'O', Item.goldNugget}); GameRegistry.addRecipe(new ItemStack(compote, 1), new Object[] {"P", "B", 'B', Item.glassBottle, 'P', ModDeclare.applered_perime}); GameRegistry.addRecipe(new ItemStack(compote, 1), new Object[] {"P", "B", 'B', Item.glassBottle, 'P', ModDeclare.applegreen_perime}); GameRegistry.addRecipe(new ItemStack(compote, 1), new Object[] {"P", "B", 'B', Item.glassBottle, 'P', ModDeclare.pear_perime}); GameRegistry.addRecipe(new ItemStack(confiture, 1), new Object[] {"C", "C", "B", 'B', Item.glassBottle, 'C', ModDeclare.cerise}); GameRegistry.addRecipe(new ItemStack(confiture, 1), new Object[] {"F", "F", "B", 'B', Item.glassBottle, 'F', ModDeclare.fraise}); GameRegistry.addRecipe(new ItemStack(jus_orange, 1), new Object[] {"O", "B", 'B', Item.glassBottle, 'O', ModDeclare.orange}); GameRegistry.addRecipe(new ItemStack(jus_orange, 1), new Object[] {"P", "P", "B", 'B', Item.glassBottle, 'P', ModDeclare.orange_perime}); // CUISSON GameRegistry.addSmelting(lobsterraw.shiftedIndex, new ItemStack(lobstercooked, 1), 1.0F); // LobsterRaw } //private String currentitemstexture = "/modaddedfoods/textures/items/moditems.png"; //private String currentblockstexture = "/modaddedfoods/textures/blocks/modblocks.png"; }Dans la première version il n’y a même pas la fonction MinecraftForgeClient.preloadTexture().
Personnellement je ne vois pas vraiment de différences entre la version complète et la version nourriture. Tout ce que j’ai fait c’est retirer les armures, certains blocs et quelques items. -
Dans la version nourriture, il manque la méthode ```java
setTextureFile() -
@‘Superloup10’:
Dans la version nourriture, il manque la méthode ```java
setTextureFile()C’est normal, j’ai placé une fonction getTextureFile() avec le lien de la texture directement dans la classe des blocs et items.
Grâce à cette fonction je n’aurai plus a écrire setTextureFile() pour chaque Block ou Item et je gagnerai beaucoup de temps en cas de grosse modification.Malheureusement ça n’a pas réglé mon problème.
-
C’est bon mon problème est résolu
.
Après avoir bien comparé les deux versions j’ai pu remarquer que les liens vers les textures avaient une légère différence.
Dans la deuxième version pour essayer de régler le problème j’avais mis le lien en minuscule ce qui a causé un autre problème car un des dossiers contenait des lettres en majuscules.Tout ce qui restait à faire était de changer certaines lettres dans le lien en majuscule comme pour le dossier pour résoudre ce dernier problème.
Pour éviter ce genre de problème il faut donc penser à précharger la texture et penser aux minuscules/majuscules dans les liens.
Merci à tous de m’avoir répondu, votre aide m’a vraiment été très utile.
-
Le problème vient souvent de là : windows te donne l’image même si le nom différe au niveau des majuscules et minuscules mais une fois dans un jar il fait la différence, il vaut donc mieux tout mettre en minuscules
