Jump to content

Draco18s

Members
  • Posts

    16559
  • Joined

  • Last visited

  • Days Won

    156

Everything posted by Draco18s

  1. 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?
  2. 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
  3. 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).
  4. I think the problem is that every time you create a new EntityItem it starts with a random rotation (check the EntityItem constructor).
  5. 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).
  6. 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).
  7. Wow, this is hilariously bad. /** This is set to true for client worlds, and false for server worlds. */ public boolean isRemote;
  8. TBH, I yoinked that out of the....boat code.
  9. 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 }
  10. 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)
  11. What do you mean return a damaged item, the function: public static int getItemBurnTime returns an integer.
  12. Ok great. Take an integer. Perform math on it. Return the integer.
  13. Dude, it's math. I can't help you because I don't know what you need this value for.
  14. It's an integer. Do whatever you want to with it.
  15. par0ItemStack.getItemDamage() ?
  16. net.minecraft.client.gui GuiInGame.java line 839
  17. More like "no respect for anyone asking what appears to be an uninformed question" regardless of how informed that person actually is.
  18. 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.
  19. Always check for the type you're casting to.
  20. if(entity instanceof EntityLivingBase) { //your code }
  21. 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.
  22. FML != Forge. FML converts ModLoader functions into Forge functions so that ModLoader mods are compatible with Forge.
  23. 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").
  24. 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
  25. In theory. Unfortunately, that would probably be a base class edit.
×
×
  • Create New...

Important Information

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