Jump to content

super_aardvark

Members
  • Posts

    3
  • Joined

  • Last visited

Everything posted by super_aardvark

  1. If a tool breaks when breaking a block, PlayerDestroyItemEvent is fired twice: first, properly, in EntityPlayer.destroyCurrentEquippedItem, and a second time, erroneously, in ItemInWorldManager.tryHarvestBlock (which first makes the call to destroyCurrentEquippedItem). See ItemInWorldManager.java:323-324 in the latest build. I trust that's clear enough without including any kind of log.
  2. FYI the hot bar comprises indices 0-8 of mainInventory.
  3. I also haven't done much modding in Minecraft in general. Many moons ago I made a simple patch to let mobs break blocks, mostly as a coding exercise/intro to modding. Now I've created a tiny mod that will replace a broken tool with another one from your inventory. (I was getting tired of opening up my inventory every time my pick broke.) I did this with MCP alone, but I want to make it available to others and have it play nicely with other mods. It seems like that's what a mod loader like FML is for... am I right? From the little I've read so far about MCForge, it seems like it's mostly designed to help people add new blocks, items, that kind of thing. This mod is a small patch (about 8 new lines) to EntityPlayer.java. If you're just dropping new files into minecraft.jar, my mod will obviously conflict with any other mod that touches that file. Can I use Forge to package my mod in a way that can be merged with other mods? Thanks EDIT: Ok, I'm on my way to answering my own question... found this in the Forge version of EntityPlayer, where my code change went: MinecraftForge.EVENT_BUS.post(new PlayerDestroyItemEvent(this, orig)); I think I saw something about events on the wiki... I'll check there. EDIT 2: Got it working.
×
×
  • Create New...

Important Information

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