mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 11:55:38 +01:00
Implement IntellectualSites/PlotSquaredSuggestions/96
Also make Plot Chat work properly. Not sure what was going on there before...
This commit is contained in:
parent
a44807d47b
commit
714b8dad87
@ -40,6 +40,7 @@ import com.plotsquared.core.plot.flag.implementations.BlockBurnFlag;
|
||||
import com.plotsquared.core.plot.flag.implementations.BlockIgnitionFlag;
|
||||
import com.plotsquared.core.plot.flag.implementations.BlockedCmdsFlag;
|
||||
import com.plotsquared.core.plot.flag.implementations.BreakFlag;
|
||||
import com.plotsquared.core.plot.flag.implementations.ChatFlag;
|
||||
import com.plotsquared.core.plot.flag.implementations.CoralDryFlag;
|
||||
import com.plotsquared.core.plot.flag.implementations.DenyTeleportFlag;
|
||||
import com.plotsquared.core.plot.flag.implementations.DisablePhysicsFlag;
|
||||
@ -934,11 +935,11 @@ 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 || !area.isPlotChat() || !plotPlayer.getAttribute("chat")) {
|
||||
return;
|
||||
}
|
||||
Plot plot = area.getPlot(location);
|
||||
if (plot == null) {
|
||||
if (plot == null || !plot.getFlag(ChatFlag.class)) {
|
||||
return;
|
||||
}
|
||||
if (plot.isDenied(plotPlayer.getUUID())) {
|
||||
|
@ -33,6 +33,7 @@ import com.plotsquared.core.plot.flag.implementations.BlockBurnFlag;
|
||||
import com.plotsquared.core.plot.flag.implementations.BlockIgnitionFlag;
|
||||
import com.plotsquared.core.plot.flag.implementations.BlockedCmdsFlag;
|
||||
import com.plotsquared.core.plot.flag.implementations.BreakFlag;
|
||||
import com.plotsquared.core.plot.flag.implementations.ChatFlag;
|
||||
import com.plotsquared.core.plot.flag.implementations.CoralDryFlag;
|
||||
import com.plotsquared.core.plot.flag.implementations.DenyExitFlag;
|
||||
import com.plotsquared.core.plot.flag.implementations.DenyTeleportFlag;
|
||||
@ -171,6 +172,7 @@ public final class GlobalFlagContainer extends FlagContainer {
|
||||
this.addFlag(ItemDropFlag.ITEM_DROP_TRUE);
|
||||
this.addFlag(InstabreakFlag.INSTABREAK_FALSE);
|
||||
this.addFlag(InvincibleFlag.INVINCIBLE_FALSE);
|
||||
this.addFlag(ChatFlag.CHAT_FLAG_TRUE);
|
||||
|
||||
// Enum Flags
|
||||
this.addFlag(WeatherFlag.PLOT_WEATHER_FLAG_OFF);
|
||||
|
@ -0,0 +1,45 @@
|
||||
/*
|
||||
* _____ _ _ _____ _
|
||||
* | __ \| | | | / ____| | |
|
||||
* | |__) | | ___ | |_| (___ __ _ _ _ __ _ _ __ ___ __| |
|
||||
* | ___/| |/ _ \| __|\___ \ / _` | | | |/ _` | '__/ _ \/ _` |
|
||||
* | | | | (_) | |_ ____) | (_| | |_| | (_| | | | __/ (_| |
|
||||
* |_| |_|\___/ \__|_____/ \__, |\__,_|\__,_|_| \___|\__,_|
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2020 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.plotsquared.core.plot.flag.implementations;
|
||||
|
||||
import com.plotsquared.core.configuration.Captions;
|
||||
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class ChatFlag extends BooleanFlag<ChatFlag> {
|
||||
|
||||
public static final ChatFlag CHAT_FLAG_TRUE = new ChatFlag(true);
|
||||
public static final ChatFlag CHAT_FLAG_FALSE = new ChatFlag(false);
|
||||
|
||||
protected ChatFlag(boolean value) {
|
||||
super(value, Captions.FLAG_DESCRIPTION_DENY_EXIT);
|
||||
}
|
||||
|
||||
@Override protected ChatFlag flagOf(@NotNull Boolean value) {
|
||||
return value ? CHAT_FLAG_TRUE : CHAT_FLAG_FALSE;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user