mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-23 16:56:31 +01:00
Throw PlayerLevelChangeEvent and PlayerExpChangeEvent events. Thanks to feildmaster for the PR.
By: Nathan Adams <dinnerbone@dinnerbone.com>
This commit is contained in:
parent
0579af1ac0
commit
127e32a023
1 changed files with 13 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue