Résolu Minerai qui drope un items
-
les balise java car la c’est illisible
EDIT: tu as bien enregistrer ton item?
-
Isador je vais finir par vous envoyez le mod si ça continue T_T
Bien sur que mon item est enregistrer:
Dans la classe principaleItem Ruby = new Ruby(5000).setUnlocalizedName("Ruby").setTextureName("forge:ruby"); GameRegistry.registerItem(Ruby, "Ruby"); LanguageRegistry.addName(Ruby, "Ruby");
et dans sa classe:
package goldenmod.Items; import goldenmod.GoldenMain; import java.util.Random; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.EnumRarity; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; public class Ruby extends Item { public Ruby(int id){ super(id); this.setCreativeTab(CreativeTabs.tabMaterials); setMaxStackSize(64); } }
-
envoi toute les classe je vais voir ca
-
Classe principale (main):
package goldenmod; import goldenmod.Items.Ruby; import goldenmod.Items.Sapphire; import goldenmod.Items.Amethyst; import goldenmod.Items.MythrilIngot; import net.minecraft.block.Block; import net.minecraft.item.Item; import net.minecraftforge.common.MinecraftForge; 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.FMLPreInitializationEvent; import cpw.mods.fml.common.network.NetworkMod; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.LanguageRegistry; import cpw.mods.fml.common.registry.TickRegistry; import cpw.mods.fml.relauncher.Side; @Mod(modid="GF", name="GoldenPack", version="1.0") @NetworkMod(clientSideRequired=true, serverSideRequired=false) //NE JAMAIS MODIFIER public class GoldenMain { @SidedProxy(clientSide = "goldenmod.ClientProxy", serverSide = "goldenmod.CommonProxy") public static goldenmod.CommonProxy proxy; @Instance("GF") public static GoldenMain instance; public static Block RubyOre, SapphireOre, AmethystOre, RubyBlock, SapphireBlock, AmethystBlock, MythrilOre, MythrilBlock, ObsidianForced, ObsiStairs, DoubleSlabObsi, SingleSlabObsi ; public static Item Ruby, Sapphire, Amethyst, MythrilIngot; @EventHandler public void PreInit(FMLPreInitializationEvent event){ //Configuration GameRegistry.registerWorldGenerator(new WorldGeneratorTutoriel()); if(event.getSide().isClient()) TickRegistry.registerTickHandler(new CustomMenuTickHandler(), Side.CLIENT); //tutomain.Blocks RubyOre = new goldenmod.Blocks.RubyOre(3000).setHardness(3.0F).setResistance(5.0F).setStepSound(Block.soundStoneFootstep).setUnlocalizedName("Ruby Ore").setTextureName("forge:rubyOre"); SapphireOre = new goldenmod.Blocks.SapphireOre(3001).setHardness(3.0F).setResistance(5.0F).setStepSound(Block.soundStoneFootstep).setUnlocalizedName("Sapphire Ore").setTextureName("forge:sapphireOre"); AmethystOre = new goldenmod.Blocks.AmethystOre(3002).setHardness(5.0F).setResistance(10.0F).setStepSound(Block.soundStoneFootstep).setUnlocalizedName("Amethyst Ore").setTextureName("forge:amethystOre"); MythrilOre = new goldenmod.Blocks.MythrilOre(3003).setHardness(2.0F).setResistance(3.0F).setStepSound(Block.soundStoneFootstep).setUnlocalizedName("Mythril Ore").setTextureName("forge:mythril_ore"); RubyBlock = new goldenmod.Blocks.BlockOreStorage(3004).setHardness(3.0F).setResistance(4.0F).setStepSound(Block.soundMetalFootstep).setUnlocalizedName("Ruby Block").setTextureName("forge:rubyBlock"); SapphireBlock = new goldenmod.Blocks.BlockOreStorage(3005).setHardness(3.0F).setResistance(4.0F).setStepSound(Block.soundMetalFootstep).setUnlocalizedName("Sapphire Block").setTextureName("forge:sapphireBlock"); AmethystBlock = new goldenmod.Blocks.BlockOreStorage(3006).setHardness(3.0F).setResistance(4.0F).setStepSound(Block.soundMetalFootstep).setUnlocalizedName("Amethyst Block").setTextureName("forge:amethystBlock"); MythrilBlock = new goldenmod.Blocks.BlockOreStorage(3007).setHardness(3.0F).setResistance(4.0F).setStepSound(Block.soundMetalFootstep).setUnlocalizedName("Mythril Block").setTextureName("forge:mythril_block"); ObsidianForced = new goldenmod.Blocks.BlockObsidianRenfo(3008).setHardness(300.0F).setResistance(2000.0F).setStepSound(Block.soundStoneFootstep).setUnlocalizedName("Reinforced Obsidian").setTextureName("forge:obsidianForced"); //tutomain.Items Item Ruby = new Ruby(5000).setUnlocalizedName("Ruby").setTextureName("forge:ruby"); Item Sapphire = new Sapphire(5001).setUnlocalizedName("Sapphire").setTextureName("forge:sapphire"); Item Amethyst = new Amethyst(5002).setUnlocalizedName("Amethyst").setTextureName("forge:amethyst"); Item MythrilIngot = new MythrilIngot(5003).setUnlocalizedName("Mythril Ingot").setTextureName("forge:mythril_ingot"); //Registers.Blocks GameRegistry.registerBlock(RubyOre, "RubyOre"); LanguageRegistry.addName(RubyOre, "Ruby Ore"); GameRegistry.registerBlock(SapphireOre, "SapphireOre"); LanguageRegistry.addName(SapphireOre, "Sapphire Ore"); GameRegistry.registerBlock(AmethystOre, "AmethystOre"); LanguageRegistry.addName(AmethystOre, "Amethyst Ore"); GameRegistry.registerBlock(MythrilOre, "MythrilOre"); LanguageRegistry.addName(MythrilOre, "Mythril Ore"); GameRegistry.registerBlock(RubyBlock, "RubyBlock"); LanguageRegistry.addName(RubyBlock, "Ruby Block"); GameRegistry.registerBlock(SapphireBlock, "SapphireBlock"); LanguageRegistry.addName(SapphireBlock, "Sapphire Block"); GameRegistry.registerBlock(AmethystBlock, "AmethystBlock"); LanguageRegistry.addName(AmethystBlock, "Amethyst Block"); GameRegistry.registerBlock(MythrilBlock, "MythrilBlock"); LanguageRegistry.addName(MythrilBlock, "Mythril Block"); GameRegistry.registerBlock(ObsidianForced, "ObsidianForced"); LanguageRegistry.addName(ObsidianForced, "Reinforced Obsidian"); //Registers.Items GameRegistry.registerItem(Ruby, "Ruby"); LanguageRegistry.addName(Ruby, "Ruby"); GameRegistry.registerItem(Sapphire, "Sapphire"); LanguageRegistry.addName(Sapphire, "Sapphire"); GameRegistry.registerItem(Amethyst, "Amethyst"); LanguageRegistry.addName(Amethyst, "Amethyst"); GameRegistry.registerItem(MythrilIngot, "MythrilIngot"); LanguageRegistry.addName(MythrilIngot, "Mythril Ingot"); } @EventHandler public void PreInit(FMLInitializationEvent Event){ //Render proxy.registerRenderers(); //Recipe //Smelting } @EventHandler public void PostInit(FMLInitializationEvent event){ MinecraftForge.setBlockHarvestLevel(RubyOre, "pickaxe", 2); MinecraftForge.setBlockHarvestLevel(SapphireOre, "pickaxe", 2); MinecraftForge.setBlockHarvestLevel(AmethystOre, "pickaxe", 2); MinecraftForge.setBlockHarvestLevel(MythrilOre, "pickaxe", 1); MinecraftForge.setBlockHarvestLevel(RubyBlock, "pickaxe", 2); MinecraftForge.setBlockHarvestLevel(SapphireBlock, "pickaxe", 2); MinecraftForge.setBlockHarvestLevel(AmethystBlock, "pickaxe", 2); MinecraftForge.setBlockHarvestLevel(MythrilBlock, "pickaxe", 1); MinecraftForge.setBlockHarvestLevel(ObsidianForced, "pickaxe", 3); } }
Rubis (minerai)
package goldenmod.Blocks; import goldenmod.GoldenMain; import java.util.Random; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; public class RubyOre extends Block { public RubyOre(int id) { super(id, Material.rock); this.setCreativeTab(CreativeTabs.tabBlock); } public int idDropped(int metadata, Random rand, int fortune) { if(metadata == 0 && rand.nextInt(5) > 3) { return GoldenMain.Ruby.itemID; } else if(metadata == 0) { return 1; } else { return this.blockID; } } }
Ruby (Item)
package goldenmod.Items; import goldenmod.GoldenMain; import java.util.Random; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.EnumRarity; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; public class Ruby extends Item { public Ruby(int id){ super(id); this.setCreativeTab(CreativeTabs.tabMaterials); setMaxStackSize(64); } }
Voilà, tout ce qui est en rapport du rubis! Si tu veux autres chose, dit le moi
-
enleve le Item a Item Ruby = new Ruby(5000).setUnlocalizedName(“Ruby”).setTextureName(“forge:ruby”);
-> Ruby = new Ruby(5000).setUnlocalizedName(“Ruby”).setTextureName(“forge:ruby”);
-
heu ça a marché, ça ma drop de la stone par contre
J’ai relancé et la console n’écris RIEN sauf ça:
juil. 17, 2014 8:08:12 PM net.minecraft.launchwrapper.LogWrapper log
INFOS: Using tweak class name cpw.mods.fml.common.launcher.FMLTweaker
Java HotSpot 64-Bit Server VM warning: Using incremental CMS is deprecated and will likely be removed in a future release -
normal ta condition est: si metadata == 0 et rand.nextInt(5) >3 ca dropt l’item, sinon si c’est juste metadata ca retourne 1, 1 c’est l’id de la stone. si tu veux drop a chaque fois fait:
public int idDropped(int metadata, Random rand, int fortune) { if(metadata == 0) { return GoldenMain.Ruby.itemID; else { return this.blockID; } }
-
J’ai relancé et la console n’écris RIEN sauf ça:
juil. 17, 2014 8:08:12 PM net.minecraft.launchwrapper.LogWrapper log
INFOS: Using tweak class name cpw.mods.fml.common.launcher.FMLTweaker
Java HotSpot 64-Bit Server VM warning: Using incremental CMS is deprecated and will likely be removed in a future release
C’est ca qui m’intrigue plutôt alors… -
dans ton bloc met:
public int idDropped(int par1, Random par2Random, int par3) { return ModMain.TonBlock.itemID; } public int quantityDropped(Random par1Random) { return nombreDeLoot; }
-
Je ne peux toujours pas lancer, je ne cherche PAS la solution a la stone mais je veux lancer mon MOD
-
pas normal,
renvoi tes code actuel -
package goldenmod; import goldenmod.Items.Ruby; import goldenmod.Items.Sapphire; import goldenmod.Items.Amethyst; import goldenmod.Items.MythrilIngot; import net.minecraft.block.Block; import net.minecraft.item.Item; import net.minecraftforge.common.MinecraftForge; 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.FMLPreInitializationEvent; import cpw.mods.fml.common.network.NetworkMod; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.LanguageRegistry; import cpw.mods.fml.common.registry.TickRegistry; import cpw.mods.fml.relauncher.Side; @Mod(modid="GF", name="GoldenPack", version="1.0") @NetworkMod(clientSideRequired=true, serverSideRequired=false) //NE JAMAIS MODIFIER public class GoldenMain { @SidedProxy(clientSide = "goldenmod.ClientProxy", serverSide = "goldenmod.CommonProxy") public static goldenmod.CommonProxy proxy; @Instance("GF") public static GoldenMain instance; public static Block RubyOre, SapphireOre, AmethystOre, RubyBlock, SapphireBlock, AmethystBlock, MythrilOre, MythrilBlock, ObsidianForced, ObsiStairs, DoubleSlabObsi, SingleSlabObsi ; public static Item Ruby, Sapphire, Amethyst, MythrilIngot; @EventHandler public void PreInit(FMLPreInitializationEvent event){ //Configuration GameRegistry.registerWorldGenerator(new WorldGeneratorTutoriel()); if(event.getSide().isClient()) TickRegistry.registerTickHandler(new CustomMenuTickHandler(), Side.CLIENT); //tutomain.Blocks RubyOre = new goldenmod.Blocks.RubyOre(3000).setHardness(3.0F).setResistance(5.0F).setStepSound(Block.soundStoneFootstep).setUnlocalizedName("Ruby Ore").setTextureName("forge:rubyOre"); SapphireOre = new goldenmod.Blocks.SapphireOre(3001).setHardness(3.0F).setResistance(5.0F).setStepSound(Block.soundStoneFootstep).setUnlocalizedName("Sapphire Ore").setTextureName("forge:sapphireOre"); AmethystOre = new goldenmod.Blocks.AmethystOre(3002).setHardness(5.0F).setResistance(10.0F).setStepSound(Block.soundStoneFootstep).setUnlocalizedName("Amethyst Ore").setTextureName("forge:amethystOre"); MythrilOre = new goldenmod.Blocks.MythrilOre(3003).setHardness(2.0F).setResistance(3.0F).setStepSound(Block.soundStoneFootstep).setUnlocalizedName("Mythril Ore").setTextureName("forge:mythril_ore"); RubyBlock = new goldenmod.Blocks.BlockOreStorage(3004).setHardness(3.0F).setResistance(4.0F).setStepSound(Block.soundMetalFootstep).setUnlocalizedName("Ruby Block").setTextureName("forge:rubyBlock"); SapphireBlock = new goldenmod.Blocks.BlockOreStorage(3005).setHardness(3.0F).setResistance(4.0F).setStepSound(Block.soundMetalFootstep).setUnlocalizedName("Sapphire Block").setTextureName("forge:sapphireBlock"); AmethystBlock = new goldenmod.Blocks.BlockOreStorage(3006).setHardness(3.0F).setResistance(4.0F).setStepSound(Block.soundMetalFootstep).setUnlocalizedName("Amethyst Block").setTextureName("forge:amethystBlock"); MythrilBlock = new goldenmod.Blocks.BlockOreStorage(3007).setHardness(3.0F).setResistance(4.0F).setStepSound(Block.soundMetalFootstep).setUnlocalizedName("Mythril Block").setTextureName("forge:mythril_block"); ObsidianForced = new goldenmod.Blocks.BlockObsidianRenfo(3008).setHardness(300.0F).setResistance(2000.0F).setStepSound(Block.soundStoneFootstep).setUnlocalizedName("Reinforced Obsidian").setTextureName("forge:obsidianForced"); //tutomain.Items Ruby = new Ruby(5000).setUnlocalizedName("Ruby").setTextureName("forge:ruby"); Sapphire = new Sapphire(5001).setUnlocalizedName("Sapphire").setTextureName("forge:sapphire"); Amethyst = new Amethyst(5002).setUnlocalizedName("Amethyst").setTextureName("forge:amethyst"); MythrilIngot = new MythrilIngot(5003).setUnlocalizedName("Mythril Ingot").setTextureName("forge:mythril_ingot"); //Registers.Blocks GameRegistry.registerBlock(RubyOre, "RubyOre"); LanguageRegistry.addName(RubyOre, "Ruby Ore"); GameRegistry.registerBlock(SapphireOre, "SapphireOre"); LanguageRegistry.addName(SapphireOre, "Sapphire Ore"); GameRegistry.registerBlock(AmethystOre, "AmethystOre"); LanguageRegistry.addName(AmethystOre, "Amethyst Ore"); GameRegistry.registerBlock(MythrilOre, "MythrilOre"); LanguageRegistry.addName(MythrilOre, "Mythril Ore"); GameRegistry.registerBlock(RubyBlock, "RubyBlock"); LanguageRegistry.addName(RubyBlock, "Ruby Block"); GameRegistry.registerBlock(SapphireBlock, "SapphireBlock"); LanguageRegistry.addName(SapphireBlock, "Sapphire Block"); GameRegistry.registerBlock(AmethystBlock, "AmethystBlock"); LanguageRegistry.addName(AmethystBlock, "Amethyst Block"); GameRegistry.registerBlock(MythrilBlock, "MythrilBlock"); LanguageRegistry.addName(MythrilBlock, "Mythril Block"); GameRegistry.registerBlock(ObsidianForced, "ObsidianForced"); LanguageRegistry.addName(ObsidianForced, "Reinforced Obsidian"); //Registers.Items GameRegistry.registerItem(Ruby, "Ruby"); LanguageRegistry.addName(Ruby, "Ruby"); GameRegistry.registerItem(Sapphire, "Sapphire"); LanguageRegistry.addName(Sapphire, "Sapphire"); GameRegistry.registerItem(Amethyst, "Amethyst"); LanguageRegistry.addName(Amethyst, "Amethyst"); GameRegistry.registerItem(MythrilIngot, "MythrilIngot"); LanguageRegistry.addName(MythrilIngot, "Mythril Ingot"); } @EventHandler public void PreInit(FMLInitializationEvent Event){ //Render proxy.registerRenderers(); //Recipe //Smelting } @EventHandler public void PostInit(FMLInitializationEvent event){ MinecraftForge.setBlockHarvestLevel(RubyOre, "pickaxe", 2); MinecraftForge.setBlockHarvestLevel(SapphireOre, "pickaxe", 2); MinecraftForge.setBlockHarvestLevel(AmethystOre, "pickaxe", 2); MinecraftForge.setBlockHarvestLevel(MythrilOre, "pickaxe", 1); MinecraftForge.setBlockHarvestLevel(RubyBlock, "pickaxe", 2); MinecraftForge.setBlockHarvestLevel(SapphireBlock, "pickaxe", 2); MinecraftForge.setBlockHarvestLevel(AmethystBlock, "pickaxe", 2); MinecraftForge.setBlockHarvestLevel(MythrilBlock, "pickaxe", 1); MinecraftForge.setBlockHarvestLevel(ObsidianForced, "pickaxe", 3); } }
package goldenmod.Items; import goldenmod.GoldenMain; import java.util.Random; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.EnumRarity; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; public class Ruby extends Item { public Ruby(int id){ super(id); this.setCreativeTab(CreativeTabs.tabMaterials); setMaxStackSize(64); } }
package goldenmod.Blocks; import goldenmod.GoldenMain; import java.util.Random; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; public class RubyOre extends Block { public RubyOre(int id) { super(id, Material.rock); this.setCreativeTab(CreativeTabs.tabBlock); } public int idDropped(int par1, Random par2Random, int par3) { return GoldenMain.Ruby.itemID; } public int quantityDropped(Random par1Random) { return 1; } }
-
Il n’y a pas d’erreur dans ton mods, envoie les logs du jeu.
-
Le problème, ca ne me génère pas de logs ;(
-
Sauf si tu as touché à un réglage, Eclipse ET Minecraft génèrent obligatoirement des logs !
Cherche dans :
ton dossier avec forge > eclipse > logs > normalement tu dois avoir des archives ou directement les logs
-
Rien, c’est quoi la paramètres qui bloque les logs?
-
Je ne crois pas qu’il y a des paramètres pouvant empêcher les logs.
Essaye ce code :
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { return this == NomDeTonMod.TonMinerai ? NomDeTonMod.TonItem : Item.getItemFromBlock(this); }
EDIT : Je n’avais pas vu que tu étais en 1.6.4. Attend que quelqu’un confirme ce code avant de l’utiliser
-
moi le problème c’est que je code en 1.6 et que le code que je lui est donner marche niquel
-
Je viens d’y penser. Essaye de détruire ton minerai avec la bonne pioche en surtout PAS en créatif (Sinon c’est normal que ton bloc ne droppe rien)
-
je pense que quand même il y a penser