Add option to force plot chat in plot areas.

This commit is contained in:
dordsor21
2020-04-16 16:55:14 +01:00
parent 6d9d0fff10
commit 3ee29297e0
3 changed files with 19 additions and 6 deletions

View File

@ -935,11 +935,15 @@ public class PlayerEvents extends PlotListener implements Listener {
PlotPlayer plotPlayer = BukkitUtil.getPlayer(event.getPlayer());
Location location = plotPlayer.getLocation();
PlotArea area = location.getPlotArea();
if (area == null || !area.isPlotChat() || !plotPlayer.getAttribute("chat")) {
if (area == null) {
return;
}
Plot plot = area.getPlot(location);
if (plot == null || !plot.getFlag(ChatFlag.class)) {
if (plot == null) {
return;
}
if (!((plot.getFlag(ChatFlag.class) && area.isPlotChat() && plotPlayer.getAttribute("chat"))
|| area.isForcingPlotChat())) {
return;
}
if (plot.isDenied(plotPlayer.getUUID())) {