mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-07-05 15:14:43 +02:00
Compare commits
2 Commits
replay-v6
...
fix/v6/cle
Author | SHA1 | Date | |
---|---|---|---|
557eacc5d7 | |||
abbac057ed |
4
.gitattributes
vendored
Normal file
4
.gitattributes
vendored
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
* text=auto
|
||||||
|
|
||||||
|
*.java text
|
||||||
|
*.jar binary
|
2
.github/workflows/build-pr.yml
vendored
2
.github/workflows/build-pr.yml
vendored
@ -20,4 +20,4 @@ jobs:
|
|||||||
distribution: temurin
|
distribution: temurin
|
||||||
java-version: 17
|
java-version: 17
|
||||||
- name: Clean Build
|
- name: Clean Build
|
||||||
run: ./gradlew clean build --warning-mode all
|
run: ./gradlew clean build
|
||||||
|
@ -24,7 +24,6 @@ import org.bukkit.Bukkit;
|
|||||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
public class BukkitWorld implements World<org.bukkit.World> {
|
public class BukkitWorld implements World<org.bukkit.World> {
|
||||||
|
|
||||||
|
@ -80,4 +80,3 @@ public class FaweSchematicHandler extends SchematicHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,7 +28,6 @@ import com.plotsquared.core.generator.HybridUtils;
|
|||||||
import com.plotsquared.core.player.PlotPlayer;
|
import com.plotsquared.core.player.PlotPlayer;
|
||||||
import com.plotsquared.core.plot.Plot;
|
import com.plotsquared.core.plot.Plot;
|
||||||
import com.plotsquared.core.plot.PlotArea;
|
import com.plotsquared.core.plot.PlotArea;
|
||||||
import com.plotsquared.core.plot.expiration.ExpireManager;
|
|
||||||
import com.plotsquared.core.plot.expiration.PlotAnalysis;
|
import com.plotsquared.core.plot.expiration.PlotAnalysis;
|
||||||
import com.plotsquared.core.plot.flag.GlobalFlagContainer;
|
import com.plotsquared.core.plot.flag.GlobalFlagContainer;
|
||||||
import com.plotsquared.core.plot.flag.PlotFlag;
|
import com.plotsquared.core.plot.flag.PlotFlag;
|
||||||
@ -42,7 +41,6 @@ import org.checkerframework.checker.nullness.qual.NonNull;
|
|||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.LinkedHashSet;
|
import java.util.LinkedHashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
@ -220,17 +220,6 @@ public final class PlotModificationManager {
|
|||||||
if (isDelete) {
|
if (isDelete) {
|
||||||
this.removeSign();
|
this.removeSign();
|
||||||
}
|
}
|
||||||
PlotUnlinkEvent event = PlotSquared.get().getEventDispatcher()
|
|
||||||
.callUnlink(
|
|
||||||
this.plot.getArea(),
|
|
||||||
this.plot,
|
|
||||||
true,
|
|
||||||
!isDelete,
|
|
||||||
isDelete ? PlotUnlinkEvent.REASON.DELETE : PlotUnlinkEvent.REASON.CLEAR
|
|
||||||
);
|
|
||||||
if (event.getEventResult() != Result.DENY && this.unlinkPlot(event.isCreateRoad(), event.isCreateSign())) {
|
|
||||||
PlotSquared.get().getEventDispatcher().callPostUnlink(plot, event.getReason());
|
|
||||||
}
|
|
||||||
final PlotManager manager = this.plot.getArea().getPlotManager();
|
final PlotManager manager = this.plot.getArea().getPlotManager();
|
||||||
Runnable run = new Runnable() {
|
Runnable run = new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
@ -281,7 +270,21 @@ public final class PlotModificationManager {
|
|||||||
manager.clearPlot(current, this, actor, null);
|
manager.clearPlot(current, this, actor, null);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
run.run();
|
PlotUnlinkEvent event = PlotSquared.get().getEventDispatcher()
|
||||||
|
.callUnlink(
|
||||||
|
this.plot.getArea(),
|
||||||
|
this.plot,
|
||||||
|
true,
|
||||||
|
!isDelete,
|
||||||
|
isDelete ? PlotUnlinkEvent.REASON.DELETE : PlotUnlinkEvent.REASON.CLEAR
|
||||||
|
);
|
||||||
|
if (event.getEventResult() != Result.DENY) {
|
||||||
|
if (this.unlinkPlot(event.isCreateRoad(), event.isCreateSign(), run)) {
|
||||||
|
PlotSquared.get().getEventDispatcher().callPostUnlink(plot, event.getReason());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
run.run();
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -321,7 +324,22 @@ public final class PlotModificationManager {
|
|||||||
* @return success/!cancelled
|
* @return success/!cancelled
|
||||||
*/
|
*/
|
||||||
public boolean unlinkPlot(final boolean createRoad, final boolean createSign) {
|
public boolean unlinkPlot(final boolean createRoad, final boolean createSign) {
|
||||||
|
return unlinkPlot(createRoad, createSign, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Unlink the plot and all connected plots.
|
||||||
|
*
|
||||||
|
* @param createRoad whether to recreate road
|
||||||
|
* @param createSign whether to recreate signs
|
||||||
|
* @param whenDone Task to run when unlink is complete
|
||||||
|
* @return success/!cancelled
|
||||||
|
*/
|
||||||
|
public boolean unlinkPlot(final boolean createRoad, final boolean createSign, final Runnable whenDone) {
|
||||||
if (!this.plot.isMerged()) {
|
if (!this.plot.isMerged()) {
|
||||||
|
if (whenDone != null) {
|
||||||
|
whenDone.run();
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
final Set<Plot> plots = this.plot.getConnectedPlots();
|
final Set<Plot> plots = this.plot.getConnectedPlots();
|
||||||
@ -366,14 +384,17 @@ public final class PlotModificationManager {
|
|||||||
current.getPlotModificationManager().setSign(PlayerManager.resolveName(current.getOwnerAbs()).getComponent(
|
current.getPlotModificationManager().setSign(PlayerManager.resolveName(current.getOwnerAbs()).getComponent(
|
||||||
LocaleHolder.console()));
|
LocaleHolder.console()));
|
||||||
}
|
}
|
||||||
|
if (whenDone != null) {
|
||||||
|
TaskManager.runTask(whenDone);
|
||||||
|
}
|
||||||
}));
|
}));
|
||||||
|
} else if (whenDone != null) {
|
||||||
|
queue.setCompleteTask(whenDone);
|
||||||
}
|
}
|
||||||
if (createRoad) {
|
if (createRoad) {
|
||||||
manager.finishPlotUnlink(ids, queue);
|
manager.finishPlotUnlink(ids, queue);
|
||||||
}
|
}
|
||||||
if (queue != null) {
|
queue.enqueue();
|
||||||
queue.enqueue();
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,7 +24,6 @@ import org.checkerframework.checker.nullness.qual.NonNull;
|
|||||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A world that contains plots
|
* A world that contains plots
|
||||||
|
@ -24,7 +24,6 @@ import org.checkerframework.checker.nullness.qual.NonNull;
|
|||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A plot flag is any property that can be assigned
|
* A plot flag is any property that can be assigned
|
||||||
|
@ -19,7 +19,6 @@
|
|||||||
package com.plotsquared.core.util;
|
package com.plotsquared.core.util;
|
||||||
|
|
||||||
import com.plotsquared.core.location.Location;
|
import com.plotsquared.core.location.Location;
|
||||||
import com.plotsquared.core.plot.Plot;
|
|
||||||
import com.sk89q.worldedit.math.BlockVector2;
|
import com.sk89q.worldedit.math.BlockVector2;
|
||||||
import com.sk89q.worldedit.math.BlockVector3;
|
import com.sk89q.worldedit.math.BlockVector3;
|
||||||
import com.sk89q.worldedit.regions.CuboidRegion;
|
import com.sk89q.worldedit.regions.CuboidRegion;
|
||||||
|
@ -31,7 +31,6 @@ import com.plotsquared.core.plot.Plot;
|
|||||||
import com.plotsquared.core.plot.PlotArea;
|
import com.plotsquared.core.plot.PlotArea;
|
||||||
import com.plotsquared.core.uuid.UUIDMapping;
|
import com.plotsquared.core.uuid.UUIDMapping;
|
||||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
@ -55,4 +55,3 @@ public class AbstractDelegateOutputStream extends OutputStream {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,7 +21,6 @@ package com.plotsquared.core.util.query;
|
|||||||
import com.plotsquared.core.plot.Plot;
|
import com.plotsquared.core.plot.Plot;
|
||||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||||
|
|
||||||
import java.util.Objects;
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
class OwnersIncludeFilter implements PlotFilter {
|
class OwnersIncludeFilter implements PlotFilter {
|
||||||
|
@ -83,4 +83,3 @@ public interface PlotSquaredTask extends Runnable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -276,4 +276,3 @@ public class AbstractDBTest implements AbstractDB {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -90,6 +90,9 @@ subprojects {
|
|||||||
java {
|
java {
|
||||||
licenseHeaderFile(rootProject.file("HEADER.txt"))
|
licenseHeaderFile(rootProject.file("HEADER.txt"))
|
||||||
target("**/*.java")
|
target("**/*.java")
|
||||||
|
endWithNewline()
|
||||||
|
trimTrailingWhitespace()
|
||||||
|
removeUnusedImports()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user