mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 05:06:44 +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
|
@EventHandler
|
||||||
public void onPlayerTakeLecternBook(PlayerTakeLecternBookEvent event) {
|
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();
|
PlotArea area = location.getPlotArea();
|
||||||
if (area == null) {
|
if (area == null) {
|
||||||
return;
|
return;
|
||||||
@ -1948,9 +1950,11 @@ public class PlayerEventListener implements Listener {
|
|||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (plot.getFlag(LecternReadBookFlag.class)) {
|
if (!plot.isAdded(pp.getUUID())) {
|
||||||
plot.debug(event.getPlayer().getName() + " could not take the book because of lectern-read-book = true");
|
if (plot.getFlag(LecternReadBookFlag.class)) {
|
||||||
event.setCancelled(true);
|
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