mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-06-25 18:24:43 +02:00
Add leaf-decay flag
Stop leaves from decaying.
This commit is contained in:
@ -68,6 +68,7 @@ import com.plotsquared.core.plot.flag.implementations.ItemDropFlag;
|
||||
import com.plotsquared.core.plot.flag.implementations.KeepFlag;
|
||||
import com.plotsquared.core.plot.flag.implementations.KeepInventoryFlag;
|
||||
import com.plotsquared.core.plot.flag.implementations.KelpGrowFlag;
|
||||
import com.plotsquared.core.plot.flag.implementations.LeafDecayFlag;
|
||||
import com.plotsquared.core.plot.flag.implementations.LiquidFlowFlag;
|
||||
import com.plotsquared.core.plot.flag.implementations.MiscBreakFlag;
|
||||
import com.plotsquared.core.plot.flag.implementations.MiscCapFlag;
|
||||
@ -187,6 +188,7 @@ public final class GlobalFlagContainer extends FlagContainer {
|
||||
this.addFlag(MiscInteractFlag.MISC_INTERACT_FALSE);
|
||||
this.addFlag(KeepInventoryFlag.KEEP_INVENTORY_FALSE);
|
||||
this.addFlag(PreventCreativeCopyFlag.PREVENT_CREATIVE_COPY_FALSE);
|
||||
this.addFlag(LeafDecayFlag.LEAF_DECAY_TRUE);
|
||||
|
||||
// Enum Flags
|
||||
this.addFlag(WeatherFlag.PLOT_WEATHER_FLAG_OFF);
|
||||
|
@ -0,0 +1,46 @@
|
||||
/*
|
||||
* _____ _ _ _____ _
|
||||
* | __ \| | | | / ____| | |
|
||||
* | |__) | | ___ | |_| (___ __ _ _ _ __ _ _ __ ___ __| |
|
||||
* | ___/| |/ _ \| __|\___ \ / _` | | | |/ _` | '__/ _ \/ _` |
|
||||
* | | | | (_) | |_ ____) | (_| | |_| | (_| | | | __/ (_| |
|
||||
* |_| |_|\___/ \__|_____/ \__, |\__,_|\__,_|_| \___|\__,_|
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.plotsquared.core.plot.flag.implementations;
|
||||
|
||||
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class LeafDecayFlag extends BooleanFlag<LeafDecayFlag> {
|
||||
|
||||
public static final LeafDecayFlag LEAF_DECAY_TRUE = new LeafDecayFlag(true);
|
||||
public static final LeafDecayFlag LEAF_DECAY_FALSE = new LeafDecayFlag(false);
|
||||
|
||||
private LeafDecayFlag(boolean value) {
|
||||
super(value, TranslatableCaption.of("flags.flag_description_leaf_decay"));
|
||||
}
|
||||
|
||||
@Override protected LeafDecayFlag flagOf(@Nonnull Boolean value) {
|
||||
return value ? LEAF_DECAY_TRUE : LEAF_DECAY_FALSE;
|
||||
}
|
||||
|
||||
}
|
@ -653,6 +653,7 @@
|
||||
"flags.flag_description_keep": "<gray>Prevents the plot from expiring. Can be set to: true, false, the number of milliseconds to keep the plot for or a timestamp (3w 2d 5h).</gray>",
|
||||
"flags.flag_description_keep_inventory": "<gray>Prevents players from dropping their items when they die inside of the plot.</gray>",
|
||||
"flags.flag_description_prevent_creative_copy": "<gray>Prevents people from copying item NBT data in the plot unless they're added as members.</gray>",
|
||||
"flags.flag_description_leaf_decay": "<gray>Set to `false` to prevent leaves from decaying.",
|
||||
|
||||
"flags.flag_error_boolean": "<prefix>Flag value must be a boolean (true | false).",
|
||||
"flags.flag_error_enum": "<prefix>Must be one of: <list>",
|
||||
|
Reference in New Issue
Block a user