Allow added players to use frost walker

Properly fixes #1438
This commit is contained in:
Jesse Boyd 2016-11-30 20:46:48 +11:00
parent 2b561f2efa
commit c891abce09
No known key found for this signature in database
GPG Key ID: 59F1DE6293AF6E1F

View File

@ -817,6 +817,27 @@ public class PlayerEvents extends PlotListener implements Listener {
event.setCancelled(true);
return;
}
Entity entity = event.getEntity();
if (entity instanceof Player) {
Player player = (Player) entity;
if (!plot.hasOwner()) {
PlotPlayer plotPlayer = BukkitUtil.getPlayer(player);
if (Flags.ICE_FORM.isTrue(plot)) {
return;
}
event.setCancelled(true);
return;
}
PlotPlayer plotPlayer = BukkitUtil.getPlayer(player);
if (!plot.isAdded(plotPlayer.getUUID())) {
if (Flags.ICE_FORM.isTrue(plot)) {
return;
}
event.setCancelled(true);
return;
}
return;
}
if (!Flags.ICE_FORM.isTrue(plot)) {
event.setCancelled(true);
}