Permalink
Browse files

use a better way to handle the messed up experience system

  • Loading branch information...
1 parent 0f96737 commit 39b095b8eac6e88194188144cf6aed41c38c17a3 Bone008 committed Apr 13, 2012
@@ -58,7 +58,7 @@ public void onEntityDeath(final EntityDeathEvent event) {
}
List<ItemStack> drops = e.getDrops();
- final int totalExp = ply.getTotalExperience();
+ final int totalExp = ExperienceUtils.getActualExp(ply);
List<ItemStack> keptItems = null;
int keptExp = 0;
@@ -98,7 +98,7 @@ private boolean restore() {
}
if (keptExp > 0) {
- ply.giveExp(keptExp);
+ ExperienceUtils.changeExp(ply, keptExp);
success = true;
}
}
@@ -156,7 +156,7 @@ public static void dump(Iterable<?> c) {
Logger logger = Logger.getLogger("Minecraft");
logger.info(c.getClass().getSimpleName() + ":");
for (Object o : c) {
- logger.info("\t" + o.toString());
+ logger.info("\t" + (o==null ? "null" : o.toString()));
}
}

0 comments on commit 39b095b

Please sign in to comment.