iChun/Morph — pull request #199 by OniBait (2013-10-31 06:13:20+00:00)
Title: Fix for dimensions being ticked w/ the same clock

This should fix the issues that manifested themselves w/ MCPC+

1) In TickHandlerServer, the code block that was progressing a morph only happens when it is dimension 0 (https://github.com/OniBait/Morph/blob/2a3418441f772c741254b0bbd54df9d398ddabac/morph/common/core/TickHandlerServer.java#L243) but that block is inside the check against whether the clock has changed since the last world tick. Since MCPC+ loads Dimension -1 and Dimension 0 at startup, they share the same clock as well as the chance that Dimension -1 will get ticked first, so the inner block was never getting called.

Note: This has the potential to happen in Vanilla Forge if any dimensions < 0 get loaded at startup (ex: DimensionalDoors or Galacticraft) which is why I'm submitting the fix to you vs. putting a hack into MCPC+ to always tick dim 0 first.

I added some (admittedly ugly) code that should keep track of the clock per dimension (which I believe is the intended behavior anyway).

2) The NBT for EntityPlayerMP contains some custom data in a tag named "bukkit" which happens to include "LastPlayedTime", which when writing the NBT is always set to the current time. The problem here is that when the player first connects, morph is sending the player's NBT down to the client and then using the player's NBT later on when it saves the morphs. This causes the player's key to be out of sync with the server (only happens the first time I think, but w/e) -- the fix is to remove any NBT tags named "bukkit" when setting up the MorphState.identifier

Have tested this with both MCPC+ and Vanilla Forge and it all works as expected.