mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-21 20:56:45 +01:00
fix: allow trusted players to remove books from lecterns while lectern-read-book flag is true (#4336)
allow trusted players to remove books from lecterns
This commit is contained in:
parent
9be2eedf7f
commit
111ea7029e
@ -1936,7 +1936,9 @@ public class PlayerEventListener implements Listener {
|
||||
|
||||
@EventHandler
|
||||
public void onPlayerTakeLecternBook(PlayerTakeLecternBookEvent event) {
|
||||
Location location = BukkitUtil.adapt(event.getPlayer().getLocation());
|
||||
Player player = event.getPlayer();
|
||||
BukkitPlayer pp = BukkitUtil.adapt(player);
|
||||
Location location = pp.getLocation();
|
||||
PlotArea area = location.getPlotArea();
|
||||
if (area == null) {
|
||||
return;
|
||||
@ -1948,10 +1950,12 @@ public class PlayerEventListener implements Listener {
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (!plot.isAdded(pp.getUUID())) {
|
||||
if (plot.getFlag(LecternReadBookFlag.class)) {
|
||||
plot.debug(event.getPlayer().getName() + " could not take the book because of lectern-read-book = true");
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user