-
Posts
16559 -
Joined
-
Last visited
-
Days Won
156
Everything posted by Draco18s
-
JDGui on your release zip will also get back a fair chunk of your code. All your class and properties will be whatever you named them, you'd only have to deal with the reobfuscated method/field names of vanilla classes. As an example: MinecraftForge.setBlockHarvestLevel(BlockMyBlock.instance, "pickaxe", 0); TileEntity.func_70306_a(TileEntityMyTE.class, "MyTE"); Most of them you'd be able to figure out from context, but the troublesome ones you can lookup through MCP
-
I'm not surprised. I had mine in postInit for a good reason (cough, probably because I backtracked the vanilla code to figure out when it registered its behaviors).
-
I think the problem is that every time you create a new EntityItem it starts with a random rotation (check the EntityItem constructor).
-
Are you making sure that this code is getting called? Also, when I mucked about with this, I called it in my mod's PostInit function, and it worked (but I was also adding custom behaviors to a custom dispenser).
-
Look at net.minecraft.dispenser DispenserBehaviorMobEgg You'll probably need to duplicate that class for your spawn eggs and add the behavior to the dispenser behavior listing (see DispenserBehaviors).
-
Wow, this is hilariously bad. /** This is set to true for client worlds, and false for server worlds. */ public boolean isRemote;
-
TBH, I yoinked that out of the....boat code.
-
float f = 1.0F; float f1 = p.prevRotationPitch + (p.rotationPitch - p.prevRotationPitch) * f; float f2 = p.prevRotationYaw + (p.rotationYaw - p.prevRotationYaw) * f; double d0 = p.prevPosX + (p.posX - p.prevPosX) * (double)f; double d1 = p.prevPosY + (p.posY - p.prevPosY) * (double)f + 1.62D - (double)p.yOffset; double d2 = p.prevPosZ + (p.posZ - p.prevPosZ) * (double)f; Vec3 vec3 = world.getWorldVec3Pool().getVecFromPool(d0, d1, d2); float f3 = MathHelper.cos(-f2 * 0.017453292F - (float)Math.PI); float f4 = MathHelper.sin(-f2 * 0.017453292F - (float)Math.PI); float f5 = -MathHelper.cos(-f1 * 0.017453292F); float f6 = MathHelper.sin(-f1 * 0.017453292F); float f7 = f4 * f5; float f8 = f3 * f5; double d3 = 5.0D; Vec3 vec31 = vec3.addVector((double)f7 * d3, (double)f6 * d3, (double)f8 * d3); MovingObjectPosition movingobjectposition = world.rayTraceBlocks_do_do(vec3, vec31, false, true); if (movingobjectposition == null) { return; } if (movingobjectposition.typeOfHit == EnumMovingObjectType.TILE) { int ix = movingobjectposition.blockX; int iy = movingobjectposition.blockY; int iz = movingobjectposition.blockZ; //block is at ix, iy, iz }
-
I know what you mean by "a damaged item" that is not causing my inability to help you. My inability to help you stems from "return a" when the function you are working with does not return an item. Of any kind. In any case, damaging an item: par0ItemStack.setItemDamage(value) If you want to change the item ID, you're going to need to make a new ItemStack(item)
-
What do you mean return a damaged item, the function: public static int getItemBurnTime returns an integer.
-
Ok great. Take an integer. Perform math on it. Return the integer.
-
Dude, it's math. I can't help you because I don't know what you need this value for.
-
It's an integer. Do whatever you want to with it.
-
par0ItemStack.getItemDamage() ?
-
net.minecraft.client.gui GuiInGame.java line 839
-
More like "no respect for anyone asking what appears to be an uninformed question" regardless of how informed that person actually is.
-
It's what happens when you tear your hair out trying to do something that should be simple, only to find that Forge didn't unfinalize something* and get dragged back into the help forum. *Lex told me that there's no reason it should be unfinalized, three days later a pull request is made, acted on, and merged with the main trunk. I think Lex just hates me.
-
[solved] problem with given player potion effects when on a block
Draco18s replied to happyPenguin's topic in Modder Support
Always check for the type you're casting to. -
[solved] problem with given player potion effects when on a block
Draco18s replied to happyPenguin's topic in Modder Support
if(entity instanceof EntityLivingBase) { //your code } -
Good thing you solved it, as that error is woefully inadequate, as there are something like FIVE different problems that will generate that error. I had the misfortune of having the most uncommon one when I was doing my gui container.
-
New modder tring to get start, not finding the information I want
Draco18s replied to sandworm55's topic in Modder Support
FML != Forge. FML converts ModLoader functions into Forge functions so that ModLoader mods are compatible with Forge. -
My guess is that you saved a reference to the icon registerer, and used it later. Bit of a workaround, but I'd have thought that it would have stopped stitching textures by then (i.e. newly added icons would be "ignored").
-
How does Minecraft detect where it is placing a block?
Draco18s replied to xxKobalxx's topic in Modder Support
Block.onAdded(...) //called any time the block is placed into the world for any reason, including block updates and being pushed by pistons. or Block.onBlockPlaced(...) //called any time the block is placed into the world by the player -
In theory. Unfortunately, that would probably be a base class edit.