mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-07-03 22:24:43 +02:00
Compare commits
5 Commits
fix/v6/cle
...
replay-v6
Author | SHA1 | Date | |
---|---|---|---|
a791f99a13 | |||
f10d0b8fbb | |||
3fc380545f | |||
c22307bf47 | |||
20bac8bc9d |
4
.gitattributes
vendored
4
.gitattributes
vendored
@ -1,4 +0,0 @@
|
||||
* 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
|
||||
java-version: 17
|
||||
- name: Clean Build
|
||||
run: ./gradlew clean build
|
||||
run: ./gradlew clean build --warning-mode all
|
||||
|
@ -24,6 +24,7 @@ import org.bukkit.Bukkit;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
public class BukkitWorld implements World<org.bukkit.World> {
|
||||
|
||||
|
@ -80,3 +80,4 @@ public class FaweSchematicHandler extends SchematicHandler {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -28,6 +28,7 @@ import com.plotsquared.core.generator.HybridUtils;
|
||||
import com.plotsquared.core.player.PlotPlayer;
|
||||
import com.plotsquared.core.plot.Plot;
|
||||
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.flag.GlobalFlagContainer;
|
||||
import com.plotsquared.core.plot.flag.PlotFlag;
|
||||
@ -41,6 +42,7 @@ import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
@ -220,6 +220,17 @@ public final class PlotModificationManager {
|
||||
if (isDelete) {
|
||||
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();
|
||||
Runnable run = new Runnable() {
|
||||
@Override
|
||||
@ -270,21 +281,7 @@ public final class PlotModificationManager {
|
||||
manager.clearPlot(current, this, actor, null);
|
||||
}
|
||||
};
|
||||
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;
|
||||
}
|
||||
|
||||
@ -324,22 +321,7 @@ public final class PlotModificationManager {
|
||||
* @return success/!cancelled
|
||||
*/
|
||||
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 (whenDone != null) {
|
||||
whenDone.run();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
final Set<Plot> plots = this.plot.getConnectedPlots();
|
||||
@ -384,17 +366,14 @@ public final class PlotModificationManager {
|
||||
current.getPlotModificationManager().setSign(PlayerManager.resolveName(current.getOwnerAbs()).getComponent(
|
||||
LocaleHolder.console()));
|
||||
}
|
||||
if (whenDone != null) {
|
||||
TaskManager.runTask(whenDone);
|
||||
}
|
||||
}));
|
||||
} else if (whenDone != null) {
|
||||
queue.setCompleteTask(whenDone);
|
||||
}
|
||||
if (createRoad) {
|
||||
manager.finishPlotUnlink(ids, queue);
|
||||
}
|
||||
if (queue != null) {
|
||||
queue.enqueue();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -24,6 +24,7 @@ import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* A world that contains plots
|
||||
|
@ -24,6 +24,7 @@ import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* A plot flag is any property that can be assigned
|
||||
|
@ -19,6 +19,7 @@
|
||||
package com.plotsquared.core.util;
|
||||
|
||||
import com.plotsquared.core.location.Location;
|
||||
import com.plotsquared.core.plot.Plot;
|
||||
import com.sk89q.worldedit.math.BlockVector2;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.regions.CuboidRegion;
|
||||
|
@ -31,6 +31,7 @@ import com.plotsquared.core.plot.Plot;
|
||||
import com.plotsquared.core.plot.PlotArea;
|
||||
import com.plotsquared.core.uuid.UUIDMapping;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
@ -55,3 +55,4 @@ public class AbstractDelegateOutputStream extends OutputStream {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -21,6 +21,7 @@ package com.plotsquared.core.util.query;
|
||||
import com.plotsquared.core.plot.Plot;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.UUID;
|
||||
|
||||
class OwnersIncludeFilter implements PlotFilter {
|
||||
|
@ -83,3 +83,4 @@ public interface PlotSquaredTask extends Runnable {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -276,3 +276,4 @@ public class AbstractDBTest implements AbstractDB {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -90,9 +90,6 @@ subprojects {
|
||||
java {
|
||||
licenseHeaderFile(rootProject.file("HEADER.txt"))
|
||||
target("**/*.java")
|
||||
endWithNewline()
|
||||
trimTrailingWhitespace()
|
||||
removeUnusedImports()
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user