Make TPlayerStats an IExtendedEntityProperties + associated changes

Inventory + Knapsack inventory (and whether you have the manual) is now synced
whenever the player data is (e.g. on disconnect, on changing dimensions and
when going into the menu in SSP.

Other changes:
 * Remove Armor sync packet as it's not needed anymore
 * Move dropping of inventory and knapsack items from TEventHandler to
     TPlayerHandler. Changes to drop items will all other inventory items.
 * Make playerstats store in TPlayerHandler and make it use player UUIDs
     instead of player names (for compatibility with 1.7.6+)
 * Don't sync inventory manually on logging off / changing dimension
     (it's unneeded)
This commit is contained in:
James McKay committed 2014-03-06 22:33:35 +11:00
1 parent cc2aeb82e0
commit 244428928c
13 files changed
+137 -223

No files matched your search

@@ -459,19 +459,6 @@ public class TEventHandler
}
}
}
GameRules rules = player.worldObj.getGameRules(); // Player is null
// if this
// crashes
if (rules == null || !rules.getGameRuleBooleanValue("keepInventory"))
{
TPlayerStats stats = TConstruct.playerTracker.getPlayerStats(player.getDisplayName());
if (stats != null)
{
stats.armor.dropItems();
stats.knapsack.dropItems();
}
}
}
}
@@ -632,7 +619,7 @@ public class TEventHandler
if (event.entityLiving instanceof EntityPlayer)
{
EntityPlayer player = (EntityPlayer) event.entityLiving;
TPlayerStats stats = TConstruct.playerTracker.getPlayerStats(player.getDisplayName());
TPlayerStats stats = TPlayerStats.get(player);
if (stats != null && stats.armor != null)
{