Jump to content

Draco18s

Members
  • Posts

    16559
  • Joined

  • Last visited

  • Days Won

    156

Everything posted by Draco18s

  1. Use all lowercase letters, both in your code and for your file/folder names.
  2. You know you can have multiple constructors...right?
  3. You probably can't, as the constructor deals with only an item ID (which, why you'd create an item stack only to get the item's ID out of it, when you could just skip the item stack, I have no idea). If you take a peek inside AITempt, you'll either find out that it doesn't care OR you'll find the variable that holds the information and how to set it.
  4. Here's a question: Does it pull the entire assets folder (which may or may not contain folders above what it necessary for the mod) or does it pull a specific folder (or folders) within the assets directory? (Also yeah, you should have waited to announce the project until your small bug was fixed)
  5. What do you mean by "activated"? Do you mean like how the vanilla furnace has two textures?
  6. Yes. You're using an old launcher to load 1.5.2, the libraries are no longer at the location the launcher expects them to be. There are like 5000 threads on this all over the forums, most of them locked because people can't freaking search.
  7. Yes, the UVs are in percentages of the texture file (a float from 0 to 1). Which is why Minecraft doesn't give two shits about texture size.
  8. Essentially, it's UV mapping (google that). What you're basically saying is that "this point in 3D space corresponds to this point on the 2D texture." For Minecraft it's generally pretty easy: all your sides are squares.
  9. Gah. I am not going to add an event handler for this. The goal of the project was to only use NBT driven effects. There's a few holes in that plan, but for the most part it works.
  10. Incorrect. The item I'm testing with should have the same speed and material harvesting as iron (because of NBT tags; the item has a tag for its material and it's saying iron). It doesn't matter if I return true OR false in canHarvest, it has the same speed and harvest level as stone (and does not call getStrVsBlock in either case for the troublesome materials). With the exception of brick and stone brick, which it acts like bare fists (no speed, no drops), which stone picks CAN harvest.
  11. Wait, so "can harvest -> true" means "don't call str vs. block" ? That seems backwards. Especially when it works just fine for obsidian and so on.
  12. Except that I need to go both ways.
  13. Show us your code? Good luck: https://github.com/Draco18s/Artifacts/blob/master/draco18s/artifacts/item/ItemArtifact.java https://github.com/Draco18s/Artifacts/blob/master/draco18s/artifacts/components/ComponentMining.java
  14. It is from ItemPickaxe: package net.minecraft.item; import net.minecraft.block.Block; import net.minecraft.block.material.Material; public class ItemPickaxe extends ItemTool { /** an array of the blocks this pickaxe is effective against */ public static final Block[] blocksEffectiveAgainst = new Block[] {Block.cobblestone, Block.stoneDoubleSlab, Block.stoneSingleSlab, Block.stone, Block.sandStone, Block.cobblestoneMossy, Block.oreIron, Block.blockIron, 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, Block.railActivator}; public ItemPickaxe(int par1, EnumToolMaterial par2EnumToolMaterial) { super(par1, 2.0F, par2EnumToolMaterial, blocksEffectiveAgainst); } /** * Returns if the item (tool) can harvest results from the block type. */ public boolean canHarvestBlock(Block par1Block) { return par1Block == Block.obsidian ? this.toolMaterial.getHarvestLevel() == 3 : (par1Block != Block.blockDiamond && par1Block != Block.oreDiamond ? (par1Block != Block.oreEmerald && par1Block != Block.blockEmerald ? (par1Block != Block.blockGold && par1Block != Block.oreGold ? (par1Block != Block.blockIron && par1Block != Block.oreIron ? (par1Block != Block.blockLapis && par1Block != Block.oreLapis ? (par1Block != Block.oreRedstone && par1Block != Block.oreRedstoneGlowing ? (par1Block.blockMaterial == Material.rock ? true : (par1Block.blockMaterial == Material.iron ? true : par1Block.blockMaterial == Material.anvil)) : this.toolMaterial.getHarvestLevel() >= 2) : this.toolMaterial.getHarvestLevel() >= 1) : this.toolMaterial.getHarvestLevel() >= 1) : this.toolMaterial.getHarvestLevel() >= 2) : this.toolMaterial.getHarvestLevel() >= 2) : this.toolMaterial.getHarvestLevel() >= 2); } /** * Returns the strength of the stack against a given block. 1.0F base, (Quality+1)*2 if correct blocktype, 1.5F if * sword */ public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block) { return par2Block != null && (par2Block.blockMaterial == Material.iron || par2Block.blockMaterial == Material.anvil || par2Block.blockMaterial == Material.rock) ? this.efficiencyOnProperMaterial : super.getStrVsBlock(par1ItemStack, par2Block); } }
  15. I asked this once. The path would be in a folder called /lang inside /assets (right next to /textures)
  16. Hey, I'm trying to figure out how to use this, and I found the class I needed to extend in order to create my own multipart packet and send it to the server (or back). But I'm not sure how I am supposed to handle the packets when received.
  17. Here's my canHarvestBlock function, which was yoinked strait from the pickaxe: public boolean canHarvestBlock(Block par1Block, ItemStack itemStack) { EnumToolMaterial toolMaterial = EnumToolMaterial.values()[itemStack.stackTagCompound.getInteger("material")]; return par1Block == Block.obsidian ? toolMaterial.getHarvestLevel() == 3 : (par1Block != Block.blockDiamond && par1Block != Block.oreDiamond ? (par1Block != Block.oreEmerald && par1Block != Block.blockEmerald ? (par1Block != Block.blockGold && par1Block != Block.oreGold ? (par1Block != Block.blockIron && par1Block != Block.oreIron ? (par1Block != Block.blockLapis && par1Block != Block.oreLapis ? (par1Block != Block.oreRedstone && par1Block != Block.oreRedstoneGlowing ? (par1Block.blockMaterial == Material.rock ? true : (par1Block.blockMaterial == Material.iron ? true : par1Block.blockMaterial == Material.anvil)) : toolMaterial.getHarvestLevel() >= 2) : toolMaterial.getHarvestLevel() >= 1) : toolMaterial.getHarvestLevel() >= 1) : toolMaterial.getHarvestLevel() >= 2) : toolMaterial.getHarvestLevel() >= 2) : toolMaterial.getHarvestLevel() >= 2); }
  18. Don't use wait() or timer. The Item class is a singleton. You should be counting update ticks and storing the result in the itemstack's NBT tags. https://github.com/Draco18s/Artifacts/blob/master/draco18s/artifacts/components/ComponentRepair.java Line 113
  19. I'm not actually using ItemTool, I have an item that is like a tool. Plus that's already inside getStrVsBlock which is NOT being called.
  20. MinecraftForge.setToolClass(myItemTool, "pickaxe", 3); ... public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block) { System.out.println("Str: " +par1ItemStack.stackTagCompound.getInteger("material")); ... return someValue; } For stone bricks and bricks, getStrVsBlock is not being called. It is for other materials, like stone, ores, and such, but NOT bricks, which pickaxes are supposed to be the tool class for. What gives?
  21. Did you register your tile entity?
  22. And would not account for partial ticks. You'd have no way to calculate the inbetweens.
  23. Unfortunately, probably not.
  24. Try rewriting the path-to-the-flowers to take the particles under ground. It's not guaranteed that they'll be inside a block, but it will be much more likely.
×
×
  • Create New...

Important Information

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