Jump to content

Kore

Forge Modder
  • Posts

    239
  • Joined

  • Last visited

Everything posted by Kore

  1. this is what metadata is, the getDamage on tools or something is the metadata counting up until it hits the tool material limit so you will want to put a metadata inside of the block you want
  2. alright, so I did that and now when I do it I added a method for the ability and one for the item, so the Console says Using item with ability ability ERROR MESSAGE Alright, so the code I have is: package korcraft; import net.minecraft.src.Block; import net.minecraft.src.EntityItem; import net.minecraft.src.EntityPlayer; import net.minecraft.src.EnumToolMaterial; import net.minecraft.src.InventoryPlayer; import net.minecraft.src.Item; import net.minecraft.src.ItemStack; import net.minecraft.src.ItemTool; import net.minecraft.src.Material; public class ItemPickaxe extends ItemTool { public static final Block[] blocksEffectiveAgainst = new Block[] {Block.cobblestone, Block.stoneDoubleSlab, Block.stoneSingleSlab, Block.stone, Block.sandStone, Block.cobblestoneMossy, Block.oreIron, Block.blockSteel, Block.oreCoal, Block.blockGold, Block.oreGold, Block.oreDiamond, Block.blockDiamond, Block.ice, Block.netherrack, Block.oreLapis, Block.blockLapis, Block.oreRedstone, Block.oreRedstoneGlowing, Block.rail, Block.railDetector, Block.railPowered}; public boolean canHarvestBlock(Block par1Block){ return par1Block == Block.obsidian ? this.toolMaterial.getHarvestLevel() == 3 : (par1Block != Block.blockDiamond && par1Block != Block.oreDiamond ? (par1Block == Block.oreEmerald ? this.toolMaterial.getHarvestLevel() >= 2 : (par1Block != Block.blockGold && par1Block != Block.oreGold ? (par1Block != Block.blockSteel && par1Block != Block.oreIron ? (par1Block != Block.blockLapis && par1Block != Block.oreLapis ? (par1Block != Block.oreRedstone && par1Block != Block.oreRedstoneGlowing ? (par1Block.blockMaterial == Material.rock ? true : par1Block.blockMaterial == Material.iron) : this.toolMaterial.getHarvestLevel() >= 2) : this.toolMaterial.getHarvestLevel() >= 1) : this.toolMaterial.getHarvestLevel() >= 1) : this.toolMaterial.getHarvestLevel() >= 2)) : this.toolMaterial.getHarvestLevel() >= 2); } public ItemPickaxe(int par1, EnumToolMaterial par2EnumToolMaterial){ super(par1, 2, par2EnumToolMaterial, blocksEffectiveAgainst); } public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block){ return par2Block != null && (par2Block.blockMaterial == Material.iron || par2Block.blockMaterial == Material.rock) ? this.efficiencyOnProperMaterial : super.getStrVsBlock(par1ItemStack, par2Block); } public String getTextureFile() { return "/KorCraftTextures/Items.png"; } static String pickaxeAbility = ""; public void test(){ System.out.println("Working"); } /** * Ability Finder based on current item in inventory */ public static String getPickaxeAbility(EntityPlayer entityplayer){ if(entityplayer.inventory.getCurrentItem().getItem()==KorCraftBase.AdvBloodstonePick){ return "Flame"; }else if(entityplayer.inventory.getCurrentItem().getItem()==KorCraftBase.AdvDiopsidePick){ return "Speed"; }else if(entityplayer.inventory.getCurrentItem().getItem()==KorCraftBase.AdvKyanitePick){ return "Silktouch"; }else if(entityplayer.inventory.getCurrentItem().getItem()==KorCraftBase.AdvSapphirePick){ return "Fortune"; } return ""; } public boolean onBlockStartBreak(ItemStack itemstack, int x, int y, int z, EntityPlayer entityplayer) { String currentItem = entityplayer.inventory.getCurrentItem().getItemName(); String currentAbility = ItemPickaxe.getPickaxeAbility(entityplayer); System.out.println("Using " + currentItem + "\twith ability " + currentAbility); int getID = entityplayer.worldObj.getBlockId(x,y,z); //Finding block if(currentAbility == "Flame") { if (getID == Block.oreIron.blockID || getID == Block.oreGold.blockID || getID == Block.stone.blockID || getID == Block.wood.blockID) { EntityItem flamed = new EntityItem(null); if(getID == Block.oreIron.blockID) { flamed = new EntityItem(entityplayer.worldObj, x, y, z, new ItemStack(Item.ingotIron, 1, entityplayer.worldObj.getBlockMetadata(x, y, z))); flamed.delayBeforeCanPickup = 10; entityplayer.worldObj.spawnEntityInWorld(flamed); }else if(getID == Block.oreGold.blockID) { flamed = new EntityItem(entityplayer.worldObj, x, y, z, new ItemStack(Item.ingotGold, 1, entityplayer.worldObj.getBlockMetadata(x, y, z))); flamed.delayBeforeCanPickup = 10; entityplayer.worldObj.spawnEntityInWorld(flamed); }else if(getID == Block.stone.blockID) { flamed = new EntityItem(entityplayer.worldObj, x, y, z, new ItemStack(Block.stone, 1, entityplayer.worldObj.getBlockMetadata(x, y, z))); flamed.delayBeforeCanPickup = 10; entityplayer.worldObj.spawnEntityInWorld(flamed); }else if(getID == Block.wood.blockID) { flamed = new EntityItem(entityplayer.worldObj, x, y, z, new ItemStack(Item.coal.getMetadata(1), 1, entityplayer.worldObj.getBlockMetadata(x, y, z))); flamed.delayBeforeCanPickup = 10; entityplayer.worldObj.spawnEntityInWorld(flamed); } } return true; } return false; } }
  3. Alright, so I have made many posts about how I could make a new ability on a pickaxe, and I found it! but the problem is that I do not know how to check what item is in your hand! Please tell me what I need to have for me to be able to access that command, and where I should put it: load() method, or another method that I would have to make?
  4. Never mind I fixed it and Thanks! [spoiler][spoiler][spoiler][spoiler][spoiler][spoiler][spoiler][spoiler]Keep it coming[spoiler][spoiler][spoiler][spoiler][spoiler][spoiler][spoiler]Woot 17 spoilers[spoiler][spoiler][spoiler]20...[spoiler][spoiler][spoiler][spoiler][spoiler]25...[spoiler][spoiler][spoiler][spoiler][spoiler]30...[spoiler][spoiler][spoiler][spoiler][spoiler]Almost there! 50...[spoiler][spoiler][spoiler][spoiler][spoiler][spoiler][spoiler][spoiler][spoiler][spoiler][spoiler][spoiler][spoiler][spoiler][spoiler][spoiler][spoiler][spoiler][spoiler][spoiler][spoiler][spoiler][spoiler][spoiler][spoiler][spoiler][spoiler]Wow...ur still doin this... you should get and award for:[spoiler][spoiler][spoiler][spoiler]Exactly... stop spoiling stuff![spoiler][spoiler][spoiler]Dude seriously get a life[/spoiler][/spoiler][/spoiler][/spoiler][/spoiler][/spoiler][/spoiler][/spoiler][/spoiler][/spoiler][/spoiler][/spoiler][/spoiler][/spoiler][/spoiler][/spoiler][/spoiler][/spoiler][/spoiler][/spoiler][/spoiler][/spoiler][/spoiler][/spoiler][/spoiler][/spoiler][/spoiler][/spoiler][/spoiler][/spoiler][/spoiler][/spoiler][/spoiler][/spoiler][/spoiler][/spoiler][/spoiler][/spoiler][/spoiler][/spoiler][/spoiler][/spoiler][/spoiler][/spoiler][/spoiler][/spoiler][/spoiler][/spoiler][/spoiler][/spoiler][/spoiler][/spoiler][/spoiler][/spoiler][/spoiler][/spoiler][/spoiler][/spoiler][/spoiler][/spoiler][/spoiler][/spoiler][/spoiler][/spoiler][/spoiler][/spoiler][/spoiler]
  5. what class would I add it in: Base(Naming blocks and items) Sapling Class Log Class Other If you need me to post my code I can!
  6. I would like to know how to get my tree to generate after spawning in a world, I have the classes set up for sapling, wood, and leaves, but I can't get it to make a tree when bonemealing it or spawning in a world! Please Help!
  7. try using ModLoader.addSmelting(Int input-id, Int input-meta, ItemStack output); this is added by forge and is used to input furnace recipes into the base class without editing it Hope this helps!
  8. to add textures to new blocks, you need to do a public String getTexturefile(){ return "/ExampleFolder/TextureFile.png"; //starts with MCP/eclipse/Minecraft/bin } this will be inside the class with your item/block NOTE: you must put .png if you have multiple blocks/items in a single class, you could do public String getTexturefile(){ if(this.blockID == mod_Examplemod.ExampleBlock.blockID){ //blockID could be this.shiftedIndex if its an item return "/ExampleFolder/TextureFile.png"; //starts with MCP/eclipse/Minecraft/bin }else if(this.blockID == mod_Examplemod.ExampleBlock2.blockID){ return "/ExampleFolder/TextureFile2.png" } } So, if you wanted an 257 blocks in 1 class, you could have that do if(this.blockID <= mod_Examplemod.ExampleBlock256.blockID && this.blockID >= mod_Examplemod.ExampleBlock.blockID){ return "/Hi.png"; } else if(this.blockID >= mod_Examplemod.ExampleBlock257.blockID && this.blockID <= mod_Examplemod.ExampleBlock512.blockID){ return"/Hi2.png"; } Hope this helps!
  9. can you please explain what each of the vars are, I might be able to help then... because as of now the variables are all set to null... Please put in more code
  10. Alright, thanks that did work and I am now in my 0.0.1.1012B stage (working fuels and stuff) next step is 0.0.1.2000A(working elemental picks!)(Oh god for the coding on that... need to add a new enchantment without occupying the slot for enchantment!)
  11. is the code just finding what direction you are facing and then determining the block based on the way that you are looking? or am I just completely screwing how it works up?
  12. I want a code that I can use to change a block that you are looking at into an item for test purposes. I do not know how to find the block x y and z based on the bounding bow you are looking at If anyone has the coding for the philosophers stone so I could look at that, that would be AMAZING! Thanks, Kore
  13. To the point, If i break a block(Dirt for instance) with my special pick, I want it to drop a different item than just dirt Alright so I want to make my mod with elemental pickaxes, one as silktouch, one that autosmelts stuff, one efficiency, and one that is fortune. I can easily make the mod have an enchantment that is set on it by default, but I do not want to occupy the slot if the player would want to enchant it further. So I would like to know if there is an easy code I could use for putting that on it by default! Thank you! -Kore P.S. I know how to do it by overriding the blocks that I want to edit and putting in my own idDropped method with and if statement, but that gets confusing and might mess up with the base classes
  14. Alright so I am new to the modding community and I am wondering what I need to do to add a fuel! Here is my code for my Item Class It is near the bottom: Alright, so my problem is that it is not registering my items as a fuel when I put it in a furnace. If you have any advice please email me @ joebanko15@gmail.com }
×
×
  • Create New...

Important Information

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