Compare commits

..

1 Commits

Author SHA1 Message Date
Alexander Brandes
dbd900f8c3 Don't fire 'PlotUnlinkEvent' twice on plot clear 2023-01-22 10:32:24 +01:00
6 changed files with 8 additions and 6 deletions

View File

@@ -75,7 +75,7 @@ public class BukkitPlayer extends PlotPlayer<Player> {
* @deprecated Please do not use this method. Instead use {@link BukkitUtil#adapt(Player)}, as it caches player objects. * @deprecated Please do not use this method. Instead use {@link BukkitUtil#adapt(Player)}, as it caches player objects.
* This method will be made private in a future release. * This method will be made private in a future release.
*/ */
@Deprecated(forRemoval = true, since = "6.10.9") @Deprecated(forRemoval = true, since = "TODO")
public BukkitPlayer( public BukkitPlayer(
final @NonNull PlotAreaManager plotAreaManager, final @NonNull EventDispatcher eventDispatcher, final @NonNull PlotAreaManager plotAreaManager, final @NonNull EventDispatcher eventDispatcher,
final @NonNull Player player, final @NonNull PermissionHandler permissionHandler final @NonNull Player player, final @NonNull PermissionHandler permissionHandler
@@ -92,7 +92,7 @@ public class BukkitPlayer extends PlotPlayer<Player> {
* @deprecated Please do not use this method. Instead use {@link BukkitUtil#adapt(Player)}, as it caches player objects. * @deprecated Please do not use this method. Instead use {@link BukkitUtil#adapt(Player)}, as it caches player objects.
* This method will be made private in a future release. * This method will be made private in a future release.
*/ */
@Deprecated(forRemoval = true, since = "6.10.9") @Deprecated(forRemoval = true, since = "TODO")
public BukkitPlayer( public BukkitPlayer(
final @NonNull PlotAreaManager plotAreaManager, final @NonNull final @NonNull PlotAreaManager plotAreaManager, final @NonNull
EventDispatcher eventDispatcher, final @NonNull Player player, EventDispatcher eventDispatcher, final @NonNull Player player,

View File

@@ -229,11 +229,14 @@ public class Area extends SubCommand {
try (final ClipboardWriter clipboardWriter = BuiltInClipboardFormat.SPONGE_SCHEMATIC.getWriter(new FileOutputStream( try (final ClipboardWriter clipboardWriter = BuiltInClipboardFormat.SPONGE_SCHEMATIC.getWriter(new FileOutputStream(
file))) { file))) {
final BlockArrayClipboard clipboard = new BlockArrayClipboard(selectedRegion); final BlockArrayClipboard clipboard = new BlockArrayClipboard(selectedRegion);
EditSessionBuilder editSessionBuilder = WorldEdit.getInstance().newEditSessionBuilder(); EditSessionBuilder editSessionBuilder = WorldEdit.getInstance().newEditSessionBuilder();
editSessionBuilder.world(selectedRegion.getWorld()); editSessionBuilder.world(selectedRegion.getWorld());
final EditSession editSession = editSessionBuilder.build(); final EditSession editSession = editSessionBuilder.build();
final ForwardExtentCopy forwardExtentCopy = final ForwardExtentCopy forwardExtentCopy =
new ForwardExtentCopy(editSession, selectedRegion, clipboard, selectedRegion.getMinimumPoint()); new ForwardExtentCopy(editSession, selectedRegion, clipboard, selectedRegion.getMinimumPoint());
forwardExtentCopy.setCopyingBiomes(true); forwardExtentCopy.setCopyingBiomes(true);
forwardExtentCopy.setCopyingEntities(true); forwardExtentCopy.setCopyingEntities(true);
Operations.complete(forwardExtentCopy); Operations.complete(forwardExtentCopy);

View File

@@ -106,7 +106,6 @@ public class Clear extends Command {
BackupManager.backup(player, plot, () -> { BackupManager.backup(player, plot, () -> {
final long start = System.currentTimeMillis(); final long start = System.currentTimeMillis();
boolean result = plot.getPlotModificationManager().clear(true, false, player, () -> { boolean result = plot.getPlotModificationManager().clear(true, false, player, () -> {
plot.getPlotModificationManager().unlink();
TaskManager.runTask(() -> { TaskManager.runTask(() -> {
plot.removeRunning(); plot.removeRunning();
// If the state changes, then mark it as no longer done // If the state changes, then mark it as no longer done

View File

@@ -204,7 +204,7 @@ public class HybridPlotWorld extends ClassicPlotWorld {
} }
Object value; Object value;
try { try {
final boolean accessible = field.isAccessible(); final boolean accessible = field.canAccess(field);
field.setAccessible(true); field.setAccessible(true);
value = field.get(this); value = field.get(this);
field.setAccessible(accessible); field.setAccessible(accessible);

View File

@@ -334,7 +334,7 @@ public final class PlotModificationManager {
* @param createSign whether to recreate signs * @param createSign whether to recreate signs
* @param whenDone Task to run when unlink is complete * @param whenDone Task to run when unlink is complete
* @return success/!cancelled * @return success/!cancelled
* @since 6.10.9 * @since TODO
*/ */
public boolean unlinkPlot(final boolean createRoad, final boolean createSign, final Runnable whenDone) { public boolean unlinkPlot(final boolean createRoad, final boolean createSign, final Runnable whenDone) {
if (!this.plot.isMerged()) { if (!this.plot.isMerged()) {

View File

@@ -18,7 +18,7 @@ plugins {
} }
group = "com.plotsquared" group = "com.plotsquared"
version = "6.10.9" version = "6.10.9-SNAPSHOT"
if (!File("$rootDir/.git").exists()) { if (!File("$rootDir/.git").exists()) {
logger.lifecycle(""" logger.lifecycle("""