mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-26 15:16:45 +01:00
Merge pull request #269 from MinelinkNetwork/keep-flag
Add keep flag for preventing plots from expiring
This commit is contained in:
commit
666b3cff3c
@ -706,7 +706,7 @@ public class PlotSquared {
|
||||
}
|
||||
|
||||
public static void setupDefaultFlags() {
|
||||
final List<String> booleanFlags = Arrays.asList("notify-enter", "notify-leave", "item-drop", "invincible", "instabreak", "drop-protection", "forcefield", "titles", "pve", "pvp", "no-worldedit", "redstone");
|
||||
final List<String> booleanFlags = Arrays.asList("notify-enter", "notify-leave", "item-drop", "invincible", "instabreak", "drop-protection", "forcefield", "titles", "pve", "pvp", "no-worldedit", "redstone", "keep");
|
||||
final List<String> intervalFlags = Arrays.asList("feed", "heal");
|
||||
final List<String> stringFlags = Arrays.asList("greeting", "farewell");
|
||||
final List<String> intFlags = Arrays.asList("mob-cap", "animal-cap", "hostile-cap");
|
||||
|
@ -18,6 +18,8 @@ import com.intellectualcrafters.plot.config.C;
|
||||
import com.intellectualcrafters.plot.config.Settings;
|
||||
import com.intellectualcrafters.plot.database.DBFunc;
|
||||
import com.intellectualcrafters.plot.events.PlotDeleteEvent;
|
||||
import com.intellectualcrafters.plot.flag.Flag;
|
||||
import com.intellectualcrafters.plot.flag.FlagManager;
|
||||
import com.intellectualcrafters.plot.object.OfflinePlotPlayer;
|
||||
import com.intellectualcrafters.plot.object.Plot;
|
||||
import com.intellectualcrafters.plot.object.PlotHandler;
|
||||
@ -159,6 +161,10 @@ public class ExpireManager {
|
||||
final HashMap<UUID, Long> remove = new HashMap<>();
|
||||
final Set<UUID> keep = new HashSet<>();
|
||||
for (final Plot plot : plots) {
|
||||
final Flag keepFlag = FlagManager.getPlotFlag(plot, "keep");
|
||||
if (keepFlag != null && (Boolean) keepFlag.getValue()) {
|
||||
continue;
|
||||
}
|
||||
final UUID uuid = plot.owner;
|
||||
if ((uuid == null) || remove.containsKey(uuid)) {
|
||||
Long stamp;
|
||||
|
Loading…
Reference in New Issue
Block a user