Everything posted by Draco18s
-
Rendering Custom Chest Contents - Getting Contents from Server
I've got what I want working 100% except for one niggling little detail: The server doesn't send the chest contents to the client until they open the chest. How do I go about resolving this?
-
Recover files
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
-
Custom Dispenser Behaviour Help
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).
-
Render EntityItem on top of Block
I think the problem is that every time you create a new EntityItem it starts with a random rotation (check the EntityItem constructor).
-
Custom Dispenser Behaviour Help
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).
-
Custom Dispenser Behaviour Help
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).
-
Block set in code doesn't save
Wow, this is hilariously bad. /** This is set to true for client worlds, and false for server worlds. */ public boolean isRemote;
-
Getting the block a player is looking at?
TBH, I yoinked that out of the....boat code.
-
Getting the block a player is looking at?
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 }
-
SOLVED
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)
-
SOLVED
What do you mean return a damaged item, the function: public static int getItemBurnTime returns an integer.
-
SOLVED
Ok great. Take an integer. Perform math on it. Return the integer.
-
SOLVED
Dude, it's math. I can't help you because I don't know what you need this value for.
-
SOLVED
It's an integer. Do whatever you want to with it.
-
SOLVED
par0ItemStack.getItemDamage() ?
-
1.6.2 Enderdragon/Wither Health Bar
net.minecraft.client.gui GuiInGame.java line 839
-
[1.5.2] Can't have more than one GUI
More like "no respect for anyone asking what appears to be an uninformed question" regardless of how informed that person actually is.
-
[1.5.2] Can't have more than one GUI
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
Always check for the type you're casting to.
-
[solved] problem with given player potion effects when on a block
if(entity instanceof EntityLivingBase) { //your code }
-
[1.5.2] Can't have more than one GUI
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
FML != Forge. FML converts ModLoader functions into Forge functions so that ModLoader mods are compatible with Forge.
-
Making an icon depend on itemstack nbt
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?
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
-
Making an icon depend on itemstack nbt
In theory. Unfortunately, that would probably be a base class edit.
IPS spam blocked by CleanTalk.