Jump to content

dries007

Forge Modder
  • Posts

    317
  • Joined

  • Last visited

Everything posted by dries007

  1. Well I found a way, but I need to edit "NetServerHandler.java" to override parts of "handleBlockDig" and "handlePlace". I now bypass the spawn-protection check there and use the one in "this.playerEntity.worldObj.canMineBlock" (That is overridden by WorldServer.java's canMineBlock so the hook should be added there) , By doing this you can allow and deny block-changes in 1 loop instead of 2. If your mod then wants to deny (or specifically allow) block-changes you only need to 'add' a deny (or allow) condition to the "canMineBlock" hook. (I'd like it to work like the IChatHandler. Intercepting all request and forwarding them to registered handlers and if the mod doesn't deny (or allow) the block-change you let the vanilla code do it) I hope my explanation was clear, I have can't express it better. Ps There is already a spawn-protection in "this.playerEntity.worldObj.canMineBlock", but it doesn't do anything. (to my knowledge)
  2. I'm looking into an area protection, but it's hard... I don't think there are forge hooks for that, but I have no clue on how to request them, and If I have to make it myself, how they need to be formatted,....., And the MC spawn protection is complicated as f*
  3. I had no clue myself, I just made a repository and installed the windows client, made a local copy of the repository, opened the folder and put in my mod file. I haven't found a good tutorial myself
  4. oh, btw, I think the flint and steel is a better example then the sword
  5. Awsome, I'd like to make such a thing, TomyLobo is cleaning up my code on github
  6. I'm working without the code in front of me, but cant you intercept a right-click event, make that check if the wrench is in the players hand, if so, damage - 1? The sword is Left-click, so maybe it needs to be coded diffidently? (I'm @ school right now, I'll be home in 1h/1h30. I want to know how to do this to )
×
×
  • Create New...

Important Information

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