mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-07-02 21:54:43 +02:00
Compare commits
27 Commits
chore/anal
...
fix/snow-t
Author | SHA1 | Date | |
---|---|---|---|
59a8fe5d6f | |||
ec51a60d80 | |||
aeb4350ccb | |||
9609990832 | |||
0e4319b757 | |||
c8f4907f77 | |||
dcf98c2298 | |||
ae59c7442f | |||
98708118d8 | |||
276d8f8e1e | |||
87f89541b5 | |||
93f6de7029 | |||
73d2686b17 | |||
c446a95b07 | |||
3676e1df35 | |||
12e2705260 | |||
31e777a03a | |||
7f436c405b | |||
4d4d2ab087 | |||
91017acce4 | |||
e90fd231d9 | |||
cd9f0789de | |||
5f4c8d92df | |||
263cb47a21 | |||
005600c99e | |||
26bec7fe2f | |||
f4b886d977 |
2
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
2
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
@ -27,10 +27,10 @@ body:
|
||||
description: Which server version version you using? If your server version is not listed, it is not supported. Update to a supported version first.
|
||||
multiple: false
|
||||
options:
|
||||
- '1.19.1'
|
||||
- '1.19'
|
||||
- '1.18.2'
|
||||
- '1.18.1'
|
||||
- '1.18'
|
||||
- '1.17.1'
|
||||
- '1.16.5'
|
||||
validations:
|
||||
|
@ -105,5 +105,6 @@ tasks {
|
||||
opt.links("https://jd.adventure.kyori.net/api/4.9.3/")
|
||||
opt.links("https://google.github.io/guice/api-docs/" + libs.guice.get().versionConstraint.toString() + "/javadoc/")
|
||||
opt.links("https://checkerframework.org/api/")
|
||||
opt.encoding("UTF-8")
|
||||
}
|
||||
}
|
||||
|
@ -732,6 +732,11 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
|
||||
this.getServer().getPluginManager().disablePlugin(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void shutdownServer() {
|
||||
getServer().shutdown();
|
||||
}
|
||||
|
||||
private void registerCommands() {
|
||||
final BukkitCommand bukkitCommand = new BukkitCommand();
|
||||
final PluginCommand plotCommand = getCommand("plots");
|
||||
|
@ -121,6 +121,23 @@ public class BlockEventListener implements Listener {
|
||||
Material.TURTLE_EGG,
|
||||
Material.TURTLE_SPAWN_EGG
|
||||
);
|
||||
private static final Set<Material> SNOW; // needed as Tag.SNOW isn't present in 1.16.5
|
||||
|
||||
static {
|
||||
if (PlotSquared.platform().serverVersion()[1] < 17) {
|
||||
SNOW = Set.of(
|
||||
Material.SNOW,
|
||||
Material.SNOW_BLOCK
|
||||
);
|
||||
} else {
|
||||
SNOW = Set.of(
|
||||
Material.SNOW,
|
||||
Material.SNOW_BLOCK,
|
||||
Material.POWDER_SNOW // only since 1.17
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
private final PlotAreaManager plotAreaManager;
|
||||
private final WorldEdit worldEdit;
|
||||
|
||||
@ -529,7 +546,7 @@ public class BlockEventListener implements Listener {
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
if (Tag.SNOW.isTagged(event.getNewState().getType())) {
|
||||
if (SNOW.contains(event.getNewState().getType())) {
|
||||
if (!plot.getFlag(SnowFormFlag.class)) {
|
||||
plot.debug("Snow could not form because snow-form = false");
|
||||
event.setCancelled(true);
|
||||
@ -561,7 +578,7 @@ public class BlockEventListener implements Listener {
|
||||
return;
|
||||
}
|
||||
Class<? extends BooleanFlag<?>> flag;
|
||||
if (Tag.SNOW.isTagged(event.getNewState().getType())) {
|
||||
if (SNOW.contains(event.getNewState().getType())) {
|
||||
flag = SnowFormFlag.class;
|
||||
} else if (Tag.ICE.isTagged(event.getNewState().getType())) {
|
||||
flag = IceFormFlag.class;
|
||||
@ -678,7 +695,7 @@ public class BlockEventListener implements Listener {
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (Tag.SNOW.isTagged(blockType)) {
|
||||
if (SNOW.contains(blockType)) {
|
||||
if (!plot.getFlag(SnowMeltFlag.class)) {
|
||||
plot.debug("Snow could not melt because snow-melt = false");
|
||||
event.setCancelled(true);
|
||||
|
@ -89,7 +89,7 @@ public class ProjectileEventListener implements Listener {
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@EventHandler(ignoreCancelled = true)
|
||||
public void onProjectileLaunch(ProjectileLaunchEvent event) {
|
||||
Projectile entity = event.getEntity();
|
||||
ProjectileSource shooter = entity.getShooter();
|
||||
|
@ -64,5 +64,6 @@ tasks {
|
||||
opt.links("https://google.github.io/guice/api-docs/" + libs.guice.get().versionConstraint.toString() + "/javadoc/")
|
||||
opt.links("https://checkerframework.org/api/")
|
||||
opt.links("https://javadoc.io/doc/com.intellectualsites.informative-annotations/informative-annotations/latest/")
|
||||
opt.encoding("UTF-8")
|
||||
}
|
||||
}
|
||||
|
@ -75,6 +75,11 @@ public interface PlotPlatform<P> extends LocaleHolder {
|
||||
*/
|
||||
void shutdown();
|
||||
|
||||
/**
|
||||
* Completely shuts down the server.
|
||||
*/
|
||||
void shutdownServer();
|
||||
|
||||
/**
|
||||
* Get the name of the plugin
|
||||
*
|
||||
|
@ -197,6 +197,9 @@ public class PlotSquared {
|
||||
this.loadCaptionMap();
|
||||
} catch (final Exception e) {
|
||||
LOGGER.error("Failed to load caption map", e);
|
||||
LOGGER.error("Shutting down server to prevent further issues");
|
||||
this.platform.shutdownServer();
|
||||
throw new RuntimeException("Abort loading PlotSquared");
|
||||
}
|
||||
|
||||
// Setup the global flag container
|
||||
@ -267,7 +270,7 @@ public class PlotSquared {
|
||||
captionMap = this.captionLoader.loadAll(this.platform.getDirectory().toPath().resolve("lang"));
|
||||
} else {
|
||||
String fileName = "messages_" + Settings.Enabled_Components.DEFAULT_LOCALE + ".json";
|
||||
captionMap = this.captionLoader.loadSingle(this.platform.getDirectory().toPath().resolve("lang").resolve(fileName));
|
||||
captionMap = this.captionLoader.loadOrCreateSingle(this.platform.getDirectory().toPath().resolve("lang").resolve(fileName));
|
||||
}
|
||||
this.captionMaps.put(TranslatableCaption.DEFAULT_NAMESPACE, captionMap);
|
||||
LOGGER.info(
|
||||
|
@ -462,6 +462,7 @@ public final class FlagCommand extends Command {
|
||||
return;
|
||||
}
|
||||
final Plot plot = player.getLocation().getPlotAbs();
|
||||
final PlotFlag<?, ?> flagWithOldValue = plot.getFlagContainer().getFlag(flag.getClass());
|
||||
PlotFlagRemoveEvent event = eventDispatcher.callFlagRemove(flag, plot);
|
||||
if (event.getEventResult() == Result.DENY) {
|
||||
player.sendMessage(
|
||||
@ -506,7 +507,7 @@ public final class FlagCommand extends Command {
|
||||
if (plot.removeFlag(flag)) {
|
||||
player.sendMessage(TranslatableCaption.of("flag.flag_removed"), Template.of("flag", args[0]), Template.of(
|
||||
"value",
|
||||
String.valueOf(flag)
|
||||
String.valueOf(flagWithOldValue)
|
||||
));
|
||||
return;
|
||||
} else {
|
||||
@ -544,7 +545,7 @@ public final class FlagCommand extends Command {
|
||||
}
|
||||
player.sendMessage(TranslatableCaption.of("flag.flag_removed"), Template.of("flag", args[0]), Template.of(
|
||||
"value",
|
||||
String.valueOf(flag)
|
||||
String.valueOf(flagWithOldValue)
|
||||
));
|
||||
}
|
||||
|
||||
|
@ -115,8 +115,8 @@ public class Remove extends SubCommand {
|
||||
}
|
||||
if (count == 0) {
|
||||
player.sendMessage(
|
||||
TranslatableCaption.of("errors.invalid_player"),
|
||||
Template.of("value", args[0])
|
||||
TranslatableCaption.of("member.player_not_removed"),
|
||||
Template.of("player", args[0])
|
||||
);
|
||||
} else {
|
||||
player.sendMessage(
|
||||
|
@ -174,7 +174,7 @@ public final class CaptionLoader {
|
||||
public @NonNull CaptionMap loadAll(final @NonNull Path directory) throws IOException {
|
||||
final Map<Locale, CaptionMap> localeMaps = new HashMap<>();
|
||||
try (final Stream<Path> files = Files.list(directory)) {
|
||||
final List<Path> captionFiles = files.filter(Files::isRegularFile).collect(Collectors.toList());
|
||||
final List<Path> captionFiles = files.filter(Files::isRegularFile).toList();
|
||||
for (Path file : captionFiles) {
|
||||
try {
|
||||
final CaptionMap localeMap = loadSingle(file);
|
||||
@ -190,13 +190,14 @@ public final class CaptionLoader {
|
||||
|
||||
/**
|
||||
* Load a message file into a new CaptionMap. The file name must match
|
||||
* the pattern {@code messages_<locale>.json} where {@code <locale>}
|
||||
* is a valid {@link Locale} string.
|
||||
* the pattern expected by the {@link #localeExtractor}.
|
||||
* Note that this method does not attempt to create a new file.
|
||||
*
|
||||
* @param file The file to load
|
||||
* @return A new CaptionMap containing the loaded messages
|
||||
* @throws IOException if the file couldn't be accessed or read successfully.
|
||||
* @throws IllegalArgumentException if the file name doesn't match the specified format.
|
||||
* @see #loadOrCreateSingle(Path)
|
||||
*/
|
||||
public @NonNull CaptionMap loadSingle(final @NonNull Path file) throws IOException {
|
||||
final Locale locale = this.localeExtractor.apply(file);
|
||||
@ -205,15 +206,43 @@ public final class CaptionLoader {
|
||||
if (patch(map, locale)) {
|
||||
save(file, map); // update the file using the modified map
|
||||
}
|
||||
return new LocalizedCaptionMap(locale, map.entrySet().stream()
|
||||
.collect(Collectors.toMap(
|
||||
entry -> TranslatableCaption.of(this.namespace, entry.getKey()),
|
||||
Map.Entry::getValue
|
||||
)
|
||||
));
|
||||
return new LocalizedCaptionMap(locale, mapToCaptions(map));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Load a message file into a new CaptionMap. The file name must match
|
||||
* the pattern expected by the {@link #localeExtractor}.
|
||||
* If no file exists at the given path, this method will
|
||||
* attempt to create one and fill it with default values.
|
||||
*
|
||||
* @param file The file to load
|
||||
* @return A new CaptionMap containing the loaded messages
|
||||
* @throws IOException if the file couldn't be accessed or read successfully.
|
||||
* @throws IllegalArgumentException if the file name doesn't match the specified format.
|
||||
* @see #loadSingle(Path)
|
||||
* @since 6.9.3
|
||||
*/
|
||||
public @NonNull CaptionMap loadOrCreateSingle(final @NonNull Path file) throws IOException {
|
||||
final Locale locale = this.localeExtractor.apply(file);
|
||||
if (!Files.exists(file) ) {
|
||||
Map<String, String> map = new LinkedHashMap<>();
|
||||
patch(map, locale);
|
||||
save(file, map);
|
||||
return new LocalizedCaptionMap(locale, mapToCaptions(map));
|
||||
} else {
|
||||
return loadSingle(file);
|
||||
}
|
||||
}
|
||||
|
||||
private @NonNull Map<TranslatableCaption, String> mapToCaptions(Map<String, String> map) {
|
||||
return map.entrySet().stream().collect(
|
||||
Collectors.toMap(
|
||||
entry -> TranslatableCaption.of(this.namespace, entry.getKey()),
|
||||
Map.Entry::getValue
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* Add missing entries to the given map.
|
||||
* Entries are missing if the key exists in {@link #defaultLocale} but isn't present
|
||||
|
@ -21,6 +21,7 @@ package com.plotsquared.core.generator;
|
||||
import com.google.inject.Inject;
|
||||
import com.google.inject.assistedinject.Assisted;
|
||||
import com.intellectualsites.annotations.DoNotUse;
|
||||
import com.intellectualsites.annotations.NotPublic;
|
||||
import com.plotsquared.core.PlotSquared;
|
||||
import com.plotsquared.core.configuration.ConfigurationSection;
|
||||
import com.plotsquared.core.configuration.Settings;
|
||||
@ -74,9 +75,6 @@ public class HybridPlotWorld extends ClassicPlotWorld {
|
||||
public short PATH_WIDTH_UPPER;
|
||||
public HashMap<Integer, BaseBlock[]> G_SCH;
|
||||
public HashMap<Integer, BiomeType> G_SCH_B;
|
||||
/**
|
||||
* The Y level at which schematic generation will start, lowest of either road or plot schematic generation.
|
||||
*/
|
||||
public int SCHEM_Y;
|
||||
private Location SIGN_LOCATION;
|
||||
private File root = null;
|
||||
@ -269,57 +267,33 @@ public class HybridPlotWorld extends ClassicPlotWorld {
|
||||
int oddshift = (this.ROAD_WIDTH & 1);
|
||||
|
||||
SCHEM_Y = schematicStartHeight();
|
||||
|
||||
// plotY and roadY are important to allow plot and/or road schematic "overflow" into each other without causing AIOOB
|
||||
// exceptions when attempting either to set blocks to, or get block from G_SCH
|
||||
// Default plot schematic start height, normalized to the minimum height schematics are pasted from.
|
||||
int plotY = PLOT_HEIGHT - SCHEM_Y;
|
||||
int minRoadWall = Settings.Schematics.USE_WALL_IN_ROAD_SCHEM_HEIGHT ? Math.min(ROAD_HEIGHT, WALL_HEIGHT) : ROAD_HEIGHT;
|
||||
// Default road schematic start height, normalized to the minimum height schematics are pasted from.
|
||||
int roadY = minRoadWall - SCHEM_Y;
|
||||
|
||||
int worldGenHeight = getMaxGenHeight() - getMinGenHeight() + 1;
|
||||
|
||||
int maxSchematicHeight = 0;
|
||||
int worldHeight = getMaxGenHeight() - getMinGenHeight() + 1;
|
||||
|
||||
// SCHEM_Y should be normalised to the plot "start" height
|
||||
if (schematic3 != null) {
|
||||
if ((maxSchematicHeight = schematic3.getClipboard().getDimensions().getY()) == worldGenHeight) {
|
||||
SCHEM_Y = getMinGenHeight();
|
||||
plotY = 0;
|
||||
if (schematic3.getClipboard().getDimensions().getY() == worldHeight) {
|
||||
SCHEM_Y = plotY = 0;
|
||||
} else if (!Settings.Schematics.PASTE_ON_TOP) {
|
||||
SCHEM_Y = getMinBuildHeight();
|
||||
plotY = 0;
|
||||
SCHEM_Y = plotY = getMinBuildHeight() - getMinGenHeight();
|
||||
}
|
||||
}
|
||||
|
||||
if (schematic1 != null) {
|
||||
if ((maxSchematicHeight = Math.max(
|
||||
schematic1.getClipboard().getDimensions().getY(),
|
||||
maxSchematicHeight
|
||||
)) == worldGenHeight) {
|
||||
SCHEM_Y = getMinGenHeight();
|
||||
roadY = 0; // Road is the lowest schematic
|
||||
if (schematic3 != null && schematic3.getClipboard().getDimensions().getY() != worldGenHeight) {
|
||||
// Road is the lowest schematic. Normalize plotY to it.
|
||||
if (Settings.Schematics.PASTE_ON_TOP) {
|
||||
plotY = PLOT_HEIGHT - getMinGenHeight();
|
||||
} else {
|
||||
plotY = getMinBuildHeight() - getMinGenHeight();
|
||||
}
|
||||
if (schematic1.getClipboard().getDimensions().getY() == worldHeight) {
|
||||
SCHEM_Y = roadY = getMinGenHeight();
|
||||
if (schematic3 != null && schematic3.getClipboard().getDimensions().getY() != worldHeight
|
||||
&& !Settings.Schematics.PASTE_ON_TOP) {
|
||||
plotY = PLOT_HEIGHT;
|
||||
}
|
||||
} else if (!Settings.Schematics.PASTE_ROAD_ON_TOP) {
|
||||
if (SCHEM_Y == getMinGenHeight()) { // Only possible if plot schematic is enabled
|
||||
// Plot is still the lowest schematic, normalize roadY to it
|
||||
roadY = getMinBuildHeight() - getMinGenHeight();
|
||||
} else if (schematic3 != null) {
|
||||
SCHEM_Y = getMinBuildHeight();
|
||||
roadY = 0;// Road is the lowest schematic
|
||||
if (Settings.Schematics.PASTE_ON_TOP) {
|
||||
// Road is the lowest schematic. Normalize plotY to it.
|
||||
plotY = PLOT_HEIGHT - getMinBuildHeight();
|
||||
}
|
||||
// If plot schematic is not paste-on-top, it will be from min build height thus plotY = 0 as well already.
|
||||
SCHEM_Y = roadY = getMinBuildHeight();
|
||||
if (schematic3 != null && schematic3.getClipboard().getDimensions().getY() != worldHeight
|
||||
&& !Settings.Schematics.PASTE_ON_TOP) {
|
||||
plotY = PLOT_HEIGHT;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -357,15 +331,17 @@ public class HybridPlotWorld extends ClassicPlotWorld {
|
||||
y + min.getBlockY(),
|
||||
z + min.getBlockZ()
|
||||
));
|
||||
schem3PopulationNeeded |= id.hasNbtData();
|
||||
addOverlayBlock(
|
||||
(short) (x + shift + oddshift + centerShiftX),
|
||||
(short) (y + plotY),
|
||||
(short) (z + shift + oddshift + centerShiftZ),
|
||||
id,
|
||||
false,
|
||||
maxSchematicHeight
|
||||
);
|
||||
if (!id.getBlockType().getMaterial().isAir()) {
|
||||
schem3PopulationNeeded |= id.hasNbtData();
|
||||
addOverlayBlock(
|
||||
(short) (x + shift + oddshift + centerShiftX),
|
||||
(short) (y + plotY),
|
||||
(short) (z + shift + oddshift + centerShiftZ),
|
||||
id,
|
||||
false,
|
||||
h3
|
||||
);
|
||||
}
|
||||
}
|
||||
if (blockArrayClipboard3.hasBiomes()) {
|
||||
BiomeType biome = blockArrayClipboard3.getBiome(BlockVector2.at(
|
||||
@ -415,23 +391,18 @@ public class HybridPlotWorld extends ClassicPlotWorld {
|
||||
y + min.getBlockY(),
|
||||
z + min.getBlockZ()
|
||||
));
|
||||
schem1PopulationNeeded |= id.hasNbtData();
|
||||
addOverlayBlock(
|
||||
(short) (x - shift),
|
||||
(short) (y + roadY),
|
||||
(short) (z + shift + oddshift),
|
||||
id,
|
||||
false,
|
||||
maxSchematicHeight
|
||||
);
|
||||
addOverlayBlock(
|
||||
(short) (z + shift + oddshift),
|
||||
(short) (y + roadY),
|
||||
(short) (shift - x + (oddshift - 1)),
|
||||
id,
|
||||
true,
|
||||
maxSchematicHeight
|
||||
);
|
||||
if (!id.getBlockType().getMaterial().isAir()) {
|
||||
schem1PopulationNeeded |= id.hasNbtData();
|
||||
addOverlayBlock((short) (x - shift), (short) (y + roadY), (short) (z + shift + oddshift), id, false, h1);
|
||||
addOverlayBlock(
|
||||
(short) (z + shift + oddshift),
|
||||
(short) (y + roadY),
|
||||
(short) (shift - x + (oddshift - 1)),
|
||||
id,
|
||||
true,
|
||||
h1
|
||||
);
|
||||
}
|
||||
}
|
||||
if (blockArrayClipboard1.hasBiomes()) {
|
||||
BiomeType biome = blockArrayClipboard1.getBiome(BlockVector2.at(x + min.getBlockX(), z + min.getBlockZ()));
|
||||
@ -459,15 +430,10 @@ public class HybridPlotWorld extends ClassicPlotWorld {
|
||||
y + min.getBlockY(),
|
||||
z + min.getBlockZ()
|
||||
));
|
||||
schem2PopulationNeeded |= id.hasNbtData();
|
||||
addOverlayBlock(
|
||||
(short) (x - shift),
|
||||
(short) (y + roadY),
|
||||
(short) (z - shift),
|
||||
id,
|
||||
false,
|
||||
maxSchematicHeight
|
||||
);
|
||||
if (!id.getBlockType().getMaterial().isAir()) {
|
||||
schem2PopulationNeeded |= id.hasNbtData();
|
||||
addOverlayBlock((short) (x - shift), (short) (y + roadY), (short) (z - shift), id, false, h2);
|
||||
}
|
||||
}
|
||||
if (blockArrayClipboard2.hasBiomes()) {
|
||||
BiomeType biome = blockArrayClipboard2.getBiome(BlockVector2.at(x + min.getBlockX(), z + min.getBlockZ()));
|
||||
@ -477,10 +443,6 @@ public class HybridPlotWorld extends ClassicPlotWorld {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated This method should not be available for public API usage and will be made private.
|
||||
*/
|
||||
@Deprecated(forRemoval = true, since = "TODO")
|
||||
public void addOverlayBlock(short x, short y, short z, BaseBlock id, boolean rotate, int height) {
|
||||
if (z < 0) {
|
||||
z += this.SIZE;
|
||||
@ -498,7 +460,7 @@ public class HybridPlotWorld extends ClassicPlotWorld {
|
||||
int pair = MathMan.pair(x, z);
|
||||
BaseBlock[] existing = this.G_SCH.computeIfAbsent(pair, k -> new BaseBlock[height]);
|
||||
if (y >= height) {
|
||||
if (y != lastOverlayHeightError) {
|
||||
if (y > lastOverlayHeightError) {
|
||||
lastOverlayHeightError = y;
|
||||
LOGGER.error(String.format("Error adding overlay block. `y > height`. y=%s, height=%s", y, height));
|
||||
}
|
||||
@ -507,10 +469,6 @@ public class HybridPlotWorld extends ClassicPlotWorld {
|
||||
existing[y] = id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated This method should not be available for public API usage and will be made private.
|
||||
*/
|
||||
@Deprecated(forRemoval = true, since = "TODO")
|
||||
public void addOverlayBiome(short x, short z, BiomeType id) {
|
||||
if (z < 0) {
|
||||
z += this.SIZE;
|
||||
|
@ -313,7 +313,7 @@ public sealed class Location extends BlockLoc implements Comparable<Location> pe
|
||||
/**
|
||||
* Get the absolute {@link Plot}, if any, that contains this location
|
||||
*
|
||||
* @return (Absolute) plot containing the location, or {code null}
|
||||
* @return (Absolute) plot containing the location, or {@code null}
|
||||
*/
|
||||
public @Nullable Plot getPlotAbs() {
|
||||
final PlotArea area = this.getPlotArea();
|
||||
@ -327,7 +327,7 @@ public sealed class Location extends BlockLoc implements Comparable<Location> pe
|
||||
/**
|
||||
* Get the {@link Plot}, if any, that contains this location
|
||||
*
|
||||
* @return plot containing the location, or {code null}
|
||||
* @return plot containing the location, or {@code null}
|
||||
*/
|
||||
public @Nullable Plot getPlot() {
|
||||
final PlotArea area = this.getPlotArea();
|
||||
|
@ -643,7 +643,7 @@ public abstract class PlotArea {
|
||||
* @param player Player to check
|
||||
* @param y y height to check
|
||||
* @return true if outside build area with no permissions
|
||||
* @since TODO
|
||||
* @since 6.9.1
|
||||
*/
|
||||
public boolean notifyIfOutsideBuildArea(PlotPlayer<?> player, int y) {
|
||||
if (!buildRangeContainsY(y) && !Permissions.hasPermission(player, Permission.PERMISSION_ADMIN_BUILD_HEIGHT_LIMIT)) {
|
||||
|
@ -30,9 +30,18 @@ import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
* The Permissions class handles checking user permissions.<br>
|
||||
* - This will respect * nodes and plots.admin and can be used to check permission ranges (e.g. plots.plot.5)<br>
|
||||
* - Checking the PlotPlayer class directly will not take the above into account<br>
|
||||
*
|
||||
* @deprecated all logic that may once have been in the class lives elsewhere. We also want to do away with statically-accessed
|
||||
* classes
|
||||
*/
|
||||
@Deprecated(forRemoval = true, since = "6.9.3")
|
||||
public class Permissions {
|
||||
|
||||
/**
|
||||
* @deprecated all logic that may once have been in the class lives elsewhere. We also want to do away with statically-accessed
|
||||
* classes
|
||||
*/
|
||||
@Deprecated(forRemoval = true, since = "6.9.3")
|
||||
public static boolean hasPermission(PlotPlayer<?> player, Permission permission, boolean notify) {
|
||||
return hasPermission(player, permission.toString(), notify);
|
||||
}
|
||||
@ -43,18 +52,25 @@ public class Permissions {
|
||||
* @param caller permission holder
|
||||
* @param permission Permission
|
||||
* @return {@code true} if the owner has the given permission, else {@code false}
|
||||
* @deprecated all logic that may once have been in the class lives elsewhere. We also want to do away with statically-accessed
|
||||
* classes
|
||||
*/
|
||||
@Deprecated(forRemoval = true, since = "6.9.3")
|
||||
public static boolean hasPermission(final @NonNull PermissionHolder caller, final @NonNull Permission permission) {
|
||||
return caller.hasPermission(permission.toString());
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the owner of the profile has a given (global) permission
|
||||
* Check if the owner of the profile has a given (global) permission. There is no guarantee that per-world permissions will
|
||||
* be checked because unmaintained crap plugins like PEX exist.
|
||||
*
|
||||
* @param caller permission holder
|
||||
* @param permission Permission
|
||||
* @return {@code true} if the owner has the given permission, else {@code false}
|
||||
* @deprecated all logic that may once have been in the class lives elsewhere. We also want to do away with statically-accessed
|
||||
* classes
|
||||
*/
|
||||
@Deprecated(forRemoval = true, since = "6.9.3")
|
||||
public static boolean hasPermission(final @NonNull PermissionHolder caller, final @NonNull String permission) {
|
||||
return caller.hasPermission(permission);
|
||||
}
|
||||
@ -68,7 +84,10 @@ public class Permissions {
|
||||
* @param key Permission "key"
|
||||
* @return {@code true} if the owner has the given permission, else {@code false}
|
||||
* @since 6.0.10
|
||||
* @deprecated all logic that may once have been in the class lives elsewhere. We also want to do away with statically-accessed
|
||||
* classes
|
||||
*/
|
||||
@Deprecated(forRemoval = true, since = "6.9.3")
|
||||
public static boolean hasKeyedPermission(
|
||||
final @NonNull PermissionHolder caller, final @NonNull String permission,
|
||||
final @NonNull String key
|
||||
@ -83,7 +102,10 @@ public class Permissions {
|
||||
* @param permission permission
|
||||
* @param notify if to notify the permission holder
|
||||
* @return if permission is had
|
||||
* @deprecated all logic that may once have been in the class lives elsewhere. We also want to do away with statically-accessed
|
||||
* classes
|
||||
*/
|
||||
@Deprecated(forRemoval = true, since = "6.9.3")
|
||||
public static boolean hasPermission(PlotPlayer<?> player, String permission, boolean notify) {
|
||||
if (!hasPermission(player, permission)) {
|
||||
if (notify) {
|
||||
@ -97,6 +119,11 @@ public class Permissions {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated all logic that may once have been in the class lives elsewhere. We also want to do away with statically-accessed
|
||||
* classes
|
||||
*/
|
||||
@Deprecated(forRemoval = true, since = "6.9.3")
|
||||
public static int hasPermissionRange(PlotPlayer<?> player, Permission Permission, int range) {
|
||||
return hasPermissionRange(player, Permission.toString(), range);
|
||||
}
|
||||
@ -110,7 +137,10 @@ public class Permissions {
|
||||
* @param stub The permission stub to check e.g. for `plots.plot.#` the stub is `plots.plot`
|
||||
* @param range The range to check
|
||||
* @return The highest permission they have within that range
|
||||
* @deprecated all logic that may once have been in the class lives elsewhere. We also want to do away with statically-accessed
|
||||
* classes
|
||||
*/
|
||||
@Deprecated(forRemoval = true, since = "6.9.3")
|
||||
public static int hasPermissionRange(PlotPlayer<?> player, String stub, int range) {
|
||||
return player.hasPermissionRange(stub, range);
|
||||
}
|
||||
|
@ -414,6 +414,7 @@
|
||||
"kick.you_got_kicked": "<prefix><dark_aqua>You got kicked from the plot!</dark_aqua>",
|
||||
"trusted.trusted_added": "<prefix><dark_aqua>You successfully trusted a user to the plot.</dark_aqua>",
|
||||
"trusted.plot_removed_user": "<prefix><red>Plot <plot> of which you were added to has been deleted due to owner inactivity.</red>",
|
||||
"member.player_not_removed": "<prefix><gray><player></gray><red> is neither added, trusted or denied on the plot, thus doesn't need to be removed.</red>",
|
||||
"member.removed_players": "<prefix><gray>Removed <amount> player(s) from this plot.</gray>",
|
||||
"member.plot_left": "<prefix><gray><player> left the plot.</gray>",
|
||||
"member.plot_cant_leave_owner": "<prefix><red>You are the plot owner. You cannot leave this plot.</red>",
|
||||
|
@ -19,7 +19,7 @@ plugins {
|
||||
}
|
||||
|
||||
group = "com.plotsquared"
|
||||
version = "6.9.1-SNAPSHOT"
|
||||
version = "6.9.4-SNAPSHOT"
|
||||
|
||||
subprojects {
|
||||
group = rootProject.group
|
||||
@ -65,12 +65,12 @@ subprojects {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(platform("com.intellectualsites.bom:bom-1.18.x:1.7"))
|
||||
implementation(platform("com.intellectualsites.bom:bom-1.18.x:1.12"))
|
||||
}
|
||||
|
||||
dependencies {
|
||||
// Tests
|
||||
testImplementation("org.junit.jupiter:junit-jupiter:5.8.2")
|
||||
testImplementation("org.junit.jupiter:junit-jupiter:5.9.0")
|
||||
}
|
||||
|
||||
plugins.withId("java") {
|
||||
|
@ -2,11 +2,11 @@
|
||||
# Platform expectations
|
||||
paper = "1.18.1-R0.1-SNAPSHOT"
|
||||
guice = "5.1.0"
|
||||
spotbugs = "4.7.0"
|
||||
spotbugs = "4.7.1"
|
||||
|
||||
# Plugins
|
||||
worldedit = "7.2.10"
|
||||
placeholderapi = "2.11.1"
|
||||
placeholderapi = "2.11.2"
|
||||
luckperms = "5.4"
|
||||
essentialsx = "2.19.4"
|
||||
mvdwapi = "3.1.1"
|
||||
|
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@ -1,5 +1,5 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
6
gradlew
vendored
6
gradlew
vendored
@ -205,6 +205,12 @@ set -- \
|
||||
org.gradle.wrapper.GradleWrapperMain \
|
||||
"$@"
|
||||
|
||||
# Stop when "xargs" is not available.
|
||||
if ! command -v xargs >/dev/null 2>&1
|
||||
then
|
||||
die "xargs is not available"
|
||||
fi
|
||||
|
||||
# Use "xargs" to parse quoted args.
|
||||
#
|
||||
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
|
||||
|
14
gradlew.bat
vendored
14
gradlew.bat
vendored
@ -14,7 +14,7 @@
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%" == "" @echo off
|
||||
@if "%DEBUG%"=="" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@ -25,7 +25,7 @@
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%" == "" set DIRNAME=.
|
||||
if "%DIRNAME%"=="" set DIRNAME=.
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if "%ERRORLEVEL%" == "0" goto execute
|
||||
if %ERRORLEVEL% equ 0 goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
@ -75,13 +75,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if "%ERRORLEVEL%"=="0" goto mainEnd
|
||||
if %ERRORLEVEL% equ 0 goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
||||
exit /b 1
|
||||
set EXIT_CODE=%ERRORLEVEL%
|
||||
if %EXIT_CODE% equ 0 set EXIT_CODE=1
|
||||
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
|
||||
exit /b %EXIT_CODE%
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
@ -1,13 +1,7 @@
|
||||
{
|
||||
"extends": [
|
||||
"config:base",
|
||||
":disableDependencyDashboard"
|
||||
],
|
||||
"timezone": "Europe/Berlin",
|
||||
"schedule": [
|
||||
"every monday"
|
||||
"config:base"
|
||||
],
|
||||
"labels": ["Renovate"],
|
||||
"commitMessagePrefix": "build: ",
|
||||
"rebaseWhen": "conflicted"
|
||||
}
|
||||
|
Reference in New Issue
Block a user