
Dragonold103
Members-
Posts
36 -
Joined
-
Last visited
Everything posted by Dragonold103
-
I tried to do the pulling Action (Texture 1 to Texture 2 to Texture 3) it won't work and I don't know what wrong. package net.DestroyerTools.Mod; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.enchantment.Enchantment; import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.projectile.EntityArrow; import net.minecraft.item.EnumAction; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.Icon; import net.minecraft.world.World; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.player.ArrowLooseEvent; import net.minecraftforge.event.entity.player.ArrowNockEvent; public class ModNatureBow1 extends Item { private String iconPath; private Icon icon; public static final String[] bowPullIconNameArray = new String[] {"Iron Nature Bow P1", "Iron Nature Bow P2"}; @SideOnly(Side.CLIENT) private Icon[] iconArray; public ModNatureBow1(int par1) { super(par1); this.maxStackSize = 1; this.setMaxDamage(501); this.setCreativeTab(CreativeTabs.tabCombat); } public void onPlayerStoppedUsing(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer, int par4) { int j = this.getMaxItemUseDuration(par1ItemStack) - par4; ArrowLooseEvent event = new ArrowLooseEvent(par3EntityPlayer, par1ItemStack, j); MinecraftForge.EVENT_BUS.post(event); if (event.isCanceled()) { return; } j = event.charge; boolean flag = par3EntityPlayer.capabilities.isCreativeMode || EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, par1ItemStack) > 0; if (flag || par3EntityPlayer.inventory.hasItem(mod_DestroyerTools.Nature_Arrow.itemID)) { float f = (float)j / 20.0F; f = (f * f + f * 2.0F) / 3.0F; if ((double)f < 0.1D) { return; } if (f > 1.0F) { f = 1.0F; } EntityArrow entityarrow = new EntityArrow(par2World, par3EntityPlayer, f * 6.0F); if (f == 1.0F) { entityarrow.setIsCritical(true); } int k = EnchantmentHelper.getEnchantmentLevel(Enchantment.power.effectId, par1ItemStack); if (k > 0) { entityarrow.setDamage(entityarrow.getDamage() + (double)k * 0.5D + 0.5D); } int l = EnchantmentHelper.getEnchantmentLevel(Enchantment.punch.effectId, par1ItemStack); if (l > 0) { entityarrow.setKnockbackStrength(l); } if (EnchantmentHelper.getEnchantmentLevel(Enchantment.flame.effectId, par1ItemStack) > 0) { entityarrow.setFire(100); } par1ItemStack.damageItem(1, par3EntityPlayer); par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 1.0F, 1.0F / (itemRand.nextFloat() * 0.4F + 1.2F) + f * 0.5F); if (flag) { entityarrow.canBePickedUp = 2; } else { par3EntityPlayer.inventory.consumeInventoryItem(mod_DestroyerTools.Nature_Arrow.itemID); } if (!par2World.isRemote) { par2World.spawnEntityInWorld(entityarrow); } } } public ItemStack onEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { return par1ItemStack; } public int getMaxItemUseDuration(ItemStack par1ItemStack) { return 72000; } public EnumAction getItemUseAction(ItemStack par1ItemStack) { return EnumAction.bow; } public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { ArrowNockEvent event = new ArrowNockEvent(par3EntityPlayer, par1ItemStack); MinecraftForge.EVENT_BUS.post(event); if (event.isCanceled()) { return event.result; } if (par3EntityPlayer.capabilities.isCreativeMode || par3EntityPlayer.inventory.hasItem(mod_DestroyerTools.Nature_Arrow.itemID)) { par3EntityPlayer.setItemInUse(par1ItemStack, this.getMaxItemUseDuration(par1ItemStack)); } return par1ItemStack; } public int getItemEnchantability() { return 1; } @SideOnly(Side.CLIENT) public void registerIcons(IconRegister par1IconRegister) { super.registerIcons(par1IconRegister); this.iconArray = new Icon[bowPullIconNameArray.length]; for (int i = 0; i < this.iconArray.length; ++i) { this.iconArray[i] = par1IconRegister.registerIcon(bowPullIconNameArray[i]); } } @SideOnly(Side.CLIENT) public Icon getItemIconForUseDuration(int par1) { return this.iconArray[par1]; } } can someone help me? if needed more info will be on when asked.
-
Thanks, but I'm still getting an error on the iconIndexs. Any suggestions? change it to this.icon
-
Getting errors when trying to add texture override
Dragonold103 replied to zdrivesmp's topic in Modder Support
I'll you how you can do it later ok -
Getting errors when trying to add texture override
Dragonold103 replied to zdrivesmp's topic in Modder Support
I'll tell you how you can do it later ok -
Ok thanks
-
Getting errors when trying to add texture override
Dragonold103 replied to zdrivesmp's topic in Modder Support
make it look like this and put the textures in the place I told you ok -
Getting errors when trying to add texture override
Dragonold103 replied to zdrivesmp's topic in Modder Support
what I have for the texture is ("mod/" + this.iconpath) And I have public string iconpath Then put the texture in jars = bin = minecraft.jar = textures = items or blocks = mod then put the texture in there And this is for items -
Getting errors when trying to add texture override
Dragonold103 replied to zdrivesmp's topic in Modder Support
Change iconindex to this.Icon -
Getting errors when trying to add texture override
Dragonold103 replied to zdrivesmp's topic in Modder Support
Change updateIcons to registerIcons -
I get this problem a lot and I can't fix it package net.sidemod.Mod; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.LanguageRegistry; 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.ItemCoal; import net.minecraft.item.ItemStack; import net.minecraft.src.BaseMod; public class Basemod_mod extends BaseMod { public static final String version = "Side mod V.25"; public static Item Stick_Left_Half = new ModItem(900, "Stick_Left_Half").setUnlocalizedName("Stick Left Half").setCreativeTab(CreativeTabs.tabMaterials); public static Item Stick_Right_Half = new ModItem(901, "Stick_Right_Half").setUnlocalizedName("Stick Right Half").setCreativeTab(CreativeTabs.tabMaterials); public static Item Iron_Hammer_Left_Gunpowder_Half = new ModItem(902, "Iron_Hammer_Left_Gunpowder_Half").setUnlocalizedName("Iron Hammer Left Gunpowder Half").setCreativeTab(CreativeTabs.tabMaterials); public static Item Iron_Hammer_Right_Lighter_Half = new ModItem(903, "Iron_Hammer_Right_Lighter_Half").setUnlocalizedName("Iron Hammer Right Lighter Half").setCreativeTab(CreativeTabs.tabMaterials); public static Item Gold_Hammer_Left_Gunpowder_Half = new ModItem(904, "Gold_Hammer_Left_Gunpowder_Half").setUnlocalizedName("Gold Hammer Left Gunpowder Half").setCreativeTab(CreativeTabs.tabMaterials); public static Item Gold_Hammer_Right_Lighter_Half = new ModItem(905, "Gold_Hammer_Right_Lighter_Half").setUnlocalizedName("Gold Hammer Right Lighter Half").setCreativeTab(CreativeTabs.tabMaterials); public static Item Diamond_Hammer_Left_Gunpowder_Half = new ModItem(906, "Diamond_Hammer_Left_Gunpowder_Half").setUnlocalizedName("Diamond Hammer Left Gunpowder Half").setCreativeTab(CreativeTabs.tabMaterials); public static Item Diamond_Hammer_Right_Lighter_Half = new ModItem(907, "Diamond_Hammer_Right_Lighter_Half").setUnlocalizedName("Diamond Hammer Right Lighter Half").setCreativeTab(CreativeTabs.tabMaterials); public static Item Iron_Hammer = new ModHammer(908, "Iron_Hammer", EnumToolMaterial.Strong_IRON, 0).setUnlocalizedName("Iron Hammer").setCreativeTab(CreativeTabs.tabTools); public static Item Gold_Hammer = new ModHammer(909, "Gold_Hammer", EnumToolMaterial.Strong_GOLD, 0).setUnlocalizedName("Gold Hammer").setCreativeTab(CreativeTabs.tabTools); public static Item Diamond_Hammer = new ModHammer(910, "Diamond_Hammer", EnumToolMaterial.Strong_EMERALD, 0).setUnlocalizedName("Diamond Hammer").setCreativeTab(CreativeTabs.tabTools); public static Item Strong_Iron = new ModItem(911, "Strong_Iron").setUnlocalizedName("Strong Ingot Iron"); public static Item Strong_Gold = new ModItem(912, "Strong_Gold").setUnlocalizedName("Strong Ingot Gold"); public static Item Strong_Diamond = new ModItem(913, "Strong_Diamond").setUnlocalizedName("Strong iamond"); public static Material materialOrc; public void load() { GameRegistry.addSmelting(Item.coal.itemID, new ItemStack(Item.gunpowder, 2), 8F); GameRegistry.addSmelting(Block.gravel.blockID, new ItemStack(Item.flint, 1), 8F); GameRegistry.addRecipe(new ItemStack(Stick_Left_Half, 2), new Object[]{" x", " xc", "xcv", 'x', Item.stick, 'c', Block.planks, 'v', Block.wood}); GameRegistry.addRecipe(new ItemStack(Stick_Right_Half, 2), new Object[]{ "x ", "cx", 'x', Item.stick, 'c', Block.planks,}); GameRegistry.addRecipe(new ItemStack(Iron_Hammer_Left_Gunpowder_Half), new Object[]{"xxx", "xcc ", "xxx", 'x', Item.ingotIron, 'c', Item.gunpowder}); GameRegistry.addRecipe(new ItemStack(Iron_Hammer_Right_Lighter_Half), new Object[]{" xx", " cx", " xx", 'x', Item.ingotIron, 'c', Item.flintAndSteel}); GameRegistry.addRecipe(new ItemStack(Gold_Hammer_Left_Gunpowder_Half), new Object[]{"xxx", "xcc ", "xxx", 'x', Item.ingotGold, 'c', Item.gunpowder}); GameRegistry.addRecipe(new ItemStack(Gold_Hammer_Right_Lighter_Half), new Object[]{" xx", " cx", " xx", 'x', Item.ingotGold, 'c', Item.flintAndSteel}); GameRegistry.addRecipe(new ItemStack(Diamond_Hammer_Left_Gunpowder_Half), new Object[]{"xxx", "xcc ", "xxx", 'x', Item.diamond, 'c', Item.gunpowder}); GameRegistry.addRecipe(new ItemStack(Diamond_Hammer_Right_Lighter_Half), new Object[]{" xx", " cx", " xx", 'x', Item.diamond, 'c', Item.flintAndSteel}); GameRegistry.addRecipe(new ItemStack(Iron_Hammer), new Object[]{"xc ", "vb ", 'x', Basemod_mod.Iron_Hammer_Left_Gunpowder_Half, 'c', Basemod_mod.Iron_Hammer_Right_Lighter_Half, 'v', Basemod_mod.Stick_Left_Half, 'b', Basemod_mod.Stick_Right_Half}); GameRegistry.addRecipe(new ItemStack(Gold_Hammer), new Object[]{"xc ", "vb ", 'x', Basemod_mod.Gold_Hammer_Left_Gunpowder_Half, 'c', Basemod_mod.Gold_Hammer_Right_Lighter_Half, 'v', Basemod_mod.Stick_Left_Half, 'b', Basemod_mod.Stick_Right_Half}); GameRegistry.addRecipe(new ItemStack(Diamond_Hammer), new Object[]{"xc ", "vb ", 'x', Basemod_mod.Diamond_Hammer_Left_Gunpowder_Half, 'c', Basemod_mod.Diamond_Hammer_Right_Lighter_Half, 'v', Basemod_mod.Stick_Left_Half, 'b', Basemod_mod.Stick_Right_Half}); GameRegistry.registerItem(Stick_Left_Half, "Stick_Left_Half"); GameRegistry.registerItem(Stick_Right_Half, "Stick Right Half"); GameRegistry.registerItem(Iron_Hammer_Left_Gunpowder_Half, "Iron_Hammer_Left Gunpowder_Half"); GameRegistry.registerItem(Iron_Hammer_Right_Lighter_Half, "Iron Hammer Right Lighter Half"); GameRegistry.registerItem(Gold_Hammer_Left_Gunpowder_Half, "Gold Hammer Left Gunpowder Half"); GameRegistry.registerItem(Gold_Hammer_Right_Lighter_Half, "Gold Hammer Right Lighter Half"); GameRegistry.registerItem(Diamond_Hammer_Left_Gunpowder_Half, "Diamond Hammer Left Gunpowder Half"); GameRegistry.registerItem(Diamond_Hammer_Right_Lighter_Half, "Diamond Hammer Right Lighter Half"); GameRegistry.registerItem(Iron_Hammer, "Iron Hammer"); GameRegistry.registerItem(Gold_Hammer, "Gold Hammer"); GameRegistry.registerItem(Diamond_Hammer, "Diamond Hammer"); GameRegistry.registerItem(Strong_Iron, "Strong Iron"); GameRegistry.registerItem(Strong_Gold, "Strong Gold"); GameRegistry.registerItem(Strong_Diamond, "Strong Diamond"); LanguageRegistry.addName(Stick_Left_Half, "Stick Left Half"); LanguageRegistry.addName(Stick_Right_Half, "Stick Right Half"); LanguageRegistry.addName(Iron_Hammer_Left_Gunpowder_Half, "Iron Hammer Left Gunpowder Half"); LanguageRegistry.addName(Iron_Hammer_Right_Lighter_Half, "Iron Hammer Right Lighter Half"); LanguageRegistry.addName(Gold_Hammer_Left_Gunpowder_Half, "Gold Hammer Left Gunpowder Half"); LanguageRegistry.addName(Gold_Hammer_Right_Lighter_Half, "Gold Hammer Right Lighter Half"); LanguageRegistry.addName(Diamond_Hammer_Left_Gunpowder_Half, "Diamond Hammer Left Gunpowder Half"); LanguageRegistry.addName(Diamond_Hammer_Right_Lighter_Half, "Diamond Hammer Right Lighter Half"); LanguageRegistry.addName(Iron_Hammer, "Iron Hammer"); LanguageRegistry.addName(Gold_Hammer, "Gold Hammer"); LanguageRegistry.addName(Diamond_Hammer, "Diamond Hammer"); LanguageRegistry.addName(Strong_Iron, "Strong Iron"); LanguageRegistry.addName(Strong_Gold, "Strong Gold"); LanguageRegistry.addName(Strong_Diamond, "Strong Diamond"); } public String getVersion() { return version; } } When I get to the recipe of making the hammers left gunpowder half I have to remove the bottom left iron, gold or diamond to make it and I can't make the hammer right lighter half recipe and don't know what to do, if needed the other coding will be up when needed
-
I put the texture in the right place but it can't find it still package net.sidemod.Mod; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.item.Item; import net.minecraft.util.Icon; public class ModItem extends Item { private String iconPath; @SideOnly(Side.CLIENT) private Icon icon; public ModItem(int par1, String par2Str) { super(par1); this.iconPath = par2Str; } @SideOnly(Side.CLIENT) public void updateIcons(IconRegister par1IconRegister) { this.icon = par1IconRegister.registerIcon("mod/" + this.iconPath); } @SideOnly(Side.CLIENT) public Icon getIconFromDamage(int par1) { return this.icon; } } I use the ScratchForFun from youtube I put the texture in minecraft.jar = textures = items = mod = the textures