Check if player is in arena on food level change.

This commit fixes a bug introduced in 88ddbe5ac6.

During a food level change event, if the arena is running and the food level lock is enabled, we just need to also make sure that the given player is actually in the arena, otherwise it affects everyone on the server.

Fixes #557
This commit is contained in:
Andreas Troelsen 2019-07-28 11:11:25 +02:00
parent 7f1c4b1b87
commit ba41e51e48

View File

@ -898,7 +898,7 @@ public class ArenaListener
Player p = (Player) event.getEntity();
if (arena.isRunning()) {
if (lockFoodLevel) {
if (arena.inArena(p) && lockFoodLevel) {
event.setCancelled(true);
}
} else {