mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-07-03 14:14:43 +02:00
Compare commits
17 Commits
chore/sqli
...
7.2.0
Author | SHA1 | Date | |
---|---|---|---|
fdc887850c | |||
e3bfd9b8bf | |||
e689337188 | |||
ee6ae6cba0 | |||
dc8d7809bd | |||
dcd63ed4d9 | |||
3cc770970f | |||
1c3776b605 | |||
95c7f621fb | |||
15b4cbdb0f | |||
812eac18d3 | |||
16a4ee835c | |||
c013b92e62 | |||
b00a46b286 | |||
44b1127181 | |||
c7bfd48a21 | |||
dc13783db8 |
23
.github/workflows/label-merge-conflicts.yaml
vendored
Normal file
23
.github/workflows/label-merge-conflicts.yaml
vendored
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
name: "Label conflicting PRs"
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
pull_request_target:
|
||||||
|
types: [ synchronize ]
|
||||||
|
pull_request:
|
||||||
|
types: [ synchronize ]
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
pull-requests: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
main:
|
||||||
|
if: github.event.pull_request.user.login != 'dependabot[bot]'
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Label conflicting PRs
|
||||||
|
uses: eps1lon/actions-label-merge-conflict@v2.1.0
|
||||||
|
with:
|
||||||
|
dirtyLabel: "unresolved-merge-conflict"
|
||||||
|
repoToken: "${{ secrets.GITHUB_TOKEN }}"
|
||||||
|
commentOnDirty: "Please take a moment and address the merge conflicts of your pull request. Thanks!"
|
||||||
|
continueOnMissingPermissions: true
|
@ -135,6 +135,7 @@ import org.bukkit.generator.ChunkGenerator;
|
|||||||
import org.bukkit.metadata.FixedMetadataValue;
|
import org.bukkit.metadata.FixedMetadataValue;
|
||||||
import org.bukkit.metadata.MetadataValue;
|
import org.bukkit.metadata.MetadataValue;
|
||||||
import org.bukkit.plugin.Plugin;
|
import org.bukkit.plugin.Plugin;
|
||||||
|
import org.bukkit.plugin.RegisteredServiceProvider;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||||
@ -1178,6 +1179,17 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
|
|||||||
.append(" • Load Before: ").append(p.getDescription().getLoadBefore()).append("\n")
|
.append(" • Load Before: ").append(p.getDescription().getLoadBefore()).append("\n")
|
||||||
.append(" • Dependencies: ").append(p.getDescription().getDepend()).append("\n")
|
.append(" • Dependencies: ").append(p.getDescription().getDepend()).append("\n")
|
||||||
.append(" • Soft Dependencies: ").append(p.getDescription().getSoftDepend()).append("\n");
|
.append(" • Soft Dependencies: ").append(p.getDescription().getSoftDepend()).append("\n");
|
||||||
|
List<RegisteredServiceProvider<?>> providers = Bukkit.getServicesManager().getRegistrations(p);
|
||||||
|
if (!providers.isEmpty()) {
|
||||||
|
msg.append(" • Provided Services: \n");
|
||||||
|
for (RegisteredServiceProvider<?> provider : providers) {
|
||||||
|
msg.append(" • ")
|
||||||
|
.append(provider.getService().getName()).append(" = ")
|
||||||
|
.append(provider.getProvider().getClass().getName())
|
||||||
|
.append(" (priority: ").append(provider.getPriority()).append(")")
|
||||||
|
.append("\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return msg.toString();
|
return msg.toString();
|
||||||
}
|
}
|
||||||
|
@ -385,9 +385,9 @@ public final class ReplicatingEntityWrapper extends EntityWrapper {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated Use {@link #restoreBreedable(Breedable)} instead
|
* @deprecated Use {@link #restoreBreedable(Breedable)} instead
|
||||||
* @since TODO
|
* @since 7.1.0
|
||||||
*/
|
*/
|
||||||
@Deprecated(forRemoval = true, since = "TODO")
|
@Deprecated(forRemoval = true, since = "7.1.0")
|
||||||
private void restoreAgeable(Ageable entity) {
|
private void restoreAgeable(Ageable entity) {
|
||||||
if (!this.aged.adult) {
|
if (!this.aged.adult) {
|
||||||
entity.setBaby();
|
entity.setBaby();
|
||||||
@ -400,9 +400,9 @@ public final class ReplicatingEntityWrapper extends EntityWrapper {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated Use {@link #storeBreedable(Breedable)} instead
|
* @deprecated Use {@link #storeBreedable(Breedable)} instead
|
||||||
* @since TODO
|
* @since 7.1.0
|
||||||
*/
|
*/
|
||||||
@Deprecated(forRemoval = true, since = "TODO")
|
@Deprecated(forRemoval = true, since = "7.1.0")
|
||||||
public void storeAgeable(Ageable aged) {
|
public void storeAgeable(Ageable aged) {
|
||||||
this.aged = new AgeableStats();
|
this.aged = new AgeableStats();
|
||||||
this.aged.age = aged.getAge();
|
this.aged.age = aged.getAge();
|
||||||
@ -411,7 +411,7 @@ public final class ReplicatingEntityWrapper extends EntityWrapper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @since TODO
|
* @since 7.1.0
|
||||||
*/
|
*/
|
||||||
private void restoreBreedable(Breedable entity) {
|
private void restoreBreedable(Breedable entity) {
|
||||||
if (!this.aged.adult) {
|
if (!this.aged.adult) {
|
||||||
@ -424,7 +424,7 @@ public final class ReplicatingEntityWrapper extends EntityWrapper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @since TODO
|
* @since 7.1.0
|
||||||
*/
|
*/
|
||||||
private void storeBreedable(Breedable breedable) {
|
private void storeBreedable(Breedable breedable) {
|
||||||
this.aged = new AgeableStats();
|
this.aged = new AgeableStats();
|
||||||
|
@ -23,13 +23,13 @@ import com.google.inject.Provides;
|
|||||||
import com.google.inject.Singleton;
|
import com.google.inject.Singleton;
|
||||||
import com.google.inject.assistedinject.FactoryModuleBuilder;
|
import com.google.inject.assistedinject.FactoryModuleBuilder;
|
||||||
import com.plotsquared.bukkit.BukkitPlatform;
|
import com.plotsquared.bukkit.BukkitPlatform;
|
||||||
|
import com.plotsquared.bukkit.listener.ServerListener;
|
||||||
import com.plotsquared.bukkit.listener.SingleWorldListener;
|
import com.plotsquared.bukkit.listener.SingleWorldListener;
|
||||||
import com.plotsquared.bukkit.player.BukkitPlayerManager;
|
import com.plotsquared.bukkit.player.BukkitPlayerManager;
|
||||||
import com.plotsquared.bukkit.queue.BukkitChunkCoordinator;
|
import com.plotsquared.bukkit.queue.BukkitChunkCoordinator;
|
||||||
import com.plotsquared.bukkit.queue.BukkitQueueCoordinator;
|
import com.plotsquared.bukkit.queue.BukkitQueueCoordinator;
|
||||||
import com.plotsquared.bukkit.schematic.BukkitSchematicHandler;
|
import com.plotsquared.bukkit.schematic.BukkitSchematicHandler;
|
||||||
import com.plotsquared.bukkit.util.BukkitChunkManager;
|
import com.plotsquared.bukkit.util.BukkitChunkManager;
|
||||||
import com.plotsquared.bukkit.util.BukkitEconHandler;
|
|
||||||
import com.plotsquared.bukkit.util.BukkitInventoryUtil;
|
import com.plotsquared.bukkit.util.BukkitInventoryUtil;
|
||||||
import com.plotsquared.bukkit.util.BukkitRegionManager;
|
import com.plotsquared.bukkit.util.BukkitRegionManager;
|
||||||
import com.plotsquared.bukkit.util.BukkitSetupUtils;
|
import com.plotsquared.bukkit.util.BukkitSetupUtils;
|
||||||
@ -47,6 +47,9 @@ import com.plotsquared.core.inject.factory.ChunkCoordinatorBuilderFactory;
|
|||||||
import com.plotsquared.core.inject.factory.ChunkCoordinatorFactory;
|
import com.plotsquared.core.inject.factory.ChunkCoordinatorFactory;
|
||||||
import com.plotsquared.core.inject.factory.HybridPlotWorldFactory;
|
import com.plotsquared.core.inject.factory.HybridPlotWorldFactory;
|
||||||
import com.plotsquared.core.inject.factory.ProgressSubscriberFactory;
|
import com.plotsquared.core.inject.factory.ProgressSubscriberFactory;
|
||||||
|
import com.plotsquared.core.player.OfflinePlotPlayer;
|
||||||
|
import com.plotsquared.core.player.PlotPlayer;
|
||||||
|
import com.plotsquared.core.plot.PlotArea;
|
||||||
import com.plotsquared.core.plot.world.DefaultPlotAreaManager;
|
import com.plotsquared.core.plot.world.DefaultPlotAreaManager;
|
||||||
import com.plotsquared.core.plot.world.PlotAreaManager;
|
import com.plotsquared.core.plot.world.PlotAreaManager;
|
||||||
import com.plotsquared.core.plot.world.SinglePlotAreaManager;
|
import com.plotsquared.core.plot.world.SinglePlotAreaManager;
|
||||||
@ -72,6 +75,8 @@ import org.bukkit.command.ConsoleCommandSender;
|
|||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||||
|
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
public class BukkitModule extends AbstractModule {
|
public class BukkitModule extends AbstractModule {
|
||||||
|
|
||||||
private static final Logger LOGGER = LogManager.getLogger("PlotSquared/" + BukkitModule.class.getSimpleName());
|
private static final Logger LOGGER = LogManager.getLogger("PlotSquared/" + BukkitModule.class.getSimpleName());
|
||||||
@ -128,21 +133,64 @@ public class BukkitModule extends AbstractModule {
|
|||||||
@Provides
|
@Provides
|
||||||
@Singleton
|
@Singleton
|
||||||
@NonNull EconHandler provideEconHandler() {
|
@NonNull EconHandler provideEconHandler() {
|
||||||
if (!Settings.Enabled_Components.ECONOMY) {
|
if (!Settings.Enabled_Components.ECONOMY || !Bukkit.getPluginManager().isPluginEnabled("Vault")) {
|
||||||
return EconHandler.nullEconHandler();
|
return EconHandler.nullEconHandler();
|
||||||
}
|
}
|
||||||
if (Bukkit.getPluginManager().isPluginEnabled("Vault")) {
|
// Guice eagerly initializes singletons, so we need to bring the laziness ourselves
|
||||||
try {
|
return new LazyEconHandler();
|
||||||
BukkitEconHandler econHandler = new BukkitEconHandler();
|
}
|
||||||
if (!econHandler.init()) {
|
|
||||||
LOGGER.warn("Economy is enabled but no plugin is providing an economy service. Falling back...");
|
private static final class LazyEconHandler extends EconHandler implements ServerListener.MutableEconHandler {
|
||||||
return EconHandler.nullEconHandler();
|
private volatile EconHandler implementation;
|
||||||
}
|
|
||||||
return econHandler;
|
public void setImplementation(EconHandler econHandler) {
|
||||||
} catch (final Exception ignored) {
|
this.implementation = econHandler;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return EconHandler.nullEconHandler();
|
|
||||||
|
@Override
|
||||||
|
public boolean init() {
|
||||||
|
return get().init();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public double getBalance(final PlotPlayer<?> player) {
|
||||||
|
return get().getBalance(player);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void withdrawMoney(final PlotPlayer<?> player, final double amount) {
|
||||||
|
get().withdrawMoney(player, amount);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void depositMoney(final PlotPlayer<?> player, final double amount) {
|
||||||
|
get().depositMoney(player, amount);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void depositMoney(final OfflinePlotPlayer player, final double amount) {
|
||||||
|
get().depositMoney(player, amount);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isEnabled(final PlotArea plotArea) {
|
||||||
|
return get().isEnabled(plotArea);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public @NonNull String format(final double balance) {
|
||||||
|
return get().format(balance);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isSupported() {
|
||||||
|
return get().isSupported();
|
||||||
|
}
|
||||||
|
|
||||||
|
private EconHandler get() {
|
||||||
|
return Objects.requireNonNull(this.implementation, "EconHandler not ready yet.");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -608,7 +608,7 @@ public class PlayerEventListener implements Listener {
|
|||||||
this.tmpTeleport = true;
|
this.tmpTeleport = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
int border = area.getBorder();
|
int border = area.getBorder(true);
|
||||||
int x1;
|
int x1;
|
||||||
if (x2 > border && this.tmpTeleport) {
|
if (x2 > border && this.tmpTeleport) {
|
||||||
if (!pp.hasPermission(Permission.PERMISSION_ADMIN_BYPASS_BORDER)) {
|
if (!pp.hasPermission(Permission.PERMISSION_ADMIN_BYPASS_BORDER)) {
|
||||||
@ -703,7 +703,7 @@ public class PlayerEventListener implements Listener {
|
|||||||
this.tmpTeleport = true;
|
this.tmpTeleport = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
int border = area.getBorder();
|
int border = area.getBorder(true);
|
||||||
int z1;
|
int z1;
|
||||||
if (z2 > border && this.tmpTeleport) {
|
if (z2 > border && this.tmpTeleport) {
|
||||||
if (!pp.hasPermission(Permission.PERMISSION_ADMIN_BYPASS_BORDER)) {
|
if (!pp.hasPermission(Permission.PERMISSION_ADMIN_BYPASS_BORDER)) {
|
||||||
|
@ -21,9 +21,14 @@ package com.plotsquared.bukkit.listener;
|
|||||||
import com.google.inject.Inject;
|
import com.google.inject.Inject;
|
||||||
import com.plotsquared.bukkit.BukkitPlatform;
|
import com.plotsquared.bukkit.BukkitPlatform;
|
||||||
import com.plotsquared.bukkit.placeholder.MVdWPlaceholders;
|
import com.plotsquared.bukkit.placeholder.MVdWPlaceholders;
|
||||||
|
import com.plotsquared.bukkit.util.BukkitEconHandler;
|
||||||
|
import com.plotsquared.core.PlotSquared;
|
||||||
import com.plotsquared.core.configuration.Settings;
|
import com.plotsquared.core.configuration.Settings;
|
||||||
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.player.ConsolePlayer;
|
import com.plotsquared.core.player.ConsolePlayer;
|
||||||
|
import com.plotsquared.core.util.EconHandler;
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
@ -32,6 +37,8 @@ import org.checkerframework.checker.nullness.qual.NonNull;
|
|||||||
|
|
||||||
public class ServerListener implements Listener {
|
public class ServerListener implements Listener {
|
||||||
|
|
||||||
|
private static final Logger LOGGER = LogManager.getLogger("PlotSquared/" + ServerListener.class.getSimpleName());
|
||||||
|
|
||||||
private final BukkitPlatform plugin;
|
private final BukkitPlatform plugin;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
@ -45,6 +52,29 @@ public class ServerListener implements Listener {
|
|||||||
new MVdWPlaceholders(this.plugin, this.plugin.placeholderRegistry());
|
new MVdWPlaceholders(this.plugin, this.plugin.placeholderRegistry());
|
||||||
ConsolePlayer.getConsole().sendMessage(TranslatableCaption.of("placeholder.hooked"));
|
ConsolePlayer.getConsole().sendMessage(TranslatableCaption.of("placeholder.hooked"));
|
||||||
}
|
}
|
||||||
|
if (Settings.Enabled_Components.ECONOMY && Bukkit.getPluginManager().isPluginEnabled("Vault")) {
|
||||||
|
EconHandler econHandler = new BukkitEconHandler();
|
||||||
|
try {
|
||||||
|
if (!econHandler.init()) {
|
||||||
|
LOGGER.warn("Economy is enabled but no plugin is providing an economy service. Falling back...");
|
||||||
|
econHandler = EconHandler.nullEconHandler();
|
||||||
|
}
|
||||||
|
} catch (final Exception ignored) {
|
||||||
|
econHandler = EconHandler.nullEconHandler();
|
||||||
|
}
|
||||||
|
if (PlotSquared.platform().econHandler() instanceof MutableEconHandler meh) {
|
||||||
|
meh.setImplementation(econHandler);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Internal use only. Required to implement lazy econ loading using Guice.
|
||||||
|
*
|
||||||
|
* @since 7.2.0
|
||||||
|
*/
|
||||||
|
public interface MutableEconHandler {
|
||||||
|
void setImplementation(EconHandler econHandler);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -72,8 +72,6 @@ tasks {
|
|||||||
opt.links("https://jd.advntr.dev/text-minimessage/4.14.0/")
|
opt.links("https://jd.advntr.dev/text-minimessage/4.14.0/")
|
||||||
opt.links("https://google.github.io/guice/api-docs/" + libs.guice.get().versionConstraint.toString() + "/javadoc/")
|
opt.links("https://google.github.io/guice/api-docs/" + libs.guice.get().versionConstraint.toString() + "/javadoc/")
|
||||||
opt.links("https://checkerframework.org/api/")
|
opt.links("https://checkerframework.org/api/")
|
||||||
opt.links("https://javadocs.dev/com.intellectualsites.informative-annotations/informative-annotations/"
|
|
||||||
+ libs.informativeAnnotations.get().versionConstraint.toString())
|
|
||||||
opt.isLinkSource = true
|
opt.isLinkSource = true
|
||||||
opt.bottom(File("$rootDir/javadocfooter.html").readText())
|
opt.bottom(File("$rootDir/javadocfooter.html").readText())
|
||||||
opt.isUse = true
|
opt.isUse = true
|
||||||
|
@ -193,7 +193,7 @@ public class Claim extends SubCommand {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!player.hasPermission(Permission.PERMISSION_ADMIN_BYPASS_BORDER)) {
|
if (!player.hasPermission(Permission.PERMISSION_ADMIN_BYPASS_BORDER)) {
|
||||||
int border = area.getBorder();
|
int border = area.getBorder(false);
|
||||||
if (border != Integer.MAX_VALUE && plot.getDistanceFromOrigin() > border && !force) {
|
if (border != Integer.MAX_VALUE && plot.getDistanceFromOrigin() > border && !force) {
|
||||||
player.sendMessage(TranslatableCaption.of("border.denied"));
|
player.sendMessage(TranslatableCaption.of("border.denied"));
|
||||||
return false;
|
return false;
|
||||||
|
@ -29,7 +29,6 @@ import com.plotsquared.core.util.WorldUtil;
|
|||||||
import com.plotsquared.core.util.entity.EntityCategories;
|
import com.plotsquared.core.util.entity.EntityCategories;
|
||||||
import com.plotsquared.core.util.entity.EntityCategory;
|
import com.plotsquared.core.util.entity.EntityCategory;
|
||||||
import com.plotsquared.core.util.query.PlotQuery;
|
import com.plotsquared.core.util.query.PlotQuery;
|
||||||
import com.plotsquared.core.util.task.TaskManager;
|
|
||||||
import com.plotsquared.core.uuid.UUIDMapping;
|
import com.plotsquared.core.uuid.UUIDMapping;
|
||||||
import com.sk89q.worldedit.world.entity.EntityType;
|
import com.sk89q.worldedit.world.entity.EntityType;
|
||||||
import net.kyori.adventure.text.Component;
|
import net.kyori.adventure.text.Component;
|
||||||
@ -71,7 +70,7 @@ public class Debug extends SubCommand {
|
|||||||
TranslatableCaption.of("commandconfig.command_syntax"),
|
TranslatableCaption.of("commandconfig.command_syntax"),
|
||||||
TagResolver.resolver(
|
TagResolver.resolver(
|
||||||
"value",
|
"value",
|
||||||
Tag.inserting(Component.text("/plot debug <loadedchunks | player | debug-players | entitytypes | msg>"))
|
Tag.inserting(Component.text("/plot debug <player | debug-players | entitytypes | msg>"))
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -85,16 +84,6 @@ public class Debug extends SubCommand {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (args.length > 0 && "loadedchunks".equalsIgnoreCase(args[0])) {
|
|
||||||
final long start = System.currentTimeMillis();
|
|
||||||
player.sendMessage(TranslatableCaption.of("debug.fetching_loaded_chunks"));
|
|
||||||
TaskManager.runTaskAsync(() -> player.sendMessage(StaticCaption
|
|
||||||
.of("Loaded chunks: " + this.worldUtil
|
|
||||||
.getChunkChunks(player.getLocation().getWorldName())
|
|
||||||
.size() + " (" + (System.currentTimeMillis()
|
|
||||||
- start) + "ms) using thread: " + Thread.currentThread().getName())));
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if (args.length > 0 && "uuids".equalsIgnoreCase(args[0])) {
|
if (args.length > 0 && "uuids".equalsIgnoreCase(args[0])) {
|
||||||
final Collection<UUIDMapping> mappings = PlotSquared.get().getImpromptuUUIDPipeline().getAllImmediately();
|
final Collection<UUIDMapping> mappings = PlotSquared.get().getImpromptuUUIDPipeline().getAllImmediately();
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
@ -196,7 +185,7 @@ public class Debug extends SubCommand {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Collection<Command> tab(final PlotPlayer<?> player, String[] args, boolean space) {
|
public Collection<Command> tab(final PlotPlayer<?> player, String[] args, boolean space) {
|
||||||
return Stream.of("loadedchunks", "debug-players", "entitytypes")
|
return Stream.of("debug-players", "entitytypes")
|
||||||
.filter(value -> value.startsWith(args[0].toLowerCase(Locale.ENGLISH)))
|
.filter(value -> value.startsWith(args[0].toLowerCase(Locale.ENGLISH)))
|
||||||
.map(value -> new Command(null, false, value, "plots.admin", RequiredType.NONE, null) {
|
.map(value -> new Command(null, false, value, "plots.admin", RequiredType.NONE, null) {
|
||||||
}).collect(Collectors.toList());
|
}).collect(Collectors.toList());
|
||||||
|
@ -55,6 +55,25 @@ public enum Direction {
|
|||||||
return NORTH;
|
return NORTH;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@return the opposite direction}
|
||||||
|
* If this is {@link Direction#ALL}, then {@link Direction#ALL} is returned.
|
||||||
|
* @since 7.2.0
|
||||||
|
*/
|
||||||
|
public Direction opposite() {
|
||||||
|
return switch (this) {
|
||||||
|
case ALL -> ALL;
|
||||||
|
case NORTH -> SOUTH;
|
||||||
|
case EAST -> WEST;
|
||||||
|
case SOUTH -> NORTH;
|
||||||
|
case WEST -> EAST;
|
||||||
|
case NORTHEAST -> SOUTHWEST;
|
||||||
|
case SOUTHEAST -> NORTHWEST;
|
||||||
|
case SOUTHWEST -> NORTHEAST;
|
||||||
|
case NORTHWEST -> SOUTHEAST;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
public int getIndex() {
|
public int getIndex() {
|
||||||
return index;
|
return index;
|
||||||
}
|
}
|
||||||
|
@ -882,7 +882,7 @@ public abstract class PlotPlayer<P> implements CommandCaller, OfflinePlotPlayer,
|
|||||||
final Component titleComponent = MiniMessage.miniMessage().deserialize(title.getComponent(this), replacements);
|
final Component titleComponent = MiniMessage.miniMessage().deserialize(title.getComponent(this), replacements);
|
||||||
final Component subtitleComponent =
|
final Component subtitleComponent =
|
||||||
MiniMessage.miniMessage().deserialize(subtitle.getComponent(this), replacements);
|
MiniMessage.miniMessage().deserialize(subtitle.getComponent(this), replacements);
|
||||||
final Title.Times times = Title.Times.of(
|
final Title.Times times = Title.Times.times(
|
||||||
Duration.of(Settings.Titles.TITLES_FADE_IN * 50L, ChronoUnit.MILLIS),
|
Duration.of(Settings.Titles.TITLES_FADE_IN * 50L, ChronoUnit.MILLIS),
|
||||||
Duration.of(Settings.Titles.TITLES_STAY * 50L, ChronoUnit.MILLIS),
|
Duration.of(Settings.Titles.TITLES_STAY * 50L, ChronoUnit.MILLIS),
|
||||||
Duration.of(Settings.Titles.TITLES_FADE_OUT * 50L, ChronoUnit.MILLIS)
|
Duration.of(Settings.Titles.TITLES_FADE_OUT * 50L, ChronoUnit.MILLIS)
|
||||||
@ -960,7 +960,7 @@ public abstract class PlotPlayer<P> implements CommandCaller, OfflinePlotPlayer,
|
|||||||
* @param caption Caption to send
|
* @param caption Caption to send
|
||||||
* @param asyncReplacement Async variable replacement
|
* @param asyncReplacement Async variable replacement
|
||||||
* @return A Future to be resolved, after the message was sent
|
* @return A Future to be resolved, after the message was sent
|
||||||
* @since TODO
|
* @since 7.1.0
|
||||||
*/
|
*/
|
||||||
public final CompletableFuture<Void> sendMessage(
|
public final CompletableFuture<Void> sendMessage(
|
||||||
@NonNull Caption caption,
|
@NonNull Caption caption,
|
||||||
@ -976,7 +976,7 @@ public abstract class PlotPlayer<P> implements CommandCaller, OfflinePlotPlayer,
|
|||||||
* @param asyncReplacements Async variable replacements
|
* @param asyncReplacements Async variable replacements
|
||||||
* @param replacements Sync variable replacements
|
* @param replacements Sync variable replacements
|
||||||
* @return A Future to be resolved, after the message was sent
|
* @return A Future to be resolved, after the message was sent
|
||||||
* @since TODO
|
* @since 7.1.0
|
||||||
*/
|
*/
|
||||||
public final CompletableFuture<Void> sendMessage(
|
public final CompletableFuture<Void> sendMessage(
|
||||||
@NonNull Caption caption,
|
@NonNull Caption caption,
|
||||||
|
@ -85,6 +85,7 @@ import java.util.ArrayDeque;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
import java.util.Deque;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -2283,8 +2284,8 @@ public class Plot {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets a set of plots connected (and including) this plot<br>
|
* Gets a set of plots connected (and including) this plot.
|
||||||
* - This result is cached globally
|
* The returned set is immutable.
|
||||||
*
|
*
|
||||||
* @return a Set of Plots connected to this Plot
|
* @return a Set of Plots connected to this Plot
|
||||||
*/
|
*/
|
||||||
@ -2295,117 +2296,75 @@ public class Plot {
|
|||||||
if (!this.isMerged()) {
|
if (!this.isMerged()) {
|
||||||
return Collections.singleton(this);
|
return Collections.singleton(this);
|
||||||
}
|
}
|
||||||
|
Plot basePlot = getBasePlot(false);
|
||||||
|
if (this.connectedCache == null && this != basePlot) {
|
||||||
|
// share cache between connected plots
|
||||||
|
Set<Plot> connectedPlots = basePlot.getConnectedPlots();
|
||||||
|
this.connectedCache = connectedPlots;
|
||||||
|
return connectedPlots;
|
||||||
|
}
|
||||||
if (this.connectedCache != null && this.connectedCache.contains(this)) {
|
if (this.connectedCache != null && this.connectedCache.contains(this)) {
|
||||||
return this.connectedCache;
|
return this.connectedCache;
|
||||||
}
|
}
|
||||||
|
|
||||||
HashSet<Plot> tmpSet = new HashSet<>();
|
Set<Plot> tmpSet = new HashSet<>();
|
||||||
tmpSet.add(this);
|
tmpSet.add(this);
|
||||||
Plot tmp;
|
HashSet<Plot> queueCache = new HashSet<>();
|
||||||
HashSet<Object> queuecache = new HashSet<>();
|
|
||||||
ArrayDeque<Plot> frontier = new ArrayDeque<>();
|
ArrayDeque<Plot> frontier = new ArrayDeque<>();
|
||||||
if (this.isMerged(Direction.NORTH)) {
|
computeDirectMerged(queueCache, frontier, Direction.NORTH);
|
||||||
tmp = this.area.getPlotAbs(this.id.getRelative(Direction.NORTH));
|
computeDirectMerged(queueCache, frontier, Direction.EAST);
|
||||||
if (!tmp.isMerged(Direction.SOUTH)) {
|
computeDirectMerged(queueCache, frontier, Direction.SOUTH);
|
||||||
// invalid merge
|
computeDirectMerged(queueCache, frontier, Direction.WEST);
|
||||||
if (tmp.isOwnerAbs(this.getOwnerAbs())) {
|
|
||||||
tmp.getSettings().setMerged(Direction.SOUTH, true);
|
|
||||||
DBFunc.setMerged(tmp, tmp.getSettings().getMerged());
|
|
||||||
} else {
|
|
||||||
this.getSettings().setMerged(Direction.NORTH, false);
|
|
||||||
DBFunc.setMerged(this, this.getSettings().getMerged());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
queuecache.add(tmp);
|
|
||||||
frontier.add(tmp);
|
|
||||||
}
|
|
||||||
if (this.isMerged(Direction.EAST)) {
|
|
||||||
tmp = this.area.getPlotAbs(this.id.getRelative(Direction.EAST));
|
|
||||||
assert tmp != null;
|
|
||||||
if (!tmp.isMerged(Direction.WEST)) {
|
|
||||||
// invalid merge
|
|
||||||
if (tmp.isOwnerAbs(this.getOwnerAbs())) {
|
|
||||||
tmp.getSettings().setMerged(Direction.WEST, true);
|
|
||||||
DBFunc.setMerged(tmp, tmp.getSettings().getMerged());
|
|
||||||
} else {
|
|
||||||
this.getSettings().setMerged(Direction.EAST, false);
|
|
||||||
DBFunc.setMerged(this, this.getSettings().getMerged());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
queuecache.add(tmp);
|
|
||||||
frontier.add(tmp);
|
|
||||||
}
|
|
||||||
if (this.isMerged(Direction.SOUTH)) {
|
|
||||||
tmp = this.area.getPlotAbs(this.id.getRelative(Direction.SOUTH));
|
|
||||||
assert tmp != null;
|
|
||||||
if (!tmp.isMerged(Direction.NORTH)) {
|
|
||||||
// invalid merge
|
|
||||||
if (tmp.isOwnerAbs(this.getOwnerAbs())) {
|
|
||||||
tmp.getSettings().setMerged(Direction.NORTH, true);
|
|
||||||
DBFunc.setMerged(tmp, tmp.getSettings().getMerged());
|
|
||||||
} else {
|
|
||||||
this.getSettings().setMerged(Direction.SOUTH, false);
|
|
||||||
DBFunc.setMerged(this, this.getSettings().getMerged());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
queuecache.add(tmp);
|
|
||||||
frontier.add(tmp);
|
|
||||||
}
|
|
||||||
if (this.isMerged(Direction.WEST)) {
|
|
||||||
tmp = this.area.getPlotAbs(this.id.getRelative(Direction.WEST));
|
|
||||||
if (!tmp.isMerged(Direction.EAST)) {
|
|
||||||
// invalid merge
|
|
||||||
if (tmp.isOwnerAbs(this.getOwnerAbs())) {
|
|
||||||
tmp.getSettings().setMerged(Direction.EAST, true);
|
|
||||||
DBFunc.setMerged(tmp, tmp.getSettings().getMerged());
|
|
||||||
} else {
|
|
||||||
this.getSettings().setMerged(Direction.WEST, false);
|
|
||||||
DBFunc.setMerged(this, this.getSettings().getMerged());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
queuecache.add(tmp);
|
|
||||||
frontier.add(tmp);
|
|
||||||
}
|
|
||||||
Plot current;
|
Plot current;
|
||||||
while ((current = frontier.poll()) != null) {
|
while ((current = frontier.poll()) != null) {
|
||||||
if (!current.hasOwner() || current.settings == null) {
|
if (!current.hasOwner() || current.settings == null) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
tmpSet.add(current);
|
tmpSet.add(current);
|
||||||
queuecache.remove(current);
|
queueCache.remove(current);
|
||||||
if (current.isMerged(Direction.NORTH)) {
|
addIfIncluded(current, Direction.NORTH, queueCache, tmpSet, frontier);
|
||||||
tmp = current.area.getPlotAbs(current.id.getRelative(Direction.NORTH));
|
addIfIncluded(current, Direction.EAST, queueCache, tmpSet, frontier);
|
||||||
if (tmp != null && !queuecache.contains(tmp) && !tmpSet.contains(tmp)) {
|
addIfIncluded(current, Direction.SOUTH, queueCache, tmpSet, frontier);
|
||||||
queuecache.add(tmp);
|
addIfIncluded(current, Direction.WEST, queueCache, tmpSet, frontier);
|
||||||
frontier.add(tmp);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (current.isMerged(Direction.EAST)) {
|
|
||||||
tmp = current.area.getPlotAbs(current.id.getRelative(Direction.EAST));
|
|
||||||
if (tmp != null && !queuecache.contains(tmp) && !tmpSet.contains(tmp)) {
|
|
||||||
queuecache.add(tmp);
|
|
||||||
frontier.add(tmp);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (current.isMerged(Direction.SOUTH)) {
|
|
||||||
tmp = current.area.getPlotAbs(current.id.getRelative(Direction.SOUTH));
|
|
||||||
if (tmp != null && !queuecache.contains(tmp) && !tmpSet.contains(tmp)) {
|
|
||||||
queuecache.add(tmp);
|
|
||||||
frontier.add(tmp);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (current.isMerged(Direction.WEST)) {
|
|
||||||
tmp = current.area.getPlotAbs(current.id.getRelative(Direction.WEST));
|
|
||||||
if (tmp != null && !queuecache.contains(tmp) && !tmpSet.contains(tmp)) {
|
|
||||||
queuecache.add(tmp);
|
|
||||||
frontier.add(tmp);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
tmpSet = Set.copyOf(tmpSet);
|
||||||
this.connectedCache = tmpSet;
|
this.connectedCache = tmpSet;
|
||||||
return tmpSet;
|
return tmpSet;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void computeDirectMerged(Set<Plot> queueCache, Deque<Plot> frontier, Direction direction) {
|
||||||
|
if (this.isMerged(direction)) {
|
||||||
|
Plot tmp = this.area.getPlotAbs(this.id.getRelative(direction));
|
||||||
|
assert tmp != null;
|
||||||
|
if (!tmp.isMerged(direction.opposite())) {
|
||||||
|
// invalid merge
|
||||||
|
if (tmp.isOwnerAbs(this.getOwnerAbs())) {
|
||||||
|
tmp.getSettings().setMerged(direction.opposite(), true);
|
||||||
|
DBFunc.setMerged(tmp, tmp.getSettings().getMerged());
|
||||||
|
} else {
|
||||||
|
this.getSettings().setMerged(direction, false);
|
||||||
|
DBFunc.setMerged(this, this.getSettings().getMerged());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
queueCache.add(tmp);
|
||||||
|
frontier.add(tmp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void addIfIncluded(
|
||||||
|
Plot current, Direction
|
||||||
|
direction, Set<Plot> queueCache, Set<Plot> tmpSet, Deque<Plot> frontier
|
||||||
|
) {
|
||||||
|
if (!current.isMerged(direction)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Plot tmp = current.area.getPlotAbs(current.id.getRelative(direction));
|
||||||
|
if (tmp != null && !queueCache.contains(tmp) && !tmpSet.contains(tmp)) {
|
||||||
|
queueCache.add(tmp);
|
||||||
|
frontier.add(tmp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This will combine each plot into effective rectangular regions<br>
|
* This will combine each plot into effective rectangular regions<br>
|
||||||
* - This result is cached globally<br>
|
* - This result is cached globally<br>
|
||||||
@ -2679,6 +2638,11 @@ public class Plot {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the maximum distance of the plot from x=0, z=0.
|
||||||
|
*
|
||||||
|
* @return max block distance from 0,0
|
||||||
|
*/
|
||||||
public int getDistanceFromOrigin() {
|
public int getDistanceFromOrigin() {
|
||||||
Location bot = getManager().getPlotBottomLocAbs(id);
|
Location bot = getManager().getPlotBottomLocAbs(id);
|
||||||
Location top = getManager().getPlotTopLocAbs(id);
|
Location top = getManager().getPlotTopLocAbs(id);
|
||||||
@ -2692,7 +2656,7 @@ public class Plot {
|
|||||||
* Expands the world border to include this plot if it is beyond the current border.
|
* Expands the world border to include this plot if it is beyond the current border.
|
||||||
*/
|
*/
|
||||||
public void updateWorldBorder() {
|
public void updateWorldBorder() {
|
||||||
int border = this.area.getBorder();
|
int border = this.area.getBorder(false);
|
||||||
if (border == Integer.MAX_VALUE) {
|
if (border == Integer.MAX_VALUE) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -147,6 +147,7 @@ public abstract class PlotArea implements ComponentLike {
|
|||||||
private Map<String, PlotExpression> prices = new HashMap<>();
|
private Map<String, PlotExpression> prices = new HashMap<>();
|
||||||
private List<String> schematics = new ArrayList<>();
|
private List<String> schematics = new ArrayList<>();
|
||||||
private boolean worldBorder = false;
|
private boolean worldBorder = false;
|
||||||
|
private int borderSize = 1;
|
||||||
private boolean useEconomy = false;
|
private boolean useEconomy = false;
|
||||||
private int hash;
|
private int hash;
|
||||||
private CuboidRegion region;
|
private CuboidRegion region;
|
||||||
@ -356,6 +357,7 @@ public abstract class PlotArea implements ComponentLike {
|
|||||||
this.plotChat = config.getBoolean("chat.enabled");
|
this.plotChat = config.getBoolean("chat.enabled");
|
||||||
this.forcingPlotChat = config.getBoolean("chat.forced");
|
this.forcingPlotChat = config.getBoolean("chat.forced");
|
||||||
this.worldBorder = config.getBoolean("world.border");
|
this.worldBorder = config.getBoolean("world.border");
|
||||||
|
this.borderSize = config.getInt("world.border_size");
|
||||||
this.maxBuildHeight = config.getInt("world.max_height");
|
this.maxBuildHeight = config.getInt("world.max_height");
|
||||||
this.minBuildHeight = config.getInt("world.min_height");
|
this.minBuildHeight = config.getInt("world.min_height");
|
||||||
this.minGenHeight = config.getInt("world.min_gen_height");
|
this.minGenHeight = config.getInt("world.min_gen_height");
|
||||||
@ -489,6 +491,7 @@ public abstract class PlotArea implements ComponentLike {
|
|||||||
options.put("event.spawn.custom", this.isSpawnCustom());
|
options.put("event.spawn.custom", this.isSpawnCustom());
|
||||||
options.put("event.spawn.breeding", this.isSpawnBreeding());
|
options.put("event.spawn.breeding", this.isSpawnBreeding());
|
||||||
options.put("world.border", this.hasWorldBorder());
|
options.put("world.border", this.hasWorldBorder());
|
||||||
|
options.put("world.border_size", this.getBorderSize());
|
||||||
options.put("home.default", "side");
|
options.put("home.default", "side");
|
||||||
String position = config.getString(
|
String position = config.getString(
|
||||||
"home.nonmembers",
|
"home.nonmembers",
|
||||||
@ -937,7 +940,9 @@ public abstract class PlotArea implements ComponentLike {
|
|||||||
* Get the plot border distance for a world<br>
|
* Get the plot border distance for a world<br>
|
||||||
*
|
*
|
||||||
* @return The border distance or Integer.MAX_VALUE if no border is set
|
* @return The border distance or Integer.MAX_VALUE if no border is set
|
||||||
|
* @deprecated Use {@link PlotArea#getBorder(boolean)}
|
||||||
*/
|
*/
|
||||||
|
@Deprecated(forRemoval = true, since = "7.2.0")
|
||||||
public int getBorder() {
|
public int getBorder() {
|
||||||
final Integer meta = (Integer) getMeta("worldBorder");
|
final Integer meta = (Integer) getMeta("worldBorder");
|
||||||
if (meta != null) {
|
if (meta != null) {
|
||||||
@ -951,6 +956,27 @@ public abstract class PlotArea implements ComponentLike {
|
|||||||
return Integer.MAX_VALUE;
|
return Integer.MAX_VALUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the plot border distance for a world, specifying whether the returned value should include the world.border-size
|
||||||
|
* value. This is a player-traversable area, where plots cannot be claimed
|
||||||
|
*
|
||||||
|
* @param getExtended If the extra border given by world.border-size should be included
|
||||||
|
* @return Border distance of Integer.MAX_VALUE if no border is set
|
||||||
|
* @since 7.2.0
|
||||||
|
*/
|
||||||
|
public int getBorder(boolean getExtended) {
|
||||||
|
final Integer meta = (Integer) getMeta("worldBorder");
|
||||||
|
if (meta != null) {
|
||||||
|
int border = meta + 1;
|
||||||
|
if (border == 0) {
|
||||||
|
return Integer.MAX_VALUE;
|
||||||
|
} else {
|
||||||
|
return getExtended ? border + borderSize : border;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return Integer.MAX_VALUE;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Setup the plot border for a world (usually done when the world is created).
|
* Setup the plot border for a world (usually done when the world is created).
|
||||||
*/
|
*/
|
||||||
@ -1210,6 +1236,16 @@ public abstract class PlotArea implements ComponentLike {
|
|||||||
return worldBorder;
|
return worldBorder;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the "extra border" size of the plot area.
|
||||||
|
*
|
||||||
|
* @return Plot area extra border size
|
||||||
|
* @since 7.2.0
|
||||||
|
*/
|
||||||
|
public int getBorderSize() {
|
||||||
|
return borderSize;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get whether plot signs are allowed or not.
|
* Get whether plot signs are allowed or not.
|
||||||
*
|
*
|
||||||
|
@ -174,7 +174,7 @@ public abstract class PlayerManager<P extends PlotPlayer<? extends T>, T> {
|
|||||||
* @since 6.4.0
|
* @since 6.4.0
|
||||||
* @deprecated Don't unnecessarily block threads and utilize playerMap - see {@link #getUsernameCaption(UUID)}
|
* @deprecated Don't unnecessarily block threads and utilize playerMap - see {@link #getUsernameCaption(UUID)}
|
||||||
*/
|
*/
|
||||||
@Deprecated(since = "TODO")
|
@Deprecated(since = "7.1.0")
|
||||||
public static @NonNull Caption resolveName(final @Nullable UUID owner) {
|
public static @NonNull Caption resolveName(final @Nullable UUID owner) {
|
||||||
return resolveName(owner, true);
|
return resolveName(owner, true);
|
||||||
}
|
}
|
||||||
@ -188,7 +188,7 @@ public abstract class PlayerManager<P extends PlotPlayer<? extends T>, T> {
|
|||||||
* @since 6.4.0
|
* @since 6.4.0
|
||||||
* @deprecated Don't unnecessarily block threads and utilize playerMap - see {@link #getUsernameCaption(UUID)}
|
* @deprecated Don't unnecessarily block threads and utilize playerMap - see {@link #getUsernameCaption(UUID)}
|
||||||
*/
|
*/
|
||||||
@Deprecated(since = "TODO")
|
@Deprecated(since = "7.1.0")
|
||||||
public static @NonNull Caption resolveName(final @Nullable UUID owner, final boolean blocking) {
|
public static @NonNull Caption resolveName(final @Nullable UUID owner, final boolean blocking) {
|
||||||
if (owner == null) {
|
if (owner == null) {
|
||||||
return TranslatableCaption.of("info.none");
|
return TranslatableCaption.of("info.none");
|
||||||
@ -237,7 +237,7 @@ public abstract class PlayerManager<P extends PlotPlayer<? extends T>, T> {
|
|||||||
*
|
*
|
||||||
* @param uuid The UUID of the player (for example provided by {@link Plot#getOwner()}
|
* @param uuid The UUID of the player (for example provided by {@link Plot#getOwner()}
|
||||||
* @return A CompletableFuture resolving to a Caption representing the players name of the uuid
|
* @return A CompletableFuture resolving to a Caption representing the players name of the uuid
|
||||||
* @since TODO
|
* @since 7.1.0
|
||||||
*/
|
*/
|
||||||
@Contract("_->!null")
|
@Contract("_->!null")
|
||||||
public @NonNull CompletableFuture<Caption> getUsernameCaption(@Nullable UUID uuid) {
|
public @NonNull CompletableFuture<Caption> getUsernameCaption(@Nullable UUID uuid) {
|
||||||
|
@ -173,7 +173,7 @@ public final class TabCompletions {
|
|||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
final List<String> commands = new ArrayList<>();
|
final List<String> commands = new ArrayList<>();
|
||||||
for (int i = offset; i < highestLimit && (offset - i + amountLimit) > 0; i++) {
|
for (int i = offset; i <= highestLimit && (offset - i + amountLimit) > 0; i++) {
|
||||||
commands.add(String.valueOf(i));
|
commands.add(String.valueOf(i));
|
||||||
}
|
}
|
||||||
return asCompletions(commands.toArray(new String[0]));
|
return asCompletions(commands.toArray(new String[0]));
|
||||||
|
@ -22,7 +22,7 @@ plugins {
|
|||||||
}
|
}
|
||||||
|
|
||||||
group = "com.intellectualsites.plotsquared"
|
group = "com.intellectualsites.plotsquared"
|
||||||
version = "7.0.1-SNAPSHOT"
|
version = "7.2.0"
|
||||||
|
|
||||||
if (!File("$rootDir/.git").exists()) {
|
if (!File("$rootDir/.git").exists()) {
|
||||||
logger.lifecycle("""
|
logger.lifecycle("""
|
||||||
@ -226,20 +226,25 @@ tasks.getByName<Jar>("jar") {
|
|||||||
|
|
||||||
val supportedVersions = listOf("1.16.5", "1.17.1", "1.18.2", "1.19.4", "1.20.1", "1.20.2")
|
val supportedVersions = listOf("1.16.5", "1.17.1", "1.18.2", "1.19.4", "1.20.1", "1.20.2")
|
||||||
tasks {
|
tasks {
|
||||||
val lastSuccessfulBuildUrl = uri("https://ci.athion.net/job/FastAsyncWorldEdit/lastSuccessfulBuild/api/json").toURL()
|
register("cacheLatestFaweArtifact") {
|
||||||
val artifact = ((JsonSlurper().parse(lastSuccessfulBuildUrl) as Map<*, *>)["artifacts"] as List<*>)
|
val lastSuccessfulBuildUrl = uri("https://ci.athion.net/job/FastAsyncWorldEdit/lastSuccessfulBuild/api/json").toURL()
|
||||||
.map { it as Map<*, *> }
|
val artifact = ((JsonSlurper().parse(lastSuccessfulBuildUrl) as Map<*, *>)["artifacts"] as List<*>)
|
||||||
.map { it["fileName"] as String }
|
.map { it as Map<*, *> }
|
||||||
.first { it.contains("Bukkit") }
|
.map { it["fileName"] as String }
|
||||||
|
.first { it -> it.contains("Bukkit") }
|
||||||
|
project.ext["faweArtifact"] = artifact
|
||||||
|
}
|
||||||
|
|
||||||
supportedVersions.forEach {
|
supportedVersions.forEach {
|
||||||
register<RunServer>("runServer-$it") {
|
register<RunServer>("runServer-$it") {
|
||||||
|
dependsOn(getByName("cacheLatestFaweArtifact"))
|
||||||
minecraftVersion(it)
|
minecraftVersion(it)
|
||||||
pluginJars(*project(":plotsquared-bukkit").getTasksByName("shadowJar", false).map { (it as Jar).archiveFile }
|
pluginJars(*project(":plotsquared-bukkit").getTasksByName("shadowJar", false)
|
||||||
|
.map { task -> (task as Jar).archiveFile }
|
||||||
.toTypedArray())
|
.toTypedArray())
|
||||||
jvmArgs("-DPaper.IgnoreJavaVersion=true", "-Dcom.mojang.eula.agree=true")
|
jvmArgs("-DPaper.IgnoreJavaVersion=true", "-Dcom.mojang.eula.agree=true")
|
||||||
downloadPlugins {
|
downloadPlugins {
|
||||||
url("https://ci.athion.net/job/FastAsyncWorldEdit/lastSuccessfulBuild/artifact/artifacts/$artifact")
|
url("https://ci.athion.net/job/FastAsyncWorldEdit/lastSuccessfulBuild/artifact/artifacts/${project.ext["faweArtifact"]}")
|
||||||
}
|
}
|
||||||
group = "run paper"
|
group = "run paper"
|
||||||
runDirectory.set(file("run-$it"))
|
runDirectory.set(file("run-$it"))
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
# Platform expectations
|
# Platform expectations
|
||||||
paper = "1.20.2-R0.1-SNAPSHOT"
|
paper = "1.20.2-R0.1-SNAPSHOT"
|
||||||
guice = "7.0.0"
|
guice = "7.0.0"
|
||||||
spotbugs = "4.7.3"
|
spotbugs = "4.8.0"
|
||||||
checkerqual = "3.39.0"
|
checkerqual = "3.39.0"
|
||||||
gson = "2.10"
|
gson = "2.10"
|
||||||
guava = "31.1-jre"
|
guava = "31.1-jre"
|
||||||
@ -12,9 +12,9 @@ adventure-bukkit = "4.3.1"
|
|||||||
log4j = "2.19.0"
|
log4j = "2.19.0"
|
||||||
|
|
||||||
# Plugins
|
# Plugins
|
||||||
worldedit = "7.2.16"
|
worldedit = "7.2.17"
|
||||||
fawe = "2.8.0"
|
fawe = "2.8.1"
|
||||||
placeholderapi = "2.11.4"
|
placeholderapi = "2.11.5"
|
||||||
luckperms = "5.4"
|
luckperms = "5.4"
|
||||||
essentialsx = "2.20.1"
|
essentialsx = "2.20.1"
|
||||||
mvdwapi = "3.1.1"
|
mvdwapi = "3.1.1"
|
||||||
|
Reference in New Issue
Block a user