Port all boolean flags.

This commit is contained in:
Alexander Söderberg 2020-02-16 19:47:05 +01:00
parent 49344da749
commit 71b2c34bc3
58 changed files with 1165 additions and 162 deletions

View File

@ -3,7 +3,7 @@ package com.github.intellectualsites.plotsquared.bukkit.listeners;
import com.github.intellectualsites.plotsquared.bukkit.object.BukkitPlayer;
import com.github.intellectualsites.plotsquared.bukkit.util.BukkitUtil;
import com.github.intellectualsites.plotsquared.plot.config.Captions;
import com.github.intellectualsites.plotsquared.plot.flag.Flags;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.ForcefieldFlag;
import com.github.intellectualsites.plotsquared.plot.object.Location;
import com.github.intellectualsites.plotsquared.plot.object.Plot;
import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer;
@ -80,7 +80,7 @@ import java.util.UUID;
}
public static void handleForcefield(Player player, PlotPlayer plotPlayer, Plot plot) {
if (Flags.FORCEFIELD.isTrue(plot)) {
if (plot.getFlag(ForcefieldFlag.class)) {
UUID uuid = plotPlayer.getUUID();
if (plot.isAdded(uuid)) {
Set<PlotPlayer> players = getNearbyPlayers(player, plot);

View File

@ -8,9 +8,40 @@ import com.github.intellectualsites.plotsquared.plot.PlotSquared;
import com.github.intellectualsites.plotsquared.plot.config.Captions;
import com.github.intellectualsites.plotsquared.plot.config.Settings;
import com.github.intellectualsites.plotsquared.plot.flag.Flags;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.AnimalAttackFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.AnimalInteractFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.BlockBurnFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.BlockIgnitionFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.DisablePhysicsFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.DoneFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.ExplosionFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.GrassGrowFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.HangingBreakFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.HangingPlaceFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.HostileAttackFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.HostileInteractFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.IceFormFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.IceMeltFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.KelpGrowFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.LiquidFlowFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.MiscBreakFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.MiscInteractFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.MobPlaceFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.MycelGrowFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.PlayerInteractFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.PveFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.PvpFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.RedstoneFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.SnowFormFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.SnowMeltFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.SoilDryFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.TamedAttackFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.TamedInteractFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.UntrustedVisitFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.VehicleBreakFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.VehicleUseFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.VillagerInteractFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.VineGrowFlag;
import com.github.intellectualsites.plotsquared.plot.listener.PlayerBlockEventType;
import com.github.intellectualsites.plotsquared.plot.listener.PlotListener;
import com.github.intellectualsites.plotsquared.plot.object.Location;
@ -414,7 +445,7 @@ import java.util.regex.Pattern;
if (plot == null) {
return;
}
if (Flags.REDSTONE.isFalse(plot)) {
if (!plot.getFlag(RedstoneFlag.class)) {
event.setNewCurrent(0);
return;
}
@ -468,7 +499,7 @@ import java.util.regex.Pattern;
if (plot == null) {
return;
}
if (Flags.REDSTONE.isFalse(plot)) {
if (!plot.getFlag(RedstoneFlag.class)) {
event.setCancelled(true);
}
return;
@ -490,7 +521,7 @@ import java.util.regex.Pattern;
if (plot == null) {
return;
}
if (Flags.DISABLE_PHYSICS.isFalse(plot)) {
if (plot.getFlag(DisablePhysicsFlag.class)) {
event.setCancelled(true);
}
return;
@ -1220,7 +1251,7 @@ import java.util.regex.Pattern;
PlotArea area = location.getPlotArea();
if (area != null) {
Plot plot = area.getOwnedPlot(location);
if (plot != null && Flags.MOB_BREAK.isTrue(plot)) {
if (plot != null && plot.getFlag(MobPlaceFlag.class)) {
return;
}
event.setCancelled(true);
@ -1249,7 +1280,7 @@ import java.util.regex.Pattern;
Player player = (Player) entity;
if (!plot.hasOwner()) {
PlotPlayer plotPlayer = BukkitUtil.getPlayer(player);
if (Flags.ICE_FORM.isTrue(plot)) {
if (plot.getFlag(IceFormFlag.class)) {
return;
}
event.setCancelled(true);
@ -1257,7 +1288,7 @@ import java.util.regex.Pattern;
}
PlotPlayer plotPlayer = BukkitUtil.getPlayer(player);
if (!plot.isAdded(plotPlayer.getUUID())) {
if (Flags.ICE_FORM.isTrue(plot)) {
if (plot.getFlag(IceFormFlag.class)) {
return;
}
event.setCancelled(true);
@ -1265,7 +1296,7 @@ import java.util.regex.Pattern;
}
return;
}
if (!Flags.ICE_FORM.isTrue(plot)) {
if (!plot.getFlag(IceFormFlag.class)) {
event.setCancelled(true);
}
}
@ -1288,22 +1319,22 @@ import java.util.regex.Pattern;
}
switch (event.getSource().getType()) {
case GRASS:
if (Flags.GRASS_GROW.isFalse(plot)) {
if (!plot.getFlag(GrassGrowFlag.class)) {
event.setCancelled(true);
}
break;
case MYCELIUM:
if (Flags.MYCEL_GROW.isFalse(plot)) {
if (!plot.getFlag(MycelGrowFlag.class)) {
event.setCancelled(true);
}
break;
case VINE:
if (Flags.VINE_GROW.isFalse(plot)) {
if (!plot.getFlag(VineGrowFlag.class)) {
event.setCancelled(true);
}
break;
case KELP:
if (Flags.KELP_GROW.isFalse(plot)) {
if (!plot.getFlag(KelpGrowFlag.class)) {
event.setCancelled(true);
}
break;
@ -1329,14 +1360,14 @@ import java.util.regex.Pattern;
switch (event.getNewState().getType()) {
case SNOW:
case SNOW_BLOCK:
if (Flags.SNOW_FORM.isFalse(plot)) {
if (!plot.getFlag(SnowFormFlag.class)) {
event.setCancelled(true);
}
return;
case ICE:
case FROSTED_ICE:
case PACKED_ICE:
if (Flags.ICE_FORM.isFalse(plot)) {
if (!plot.getFlag(IceFormFlag.class)) {
event.setCancelled(true);
}
}
@ -1401,17 +1432,17 @@ import java.util.regex.Pattern;
}
switch (block.getType()) {
case ICE:
if (Flags.ICE_MELT.isFalse(plot)) {
if (!plot.getFlag(IceMeltFlag.class)) {
event.setCancelled(true);
}
break;
case SNOW:
if (Flags.SNOW_MELT.isFalse(plot)) {
if (!plot.getFlag(SnowMeltFlag.class)) {
event.setCancelled(true);
}
break;
case FARMLAND:
if (Flags.SOIL_DRY.isFalse(plot)) {
if (!plot.getFlag(SoilDryFlag.class)) {
event.setCancelled(true);
}
break;
@ -1430,7 +1461,7 @@ import java.util.regex.Pattern;
Plot plot = area.getOwnedPlot(tLocation);
Location fLocation = BukkitUtil.getLocation(from.getLocation());
if (plot != null) {
if (Flags.DISABLE_PHYSICS.isFalse(plot)) {
if (plot.getFlag(DisablePhysicsFlag.class)) {
event.setCancelled(true);
return;
} else if (!area.contains(fLocation.getX(), fLocation.getZ()) || !Objects
@ -1438,7 +1469,7 @@ import java.util.regex.Pattern;
event.setCancelled(true);
return;
}
if (Flags.LIQUID_FLOW.isFalse(plot)) {
if (plot.getFlag(LiquidFlowFlag.class)) {
switch (to.getType()) {
case WATER:
case LAVA:
@ -1825,7 +1856,7 @@ import java.util.regex.Pattern;
if (plot.isAdded(uuid)) {
return;
}
if (Flags.MISC_INTERACT.isTrue(plot)) {
if (plot.getFlag(MiscInteractFlag.class)) {
return;
}
if (!Permissions.hasPermission(pp, "plots.admin.interact.other")) {
@ -2110,7 +2141,7 @@ import java.util.regex.Pattern;
return;
}
Plot plot = area.getOwnedPlotAbs(location);
if (plot == null || plot.getFlag(Flags.DISABLE_PHYSICS, false)) {
if (plot == null || plot.getFlag(DisablePhysicsFlag.class)) {
event.setCancelled(true);
return;
}
@ -2146,7 +2177,7 @@ import java.util.regex.Pattern;
}
Plot plot = location.getOwnedPlot();
if (plot == null || !plot.getFlag(Flags.BLOCK_BURN, false)) {
if (plot == null || !plot.getFlag(BlockBurnFlag.class)) {
event.setCancelled(true);
}
@ -2189,7 +2220,7 @@ import java.util.regex.Pattern;
Captions.PERMISSION_ADMIN_BUILD_OTHER);
event.setCancelled(true);
}
} else if (Flags.BLOCK_IGNITION.isFalse(plot)) {
} else if (!plot.getFlag(BlockIgnitionFlag.class)) {
event.setCancelled(true);
}
} else {
@ -2198,7 +2229,7 @@ import java.util.regex.Pattern;
return;
}
if (ignitingEntity != null) {
if (!plot.getFlag(Flags.BLOCK_IGNITION, false)) {
if (!plot.getFlag(BlockIgnitionFlag.class)) {
event.setCancelled(true);
return;
}
@ -2224,11 +2255,11 @@ import java.util.regex.Pattern;
Block ignitingBlock = event.getIgnitingBlock();
Plot plotIgnited = BukkitUtil.getLocation(ignitingBlock.getLocation()).getPlot();
if (igniteCause == BlockIgniteEvent.IgniteCause.FLINT_AND_STEEL && (
!plot.getFlag(Flags.BLOCK_IGNITION, false) || plotIgnited == null
!plot.getFlag(BlockIgnitionFlag.class) || plotIgnited == null
|| !plotIgnited.equals(plot)) ||
(igniteCause == BlockIgniteEvent.IgniteCause.SPREAD
|| igniteCause == BlockIgniteEvent.IgniteCause.LAVA) && (
!plot.getFlag(Flags.BLOCK_IGNITION).orElse(false) || plotIgnited == null
!plot.getFlag(BlockIgnitionFlag.class) || plotIgnited == null
|| !plotIgnited.equals(plot))) {
event.setCancelled(true);
}
@ -2395,7 +2426,7 @@ import java.util.regex.Pattern;
return;
}
if (!plot.isAdded(pp.getUUID())) {
if (!plot.getFlag(Flags.HANGING_PLACE, false)) {
if (!plot.getFlag(HangingPlaceFlag.class)) {
if (!Permissions.hasPermission(pp, Captions.PERMISSION_ADMIN_BUILD_OTHER)) {
MainUtil.sendMessage(pp, Captions.NO_PERMISSION_EVENT,
Captions.PERMISSION_ADMIN_BUILD_OTHER);
@ -2436,7 +2467,7 @@ import java.util.regex.Pattern;
event.setCancelled(true);
}
} else if (!plot.isAdded(pp.getUUID())) {
if (plot.getFlag(Flags.HANGING_BREAK, false)) {
if (plot.getFlag(HangingBreakFlag.class)) {
return;
}
if (!Permissions.hasPermission(pp, Captions.PERMISSION_ADMIN_DESTROY_OTHER)) {
@ -2465,7 +2496,7 @@ import java.util.regex.Pattern;
event.setCancelled(true);
}
} else if (!plot.isAdded(player.getUUID())) {
if (!plot.getFlag(Flags.HANGING_BREAK, false)) {
if (!plot.getFlag(HangingBreakFlag.class)) {
if (!Permissions
.hasPermission(player, Captions.PERMISSION_ADMIN_DESTROY_OTHER)) {
MainUtil.sendMessage(player, Captions.NO_PERMISSION_EVENT,
@ -2505,26 +2536,26 @@ import java.util.regex.Pattern;
}
} else if (!plot.isAdded(pp.getUUID())) {
Entity entity = event.getRightClicked();
if (entity instanceof Monster && plot.getFlag(Flags.HOSTILE_INTERACT, false)) {
if (entity instanceof Monster && plot.getFlag(HostileInteractFlag.class)) {
return;
}
if (entity instanceof Animals && plot.getFlag(Flags.ANIMAL_INTERACT, false)) {
if (entity instanceof Animals && plot.getFlag(AnimalInteractFlag.class)) {
return;
}
if (entity instanceof Tameable && ((Tameable) entity).isTamed() && plot
.getFlag(Flags.TAMED_INTERACT, false)) {
if (entity instanceof Tameable && ((Tameable) entity).isTamed() && plot.getFlag(
TamedInteractFlag.class)) {
return;
}
if (entity instanceof Vehicle && plot.getFlag(Flags.VEHICLE_USE, false)) {
if (entity instanceof Vehicle && plot.getFlag(VehicleUseFlag.class)) {
return;
}
if (entity instanceof Player && plot.getFlag(Flags.PLAYER_INTERACT, false)) {
if (entity instanceof Player && plot.getFlag(PlayerInteractFlag.class)) {
return;
}
if (entity instanceof Villager && plot.getFlag(Flags.VILLAGER_INTERACT, false)) {
if (entity instanceof Villager && plot.getFlag(VillagerInteractFlag.class)) {
return;
}
if (entity instanceof ItemFrame && plot.getFlag(Flags.MISC_INTERACT, false)) {
if (entity instanceof ItemFrame && plot.getFlag(MiscInteractFlag.class)) {
return;
}
if (!Permissions.hasPermission(pp, Captions.PERMISSION_ADMIN_INTERACT_OTHER)) {
@ -2564,7 +2595,7 @@ import java.util.regex.Pattern;
return;
}
if (!plot.isAdded(pp.getUUID())) {
if (plot.getFlag(Flags.VEHICLE_BREAK, false)) {
if (plot.getFlag(VehicleBreakFlag.class)) {
return;
}
if (!Permissions.hasPermission(pp, "plots.admin.vehicle.break.other")) {
@ -2730,7 +2761,7 @@ import java.util.regex.Pattern;
if (player != null) {
PlotPlayer plotPlayer = BukkitUtil.getPlayer(player);
if (victim instanceof Hanging) { // hanging
if (plot != null && (plot.getFlag(Flags.HANGING_BREAK, false) || plot
if (plot != null && (plot.getFlag(HangingBreakFlag.class)) || plot
.isAdded(plotPlayer.getUUID()))) {
if (Settings.Done.RESTRICT_BUILDING && DoneFlag.isDone(plot)) {
if (!Permissions.hasPermission(plotPlayer, Captions.PERMISSION_ADMIN_BUILD_OTHER)) {
@ -2746,7 +2777,7 @@ import java.util.regex.Pattern;
return false;
}
} else if (victim.getType() == EntityType.ARMOR_STAND) {
if (plot != null && (plot.getFlag(Flags.MISC_BREAK, false) || plot
if (plot != null && (plot.getFlag(MiscBreakFlag.class) || plot
.isAdded(plotPlayer.getUUID()))) {
return true;
}
@ -2757,8 +2788,8 @@ import java.util.regex.Pattern;
}
} else if (victim instanceof Monster
|| victim instanceof EnderDragon) { // victim is monster
if (plot != null && (plot.getFlag(Flags.HOSTILE_ATTACK, false) || plot
.getFlag(Flags.PVE, false) || plot.isAdded(plotPlayer.getUUID()))) {
if (plot != null && (plot.getFlag(HostileAttackFlag.class) || plot.getFlag(PveFlag.class) ||
plot.isAdded(plotPlayer.getUUID()))) {
return true;
}
if (!Permissions.hasPermission(plotPlayer, "plots.admin.pve." + stub)) {
@ -2767,8 +2798,8 @@ import java.util.regex.Pattern;
return false;
}
} else if (victim instanceof Tameable) { // victim is tameable
if (plot != null && (plot.getFlag(Flags.TAMED_ATTACK, false) || plot
.getFlag(Flags.PVE, false) || plot.isAdded(plotPlayer.getUUID()))) {
if (plot != null && (plot.getFlag(TamedAttackFlag.class) || plot.getFlag(PveFlag.class) ||
plot.isAdded(plotPlayer.getUUID()))) {
return true;
}
if (!Permissions.hasPermission(plotPlayer, "plots.admin.pve." + stub)) {
@ -2778,7 +2809,7 @@ import java.util.regex.Pattern;
}
} else if (victim instanceof Player) {
if (plot != null) {
if (Flags.PVP.isFalse(plot) && !Permissions
if (!plot.getFlag(PvpFlag.class) && !Permissions
.hasPermission(plotPlayer, "plots.admin.pvp." + stub)) {
MainUtil.sendMessage(plotPlayer, Captions.NO_PERMISSION_EVENT,
"plots.admin.pvp." + stub);
@ -2793,8 +2824,8 @@ import java.util.regex.Pattern;
return false;
}
} else if (victim instanceof Creature) { // victim is animal
if (plot != null && (plot.getFlag(Flags.ANIMAL_ATTACK, false) || plot
.getFlag(Flags.PVE, false) || plot.isAdded(plotPlayer.getUUID()))) {
if (plot != null && (plot.getFlag(AnimalAttackFlag.class) || plot.getFlag(PveFlag.class)
|| plot.isAdded(plotPlayer.getUUID()))) {
return true;
}
if (!Permissions.hasPermission(plotPlayer, "plots.admin.pve." + stub)) {
@ -2805,7 +2836,7 @@ import java.util.regex.Pattern;
} else if (victim instanceof Vehicle) { // Vehicles are managed in vehicle destroy event
return true;
} else { // victim is something else
if (plot != null && (plot.getFlag(Flags.PVE, false) || plot
if (plot != null && (plot.getFlag(PveFlag.class) || plot
.isAdded(plotPlayer.getUUID()))) {
return true;
}
@ -2818,7 +2849,7 @@ import java.util.regex.Pattern;
return true;
} else if (dplot != null && (!dplot.equals(vplot) || Objects
.equals(dplot.guessOwner(), vplot.guessOwner()))) {
return vplot != null && Flags.PVE.isTrue(vplot);
return vplot != null && vplot.getFlag(PveFlag.class);
}
//disable the firework damage. too much of a headache to support at the moment.
if (vplot != null) {
@ -2827,7 +2858,7 @@ import java.util.regex.Pattern;
return false;
}
}
return ((vplot != null && Flags.PVE.isTrue(vplot)) || !(damager instanceof Arrow
return ((vplot != null && vplot.getFlag(PveFlag.class)) || !(damager instanceof Arrow
&& !(victim instanceof Creature)));
}
@ -2908,7 +2939,7 @@ import java.util.regex.Pattern;
return;
}
}
if (plot.getFlag(Flags.DISABLE_PHYSICS, false)) {
if (plot.getFlag(DisablePhysicsFlag.class)) {
Block block = event.getBlockPlaced();
if (block.getType().hasGravity()) {
sendBlockChange(block.getLocation(), block.getBlockData());

View File

@ -5,6 +5,10 @@ import com.github.intellectualsites.plotsquared.bukkit.events.PlayerLeavePlotEve
import com.github.intellectualsites.plotsquared.bukkit.util.BukkitUtil;
import com.github.intellectualsites.plotsquared.plot.flag.Flags;
import com.github.intellectualsites.plotsquared.plot.flag.IntervalFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.DropProtectionFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.InstabreakFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.InvincibleFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.ItemDropFlag;
import com.github.intellectualsites.plotsquared.plot.listener.PlotListener;
import com.github.intellectualsites.plotsquared.plot.object.Plot;
import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer;
@ -90,7 +94,7 @@ import java.util.UUID;
if (plot == null) {
return;
}
if (Flags.INSTABREAK.isTrue(plot)) {
if (plot.getFlag(InstabreakFlag.class)) {
Block block = event.getBlock();
BlockBreakEvent call = new BlockBreakEvent(block, player);
Bukkit.getServer().getPluginManager().callEvent(call);
@ -108,7 +112,7 @@ import java.util.UUID;
if (plot == null) {
return;
}
if (Flags.INVINCIBLE.isTrue(plot)) {
if (plot.getFlag(InvincibleFlag.class)) {
event.setCancelled(true);
}
}
@ -122,7 +126,7 @@ import java.util.UUID;
}
UUID uuid = pp.getUUID();
if (!plot.isAdded(uuid)) {
if (Flags.ITEM_DROP.isFalse(plot)) {
if (!plot.getFlag(ItemDropFlag.class)) {
event.setCancelled(true);
}
}
@ -166,7 +170,7 @@ import java.util.UUID;
return;
}
UUID uuid = pp.getUUID();
if (!plot.isAdded(uuid) && Flags.DROP_PROTECTION.isTrue(plot)) {
if (!plot.isAdded(uuid) && plot.getFlag(DropProtectionFlag.class)) {
event.setCancelled(true);
}
}

View File

@ -5,6 +5,7 @@ import com.github.intellectualsites.plotsquared.plot.config.Captions;
import com.github.intellectualsites.plotsquared.plot.config.Settings;
import com.github.intellectualsites.plotsquared.plot.database.DBFunc;
import com.github.intellectualsites.plotsquared.plot.flag.Flags;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.HideInfoFlag;
import com.github.intellectualsites.plotsquared.plot.object.Plot;
import com.github.intellectualsites.plotsquared.plot.object.PlotInventory;
import com.github.intellectualsites.plotsquared.plot.object.PlotItemStack;
@ -70,7 +71,7 @@ public class Info extends SubCommand {
}
// hide-info flag
if (plot.getFlag(Flags.HIDE_INFO).orElse(false)) {
if (plot.getFlag(HideInfoFlag.class)) {
boolean allowed = false;
for (final String argument : args) {
if (argument.equalsIgnoreCase("-f")) {

View File

@ -556,6 +556,52 @@ public enum Captions implements Caption {
FLAG_DESCRIPTION_GREETING("Message sent to players on plot entry. Supports '&' color codes.", "Flags"),
FLAG_DESCRIPTION_FAREWELL("Message sent to players when leaving the plot. Supports '&' color codes.", "Flags"),
FLAG_DESCRIPTION_WEATHER("Specifies the weather conditions inside of the plot.", "Flags"),
FLAG_DESCRIPTION_ANIMAL_ATTACK("Set to `true` to allow animals to be attacked in the plot.", "Flags"),
FLAG_DESCRIPTION_ANIMAL_INTERACT("Set to `true` to allow animals to be interacted with in the plot.", "Flags"),
FLAG_DESCRIPTION_BLOCK_BURN("Set to `true` to allow blocks to burn within the plot.", "Flags"),
FLAG_DESCRIPTION_BLOCK_IGNITION("Set to `true` to allow blocks to ignite within the plot.", "Flags"),
FLAG_DESCRIPTION_DEVICE_INTERACT("Set to `true` to allow devices to be interacted with in the plot.", "Flags"),
FLAG_DESCRIPTION_DISABLE_PHYSICS("Set to `true` to disable block physics in the plot.", "Flags"),
FLAG_DESCRIPTION_DROP_PROTECTION("Set to `true` to prevent dropped items from being picked up by non-members of the plot.", "Flags"),
FLAG_DESCRIPTION_FORCEFIELD("Set to `true` to enable member forcefield in the plot.", "Flags"),
FLAG_DESCRIPTION_GRASS_GROW("Set to `false` to disable grass to grow within the plot.", "Flags"),
FLAG_DESCRIPTION_HANGING_BREAK("Set to `true` to allow guests to break hanging objects in the plot.", "Flags"),
FLAG_DESCRIPTION_HANGING_PLACE("Set to `true` to allow guests to hang objects in the plot.", "Flags"),
FLAG_DESCRIPTION_HIDE_INFO("Set to `true` to hide plot information.", "Flags"),
FLAG_DESCRIPTION_HOSTILE_ATTACK("Set to `true` to enable players to attack hostile mobs in the plot.", "Flags"),
FLAG_DESCRIPTION_HOSTILE_INTERACT("Set to `true` to allow players to interact with hostile mobs in the plot.", "Flags"),
FLAG_DESCRIPTION_ICE_FORM("Set to `true` to allow ice to form in the plot.", "Flags"),
FLAG_DESCRIPTION_ICE_MELT("Set to `true` to allow ice to melt in the plot.", "Flags"),
FLAG_DESCRIPTION_INSTABREAK("Set to `true` to allow blocks to be instantaneously broken in survival mode.", "Flags"),
FLAG_DESCRIPTION_INVINCIBLE("Set to `true` to prevent players from taking damage inside of the plot.", "Flags"),
FLAG_DESCRIPTION_ITEM_DROP("Set to `false` to prevent items from being dropped inside of the plot.", "Flags"),
FLAG_DESCRIPTION_KELP_GROW("Set to `true` to allow kelp to grow in the plot.", "Flags"),
FLAG_DESCRIPTION_LIQUID_FLOW("Set to `false` to disable liquids from flowing within the plot.", "Flags"),
FLAG_DESCRIPTION_MISC_BREAK("Set to `true` to allow guests to break miscellaneous items.", "Flags"),
FLAG_DESCRIPTION_MISC_INTERACT("Set to `true` to allow guests to interact with miscellaneous items.", "Flags"),
FLAG_DESCRIPTION_MISC_PLACE("Set to `true` to allow guests to place miscellaneous items.", "Flags"),
FLAG_DESCRIPTION_MOB_BREAK("Set to `true` to allow mobs to break blocks within the plot.", "Flags"),
FLAG_DESCRIPTION_MOB_PLACE("Set to `true` to allow mobs to place blocks within the plot.", "Flags"),
FLAG_DESCRIPTION_MYCEL_GROW("Set to `true` to allow mycelium to grow in the plot.", "Flags"),
FLAG_DESCRIPTION_NOTIFY_ENTER("Set to `true` to notify the plot owners when someone enters the plot.", "Flags"),
FLAG_DESCRIPTION_NOITFY_LEAVE("Set to `true` to notify the plot owners when someone leaves the plot.", "Flags"),
FLAG_DESCRIPTION_NO_WORLDEDIT("Set to `true` to disable WorldEdit usage within the plot.", "Flags"),
FLAG_DESCRIPTION_PLAYER_INTERACT("Set to `true` to allow guests to interact with players in the plot.", "Flags"),
FLAG_DESCRIPTION_PVE("Set to `true` to enable PVE inside the plot.", "Flags"),
FLAG_DESCRIPTION_PVP("Set to `true` to enable PVP inside the plot.", "Flags"),
FLAG_DESCRIPTION_REDSTONE("Set to `false` to disable redstone in the plot.", "Flags"),
FLAG_DESCRIPTION_SERVER_PLOT("Set to `true` to turn the plot into a server plot. This is equivalent to setting the server as the plot owner.", "Flags"),
FLAG_DESCRIPTION_SNOW_FORM("Set to `true` to allow snow to form within the plot.", "Flags"),
FLAG_DESCRIPTION_SNOW_MELT("Set to `true` to allow snow to melt within the plot.", "Flags"),
FLAG_DESCRIPTION_SOIL_DRY("Set to `true` to allow soil to dry within the plot.", "Flags"),
FLAG_DESCRIPTION_TAMED_ATTACK("Set to `true` to allow guests to attack tamed animals in the plot.", "Flags"),
FLAG_DESCRIPTION_TAMED_INTERACT("Set to `true` to allow guests to interact with tamed animals in the plot.", "Flags"),
FLAG_DESCRIPTION_TITLES("Set to `false` to disable plot titles.", "Flags"),
FLAG_DESCRIPTION_VEHICLE_BREAK("Set to `true` to allow guests to break vehicles in the plot.", "Flags"),
FLAG_DESCRIPTION_VEHICLE_PLACE("Set to `true` to allow guests to place vehicles in the plot.", "Flags"),
FLAG_DESCRIPTION_VEHICLE_USE("Set to `true` to allow guests to use vehicles in the plot.", "Flags"),
FLAG_DESCRIPTION_VILLAGER_INTERACT("Set to `true` to allow guests to interact with villagers in the plot.", "Flags"),
FLAG_DESCRIPTION_VINE_GROW("Set to `true` to allow vines to grow within the plot.", "Flags"),
//</editor-fold>
//<editor-fold desc="Flag category errors">
FLAG_ERROR_BOOLEAN("Flag value must be a boolean (true|false)", "Flags"),

View File

@ -1,46 +0,0 @@
package com.github.intellectualsites.plotsquared.plot.flag;
import com.github.intellectualsites.plotsquared.plot.config.Captions;
import com.github.intellectualsites.plotsquared.plot.object.Plot;
public class BooleanFlag extends Flag<Boolean> {
public BooleanFlag(String name) {
super(Captions.FLAG_CATEGORY_BOOLEAN, name);
}
@Override public String valueToString(Object value) {
return value + "";
}
@Override public Boolean parseValue(String value) {
switch (value.toLowerCase()) {
case "1":
case "yes":
case "allow":
case "true":
return true;
case "0":
case "no":
case "deny":
case "false":
return false;
default:
return null;
}
}
@Override public String getValueDescription() {
return Captions.FLAG_ERROR_BOOLEAN.getTranslated();
}
public boolean isTrue(Plot plot) {
Boolean value = FlagManager.getPlotFlagRaw(plot, this);
return Boolean.TRUE == value;
}
public boolean isFalse(Plot plot) {
Boolean value = FlagManager.getPlotFlagRaw(plot, this);
return Boolean.FALSE == value;
}
}

View File

@ -10,12 +10,6 @@ public final class Flags {
public static final IntervalFlag HEAL = new IntervalFlag("heal");
public static final GameModeFlag GAMEMODE = new GameModeFlag("gamemode");
public static final GameModeFlag GUEST_GAMEMODE = new GameModeFlag("guest-gamemode");
public static final BooleanFlag REDSTONE = new BooleanFlag("redstone");
public static final BooleanFlag NOTIFY_LEAVE = new BooleanFlag("notify-leave");
public static final BooleanFlag TITLES = new BooleanFlag("titles");
public static final BooleanFlag NOTIFY_ENTER = new BooleanFlag("notify-enter");
public static final BooleanFlag HIDE_INFO = new BooleanFlag("hide-info");
public static final BooleanFlag SERVER_PLOT = new BooleanFlag("server-plot");
public static final LongFlag TIME = new LongFlag("time");
public static final DoubleFlag PRICE = new DoubleFlag("price") {
@Override public Double parseValue(String input) {
@ -27,50 +21,10 @@ public final class Flags {
return Captions.FLAG_ERROR_PRICE.getTranslated();
}
};
public static final BooleanFlag GRASS_GROW = new BooleanFlag("grass-grow");
public static final BooleanFlag VINE_GROW = new BooleanFlag("vine-grow");
public static final BooleanFlag MYCEL_GROW = new BooleanFlag("mycel-grow");
public static final BooleanFlag KELP_GROW = new BooleanFlag("kelp-grow");
public static final BooleanFlag DISABLE_PHYSICS = new BooleanFlag("disable-physics");
public static final BooleanFlag LIQUID_FLOW = new BooleanFlag("liquid-flow");
public static final BooleanFlag SNOW_MELT = new BooleanFlag("snow-melt");
public static final BooleanFlag SNOW_FORM = new BooleanFlag("snow-form");
public static final BooleanFlag ICE_MELT = new BooleanFlag("ice-melt");
public static final BooleanFlag BLOCK_BURN = new BooleanFlag("block-burn");
public static final BooleanFlag ICE_FORM = new BooleanFlag("ice-form");
public static final BooleanFlag BLOCK_IGNITION = new BooleanFlag("block-ignition");
public static final BooleanFlag SOIL_DRY = new BooleanFlag("soil-dry");
public static final StringListFlag BLOCKED_CMDS = new StringListFlag("blocked-cmds");
public static final BlockStateListFlag USE = new BlockStateListFlag("use");
public static final BlockStateListFlag BREAK = new BlockStateListFlag("break");
public static final BlockStateListFlag PLACE = new BlockStateListFlag("place");
public static final BooleanFlag DEVICE_INTERACT = new BooleanFlag("device-interact");
public static final BooleanFlag VEHICLE_BREAK = new BooleanFlag("vehicle-break");
public static final BooleanFlag VEHICLE_PLACE = new BooleanFlag("vehicle-place");
public static final BooleanFlag VEHICLE_USE = new BooleanFlag("vehicle-use");
public static final BooleanFlag HANGING_BREAK = new BooleanFlag("hanging-break");
public static final BooleanFlag HANGING_PLACE = new BooleanFlag("hanging-place");
public static final BooleanFlag MISC_PLACE = new BooleanFlag("misc-place");
public static final BooleanFlag MISC_BREAK = new BooleanFlag("misc-break");
public static final BooleanFlag MISC_INTERACT = new BooleanFlag("misc-interact");
public static final BooleanFlag VILLAGER_INTERACT = new BooleanFlag("villager-interact");
public static final BooleanFlag PLAYER_INTERACT = new BooleanFlag("player-interact");
public static final BooleanFlag TAMED_ATTACK = new BooleanFlag("tamed-attack");
public static final BooleanFlag TAMED_INTERACT = new BooleanFlag("tamed-interact");
public static final BooleanFlag ANIMAL_ATTACK = new BooleanFlag("animal-attack");
public static final BooleanFlag ANIMAL_INTERACT = new BooleanFlag("animal-interact");
public static final BooleanFlag HOSTILE_ATTACK = new BooleanFlag("hostile-attack");
public static final BooleanFlag HOSTILE_INTERACT = new BooleanFlag("hostile-interact");
public static final BooleanFlag MOB_PLACE = new BooleanFlag("mob-place");
public static final BooleanFlag MOB_BREAK = new BooleanFlag("mob-break");
public static final BooleanFlag FORCEFIELD = new BooleanFlag("forcefield");
public static final BooleanFlag INVINCIBLE = new BooleanFlag("invincible");
public static final BooleanFlag ITEM_DROP = new BooleanFlag("item-drop");
public static final BooleanFlag INSTABREAK = new BooleanFlag("instabreak");
public static final BooleanFlag DROP_PROTECTION = new BooleanFlag("drop-protection");
public static final BooleanFlag PVP = new BooleanFlag("pvp");
public static final BooleanFlag PVE = new BooleanFlag("pve");
public static final BooleanFlag NO_WORLDEDIT = new BooleanFlag("no-worldedit");
public static final IntegerFlag MISC_CAP = new IntegerFlag("misc-cap");
public static final IntegerFlag ENTITY_CAP = new IntegerFlag("entity-cap");
public static final IntegerFlag MOB_CAP = new IntegerFlag("mob-cap");

View File

@ -1,16 +1,59 @@
package com.github.intellectualsites.plotsquared.plot.flags;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.AnalysisFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.AnimalAttackFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.AnimalInteractFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.BlockBurnFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.BlockIgnitionFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.DenyExitFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.DescriptionFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.DeviceInteractFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.DisablePhysicsFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.DoneFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.DropProtectionFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.ExplosionFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.FarewellFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.FlightFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.ForcefieldFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.GrassGrowFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.GreetingFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.HangingBreakFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.HangingPlaceFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.HideInfoFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.HostileAttackFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.HostileInteractFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.IceFormFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.IceMeltFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.InstabreakFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.InvincibleFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.ItemDropFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.KelpGrowFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.LiquidFlowFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.MiscBreakFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.MobBreakFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.MobPlaceFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.MusicFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.MycelGrowFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.NoWorldeditFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.NotifyEnterFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.NotifyLeaveFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.PlayerInteractFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.PlotWeatherFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.PveFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.PvpFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.RedstoneFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.ServerPlotFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.SnowFormFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.SnowMeltFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.SoilDryFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.TamedAttackFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.TamedInteractFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.TitlesFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.UntrustedVisitFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.VehicleBreakFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.VehicleUseFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.VillagerInteractFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.VineGrowFlag;
import lombok.Getter;
import javax.annotation.Nonnull;
@ -40,6 +83,50 @@ public final class GlobalFlagContainer extends FlagContainer {
this.addFlag(GreetingFlag.GREETING_FLAG_EMPTY);
this.addFlag(FarewellFlag.FAREWELL_FLAG_EMPTY);
this.addFlag(PlotWeatherFlag.PLOT_WEATHER_FLAG_OFF);
this.addFlag(AnimalAttackFlag.ANIMAL_ATTACK_FALSE);
this.addFlag(AnimalInteractFlag.ANIMAL_INTERACT_FALSE);
this.addFlag(BlockBurnFlag.BLOCK_BURN_FALSE);
this.addFlag(BlockIgnitionFlag.BLOCK_IGNITION_FALSE);
this.addFlag(DeviceInteractFlag.DEVICE_INTERACT_FALSE);
this.addFlag(DisablePhysicsFlag.DISABLE_PHYSICS_FALSE);
this.addFlag(DropProtectionFlag.DROP_PROTECTION_FALSE);
this.addFlag(ForcefieldFlag.FORCEFIELD_FALSE);
this.addFlag(GrassGrowFlag.GRASS_GROW_TRUE);
this.addFlag(HangingBreakFlag.HANGING_BREAK_FALSE);
this.addFlag(HangingPlaceFlag.HANGING_PLACE_FALSE);
this.addFlag(HideInfoFlag.HIDE_INFO_FALSE);
this.addFlag(HostileAttackFlag.HOSTILE_ATTACK_FALSE);
this.addFlag(HostileInteractFlag.HOSTILE_INTERACT_FALSE);
this.addFlag(IceFormFlag.ICE_FORM_FALSE);
this.addFlag(IceMeltFlag.ICE_MELT_FALSE);
this.addFlag(KelpGrowFlag.KELP_GROW_TRUE);
this.addFlag(LiquidFlowFlag.LIQUID_FLOW_TRUE);
this.addFlag(RedstoneFlag.REDSTONE_TRUE);
this.addFlag(ServerPlotFlag.SERVER_PLOT_FALSE);
this.addFlag(MiscBreakFlag.MISC_BREAK_FALSE);
this.addFlag(MobBreakFlag.MOB_BREAK_FALSE);
this.addFlag(MobPlaceFlag.MOB_PLACE_FALSE);
this.addFlag(MycelGrowFlag.MYCEL_GROW_TRUE);
this.addFlag(NotifyEnterFlag.NOTIFY_ENTER_FALSE);
this.addFlag(NotifyLeaveFlag.NOTIFY_LEAVE_FALSE);
this.addFlag(NoWorldeditFlag.NO_WORLDEDIT_FALSE);
this.addFlag(PlayerInteractFlag.PLAYER_INTERACT_FALSE);
this.addFlag(PveFlag.PVE_FALSE);
this.addFlag(PvpFlag.PVP_FALSE);
this.addFlag(SnowFormFlag.SNOW_FORM_FALSE);
this.addFlag(SnowMeltFlag.SNOW_MELT_TRUE);
this.addFlag(SoilDryFlag.SOIL_DRY_FALSE);
this.addFlag(TamedAttackFlag.TAMED_ATTACK_FALSE);
this.addFlag(TamedInteractFlag.TAMED_INTERACT_FALSE);
this.addFlag(TitlesFlag.TITLES_TRUE);
this.addFlag(VehicleBreakFlag.VEHICLE_BREAK_FALSE);
this.addFlag(VehicleUseFlag.VEHICLE_USE_FALSE);
this.addFlag(VillagerInteractFlag.VILLAGER_INTERACT_FALSE);
this.addFlag(VineGrowFlag.VINE_GROW_TRUE);
this.addFlag(ItemDropFlag.ITEM_DROP_TRUE);
this.addFlag(InstabreakFlag.INSTABREAK_FALSE);
this.addFlag(InvincibleFlag.INVINCIBLE_FALSE);
// Internal flags
this.addFlag(new AnalysisFlag(Collections.emptyList()));
this.addFlag(new DoneFlag(""));

View File

@ -0,0 +1,20 @@
package com.github.intellectualsites.plotsquared.plot.flags.implementations;
import com.github.intellectualsites.plotsquared.plot.config.Captions;
import com.github.intellectualsites.plotsquared.plot.flags.types.BooleanFlag;
import org.jetbrains.annotations.NotNull;
public class AnimalAttackFlag extends BooleanFlag<AnimalAttackFlag> {
public static final AnimalAttackFlag ANIMAL_ATTACK_TRUE = new AnimalAttackFlag(true);
public static final AnimalAttackFlag ANIMAL_ATTACK_FALSE = new AnimalAttackFlag(false);
private AnimalAttackFlag(boolean value) {
super(value, Captions.FLAG_DESCRIPTION_ANIMAL_ATTACK);
}
@Override protected AnimalAttackFlag flagOf(@NotNull Boolean value) {
return value ? ANIMAL_ATTACK_TRUE : ANIMAL_ATTACK_FALSE;
}
}

View File

@ -0,0 +1,20 @@
package com.github.intellectualsites.plotsquared.plot.flags.implementations;
import com.github.intellectualsites.plotsquared.plot.config.Captions;
import com.github.intellectualsites.plotsquared.plot.flags.types.BooleanFlag;
import org.jetbrains.annotations.NotNull;
public class AnimalInteractFlag extends BooleanFlag<AnimalInteractFlag> {
public static final AnimalInteractFlag ANIMAL_INTERACT_TRUE = new AnimalInteractFlag(true);
public static final AnimalInteractFlag ANIMAL_INTERACT_FALSE = new AnimalInteractFlag(false);
private AnimalInteractFlag(boolean value) {
super(value, Captions.FLAG_DESCRIPTION_ANIMAL_INTERACT);
}
@Override protected AnimalInteractFlag flagOf(@NotNull Boolean value) {
return value ? ANIMAL_INTERACT_TRUE : ANIMAL_INTERACT_FALSE;
}
}

View File

@ -0,0 +1,20 @@
package com.github.intellectualsites.plotsquared.plot.flags.implementations;
import com.github.intellectualsites.plotsquared.plot.config.Captions;
import com.github.intellectualsites.plotsquared.plot.flags.types.BooleanFlag;
import org.jetbrains.annotations.NotNull;
public class BlockBurnFlag extends BooleanFlag<BlockBurnFlag> {
public static final BlockBurnFlag BLOCK_BURN_TRUE = new BlockBurnFlag(true);
public static final BlockBurnFlag BLOCK_BURN_FALSE = new BlockBurnFlag(false);
private BlockBurnFlag(boolean value) {
super(value, Captions.FLAG_DESCRIPTION_BLOCK_BURN);
}
@Override protected BlockBurnFlag flagOf(@NotNull Boolean value) {
return value ? BLOCK_BURN_TRUE : BLOCK_BURN_FALSE;
}
}

View File

@ -0,0 +1,20 @@
package com.github.intellectualsites.plotsquared.plot.flags.implementations;
import com.github.intellectualsites.plotsquared.plot.config.Captions;
import com.github.intellectualsites.plotsquared.plot.flags.types.BooleanFlag;
import org.jetbrains.annotations.NotNull;
public class BlockIgnitionFlag extends BooleanFlag<BlockIgnitionFlag> {
public static final BlockIgnitionFlag BLOCK_IGNITION_TRUE = new BlockIgnitionFlag(true);
public static final BlockIgnitionFlag BLOCK_IGNITION_FALSE = new BlockIgnitionFlag(false);
private BlockIgnitionFlag(boolean value) {
super(value, Captions.FLAG_DESCRIPTION_BLOCK_IGNITION);
}
@Override protected BlockIgnitionFlag flagOf(@NotNull Boolean value) {
return value ? BLOCK_IGNITION_TRUE : BLOCK_IGNITION_FALSE;
}
}

View File

@ -0,0 +1,20 @@
package com.github.intellectualsites.plotsquared.plot.flags.implementations;
import com.github.intellectualsites.plotsquared.plot.config.Captions;
import com.github.intellectualsites.plotsquared.plot.flags.types.BooleanFlag;
import org.jetbrains.annotations.NotNull;
public class DeviceInteractFlag extends BooleanFlag<DeviceInteractFlag> {
public static final DeviceInteractFlag DEVICE_INTERACT_TRUE = new DeviceInteractFlag(true);
public static final DeviceInteractFlag DEVICE_INTERACT_FALSE = new DeviceInteractFlag(false);
private DeviceInteractFlag(boolean value) {
super(value, Captions.FLAG_DESCRIPTION_DEVICE_INTERACT);
}
@Override protected DeviceInteractFlag flagOf(@NotNull Boolean value) {
return value ? DEVICE_INTERACT_TRUE : DEVICE_INTERACT_FALSE;
}
}

View File

@ -0,0 +1,20 @@
package com.github.intellectualsites.plotsquared.plot.flags.implementations;
import com.github.intellectualsites.plotsquared.plot.config.Captions;
import com.github.intellectualsites.plotsquared.plot.flags.types.BooleanFlag;
import org.jetbrains.annotations.NotNull;
public class DisablePhysicsFlag extends BooleanFlag<DisablePhysicsFlag> {
public static final DisablePhysicsFlag DISABLE_PHYSICS_TRUE = new DisablePhysicsFlag(true);
public static final DisablePhysicsFlag DISABLE_PHYSICS_FALSE = new DisablePhysicsFlag(false);
private DisablePhysicsFlag(boolean value) {
super(value, Captions.FLAG_DESCRIPTION_DISABLE_PHYSICS);
}
@Override protected DisablePhysicsFlag flagOf(@NotNull Boolean value) {
return value ? DISABLE_PHYSICS_TRUE : DISABLE_PHYSICS_FALSE;
}
}

View File

@ -0,0 +1,20 @@
package com.github.intellectualsites.plotsquared.plot.flags.implementations;
import com.github.intellectualsites.plotsquared.plot.config.Captions;
import com.github.intellectualsites.plotsquared.plot.flags.types.BooleanFlag;
import org.jetbrains.annotations.NotNull;
public class DropProtectionFlag extends BooleanFlag<DropProtectionFlag> {
public static final DropProtectionFlag DROP_PROTECTION_TRUE = new DropProtectionFlag(true);
public static final DropProtectionFlag DROP_PROTECTION_FALSE = new DropProtectionFlag(false);
private DropProtectionFlag(boolean value) {
super(value, Captions.FLAG_DESCRIPTION_DROP_PROTECTION);
}
@Override protected DropProtectionFlag flagOf(@NotNull Boolean value) {
return value ? DROP_PROTECTION_TRUE : DROP_PROTECTION_FALSE;
}
}

View File

@ -0,0 +1,20 @@
package com.github.intellectualsites.plotsquared.plot.flags.implementations;
import com.github.intellectualsites.plotsquared.plot.config.Captions;
import com.github.intellectualsites.plotsquared.plot.flags.types.BooleanFlag;
import org.jetbrains.annotations.NotNull;
public class ForcefieldFlag extends BooleanFlag<ForcefieldFlag> {
public static final ForcefieldFlag FORCEFIELD_TRUE = new ForcefieldFlag(true);
public static final ForcefieldFlag FORCEFIELD_FALSE = new ForcefieldFlag(false);
private ForcefieldFlag(boolean value) {
super(value, Captions.FLAG_DESCRIPTION_FORCEFIELD);
}
@Override protected ForcefieldFlag flagOf(@NotNull Boolean value) {
return value ? FORCEFIELD_TRUE : FORCEFIELD_FALSE;
}
}

View File

@ -0,0 +1,20 @@
package com.github.intellectualsites.plotsquared.plot.flags.implementations;
import com.github.intellectualsites.plotsquared.plot.config.Captions;
import com.github.intellectualsites.plotsquared.plot.flags.types.BooleanFlag;
import org.jetbrains.annotations.NotNull;
public class GrassGrowFlag extends BooleanFlag<GrassGrowFlag> {
public static final GrassGrowFlag GRASS_GROW_TRUE = new GrassGrowFlag(true);
public static final GrassGrowFlag GRASS_GROW_FALSE = new GrassGrowFlag(false);
private GrassGrowFlag(boolean value) {
super(value, Captions.FLAG_DESCRIPTION_GRASS_GROW);
}
@Override protected GrassGrowFlag flagOf(@NotNull Boolean value) {
return value ? GRASS_GROW_TRUE : GRASS_GROW_FALSE;
}
}

View File

@ -0,0 +1,20 @@
package com.github.intellectualsites.plotsquared.plot.flags.implementations;
import com.github.intellectualsites.plotsquared.plot.config.Captions;
import com.github.intellectualsites.plotsquared.plot.flags.types.BooleanFlag;
import org.jetbrains.annotations.NotNull;
public class HangingBreakFlag extends BooleanFlag<HangingBreakFlag> {
public static final HangingBreakFlag HANGING_BREAK_TRUE = new HangingBreakFlag(true);
public static final HangingBreakFlag HANGING_BREAK_FALSE = new HangingBreakFlag(false);
private HangingBreakFlag(boolean value) {
super(value, Captions.FLAG_DESCRIPTION_HANGING_BREAK);
}
@Override protected HangingBreakFlag flagOf(@NotNull Boolean value) {
return value ? HANGING_BREAK_TRUE : HANGING_BREAK_FALSE;
}
}

View File

@ -0,0 +1,20 @@
package com.github.intellectualsites.plotsquared.plot.flags.implementations;
import com.github.intellectualsites.plotsquared.plot.config.Captions;
import com.github.intellectualsites.plotsquared.plot.flags.types.BooleanFlag;
import org.jetbrains.annotations.NotNull;
public class HangingPlaceFlag extends BooleanFlag<HangingPlaceFlag> {
public static final HangingPlaceFlag HANGING_PLACE_TRUE = new HangingPlaceFlag(true);
public static final HangingPlaceFlag HANGING_PLACE_FALSE = new HangingPlaceFlag(false);
private HangingPlaceFlag(boolean value) {
super(value, Captions.FLAG_DESCRIPTION_HANGING_PLACE);
}
@Override protected HangingPlaceFlag flagOf(@NotNull Boolean value) {
return value ? HANGING_PLACE_TRUE : HANGING_PLACE_FALSE;
}
}

View File

@ -0,0 +1,20 @@
package com.github.intellectualsites.plotsquared.plot.flags.implementations;
import com.github.intellectualsites.plotsquared.plot.config.Captions;
import com.github.intellectualsites.plotsquared.plot.flags.types.BooleanFlag;
import org.jetbrains.annotations.NotNull;
public class HideInfoFlag extends BooleanFlag<HideInfoFlag> {
public static final HideInfoFlag HIDE_INFO_TRUE = new HideInfoFlag(true);
public static final HideInfoFlag HIDE_INFO_FALSE = new HideInfoFlag(false);
private HideInfoFlag(boolean value) {
super(value, Captions.FLAG_DESCRIPTION_HIDE_INFO);
}
@Override protected HideInfoFlag flagOf(@NotNull Boolean value) {
return value ? HIDE_INFO_TRUE : HIDE_INFO_FALSE;
}
}

View File

@ -0,0 +1,20 @@
package com.github.intellectualsites.plotsquared.plot.flags.implementations;
import com.github.intellectualsites.plotsquared.plot.config.Captions;
import com.github.intellectualsites.plotsquared.plot.flags.types.BooleanFlag;
import org.jetbrains.annotations.NotNull;
public class HostileAttackFlag extends BooleanFlag<HostileAttackFlag> {
public static final HostileAttackFlag HOSTILE_ATTACK_TRUE = new HostileAttackFlag(true);
public static final HostileAttackFlag HOSTILE_ATTACK_FALSE = new HostileAttackFlag(false);
private HostileAttackFlag(boolean value) {
super(value, Captions.FLAG_DESCRIPTION_HOSTILE_ATTACK);
}
@Override protected HostileAttackFlag flagOf(@NotNull Boolean value) {
return value ? HOSTILE_ATTACK_TRUE : HOSTILE_ATTACK_FALSE;
}
}

View File

@ -0,0 +1,20 @@
package com.github.intellectualsites.plotsquared.plot.flags.implementations;
import com.github.intellectualsites.plotsquared.plot.config.Captions;
import com.github.intellectualsites.plotsquared.plot.flags.types.BooleanFlag;
import org.jetbrains.annotations.NotNull;
public class HostileInteractFlag extends BooleanFlag<HostileInteractFlag> {
public static final HostileInteractFlag HOSTILE_INTERACT_TRUE = new HostileInteractFlag(true);
public static final HostileInteractFlag HOSTILE_INTERACT_FALSE = new HostileInteractFlag(false);
private HostileInteractFlag(boolean value) {
super(value, Captions.FLAG_DESCRIPTION_HOSTILE_INTERACT);
}
@Override protected HostileInteractFlag flagOf(@NotNull Boolean value) {
return value ? HOSTILE_INTERACT_TRUE : HOSTILE_INTERACT_FALSE;
}
}

View File

@ -0,0 +1,20 @@
package com.github.intellectualsites.plotsquared.plot.flags.implementations;
import com.github.intellectualsites.plotsquared.plot.config.Captions;
import com.github.intellectualsites.plotsquared.plot.flags.types.BooleanFlag;
import org.jetbrains.annotations.NotNull;
public class IceFormFlag extends BooleanFlag<IceFormFlag> {
public static final IceFormFlag ICE_FORM_TRUE = new IceFormFlag(true);
public static final IceFormFlag ICE_FORM_FALSE = new IceFormFlag(false);
private IceFormFlag(boolean value) {
super(value, Captions.FLAG_DESCRIPTION_ICE_FORM);
}
@Override protected IceFormFlag flagOf(@NotNull Boolean value) {
return value ? ICE_FORM_TRUE : ICE_FORM_FALSE;
}
}

View File

@ -0,0 +1,20 @@
package com.github.intellectualsites.plotsquared.plot.flags.implementations;
import com.github.intellectualsites.plotsquared.plot.config.Captions;
import com.github.intellectualsites.plotsquared.plot.flags.types.BooleanFlag;
import org.jetbrains.annotations.NotNull;
public class IceMeltFlag extends BooleanFlag<IceMeltFlag> {
public static final IceMeltFlag ICE_MELT_TRUE = new IceMeltFlag(true);
public static final IceMeltFlag ICE_MELT_FALSE = new IceMeltFlag(false);
private IceMeltFlag(boolean value) {
super(value, Captions.FLAG_DESCRIPTION_ICE_MELT);
}
@Override protected IceMeltFlag flagOf(@NotNull Boolean value) {
return value ? ICE_MELT_TRUE : ICE_MELT_FALSE;
}
}

View File

@ -0,0 +1,20 @@
package com.github.intellectualsites.plotsquared.plot.flags.implementations;
import com.github.intellectualsites.plotsquared.plot.config.Captions;
import com.github.intellectualsites.plotsquared.plot.flags.types.BooleanFlag;
import org.jetbrains.annotations.NotNull;
public class InstabreakFlag extends BooleanFlag<InstabreakFlag> {
public static final InstabreakFlag INSTABREAK_TRUE = new InstabreakFlag(true);
public static final InstabreakFlag INSTABREAK_FALSE = new InstabreakFlag(false);
private InstabreakFlag(boolean value) {
super(value, Captions.FLAG_DESCRIPTION_INSTABREAK);
}
@Override protected InstabreakFlag flagOf(@NotNull Boolean value) {
return value ? INSTABREAK_TRUE : INSTABREAK_FALSE;
}
}

View File

@ -0,0 +1,20 @@
package com.github.intellectualsites.plotsquared.plot.flags.implementations;
import com.github.intellectualsites.plotsquared.plot.config.Captions;
import com.github.intellectualsites.plotsquared.plot.flags.types.BooleanFlag;
import org.jetbrains.annotations.NotNull;
public class InvincibleFlag extends BooleanFlag<InvincibleFlag> {
public static final InvincibleFlag INVINCIBLE_TRUE = new InvincibleFlag(true);
public static final InvincibleFlag INVINCIBLE_FALSE = new InvincibleFlag(false);
private InvincibleFlag(boolean value) {
super(value, Captions.FLAG_DESCRIPTION_INVINCIBLE);
}
@Override protected InvincibleFlag flagOf(@NotNull Boolean value) {
return value ? INVINCIBLE_TRUE : INVINCIBLE_FALSE;
}
}

View File

@ -0,0 +1,20 @@
package com.github.intellectualsites.plotsquared.plot.flags.implementations;
import com.github.intellectualsites.plotsquared.plot.config.Captions;
import com.github.intellectualsites.plotsquared.plot.flags.types.BooleanFlag;
import org.jetbrains.annotations.NotNull;
public class ItemDropFlag extends BooleanFlag<ItemDropFlag> {
public static final ItemDropFlag ITEM_DROP_TRUE = new ItemDropFlag(true);
public static final ItemDropFlag ITEM_DROP_FALSE = new ItemDropFlag(false);
private ItemDropFlag(boolean value) {
super(value, Captions.FLAG_DESCRIPTION_ITEM_DROP);
}
@Override protected ItemDropFlag flagOf(@NotNull Boolean value) {
return value ? ITEM_DROP_TRUE : ITEM_DROP_FALSE;
}
}

View File

@ -0,0 +1,20 @@
package com.github.intellectualsites.plotsquared.plot.flags.implementations;
import com.github.intellectualsites.plotsquared.plot.config.Captions;
import com.github.intellectualsites.plotsquared.plot.flags.types.BooleanFlag;
import org.jetbrains.annotations.NotNull;
public class KelpGrowFlag extends BooleanFlag<KelpGrowFlag> {
public static final KelpGrowFlag KELP_GROW_TRUE = new KelpGrowFlag(true);
public static final KelpGrowFlag KELP_GROW_FALSE = new KelpGrowFlag(false);
private KelpGrowFlag(boolean value) {
super(value, Captions.FLAG_DESCRIPTION_KELP_GROW);
}
@Override protected KelpGrowFlag flagOf(@NotNull Boolean value) {
return value ? KELP_GROW_TRUE : KELP_GROW_FALSE;
}
}

View File

@ -0,0 +1,20 @@
package com.github.intellectualsites.plotsquared.plot.flags.implementations;
import com.github.intellectualsites.plotsquared.plot.config.Captions;
import com.github.intellectualsites.plotsquared.plot.flags.types.BooleanFlag;
import org.jetbrains.annotations.NotNull;
public class LiquidFlowFlag extends BooleanFlag<LiquidFlowFlag> {
public static final LiquidFlowFlag LIQUID_FLOW_TRUE = new LiquidFlowFlag(true);
public static final LiquidFlowFlag LIQUID_FLOW_FALSE = new LiquidFlowFlag(false);
private LiquidFlowFlag(boolean value) {
super(value, Captions.FLAG_DESCRIPTION_LIQUID_FLOW);
}
@Override protected LiquidFlowFlag flagOf(@NotNull Boolean value) {
return value ? LIQUID_FLOW_TRUE : LIQUID_FLOW_FALSE;
}
}

View File

@ -0,0 +1,20 @@
package com.github.intellectualsites.plotsquared.plot.flags.implementations;
import com.github.intellectualsites.plotsquared.plot.config.Captions;
import com.github.intellectualsites.plotsquared.plot.flags.types.BooleanFlag;
import org.jetbrains.annotations.NotNull;
public class MiscBreakFlag extends BooleanFlag<MiscBreakFlag> {
public static final MiscBreakFlag MISC_BREAK_TRUE = new MiscBreakFlag(true);
public static final MiscBreakFlag MISC_BREAK_FALSE = new MiscBreakFlag(false);
private MiscBreakFlag(boolean value) {
super(value, Captions.FLAG_DESCRIPTION_MISC_BREAK);
}
@Override protected MiscBreakFlag flagOf(@NotNull Boolean value) {
return value ? MISC_BREAK_TRUE : MISC_BREAK_FALSE;
}
}

View File

@ -0,0 +1,20 @@
package com.github.intellectualsites.plotsquared.plot.flags.implementations;
import com.github.intellectualsites.plotsquared.plot.config.Captions;
import com.github.intellectualsites.plotsquared.plot.flags.types.BooleanFlag;
import org.jetbrains.annotations.NotNull;
public class MiscInteractFlag extends BooleanFlag<MiscInteractFlag> {
public static final MiscInteractFlag MISC_INTERACT_TRUE = new MiscInteractFlag(true);
public static final MiscInteractFlag MISC_INTERACT_FALSE = new MiscInteractFlag(false);
private MiscInteractFlag(boolean value) {
super(value, Captions.FLAG_DESCRIPTION_MISC_INTERACT);
}
@Override protected MiscInteractFlag flagOf(@NotNull Boolean value) {
return value ? MISC_INTERACT_TRUE : MISC_INTERACT_FALSE;
}
}

View File

@ -0,0 +1,20 @@
package com.github.intellectualsites.plotsquared.plot.flags.implementations;
import com.github.intellectualsites.plotsquared.plot.config.Captions;
import com.github.intellectualsites.plotsquared.plot.flags.types.BooleanFlag;
import org.jetbrains.annotations.NotNull;
public class MiscPlaceFlag extends BooleanFlag<MiscPlaceFlag> {
public static final MiscPlaceFlag MISC_PLACE_TRUE = new MiscPlaceFlag(true);
public static final MiscPlaceFlag MISC_PLACE_FALSE = new MiscPlaceFlag(false);
private MiscPlaceFlag(boolean value) {
super(value, Captions.FLAG_DESCRIPTION_MISC_PLACE);
}
@Override protected MiscPlaceFlag flagOf(@NotNull Boolean value) {
return value ? MISC_PLACE_TRUE : MISC_PLACE_FALSE;
}
}

View File

@ -0,0 +1,20 @@
package com.github.intellectualsites.plotsquared.plot.flags.implementations;
import com.github.intellectualsites.plotsquared.plot.config.Captions;
import com.github.intellectualsites.plotsquared.plot.flags.types.BooleanFlag;
import org.jetbrains.annotations.NotNull;
public class MobBreakFlag extends BooleanFlag<MobBreakFlag> {
public static final MobBreakFlag MOB_BREAK_TRUE = new MobBreakFlag(true);
public static final MobBreakFlag MOB_BREAK_FALSE = new MobBreakFlag(false);
private MobBreakFlag(boolean value) {
super(value, Captions.FLAG_DESCRIPTION_MOB_BREAK);
}
@Override protected MobBreakFlag flagOf(@NotNull Boolean value) {
return value ? MOB_BREAK_TRUE : MOB_BREAK_FALSE;
}
}

View File

@ -0,0 +1,20 @@
package com.github.intellectualsites.plotsquared.plot.flags.implementations;
import com.github.intellectualsites.plotsquared.plot.config.Captions;
import com.github.intellectualsites.plotsquared.plot.flags.types.BooleanFlag;
import org.jetbrains.annotations.NotNull;
public class MobPlaceFlag extends BooleanFlag<MobPlaceFlag> {
public static final MobPlaceFlag MOB_PLACE_TRUE = new MobPlaceFlag(true);
public static final MobPlaceFlag MOB_PLACE_FALSE = new MobPlaceFlag(false);
private MobPlaceFlag(boolean value) {
super(value, Captions.FLAG_DESCRIPTION_MOB_PLACE);
}
@Override protected MobPlaceFlag flagOf(@NotNull Boolean value) {
return value ? MOB_PLACE_TRUE : MOB_PLACE_FALSE;
}
}

View File

@ -0,0 +1,20 @@
package com.github.intellectualsites.plotsquared.plot.flags.implementations;
import com.github.intellectualsites.plotsquared.plot.config.Captions;
import com.github.intellectualsites.plotsquared.plot.flags.types.BooleanFlag;
import org.jetbrains.annotations.NotNull;
public class MycelGrowFlag extends BooleanFlag<MycelGrowFlag> {
public static final MycelGrowFlag MYCEL_GROW_TRUE = new MycelGrowFlag(true);
public static final MycelGrowFlag MYCEL_GROW_FALSE = new MycelGrowFlag(false);
private MycelGrowFlag(boolean value) {
super(value, Captions.FLAG_DESCRIPTION_MYCEL_GROW);
}
@Override protected MycelGrowFlag flagOf(@NotNull Boolean value) {
return value ? MYCEL_GROW_TRUE : MYCEL_GROW_FALSE;
}
}

View File

@ -0,0 +1,20 @@
package com.github.intellectualsites.plotsquared.plot.flags.implementations;
import com.github.intellectualsites.plotsquared.plot.config.Captions;
import com.github.intellectualsites.plotsquared.plot.flags.types.BooleanFlag;
import org.jetbrains.annotations.NotNull;
public class NoWorldeditFlag extends BooleanFlag<NoWorldeditFlag> {
public static final NoWorldeditFlag NO_WORLDEDIT_TRUE = new NoWorldeditFlag(true);
public static final NoWorldeditFlag NO_WORLDEDIT_FALSE = new NoWorldeditFlag(false);
private NoWorldeditFlag(boolean value) {
super(value, Captions.FLAG_DESCRIPTION_NO_WORLDEDIT);
}
@Override protected NoWorldeditFlag flagOf(@NotNull Boolean value) {
return value ? NO_WORLDEDIT_TRUE : NO_WORLDEDIT_FALSE;
}
}

View File

@ -0,0 +1,20 @@
package com.github.intellectualsites.plotsquared.plot.flags.implementations;
import com.github.intellectualsites.plotsquared.plot.config.Captions;
import com.github.intellectualsites.plotsquared.plot.flags.types.BooleanFlag;
import org.jetbrains.annotations.NotNull;
public class NotifyEnterFlag extends BooleanFlag<NotifyEnterFlag> {
public static final NotifyEnterFlag NOTIFY_ENTER_TRUE = new NotifyEnterFlag(true);
public static final NotifyEnterFlag NOTIFY_ENTER_FALSE = new NotifyEnterFlag(false);
private NotifyEnterFlag(boolean value) {
super(value, Captions.FLAG_DESCRIPTION_NOTIFY_ENTER);
}
@Override protected NotifyEnterFlag flagOf(@NotNull Boolean value) {
return value ? NOTIFY_ENTER_TRUE : NOTIFY_ENTER_FALSE;
}
}

View File

@ -0,0 +1,20 @@
package com.github.intellectualsites.plotsquared.plot.flags.implementations;
import com.github.intellectualsites.plotsquared.plot.config.Captions;
import com.github.intellectualsites.plotsquared.plot.flags.types.BooleanFlag;
import org.jetbrains.annotations.NotNull;
public class NotifyLeaveFlag extends BooleanFlag<NotifyLeaveFlag> {
public static final NotifyLeaveFlag NOTIFY_LEAVE_TRUE = new NotifyLeaveFlag(true);
public static final NotifyLeaveFlag NOTIFY_LEAVE_FALSE = new NotifyLeaveFlag(false);
private NotifyLeaveFlag(boolean value) {
super(value, Captions.FLAG_DESCRIPTION_NOTIFY_LEAVE);
}
@Override protected NotifyLeaveFlag flagOf(@NotNull Boolean value) {
return value ? NOTIFY_LEAVE_TRUE : NOTIFY_LEAVE_FALSE;
}
}

View File

@ -0,0 +1,20 @@
package com.github.intellectualsites.plotsquared.plot.flags.implementations;
import com.github.intellectualsites.plotsquared.plot.config.Captions;
import com.github.intellectualsites.plotsquared.plot.flags.types.BooleanFlag;
import org.jetbrains.annotations.NotNull;
public class PlayerInteractFlag extends BooleanFlag<PlayerInteractFlag> {
public static final PlayerInteractFlag PLAYER_INTERACT_TRUE = new PlayerInteractFlag(true);
public static final PlayerInteractFlag PLAYER_INTERACT_FALSE = new PlayerInteractFlag(false);
private PlayerInteractFlag(boolean value) {
super(value, Captions.FLAG_DESCRIPTION_PLAYER_INTERACT);
}
@Override protected PlayerInteractFlag flagOf(@NotNull Boolean value) {
return value ? PLAYER_INTERACT_TRUE : PLAYER_INTERACT_FALSE;
}
}

View File

@ -0,0 +1,20 @@
package com.github.intellectualsites.plotsquared.plot.flags.implementations;
import com.github.intellectualsites.plotsquared.plot.config.Captions;
import com.github.intellectualsites.plotsquared.plot.flags.types.BooleanFlag;
import org.jetbrains.annotations.NotNull;
public class PveFlag extends BooleanFlag<PveFlag> {
public static final PveFlag PVE_TRUE = new PveFlag(true);
public static final PveFlag PVE_FALSE = new PveFlag(false);
private PveFlag(boolean value) {
super(value, Captions.FLAG_DESCRIPTION_PVE);
}
@Override protected PveFlag flagOf(@NotNull Boolean value) {
return value ? PVE_TRUE : PVE_FALSE;
}
}

View File

@ -0,0 +1,20 @@
package com.github.intellectualsites.plotsquared.plot.flags.implementations;
import com.github.intellectualsites.plotsquared.plot.config.Captions;
import com.github.intellectualsites.plotsquared.plot.flags.types.BooleanFlag;
import org.jetbrains.annotations.NotNull;
public class PvpFlag extends BooleanFlag<PvpFlag> {
public static final PvpFlag PVP_TRUE = new PvpFlag(true);
public static final PvpFlag PVP_FALSE = new PvpFlag(false);
private PvpFlag(boolean value) {
super(value, Captions.FLAG_DESCRIPTION_PVP);
}
@Override protected PvpFlag flagOf(@NotNull Boolean value) {
return value ? PVP_TRUE : PVP_FALSE;
}
}

View File

@ -0,0 +1,20 @@
package com.github.intellectualsites.plotsquared.plot.flags.implementations;
import com.github.intellectualsites.plotsquared.plot.config.Captions;
import com.github.intellectualsites.plotsquared.plot.flags.types.BooleanFlag;
import org.jetbrains.annotations.NotNull;
public class RedstoneFlag extends BooleanFlag<RedstoneFlag> {
public static final RedstoneFlag REDSTONE_TRUE = new RedstoneFlag(true);
public static final RedstoneFlag REDSTONE_FALSE = new RedstoneFlag(false);
private RedstoneFlag(boolean value) {
super(value, Captions.FLAG_DESCRIPTION_REDSTONE);
}
@Override protected RedstoneFlag flagOf(@NotNull Boolean value) {
return value ? REDSTONE_TRUE : REDSTONE_FALSE;
}
}

View File

@ -0,0 +1,20 @@
package com.github.intellectualsites.plotsquared.plot.flags.implementations;
import com.github.intellectualsites.plotsquared.plot.config.Captions;
import com.github.intellectualsites.plotsquared.plot.flags.types.BooleanFlag;
import org.jetbrains.annotations.NotNull;
public class ServerPlotFlag extends BooleanFlag<ServerPlotFlag> {
public static final ServerPlotFlag SERVER_PLOT_TRUE = new ServerPlotFlag(true);
public static final ServerPlotFlag SERVER_PLOT_FALSE = new ServerPlotFlag(false);
private ServerPlotFlag(boolean value) {
super(value, Captions.FLAG_DESCRIPTION_SERVER_PLOT);
}
@Override protected ServerPlotFlag flagOf(@NotNull Boolean value) {
return value ? SERVER_PLOT_TRUE : SERVER_PLOT_FALSE;
}
}

View File

@ -0,0 +1,20 @@
package com.github.intellectualsites.plotsquared.plot.flags.implementations;
import com.github.intellectualsites.plotsquared.plot.config.Captions;
import com.github.intellectualsites.plotsquared.plot.flags.types.BooleanFlag;
import org.jetbrains.annotations.NotNull;
public class SnowFormFlag extends BooleanFlag<SnowFormFlag> {
public static final SnowFormFlag SNOW_FORM_TRUE = new SnowFormFlag(true);
public static final SnowFormFlag SNOW_FORM_FALSE = new SnowFormFlag(false);
private SnowFormFlag(boolean value) {
super(value, Captions.FLAG_DESCRIPTION_SNOW_FORM);
}
@Override protected SnowFormFlag flagOf(@NotNull Boolean value) {
return value ? SNOW_FORM_TRUE : SNOW_FORM_FALSE;
}
}

View File

@ -0,0 +1,20 @@
package com.github.intellectualsites.plotsquared.plot.flags.implementations;
import com.github.intellectualsites.plotsquared.plot.config.Captions;
import com.github.intellectualsites.plotsquared.plot.flags.types.BooleanFlag;
import org.jetbrains.annotations.NotNull;
public class SnowMeltFlag extends BooleanFlag<SnowMeltFlag> {
public static final SnowMeltFlag SNOW_MELT_TRUE = new SnowMeltFlag(true);
public static final SnowMeltFlag SNOW_MELT_FALSE = new SnowMeltFlag(false);
private SnowMeltFlag(boolean value) {
super(value, Captions.FLAG_DESCRIPTION_SNOW_MELT);
}
@Override protected SnowMeltFlag flagOf(@NotNull Boolean value) {
return value ? SNOW_MELT_TRUE : SNOW_MELT_FALSE;
}
}

View File

@ -0,0 +1,20 @@
package com.github.intellectualsites.plotsquared.plot.flags.implementations;
import com.github.intellectualsites.plotsquared.plot.config.Captions;
import com.github.intellectualsites.plotsquared.plot.flags.types.BooleanFlag;
import org.jetbrains.annotations.NotNull;
public class SoilDryFlag extends BooleanFlag<SoilDryFlag> {
public static final SoilDryFlag SOIL_DRY_TRUE = new SoilDryFlag(true);
public static final SoilDryFlag SOIL_DRY_FALSE = new SoilDryFlag(false);
private SoilDryFlag(boolean value) {
super(value, Captions.FLAG_DESCRIPTION_SOIL_DRY);
}
@Override protected SoilDryFlag flagOf(@NotNull Boolean value) {
return value ? SOIL_DRY_TRUE : SOIL_DRY_FALSE;
}
}

View File

@ -0,0 +1,20 @@
package com.github.intellectualsites.plotsquared.plot.flags.implementations;
import com.github.intellectualsites.plotsquared.plot.config.Captions;
import com.github.intellectualsites.plotsquared.plot.flags.types.BooleanFlag;
import org.jetbrains.annotations.NotNull;
public class TamedAttackFlag extends BooleanFlag<TamedAttackFlag> {
public static final TamedAttackFlag TAMED_ATTACK_TRUE = new TamedAttackFlag(true);
public static final TamedAttackFlag TAMED_ATTACK_FALSE = new TamedAttackFlag(false);
private TamedAttackFlag(boolean value) {
super(value, Captions.FLAG_DESCRIPTION_TAMED_ATTACK);
}
@Override protected TamedAttackFlag flagOf(@NotNull Boolean value) {
return value ? TAMED_ATTACK_TRUE : TAMED_ATTACK_FALSE;
}
}

View File

@ -0,0 +1,20 @@
package com.github.intellectualsites.plotsquared.plot.flags.implementations;
import com.github.intellectualsites.plotsquared.plot.config.Captions;
import com.github.intellectualsites.plotsquared.plot.flags.types.BooleanFlag;
import org.jetbrains.annotations.NotNull;
public class TamedInteractFlag extends BooleanFlag<TamedInteractFlag> {
public static final TamedInteractFlag TAMED_INTERACT_TRUE = new TamedInteractFlag(true);
public static final TamedInteractFlag TAMED_INTERACT_FALSE = new TamedInteractFlag(false);
private TamedInteractFlag(boolean value) {
super(value, Captions.FLAG_DESCRIPTION_TAMED_INTERACT);
}
@Override protected TamedInteractFlag flagOf(@NotNull Boolean value) {
return value ? TAMED_INTERACT_TRUE : TAMED_INTERACT_FALSE;
}
}

View File

@ -0,0 +1,20 @@
package com.github.intellectualsites.plotsquared.plot.flags.implementations;
import com.github.intellectualsites.plotsquared.plot.config.Captions;
import com.github.intellectualsites.plotsquared.plot.flags.types.BooleanFlag;
import org.jetbrains.annotations.NotNull;
public class TitlesFlag extends BooleanFlag<TitlesFlag> {
public static final TitlesFlag TITLES_TRUE = new TitlesFlag(true);
public static final TitlesFlag TITLES_FALSE = new TitlesFlag(false);
private TitlesFlag(boolean value) {
super(value, Captions.FLAG_DESCRIPTION_TITLES);
}
@Override protected TitlesFlag flagOf(@NotNull Boolean value) {
return value ? TITLES_TRUE : TITLES_FALSE;
}
}

View File

@ -0,0 +1,20 @@
package com.github.intellectualsites.plotsquared.plot.flags.implementations;
import com.github.intellectualsites.plotsquared.plot.config.Captions;
import com.github.intellectualsites.plotsquared.plot.flags.types.BooleanFlag;
import org.jetbrains.annotations.NotNull;
public class VehicleBreakFlag extends BooleanFlag<VehicleBreakFlag> {
public static final VehicleBreakFlag VEHICLE_BREAK_TRUE = new VehicleBreakFlag(true);
public static final VehicleBreakFlag VEHICLE_BREAK_FALSE = new VehicleBreakFlag(false);
private VehicleBreakFlag(boolean value) {
super(value, Captions.FLAG_DESCRIPTION_VEHICLE_BREAK);
}
@Override protected VehicleBreakFlag flagOf(@NotNull Boolean value) {
return value ? VEHICLE_BREAK_TRUE : VEHICLE_BREAK_FALSE;
}
}

View File

@ -0,0 +1,20 @@
package com.github.intellectualsites.plotsquared.plot.flags.implementations;
import com.github.intellectualsites.plotsquared.plot.config.Captions;
import com.github.intellectualsites.plotsquared.plot.flags.types.BooleanFlag;
import org.jetbrains.annotations.NotNull;
public class VehiclePlaceFlag extends BooleanFlag<VehiclePlaceFlag> {
public static final VehiclePlaceFlag VEHICLE_PLACE_TRUE = new VehiclePlaceFlag(true);
public static final VehiclePlaceFlag VEHICLE_PLACE_FALSE = new VehiclePlaceFlag(false);
private VehiclePlaceFlag(boolean value) {
super(value, Captions.FLAG_DESCRIPTION_VEHICLE_PLACE);
}
@Override protected VehiclePlaceFlag flagOf(@NotNull Boolean value) {
return value ? VEHICLE_PLACE_TRUE : VEHICLE_PLACE_FALSE;
}
}

View File

@ -0,0 +1,20 @@
package com.github.intellectualsites.plotsquared.plot.flags.implementations;
import com.github.intellectualsites.plotsquared.plot.config.Captions;
import com.github.intellectualsites.plotsquared.plot.flags.types.BooleanFlag;
import org.jetbrains.annotations.NotNull;
public class VehicleUseFlag extends BooleanFlag<VehicleUseFlag> {
public static final VehicleUseFlag VEHICLE_USE_TRUE = new VehicleUseFlag(true);
public static final VehicleUseFlag VEHICLE_USE_FALSE = new VehicleUseFlag(false);
private VehicleUseFlag(boolean value) {
super(value, Captions.FLAG_DESCRIPTION_VEHICLE_USE);
}
@Override protected VehicleUseFlag flagOf(@NotNull Boolean value) {
return value ? VEHICLE_USE_TRUE : VEHICLE_USE_FALSE;
}
}

View File

@ -0,0 +1,20 @@
package com.github.intellectualsites.plotsquared.plot.flags.implementations;
import com.github.intellectualsites.plotsquared.plot.config.Captions;
import com.github.intellectualsites.plotsquared.plot.flags.types.BooleanFlag;
import org.jetbrains.annotations.NotNull;
public class VillagerInteractFlag extends BooleanFlag<VillagerInteractFlag> {
public static final VillagerInteractFlag VILLAGER_INTERACT_TRUE = new VillagerInteractFlag(true);
public static final VillagerInteractFlag VILLAGER_INTERACT_FALSE = new VillagerInteractFlag(false);
private VillagerInteractFlag(boolean value) {
super(value, Captions.FLAG_DESCRIPTION_VILLAGER_INTERACT);
}
@Override protected VillagerInteractFlag flagOf(@NotNull Boolean value) {
return value ? VILLAGER_INTERACT_TRUE : VILLAGER_INTERACT_FALSE;
}
}

View File

@ -0,0 +1,20 @@
package com.github.intellectualsites.plotsquared.plot.flags.implementations;
import com.github.intellectualsites.plotsquared.plot.config.Captions;
import com.github.intellectualsites.plotsquared.plot.flags.types.BooleanFlag;
import org.jetbrains.annotations.NotNull;
public class VineGrowFlag extends BooleanFlag<VineGrowFlag> {
public static final VineGrowFlag VINE_GROW_TRUE = new VineGrowFlag(true);
public static final VineGrowFlag VINE_GROW_FALSE = new VineGrowFlag(false);
private VineGrowFlag(boolean value) {
super(value, Captions.FLAG_DESCRIPTION_VINE_GROW);
}
@Override protected VineGrowFlag flagOf(@NotNull Boolean value) {
return value ? VINE_GROW_TRUE : VINE_GROW_FALSE;
}
}

View File

@ -10,7 +10,10 @@ import com.github.intellectualsites.plotsquared.plot.flags.implementations.Farew
import com.github.intellectualsites.plotsquared.plot.flags.implementations.FlightFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.GreetingFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.MusicFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.NotifyEnterFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.NotifyLeaveFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.PlotWeatherFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.TitlesFlag;
import com.github.intellectualsites.plotsquared.plot.object.Location;
import com.github.intellectualsites.plotsquared.plot.object.Plot;
import com.github.intellectualsites.plotsquared.plot.object.PlotArea;
@ -71,7 +74,7 @@ public class PlotListener {
return true;
}
} else {
titles = plot.getFlag(Flags.TITLES, titles);
titles = titles && plot.getFlag(TitlesFlag.class);
greeting = plot.getFlag(GreetingFlag.class);
if (!greeting.isEmpty()) {
@ -84,8 +87,8 @@ public class PlotListener {
}
});
}
Optional<Boolean> enter = plot.getFlag(Flags.NOTIFY_ENTER);
if (enter.isPresent() && enter.get()) {
if (plot.getFlag(NotifyEnterFlag.class)) {
if (!Permissions.hasPermission(player, "plots.flag.notify-enter.bypass")) {
for (UUID uuid : plot.getOwners()) {
PlotPlayer owner = UUIDHandler.getPlayer(uuid);
@ -246,8 +249,7 @@ public class PlotListener {
});
}
Optional<Boolean> leave = plot.getFlag(Flags.NOTIFY_LEAVE);
if (leave.isPresent() && leave.get()) {
if (plot.getFlag(NotifyLeaveFlag.class)) {
if (!Permissions.hasPermission(player, "plots.flag.notify-enter.bypass")) {
for (UUID uuid : plot.getOwners()) {
PlotPlayer owner = UUIDHandler.getPlayer(uuid);

View File

@ -2,8 +2,8 @@ package com.github.intellectualsites.plotsquared.plot.listener;
import com.github.intellectualsites.plotsquared.plot.PlotSquared;
import com.github.intellectualsites.plotsquared.plot.config.Settings;
import com.github.intellectualsites.plotsquared.plot.flag.Flags;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.DoneFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.NoWorldeditFlag;
import com.github.intellectualsites.plotsquared.plot.object.Location;
import com.github.intellectualsites.plotsquared.plot.object.Plot;
import com.github.intellectualsites.plotsquared.plot.object.PlotArea;
@ -81,7 +81,7 @@ public class WEManager {
}
if (plot != null && (!Settings.Done.RESTRICT_BUILDING || !DoneFlag.isDone(plot)) && (
(allowMember && plot.isAdded(uuid)) || (!allowMember && (plot.isOwner(uuid)) || plot
.getTrusted().contains(uuid))) && !(Flags.NO_WORLDEDIT.isTrue(plot))) {
.getTrusted().contains(uuid))) && !plot.getFlag(NoWorldeditFlag.class)) {
for (CuboidRegion region : plot.getRegions()) {
BlockVector3 pos1 = region.getMinimumPoint().withY(area.MIN_BUILD_HEIGHT);
BlockVector3 pos2 = region.getMaximumPoint().withY(area.MAX_BUILD_HEIGHT);

View File

@ -5,6 +5,10 @@ import com.github.intellectualsites.plotsquared.plot.config.Captions;
import com.github.intellectualsites.plotsquared.plot.config.Settings;
import com.github.intellectualsites.plotsquared.plot.flag.Flag;
import com.github.intellectualsites.plotsquared.plot.flag.Flags;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.DeviceInteractFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.MiscPlaceFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.MobPlaceFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.VehiclePlaceFlag;
import com.github.intellectualsites.plotsquared.plot.listener.PlayerBlockEventType;
import com.github.intellectualsites.plotsquared.plot.object.Location;
import com.github.intellectualsites.plotsquared.plot.object.Plot;
@ -149,7 +153,7 @@ public abstract class EventUtil {
Captions.PERMISSION_ADMIN_INTERACT_UNOWNED.getTranslated(),
false);
}
if (plot.getFlag(Flags.DEVICE_INTERACT).orElse(false)) {
if (plot.getFlag(DeviceInteractFlag.class)) {
return true;
}
Optional<Set<BlockType>> flagValue = plot.getFlag(Flags.USE);
@ -176,7 +180,7 @@ public abstract class EventUtil {
Captions.PERMISSION_ADMIN_INTERACT_UNOWNED.getTranslated(),
notifyPerms);
}
if (plot.getFlag(Flags.MOB_PLACE).orElse(false)) {
if (plot.getFlag(MobPlaceFlag.class)) {
return true;
}
Optional<Set<BlockType>> flagValue = plot.getFlag(Flags.PLACE);
@ -206,7 +210,7 @@ public abstract class EventUtil {
Captions.PERMISSION_ADMIN_INTERACT_UNOWNED.getTranslated(),
notifyPerms);
}
if (plot.getFlag(Flags.MISC_PLACE).orElse(false)) {
if (plot.getFlag(MiscPlaceFlag.class)) {
return true;
}
Optional<Set<BlockType>> flag = plot.getFlag(Flags.PLACE);
@ -237,8 +241,7 @@ public abstract class EventUtil {
Captions.PERMISSION_ADMIN_INTERACT_UNOWNED.getTranslated(),
notifyPerms);
}
Optional<Boolean> flag1 = plot.getFlag(Flags.VEHICLE_PLACE);
return flag1.orElse(false);
return plot.getFlag(VehiclePlaceFlag.class);
default:
break;
}

View File

@ -13,6 +13,7 @@ import com.github.intellectualsites.plotsquared.plot.flag.Flag;
import com.github.intellectualsites.plotsquared.plot.flag.FlagManager;
import com.github.intellectualsites.plotsquared.plot.flag.Flags;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.DescriptionFlag;
import com.github.intellectualsites.plotsquared.plot.flags.implementations.ServerPlotFlag;
import com.github.intellectualsites.plotsquared.plot.object.ConsolePlayer;
import com.github.intellectualsites.plotsquared.plot.object.Location;
import com.github.intellectualsites.plotsquared.plot.object.Plot;
@ -375,7 +376,7 @@ public class MainUtil {
}
public static boolean isServerOwned(Plot plot) {
return plot.getFlag(Flags.SERVER_PLOT).orElse(false);
return plot.getFlag(ServerPlotFlag.class);
}
@NotNull public static Location[] getCorners(String world, CuboidRegion region) {