-
Posts
16559 -
Joined
-
Last visited
-
Days Won
156
Everything posted by Draco18s
-
Use all lowercase letters, both in your code and for your file/folder names.
-
[SORTA SOLVED][1.6.4] getting int with metadata from ItemStack
Draco18s replied to saxon564's topic in Modder Support
You know you can have multiple constructors...right? -
[SORTA SOLVED][1.6.4] getting int with metadata from ItemStack
Draco18s replied to saxon564's topic in Modder Support
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. -
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)
-
What do you mean by "activated"? Do you mean like how the vanilla furnace has two textures?
-
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.
-
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.
-
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.
-
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.
-
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.
-
Packets. Large amounts of data. Breaking the 32kb cap
Draco18s replied to Draco18s's topic in Modder Support
Except that I need to go both ways. -
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
-
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); } }
-
I asked this once. The path would be in a folder called /lang inside /assets (right next to /textures)
-
Packets. Large amounts of data. Breaking the 32kb cap
Draco18s replied to Draco18s's topic in Modder Support
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. -
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); }
-
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
-
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.
-
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?
-
Did you register your tile entity?
-
And would not account for partial ticks. You'd have no way to calculate the inbetweens.
-
call a method from a specific block using the blocks co-ordinates
Draco18s replied to jamiemac262's topic in Modder Support
world.raycast(...) -
Unfortunately, probably not.
-
Enchanting Table-style particles spazzing out
Draco18s replied to Whale Cancer's topic in Modder Support
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.