Introduce tile-drop flag (#4371)

* added tile-drops flag

* added tile-drops flag

* added tile-drop flag

* updated description

* relocated listener
This commit is contained in:
Nicolai
2024-03-26 17:38:55 +01:00
committed by GitHub
parent e46dbd826c
commit 82f868ae7d
5 changed files with 76 additions and 0 deletions

View File

@ -102,6 +102,7 @@ import com.plotsquared.core.plot.flag.implementations.SnowMeltFlag;
import com.plotsquared.core.plot.flag.implementations.SoilDryFlag;
import com.plotsquared.core.plot.flag.implementations.TamedAttackFlag;
import com.plotsquared.core.plot.flag.implementations.TamedInteractFlag;
import com.plotsquared.core.plot.flag.implementations.TileDropFlag;
import com.plotsquared.core.plot.flag.implementations.TimeFlag;
import com.plotsquared.core.plot.flag.implementations.TitlesFlag;
import com.plotsquared.core.plot.flag.implementations.UntrustedVisitFlag;
@ -198,6 +199,7 @@ public final class GlobalFlagContainer extends FlagContainer {
this.addFlag(SoilDryFlag.SOIL_DRY_FALSE);
this.addFlag(TamedAttackFlag.TAMED_ATTACK_FALSE);
this.addFlag(TamedInteractFlag.TAMED_INTERACT_FALSE);
this.addFlag(TileDropFlag.TILE_DROP_TRUE);
this.addFlag(UntrustedVisitFlag.UNTRUSTED_VISIT_FLAG_TRUE);
this.addFlag(VehicleBreakFlag.VEHICLE_BREAK_FALSE);
this.addFlag(VehiclePlaceFlag.VEHICLE_PLACE_FALSE);

View File

@ -0,0 +1,43 @@
/*
* PlotSquared, a land and world management plugin for Minecraft.
* Copyright (C) IntellectualSites <https://intellectualsites.com>
* Copyright (C) IntellectualSites team and contributors
*
* 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 org.checkerframework.checker.nullness.qual.NonNull;
/**
* @since TODO
*/
public class TileDropFlag extends BooleanFlag<TileDropFlag> {
public static final TileDropFlag TILE_DROP_TRUE = new TileDropFlag(true);
public static final TileDropFlag TILE_DROP_FALSE = new TileDropFlag(false);
private TileDropFlag(boolean value) {
super(value, TranslatableCaption.of("flags.flag_description_tile_drop"));
}
@Override
protected TileDropFlag flagOf(@NonNull Boolean value) {
return value ? TILE_DROP_TRUE : TILE_DROP_FALSE;
}
}

View File

@ -606,6 +606,7 @@
"flags.flag_description_tamed_attack": "<gray>Set to `true` to allow guests to attack tamed animals in the plot.</gray>",
"flags.flag_description_tamed_interact": "<gray>Set to `true` to allow guests to interact with tamed animals in the plot.</gray>",
"flags.flag_description_time": "<gray>Set the time in the plot to a fixed value.</gray>",
"flags.flag_description_tile_drop": "<gray>Set to `false` to prevent blocks from dropping items in the plot.</gray>",
"flags.flag_description_titles": "<gray>Set to `false` to disable plot titles. Can be set to: `none` (to inherit world settings), `true`, or `false`</gray>",
"flags.flag_description_title": "<gray>Set the pop-up title's title and subtitle. Format: /plot flag set title \"A title\" \"The subtitle\"</gray>",
"flags.flag_description_use": "<gray>Define a list of materials players should be able to interact with in the plot.</gray>",