first: style, put a whitespace after if, for reference see the existing code. Secondly, don't use == false, use !net.minecraft.server.MinecraftServer.getAllowNether().
Sorry for the delay, I was busy with work. Need to test this later this day, but you can already fix some style and best practise things.
first: style, put a blank before you start a new function, for reference see the existing code.
Unnecessary whitespace, please remove this.
What do you mean by switched around?
Well, there are a few issues here. First, please base all PR against master. I cherry-pick them into the stable branches when a new release is due.
Can you open a PR with your changes so far, so that I can look into it? Just prefix it with WIP:
We already had a discussion about cascading wordgen on our old tracker, let me reiterate the important bits:
On second thought, maybe that whole logic is flawed. durabilitymax - durability should always be >= 0, right? So just changing that to Math.max(durabilitymax - durability, 1) would do it, if I'm not mistaken.