Jump to content

MetroidMan347

Members
  • Posts

    7
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

MetroidMan347's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. Hello, So I've been working on a mod to add a new enchantment for digging tools that I want to make incompatible with Silk Touch. If I override the canApplyTogether method in my Enchantment class I can make it so a tool already enchanted with Silk Touch cannot have my enchantment applied to it but not vice-versa. Here is my Enchantment Class: package mm347.jake_enchants; import net.minecraft.enchantment.Enchantment; import net.minecraft.enchantment.EnchantmentDigging; import net.minecraft.enchantment.EnumEnchantmentType; public class EnchantmentSuperHeat extends EnchantmentDigging { protected EnchantmentSuperHeat(int par1, int par2) { super(par1, par2); this.setName("superHeat"); } public int getMinEnchantability(int par1) { return 1 + 10 *(par1 - 1); } public int getMaxEnchantability(int par1) { return super.getMinEnchantability(par1) + 50; } public int getMaxLevel() { return 1; } public boolean canApplyTogether(Enchantment enchantment) { return super.canApplyTogether(enchantment) && enchantment.effectId != Enchantment.silkTouch.effectId; } } TL;DR How do I ensure that my enchantment remains 100% incompatible with specific other enchantments?
  2. -________________________- FAAAAAAAAAAAAAIIIIIIIIIIIIIIIIIIIIIIIIIILLLLL It had nothing to do with my mod, I changed the stone texture in my assets. I... uuughh
  3. Well thank you, those both sound quite helpful.
  4. Hello, I am a fairly new modder, working on my second mod called RGB Gems. It adds three different kinds of ore to the game, Rubite, Sapphirite and Emerite. When in my dev environment everything works just fine like it should but when I compile my mod and add it to a Minecraft Profile the Rubite Ore texture overwrites the stone one. Everything functions correctly but it looks horrible. I'd be happy to provide any code that would be helpful in finding the problem but at the moment I have no idea what could be the cause. Any help is appreciated, thank you! Laterz, ~Jake EDIT: Okay, here's the code from my OreRubite Class: package jakegems; import java.util.Random; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.util.MathHelper; import net.minecraft.world.World; public class OreRubite extends Block { public OreRubite(int id, Material material) { super (id, material); setHardness(1.5f); setStepSound(Block.soundStoneFootstep); setTextureName("jakegems:oreRubite"); } public int idDropped (int metadata, Random random, int fortune) { return JakeGems.gemRubite.itemID; } public int quantityDroppedWithBonus(int par1, Random par2random) { return this.quantityDropped(par2random)+par2random.nextInt(par1+1); } public void dropBlockAsItemWithChance (World world, int par2, int par3, int par4, int par5, float par6, int par7) { super.dropBlockAsItemWithChance(world, par2, par3, par4, par5, par6, par7); if (this.idDropped(par5, world.rand, par7) != this.blockID) { int xporbs = 0; xporbs = MathHelper.getRandomIntegerInRange(world.rand, 0, 12); this.dropXpOnBlockBreak(world, par2, par3, par4, xporbs); } } } And from my Mod Class: package jakegems; import java.io.File; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.EnumToolMaterial; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.CraftingManager; import net.minecraftforge.common.Configuration; import net.minecraftforge.common.EnumHelper; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.ShapedOreRecipe; 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.NetworkMod; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.LanguageRegistry; @Mod(modid = "jakegems", name = "Jake's Gems Mod", version = "1.0") @NetworkMod(clientSideRequired = true, serverSideRequired = false) public class JakeGems { @Instance(value = "jakegems") public static JakeGems instance; static EnumToolMaterial toolGem = EnumHelper.addToolMaterial("LowPower", 2, 512, 8.0F, 3, 16); public static int gemRubiteID; public static int gemSapphiriteID; public static int gemEmeriteID; public static int rubitePickaxeID; public static int rubiteShovelID; public static int rubiteAxeID; public static int rubiteSwordID; public static int rubiteHoeID; public static int sapphiritePickaxeID; public static int sapphiriteShovelID; public static int sapphiriteAxeID; public static int sapphiriteSwordID; public static int sapphiriteHoeID; public static int emeritePickaxeID; public static int emeriteShovelID; public static int emeriteAxeID; public static int emeriteSwordID; public static int emeriteHoeID; public static int blockRubiteID; public static int blockSapphiriteID; public static int blockEmeriteID; public static int oreRubiteID; public static int oreSapphiriteID; public static int oreEmeriteID; public static Item gemRubite; public static Item gemSapphirite; public static Item gemEmerite; public static Item rubitePickaxe; public static Item rubiteShovel; public static Item rubiteAxe; public static Item rubiteSword; public static Item rubiteHoe; public static Item sapphiritePickaxe; public static Item sapphiriteShovel; public static Item sapphiriteAxe; public static Item sapphiriteSword; public static Item sapphiriteHoe; public static Item emeritePickaxe; public static Item emeriteShovel; public static Item emeriteAxe; public static Item emeriteSword; public static Item emeriteHoe; public static Block blockRubite; public static Block blockSapphirite; public static Block blockEmerite; public static Block oreRubite; public static Block oreSapphirite; public static Block oreEmerite; @SidedProxy(clientSide = "jakegems.client.ClientProxy", serverSide = "jakegems.CommonProxy") public static CommonProxy proxy; public static CreativeTabs tabGems = new CreativeTabs("tabGems") { public ItemStack getIconItemStack() { return new ItemStack(gemRubite, 1, 0); } }; public static CreativeTabs tabGemTools = new CreativeTabs("tabGemTools") { public ItemStack getIconItemStack() { return new ItemStack(rubitePickaxe, 1, 0); } }; public void initConfig(FMLPreInitializationEvent event) { Configuration config = new Configuration(new File("config/Jake's Gems.cfg")); config.load(); gemRubiteID = config.getItem("rubite", 8212).getInt(); gemSapphiriteID = config.getItem("sapphirite", 8213).getInt(); gemEmeriteID = config.getItem("emerite", 8214).getInt(); rubitePickaxeID = config.getItem("rubitePickaxe", 8215).getInt(); rubiteShovelID = config.getItem("rubiteShovel", 8216).getInt(); rubiteAxeID = config.getItem("rubiteAxe", 8217).getInt(); rubiteSwordID = config.getItem("rubiteSword", 8218).getInt(); rubiteHoeID = config.getItem("rubiteHoe", 8219).getInt(); sapphiritePickaxeID = config.getItem("sapphiritePickaxe", 8220).getInt(); sapphiriteShovelID = config.getItem("sapphiriteShovel", 8221).getInt(); sapphiriteAxeID = config.getItem("sapphiriteAxe", 8222).getInt(); sapphiriteSwordID = config.getItem("sapphiriteSword", 8223).getInt(); sapphiriteHoeID = config.getItem("sapphiriteHoe", 8224).getInt(); emeritePickaxeID = config.getItem("emeritePickaxe", 8225).getInt(); emeriteShovelID = config.getItem("emeriteShovel", 8226).getInt(); emeriteAxeID = config.getItem("emeriteAxe", 8227).getInt(); emeriteSwordID = config.getItem("emeriteSword", 8228).getInt(); emeriteHoeID = config.getItem("emeriteHoe", 8229).getInt(); blockRubiteID = config.getBlock("blockRubite", 2528).getInt(); blockSapphiriteID = config.getBlock("blockSapphirite", 2529).getInt(); blockEmeriteID = config.getBlock("blockEmerite", 2530).getInt(); oreRubiteID = config.getBlock("oreRubite", 2531).getInt(); oreSapphiriteID = config.getBlock("oreSapphirite", 2532).getInt(); oreEmeriteID = config.getBlock("oreEmerite", 2533).getInt(); config.save(); } private void addItems() { //Items gemRubite = new BasicItem(this.gemRubiteID) .setUnlocalizedName("gemRubite") .setTextureName("jakegems:gemRubite") .setCreativeTab(this.tabGems); gemSapphirite = new BasicItem(this.gemSapphiriteID) .setUnlocalizedName("gemSapphirite") .setTextureName("jakegems:gemSapphirite") .setCreativeTab(this.tabGems); gemEmerite = new BasicItem(this.gemEmeriteID) .setUnlocalizedName("gemEmerite") .setTextureName("jakegems:gemEmerite") .setCreativeTab(this.tabGems); //Tools //Rubite rubitePickaxe = new BasicPickaxe(this.rubitePickaxeID, toolGem) .setUnlocalizedName("rubitePickaxe") .setTextureName("jakegems:rubitePickaxe") .setCreativeTab(this.tabGemTools); rubiteShovel = new BasicShovel(this.rubiteShovelID, toolGem) .setUnlocalizedName("rubiteShovel") .setTextureName("jakegems:rubiteShovel") .setCreativeTab(this.tabGemTools); rubiteAxe = new BasicAxe(this.rubiteAxeID, toolGem) .setUnlocalizedName("rubiteAxe") .setTextureName("jakegems:rubiteAxe") .setCreativeTab(this.tabGemTools); rubiteSword = new BasicSword(this.rubiteSwordID, toolGem) .setUnlocalizedName("rubiteSword") .setTextureName("jakegems:rubiteSword") .setCreativeTab(this.tabGemTools); rubiteHoe = new BasicHoe(this.rubiteHoeID, toolGem) .setUnlocalizedName("rubiteHoe") .setTextureName("jakegems:rubiteHoe") .setCreativeTab(this.tabGemTools); //Sapphirite sapphiritePickaxe = new BasicPickaxe(this.sapphiritePickaxeID, toolGem) .setUnlocalizedName("sapphiritePickaxe") .setTextureName("jakegems:sapphiritePickaxe") .setCreativeTab(this.tabGemTools); sapphiriteShovel = new BasicShovel(this.sapphiriteShovelID, toolGem) .setUnlocalizedName("sapphiriteShovel") .setTextureName("jakegems:sapphiriteShovel") .setCreativeTab(this.tabGemTools); sapphiriteAxe = new BasicAxe(this.sapphiriteAxeID, toolGem) .setUnlocalizedName("sapphiriteAxe") .setTextureName("jakegems:sapphiriteAxe") .setCreativeTab(this.tabGemTools); sapphiriteSword = new BasicSword(this.sapphiriteSwordID, toolGem) .setUnlocalizedName("sapphiriteSword") .setTextureName("jakegems:sapphiriteSword") .setCreativeTab(this.tabGemTools); sapphiriteHoe = new BasicHoe(this.sapphiriteHoeID, toolGem) .setUnlocalizedName("sapphiriteHoe") .setTextureName("jakegems:sapphiriteHoe") .setCreativeTab(this.tabGemTools); //Emerite emeritePickaxe = new BasicPickaxe(this.emeritePickaxeID, toolGem) .setUnlocalizedName("emeritePickaxe") .setTextureName("jakegems:emeritePickaxe") .setCreativeTab(this.tabGemTools); emeriteShovel = new BasicShovel(this.emeriteShovelID, toolGem) .setUnlocalizedName("emeriteShovel") .setTextureName("jakegems:emeriteShovel") .setCreativeTab(this.tabGemTools); emeriteAxe = new BasicAxe(this.emeriteAxeID, toolGem) .setUnlocalizedName("emeriteAxe") .setTextureName("jakegems:emeriteAxe") .setCreativeTab(this.tabGemTools); emeriteSword = new BasicSword(this.emeriteSwordID, toolGem) .setUnlocalizedName("emeriteSword") .setTextureName("jakegems:emeriteSword") .setCreativeTab(this.tabGemTools); emeriteHoe = new BasicHoe(this.emeriteHoeID, toolGem) .setUnlocalizedName("emeriteHoe") .setTextureName("jakegems:emeriteHoe") .setCreativeTab(this.tabGemTools); } private void addBlocks() { blockRubite = new BasicBlock(this.blockRubiteID, Material.rock) .setUnlocalizedName("blockRubite") .setTextureName("jakegems:blockRubite") .setCreativeTab(this.tabGems); blockSapphirite = new BasicBlock(this.blockSapphiriteID, Material.rock) .setUnlocalizedName("blockSapphirite") .setTextureName("jakegems:blockSapphirite") .setCreativeTab(this.tabGems); blockEmerite = new BasicBlock(this.blockEmeriteID, Material.rock) .setUnlocalizedName("blockEmerite") .setTextureName("jakegems:blockEmerite") .setCreativeTab(this.tabGems); oreRubite = new OreRubite(this.oreRubiteID, Material.rock) .setUnlocalizedName("oreRubite") .setCreativeTab(this.tabGems); oreSapphirite = new OreSapphirite(this.oreSapphiriteID, Material.rock) .setUnlocalizedName("oreSapphirite") .setCreativeTab(this.tabGems); oreEmerite = new OreEmerite(this.oreEmeriteID, Material.rock) .setUnlocalizedName("oreEmerite") .setCreativeTab(this.tabGems); GameRegistry.registerBlock(blockRubite, "blockRubite"); GameRegistry.registerBlock(blockSapphirite, "blockSapphirite"); GameRegistry.registerBlock(blockEmerite, "blockEmerite"); GameRegistry.registerBlock(oreRubite, "oreRubite"); GameRegistry.registerBlock(oreSapphirite, "oreSapphirite"); GameRegistry.registerBlock(oreEmerite, "oreEmerite"); MinecraftForge.setBlockHarvestLevel(blockRubite, "pickaxe", 1); MinecraftForge.setBlockHarvestLevel(blockSapphirite, "pickaxe", 1); MinecraftForge.setBlockHarvestLevel(blockEmerite, "pickaxe", 1); MinecraftForge.setBlockHarvestLevel(oreRubite, "pickaxe", 2); MinecraftForge.setBlockHarvestLevel(oreSapphirite, "pickaxe", 2); MinecraftForge.setBlockHarvestLevel(oreEmerite, "pickaxe", 2); } private void addNames() { //Creative Tabs LanguageRegistry.instance().addStringLocalization("itemGroup.tabGems", "en_US", "RGB Gems"); LanguageRegistry.instance().addStringLocalization("itemGroup.tabGemTools", "en_US", "Gem Tools"); //Items LanguageRegistry.addName(gemRubite,"Rubite Gemstone"); LanguageRegistry.addName(gemSapphirite,"Sapphirite Gemstone"); LanguageRegistry.addName(gemEmerite,"Emerite Gemstone"); //Tools LanguageRegistry.addName(rubitePickaxe,"Rubite Pickaxe"); LanguageRegistry.addName(rubiteShovel,"Rubite Shovel"); LanguageRegistry.addName(rubiteAxe,"Rubite Axe"); LanguageRegistry.addName(rubiteSword,"Rubite Sword"); LanguageRegistry.addName(rubiteHoe,"Rubite Hoe"); LanguageRegistry.addName(sapphiritePickaxe,"Sapphirite Pickaxe"); LanguageRegistry.addName(sapphiriteShovel,"Sapphirite Shovel"); LanguageRegistry.addName(sapphiriteAxe,"Sapphirite Axe"); LanguageRegistry.addName(sapphiriteSword,"Sapphirite Sword"); LanguageRegistry.addName(sapphiriteHoe,"Sapphirite Hoe"); LanguageRegistry.addName(emeritePickaxe,"Emerite Pickaxe"); LanguageRegistry.addName(emeriteShovel,"Emerite Shovel"); LanguageRegistry.addName(emeriteAxe,"Emerite Axe"); LanguageRegistry.addName(emeriteSword,"Emerite Sword"); LanguageRegistry.addName(emeriteHoe,"Emerite Hoe"); //Blocks LanguageRegistry.addName(blockRubite,"Block of Rubite"); LanguageRegistry.addName(blockSapphirite,"Block of Sapphirite"); LanguageRegistry.addName(blockEmerite,"Block of Emerite"); LanguageRegistry.addName(oreRubite,"Rubite Ore"); LanguageRegistry.addName(oreSapphirite,"Sapphirite Ore"); LanguageRegistry.addName(oreEmerite,"Emerite Ore"); } private void addRecipes() { //Rubite GameRegistry.addRecipe(new ShapedOreRecipe(blockRubite, true, new Object[]{"FFF","FFF","FFF", Character.valueOf('F'), "gemRuby"})); GameRegistry.addRecipe(new ShapedOreRecipe(rubitePickaxe, true, new Object[]{"FFF", " X ", " X ", Character.valueOf('F'), "gemRuby", Character.valueOf('X'), Item.stick})); GameRegistry.addRecipe(new ShapedOreRecipe(rubiteShovel, true, new Object[]{" F ", " X ", " X ", Character.valueOf('F'), "gemRuby", Character.valueOf('X'), Item.stick})); GameRegistry.addRecipe(new ShapedOreRecipe(rubiteAxe, true, new Object[]{"FF ", "FX ", " X ", Character.valueOf('F'), "gemRuby", Character.valueOf('X'), Item.stick})); GameRegistry.addRecipe(new ShapedOreRecipe(rubiteSword, true, new Object[]{" F ", " F ", " X ", Character.valueOf('F'), "gemRuby", Character.valueOf('X'), Item.stick})); GameRegistry.addRecipe(new ShapedOreRecipe(rubiteHoe, true, new Object[]{"FF ", " X ", " X ", Character.valueOf('F'), "gemRuby", Character.valueOf('X'), Item.stick})); //Sapphirite GameRegistry.addRecipe(new ShapedOreRecipe(blockSapphirite, true, new Object[]{"FFF","FFF","FFF", Character.valueOf('F'), "gemSapphire"})); GameRegistry.addRecipe(new ShapedOreRecipe(sapphiritePickaxe, true, new Object[]{"FFF", " X ", " X ", Character.valueOf('F'), "gemSapphire", Character.valueOf('X'), Item.stick})); GameRegistry.addRecipe(new ShapedOreRecipe(sapphiriteShovel, true, new Object[]{" F ", " X ", " X ", Character.valueOf('F'), "gemSapphire", Character.valueOf('X'), Item.stick})); GameRegistry.addRecipe(new ShapedOreRecipe(sapphiriteAxe, true, new Object[]{"FF ", "FX ", " X ", Character.valueOf('F'), "gemSapphire", Character.valueOf('X'), Item.stick})); GameRegistry.addRecipe(new ShapedOreRecipe(sapphiriteSword, true, new Object[]{" F ", " F ", " X ", Character.valueOf('F'), "gemSapphire", Character.valueOf('X'), Item.stick})); GameRegistry.addRecipe(new ShapedOreRecipe(sapphiriteHoe, true, new Object[]{"FF ", " X ", " X ", Character.valueOf('F'), "gemSapphire", Character.valueOf('X'), Item.stick})); //Emerite GameRegistry.addRecipe(new ShapedOreRecipe(blockEmerite, true, new Object[]{"FFF","FFF","FFF", Character.valueOf('F'), "gemGreenSapphire"})); GameRegistry.addRecipe(new ShapedOreRecipe(emeritePickaxe, true, new Object[]{"FFF", " X ", " X ", Character.valueOf('F'), "gemGreenSapphire", Character.valueOf('X'), Item.stick})); GameRegistry.addRecipe(new ShapedOreRecipe(emeriteShovel, true, new Object[]{" F ", " X ", " X ", Character.valueOf('F'), "gemGreenSapphire", Character.valueOf('X'), Item.stick})); GameRegistry.addRecipe(new ShapedOreRecipe(emeriteAxe, true, new Object[]{"FF ", "FX ", " X ", Character.valueOf('F'), "gemGreenSapphire", Character.valueOf('X'), Item.stick})); GameRegistry.addRecipe(new ShapedOreRecipe(emeriteSword, true, new Object[]{" F ", " F ", " X ", Character.valueOf('F'), "gemGreenSapphire", Character.valueOf('X'), Item.stick})); GameRegistry.addRecipe(new ShapedOreRecipe(emeriteHoe, true, new Object[]{"FF ", " X ", " X ", Character.valueOf('F'), "gemGreenSapphire", Character.valueOf('X'), Item.stick})); } private void registerOreDictionary() { OreDictionary.registerOre("gemRuby", new ItemStack(gemRubite)); OreDictionary.registerOre("gemSapphire", new ItemStack(gemSapphirite)); OreDictionary.registerOre("gemGreenSapphire", new ItemStack(gemEmerite)); OreDictionary.registerOre("oreRuby", new ItemStack(oreRubite)); OreDictionary.registerOre("oreSapphire", new ItemStack(oreSapphirite)); OreDictionary.registerOre("oreGreenSapphire", new ItemStack(oreEmerite)); } @EventHandler public void preInit(FMLPreInitializationEvent event) { this.initConfig(event); addItems(); addBlocks(); addNames(); } @EventHandler public void load (FMLInitializationEvent event) { proxy.registerRenderers(); GameRegistry.registerWorldGenerator(new GemOreGenerator()); registerOreDictionary(); } @EventHandler public void postInit (FMLPostInitializationEvent event) { addRecipes(); } } Hopefully that helps somewhat.
  5. Ahh! Thank you very much! This did exactly what I needed!
  6. Hello. So I've recently begun my second mod which I've named Jake's Gems which adds gems very similar to the ones in RedPower2. Yes, I'm aware this idea is not very original, but I wanted to make it both as a learning experience and something to complement a custom modpack of mine. Anyway the problem I'm having is just like the title says. My custom ore is unaffected by being broken with a Fortune Pickaxe. Here is the code in my RubiteOre class: package jakegems; import java.util.Random; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.util.MathHelper; import net.minecraft.world.World; public class RubiteOre extends Block { public RubiteOre(int id, Material material) { super (id, material); setHardness(1.5f); setStepSound(Block.soundStoneFootstep); setUnlocalizedName("newBlock"); setCreativeTab(CreativeTabs.tabMisc); } public int idDropped (int metadata, Random random, int fortune) { return JakeGems.gemRubite.itemID; } public void dropBlockAsItemWithChance (World world, int par2, int par3, int par4, int par5, float par6, int par7) { super.dropBlockAsItemWithChance(world, par2, par3, par4, par5, par6, par7); if (this.idDropped(par5, world.rand, par7) != this.blockID) { int xporbs = 0; xporbs = MathHelper.getRandomIntegerInRange(world.rand, 0, 12); this.dropXpOnBlockBreak(world, par2, par3, par4, xporbs); } } } Any and all help received is greatly appreciated, thank you! Laterz, ~Jake
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.