Throw PlayerLevelChangeEvent and PlayerExpChangeEvent events. Thanks to feildmaster for the PR.

By: Nathan Adams <dinnerbone@dinnerbone.com>
This commit is contained in:
CraftBukkit/Spigot 2012-01-19 16:06:27 +00:00
parent 0579af1ac0
commit 127e32a023

View file

@ -391,4 +391,17 @@ public class CraftEventFactory {
return event;
}
public static PlayerLevelChangeEvent callPlayerLevelChangeEvent(Player player, int oldLevel, int newLevel) {
PlayerLevelChangeEvent event = new PlayerLevelChangeEvent(player, oldLevel, newLevel);
Bukkit.getPluginManager().callEvent(event);
return event;
}
public static PlayerExpChangeEvent callPlayerExpChangeEvent(EntityHuman entity, int expAmount) {
Player player = (Player) entity.getBukkitEntity();
PlayerExpChangeEvent event = new PlayerExpChangeEvent(player, expAmount);
Bukkit.getPluginManager().callEvent(event);
return event;
}
}