mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-07-03 06:04:43 +02:00
Compare commits
1 Commits
fix/flag-e
...
fix/v6/nul
Author | SHA1 | Date | |
---|---|---|---|
2d0fdccc48 |
@ -95,11 +95,11 @@ tasks.named<ShadowJar>("shadowJar") {
|
||||
tasks {
|
||||
withType<Javadoc> {
|
||||
val opt = options as StandardJavadocDocletOptions
|
||||
opt.links("https://papermc.io/javadocs/paper/1.18/")
|
||||
opt.links("https://docs.enginehub.org/javadoc/com.sk89q.worldedit/worldedit-bukkit/" + libs.worldeditBukkit.get().versionConstraint.toString())
|
||||
opt.links("https://javadoc.io/doc/com.plotsquared/PlotSquared-Core/latest/")
|
||||
opt.links("https://jd.adventure.kyori.net/api/" + libs.adventure.get().versionConstraint.toString())
|
||||
opt.links("https://google.github.io/guice/api-docs/" + libs.guice.get().versionConstraint.toString() + "/javadoc/")
|
||||
opt.links("https://papermc.io/javadocs/paper/1.17/")
|
||||
opt.links("https://docs.enginehub.org/javadoc/com.sk89q.worldedit/worldedit-core/7.2.7/")
|
||||
opt.links("https://docs.enginehub.org/javadoc/com.sk89q.worldedit/worldedit-bukkit/7.2.7/")
|
||||
opt.links("https://jd.adventure.kyori.net/api/4.9.3/")
|
||||
opt.links("https://google.github.io/guice/api-docs/5.0.1/javadoc/")
|
||||
opt.links("https://checkerframework.org/api/")
|
||||
}
|
||||
}
|
||||
|
@ -54,13 +54,3 @@ tasks.processResources {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
tasks {
|
||||
withType<Javadoc> {
|
||||
val opt = options as StandardJavadocDocletOptions
|
||||
opt.links("https://docs.enginehub.org/javadoc/com.sk89q.worldedit/worldedit-core/" + libs.worldeditCore.get().versionConstraint.toString())
|
||||
opt.links("https://jd.adventure.kyori.net/api/" + libs.adventure.get().versionConstraint.toString())
|
||||
opt.links("https://google.github.io/guice/api-docs/" + libs.guice.get().versionConstraint.toString() + "/javadoc/")
|
||||
opt.links("https://checkerframework.org/api/")
|
||||
}
|
||||
}
|
||||
|
@ -126,7 +126,7 @@ public class Done extends SubCommand {
|
||||
long flagValue = System.currentTimeMillis() / 1000;
|
||||
PlotFlag<?, ?> plotFlag = plot.getFlagContainer().getFlag(DoneFlag.class)
|
||||
.createFlagInstance(Long.toString(flagValue));
|
||||
PlotFlagAddEvent event = eventDispatcher.callFlagAdd(plotFlag, plot);
|
||||
PlotFlagAddEvent event = new PlotFlagAddEvent(plotFlag, plot);
|
||||
if (event.getEventResult() == Result.DENY) {
|
||||
player.sendMessage(TranslatableCaption.of("events.event_denied"));
|
||||
return;
|
||||
|
@ -25,7 +25,6 @@
|
||||
*/
|
||||
package com.plotsquared.core.command;
|
||||
|
||||
import com.google.inject.Inject;
|
||||
import com.plotsquared.core.PlotSquared;
|
||||
import com.plotsquared.core.configuration.Settings;
|
||||
import com.plotsquared.core.configuration.caption.CaptionUtility;
|
||||
@ -45,7 +44,6 @@ import com.plotsquared.core.plot.flag.InternalFlag;
|
||||
import com.plotsquared.core.plot.flag.PlotFlag;
|
||||
import com.plotsquared.core.plot.flag.types.IntegerFlag;
|
||||
import com.plotsquared.core.plot.flag.types.ListFlag;
|
||||
import com.plotsquared.core.util.EventDispatcher;
|
||||
import com.plotsquared.core.util.MathMan;
|
||||
import com.plotsquared.core.util.Permissions;
|
||||
import com.plotsquared.core.util.StringComparison;
|
||||
@ -81,12 +79,8 @@ import java.util.stream.Stream;
|
||||
@SuppressWarnings("unused")
|
||||
public final class FlagCommand extends Command {
|
||||
|
||||
private final EventDispatcher eventDispatcher;
|
||||
|
||||
@Inject
|
||||
public FlagCommand(final @NonNull EventDispatcher eventDispatcher) {
|
||||
public FlagCommand() {
|
||||
super(MainCommand.getInstance(), true);
|
||||
this.eventDispatcher = eventDispatcher;
|
||||
}
|
||||
|
||||
private static boolean sendMessage(PlotPlayer<?> player) {
|
||||
@ -120,7 +114,7 @@ public final class FlagCommand extends Command {
|
||||
TranslatableCaption.of("permission.no_permission"),
|
||||
Template.of(
|
||||
"node",
|
||||
perm + "." + numeric
|
||||
perm
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -341,7 +335,7 @@ public final class FlagCommand extends Command {
|
||||
return;
|
||||
}
|
||||
Plot plot = player.getLocation().getPlotAbs();
|
||||
PlotFlagAddEvent event = eventDispatcher.callFlagAdd(plotFlag, plot);
|
||||
PlotFlagAddEvent event = new PlotFlagAddEvent(plotFlag, plot);
|
||||
if (event.getEventResult() == Result.DENY) {
|
||||
player.sendMessage(
|
||||
TranslatableCaption.of("events.event_denied"),
|
||||
@ -400,7 +394,7 @@ public final class FlagCommand extends Command {
|
||||
return;
|
||||
}
|
||||
Plot plot = player.getLocation().getPlotAbs();
|
||||
PlotFlagAddEvent event = eventDispatcher.callFlagAdd(plotFlag, plot);
|
||||
PlotFlagAddEvent event = new PlotFlagAddEvent(plotFlag, plot);
|
||||
if (event.getEventResult() == Result.DENY) {
|
||||
player.sendMessage(
|
||||
TranslatableCaption.of("events.event_denied"),
|
||||
@ -469,7 +463,7 @@ public final class FlagCommand extends Command {
|
||||
return;
|
||||
}
|
||||
final Plot plot = player.getLocation().getPlotAbs();
|
||||
PlotFlagRemoveEvent event = eventDispatcher.callFlagRemove(flag, plot);
|
||||
PlotFlagRemoveEvent event = new PlotFlagRemoveEvent(flag, plot);
|
||||
if (event.getEventResult() == Result.DENY) {
|
||||
player.sendMessage(
|
||||
TranslatableCaption.of("events.event_denied"),
|
||||
@ -522,7 +516,7 @@ public final class FlagCommand extends Command {
|
||||
}
|
||||
} else {
|
||||
PlotFlag<?, ?> plotFlag = parsedFlag.createFlagInstance(list);
|
||||
PlotFlagAddEvent addEvent = eventDispatcher.callFlagAdd(plotFlag, plot);
|
||||
PlotFlagAddEvent addEvent = new PlotFlagAddEvent(plotFlag, plot);
|
||||
if (addEvent.getEventResult() == Result.DENY) {
|
||||
player.sendMessage(
|
||||
TranslatableCaption.of("events.event_denied"),
|
||||
|
@ -38,12 +38,10 @@ import com.plotsquared.core.plot.PlotInventory;
|
||||
import com.plotsquared.core.plot.PlotItemStack;
|
||||
import com.plotsquared.core.plot.flag.PlotFlag;
|
||||
import com.plotsquared.core.plot.flag.implementations.MusicFlag;
|
||||
import com.plotsquared.core.util.EventDispatcher;
|
||||
import com.plotsquared.core.util.InventoryUtil;
|
||||
import com.plotsquared.core.util.Permissions;
|
||||
import com.sk89q.worldedit.world.item.ItemTypes;
|
||||
import net.kyori.adventure.text.minimessage.Template;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.Arrays;
|
||||
@ -65,12 +63,10 @@ public class Music extends SubCommand {
|
||||
);
|
||||
|
||||
private final InventoryUtil inventoryUtil;
|
||||
private final EventDispatcher eventDispatcher;
|
||||
|
||||
@Inject
|
||||
public Music(final @Nullable InventoryUtil inventoryUtil, final @NonNull EventDispatcher eventDispatcher) {
|
||||
public Music(final @Nullable InventoryUtil inventoryUtil) {
|
||||
this.inventoryUtil = inventoryUtil;
|
||||
this.eventDispatcher = eventDispatcher;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -108,7 +104,7 @@ public class Music extends SubCommand {
|
||||
if (item.getType() == ItemTypes.BEDROCK) {
|
||||
PlotFlag<?, ?> plotFlag = plot.getFlagContainer().getFlag(MusicFlag.class)
|
||||
.createFlagInstance(item.getType());
|
||||
PlotFlagRemoveEvent event = eventDispatcher.callFlagRemove(plotFlag, plot);
|
||||
PlotFlagRemoveEvent event = new PlotFlagRemoveEvent(plotFlag, plot);
|
||||
if (event.getEventResult() == Result.DENY) {
|
||||
getPlayer().sendMessage(
|
||||
TranslatableCaption.of("events.event_denied"),
|
||||
@ -125,7 +121,7 @@ public class Music extends SubCommand {
|
||||
} else if (item.getName().toLowerCase(Locale.ENGLISH).contains("disc")) {
|
||||
PlotFlag<?, ?> plotFlag = plot.getFlagContainer().getFlag(MusicFlag.class)
|
||||
.createFlagInstance(item.getType());
|
||||
PlotFlagAddEvent event = eventDispatcher.callFlagAdd(plotFlag, plot);
|
||||
PlotFlagAddEvent event = new PlotFlagAddEvent(plotFlag, plot);
|
||||
if (event.getEventResult() == Result.DENY) {
|
||||
getPlayer().sendMessage(
|
||||
TranslatableCaption.of("events.event_denied"),
|
||||
|
@ -45,7 +45,6 @@ import com.plotsquared.core.queue.ChunkQueueCoordinator;
|
||||
import com.plotsquared.core.queue.GlobalBlockQueue;
|
||||
import com.plotsquared.core.queue.QueueCoordinator;
|
||||
import com.plotsquared.core.util.ChunkManager;
|
||||
import com.plotsquared.core.util.EventDispatcher;
|
||||
import com.plotsquared.core.util.MathMan;
|
||||
import com.plotsquared.core.util.RegionManager;
|
||||
import com.plotsquared.core.util.RegionUtil;
|
||||
@ -94,7 +93,6 @@ public class HybridUtils {
|
||||
private final GlobalBlockQueue blockQueue;
|
||||
private final WorldUtil worldUtil;
|
||||
private final SchematicHandler schematicHandler;
|
||||
private final EventDispatcher eventDispatcher;
|
||||
|
||||
@Inject
|
||||
public HybridUtils(
|
||||
@ -102,15 +100,13 @@ public class HybridUtils {
|
||||
final @NonNull ChunkManager chunkManager,
|
||||
final @NonNull GlobalBlockQueue blockQueue,
|
||||
final @NonNull WorldUtil worldUtil,
|
||||
final @NonNull SchematicHandler schematicHandler,
|
||||
final @NonNull EventDispatcher eventDispatcher
|
||||
final @NonNull SchematicHandler schematicHandler
|
||||
) {
|
||||
this.plotAreaManager = plotAreaManager;
|
||||
this.chunkManager = chunkManager;
|
||||
this.blockQueue = blockQueue;
|
||||
this.worldUtil = worldUtil;
|
||||
this.schematicHandler = schematicHandler;
|
||||
this.eventDispatcher = eventDispatcher;
|
||||
}
|
||||
|
||||
public void regeneratePlotWalls(final PlotArea area) {
|
||||
@ -352,7 +348,7 @@ public class HybridUtils {
|
||||
result.add(whenDone.value.variety_sd);
|
||||
PlotFlag<?, ?> plotFlag = GlobalFlagContainer.getInstance().getFlag(AnalysisFlag.class).createFlagInstance(
|
||||
result);
|
||||
PlotFlagAddEvent event = eventDispatcher.callFlagAdd(plotFlag, origin);
|
||||
PlotFlagAddEvent event = new PlotFlagAddEvent(plotFlag, origin);
|
||||
if (event.getEventResult() == Result.DENY) {
|
||||
return;
|
||||
}
|
||||
|
@ -262,9 +262,7 @@ public final class PlotModificationManager {
|
||||
if (queue.size() > 0) {
|
||||
queue.setCompleteTask(run);
|
||||
queue.enqueue();
|
||||
return;
|
||||
}
|
||||
run.run();
|
||||
return;
|
||||
}
|
||||
Plot current = queue.poll();
|
||||
|
@ -359,7 +359,7 @@ public class ExpireManager {
|
||||
.getFlag(AnalysisFlag.class)
|
||||
.createFlagInstance(changed.asList());
|
||||
PlotFlagAddEvent event =
|
||||
eventDispatcher.callFlagAdd(plotFlag, plot);
|
||||
new PlotFlagAddEvent(plotFlag, newPlot);
|
||||
if (event.getEventResult() == Result.DENY) {
|
||||
return;
|
||||
}
|
||||
@ -451,7 +451,7 @@ public class ExpireManager {
|
||||
plot.getPlotModificationManager().deletePlot(null, whenDone);
|
||||
}
|
||||
|
||||
@Deprecated(forRemoval = true, since = "6.4.0")
|
||||
@Deprecated(forRemoval = true, since = "TODO")
|
||||
public long getAge(UUID uuid) {
|
||||
return getAge(uuid, false);
|
||||
}
|
||||
@ -462,7 +462,7 @@ public class ExpireManager {
|
||||
* @param uuid the uuid of the owner to check against
|
||||
* @param shouldDeleteUnknownOwner {@code true} if an unknown player should be counted as never online
|
||||
* @return the millis since the player was last online, or {@link Long#MAX_VALUE} if player was never online
|
||||
* @since 6.4.0
|
||||
* @since TODO
|
||||
*/
|
||||
public long getAge(UUID uuid, final boolean shouldDeleteUnknownOwner) {
|
||||
if (PlotSquared.platform().playerManager().getPlayerIfExists(uuid) != null) {
|
||||
|
@ -160,7 +160,7 @@ public class ExpiryTask {
|
||||
/**
|
||||
* Returns {@code true} if this task respects unknown owners
|
||||
* @return {@code true} if unknown owners should be counted as never online
|
||||
* @since 6.4.0
|
||||
* @since TODO
|
||||
*/
|
||||
public boolean shouldDeleteForUnknownOwner() {
|
||||
return settings.DELETE_IF_OWNER_IS_UNKNOWN;
|
||||
|
@ -166,7 +166,7 @@ public abstract class PlayerManager<P extends PlotPlayer<? extends T>, T> {
|
||||
* @return The player's name, None, Everyone or Unknown
|
||||
* @deprecated Use {@link #resolveName(UUID)}
|
||||
*/
|
||||
@Deprecated(forRemoval = true, since = "6.4.0")
|
||||
@Deprecated(forRemoval = true, since = "TODO")
|
||||
public static @NonNull String getName(final @Nullable UUID owner) {
|
||||
return getName(owner, true);
|
||||
}
|
||||
@ -179,7 +179,7 @@ public abstract class PlayerManager<P extends PlotPlayer<? extends T>, T> {
|
||||
* @return The player's name, None, Everyone or Unknown
|
||||
* @deprecated Use {@link #resolveName(UUID, boolean)}
|
||||
*/
|
||||
@Deprecated(forRemoval = true, since = "6.4.0")
|
||||
@Deprecated(forRemoval = true, since = "TODO")
|
||||
public static @NonNull String getName(final @Nullable UUID owner, final boolean blocking) {
|
||||
if (owner == null) {
|
||||
TranslatableCaption.of("info.none");
|
||||
@ -217,7 +217,7 @@ public abstract class PlayerManager<P extends PlotPlayer<? extends T>, T> {
|
||||
* @param owner The UUID of the owner
|
||||
* @return A caption containing either the name, {@code None}, {@code Everyone} or {@code Unknown}
|
||||
* @see #resolveName(UUID, boolean)
|
||||
* @since 6.4.0
|
||||
* @since TODO
|
||||
*/
|
||||
public static @NonNull Caption resolveName(final @Nullable UUID owner) {
|
||||
return resolveName(owner, true);
|
||||
@ -229,7 +229,7 @@ public abstract class PlayerManager<P extends PlotPlayer<? extends T>, T> {
|
||||
* @param owner The UUID of the owner
|
||||
* @param blocking If the operation should block the current thread for {@link Settings.UUID#BLOCKING_TIMEOUT} milliseconds
|
||||
* @return A caption containing either the name, {@code None}, {@code Everyone} or {@code Unknown}
|
||||
* @since 6.4.0
|
||||
* @since TODO
|
||||
*/
|
||||
public static @NonNull Caption resolveName(final @Nullable UUID owner, final boolean blocking) {
|
||||
if (owner == null) {
|
||||
|
@ -328,7 +328,7 @@ public class StringMan {
|
||||
/**
|
||||
* @param message an input string
|
||||
* @return a list of strings
|
||||
* @since 6.4.0
|
||||
* @since TODO
|
||||
*
|
||||
* <table border="1">
|
||||
* <caption>Converts multiple quoted and single strings into a list of strings</caption>
|
||||
|
@ -18,7 +18,7 @@ plugins {
|
||||
idea
|
||||
}
|
||||
|
||||
version = "6.4.1-SNAPSHOT"
|
||||
version = "6.3.1-SNAPSHOT"
|
||||
|
||||
allprojects {
|
||||
group = "com.plotsquared"
|
||||
@ -77,7 +77,7 @@ allprojects {
|
||||
}
|
||||
|
||||
tasks.compileJava.configure {
|
||||
options.release.set(17)
|
||||
options.release.set(16)
|
||||
}
|
||||
|
||||
configurations.all {
|
||||
|
@ -7,7 +7,7 @@ guava = "31.0.1-jre" # Version set by Minecraft
|
||||
# Platform expectations
|
||||
paper = "1.18.1-R0.1-SNAPSHOT"
|
||||
checker-qual = "3.21.1"
|
||||
guice = "5.1.0"
|
||||
guice = "5.0.1"
|
||||
findbugs = "3.0.1"
|
||||
snakeyaml = "1.30" # Version set by Bukkit
|
||||
|
||||
|
Reference in New Issue
Block a user