mirror of
https://github.com/Zrips/Jobs.git
synced 2024-11-29 14:05:25 +01:00
Food level needs to be checked by PLayer object and not HumanEntity
This commit is contained in:
parent
d25086e3da
commit
cd973fd35d
@ -1489,12 +1489,12 @@ public final class JobsPaymentListener implements Listener {
|
||||
public void onPlayerEat(FoodLevelChangeEvent event) {
|
||||
HumanEntity human = event.getEntity();
|
||||
|
||||
if (event.getFoodLevel() <= human.getFoodLevel() || !(human instanceof Player)
|
||||
|| !Jobs.getGCManager().canPerformActionInWorld(human.getWorld()) || human.hasMetadata("NPC"))
|
||||
if (!(human instanceof Player) || !Jobs.getGCManager().canPerformActionInWorld(human.getWorld()) || human.hasMetadata("NPC"))
|
||||
return;
|
||||
|
||||
Player player = (Player) human;
|
||||
if (!player.isOnline())
|
||||
|
||||
if (!player.isOnline() || event.getFoodLevel() <= player.getFoodLevel() )
|
||||
return;
|
||||
|
||||
// check if in creative
|
||||
|
Loading…
Reference in New Issue
Block a user