mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-07-02 21:54:43 +02:00
Compare commits
5 Commits
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
|
||||
|
@ -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.
|
||||
* This method will be made private in a future release.
|
||||
*/
|
||||
@Deprecated(forRemoval = true, since = "6.10.9")
|
||||
@Deprecated(forRemoval = true, since = "TODO")
|
||||
public BukkitPlayer(
|
||||
final @NonNull PlotAreaManager plotAreaManager, final @NonNull EventDispatcher eventDispatcher,
|
||||
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.
|
||||
* This method will be made private in a future release.
|
||||
*/
|
||||
@Deprecated(forRemoval = true, since = "6.10.9")
|
||||
@Deprecated(forRemoval = true, since = "TODO")
|
||||
public BukkitPlayer(
|
||||
final @NonNull PlotAreaManager plotAreaManager, final @NonNull
|
||||
EventDispatcher eventDispatcher, final @NonNull Player player,
|
||||
|
@ -239,11 +239,9 @@ public final class BukkitChunkCoordinator extends ChunkCoordinator {
|
||||
* server's main thread.
|
||||
*/
|
||||
private void processChunk(final @NonNull Chunk chunk) {
|
||||
/* Chunk#isLoaded does not necessarily return true shortly after PaperLib#getChunkAtAsync completes, but the chunk is
|
||||
still loaded.
|
||||
if (!chunk.isLoaded()) {
|
||||
throw new IllegalArgumentException(String.format("Chunk %d;%d is is not loaded", chunk.getX(), chunk.getZ());
|
||||
}*/
|
||||
throw new IllegalArgumentException(String.format("Chunk %d;%d is is not loaded", chunk.getX(), chunk.getZ()));
|
||||
}
|
||||
if (finished) {
|
||||
return;
|
||||
}
|
||||
|
@ -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 {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -56,7 +56,6 @@ import com.plotsquared.core.util.TabCompletions;
|
||||
import com.plotsquared.core.util.WorldUtil;
|
||||
import com.plotsquared.core.util.task.RunnableVal3;
|
||||
import com.sk89q.worldedit.EditSession;
|
||||
import com.sk89q.worldedit.EditSessionBuilder;
|
||||
import com.sk89q.worldedit.LocalSession;
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
import com.sk89q.worldedit.entity.Player;
|
||||
@ -229,9 +228,10 @@ public class Area extends SubCommand {
|
||||
try (final ClipboardWriter clipboardWriter = BuiltInClipboardFormat.SPONGE_SCHEMATIC.getWriter(new FileOutputStream(
|
||||
file))) {
|
||||
final BlockArrayClipboard clipboard = new BlockArrayClipboard(selectedRegion);
|
||||
EditSessionBuilder editSessionBuilder = WorldEdit.getInstance().newEditSessionBuilder();
|
||||
editSessionBuilder.world(selectedRegion.getWorld());
|
||||
final EditSession editSession = editSessionBuilder.build();
|
||||
final EditSession editSession = WorldEdit
|
||||
.getInstance()
|
||||
.getEditSessionFactory()
|
||||
.getEditSession(selectedRegion.getWorld(), -1);
|
||||
final ForwardExtentCopy forwardExtentCopy =
|
||||
new ForwardExtentCopy(editSession, selectedRegion, clipboard, selectedRegion.getMinimumPoint());
|
||||
forwardExtentCopy.setCopyingBiomes(true);
|
||||
|
@ -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;
|
||||
|
@ -62,7 +62,7 @@ public class ComponentPreset implements ConfigurationSerializable {
|
||||
public static ComponentPreset deserialize(final @NonNull Map<String, Object> map) {
|
||||
final ClassicPlotManagerComponent classicPlotManagerComponent = ClassicPlotManagerComponent
|
||||
.fromString(map.getOrDefault("component", "").toString()).orElseThrow(() ->
|
||||
new IllegalArgumentException("The preset in components.yml needs a valid target component, got: " + map.get("component")));
|
||||
new IllegalArgumentException("The preset needs a valid target component"));
|
||||
final String pattern = map.getOrDefault("pattern", "").toString();
|
||||
final double cost = Double.parseDouble(map.getOrDefault("cost", "0.0").toString());
|
||||
final String permission = map.getOrDefault("permission", "").toString();
|
||||
|
@ -144,7 +144,7 @@ public class ClassicPlotManager extends SquarePlotManager {
|
||||
plot.getRegions(),
|
||||
blocks,
|
||||
classicPlotWorld.getMinBuildHeight(),
|
||||
classicPlotWorld.getMaxBuildHeight() - 1,
|
||||
classicPlotWorld.getMaxBuildHeight(),
|
||||
actor,
|
||||
queue
|
||||
);
|
||||
@ -175,7 +175,7 @@ public class ClassicPlotManager extends SquarePlotManager {
|
||||
plot.getRegions(),
|
||||
blocks,
|
||||
classicPlotWorld.PLOT_HEIGHT + 1,
|
||||
classicPlotWorld.getMaxBuildHeight() - 1,
|
||||
classicPlotWorld.getMaxBuildHeight(),
|
||||
actor,
|
||||
queue
|
||||
);
|
||||
@ -281,7 +281,7 @@ public class ClassicPlotManager extends SquarePlotManager {
|
||||
}
|
||||
}
|
||||
|
||||
int maxY = classicPlotWorld.getMaxBuildHeight() - 1;
|
||||
int maxY = classicPlotWorld.getMaxBuildHeight();
|
||||
if (!plot.isMerged(Direction.NORTH)) {
|
||||
int z = bottom.getZ();
|
||||
for (int x = bottom.getX(); x <= top.getX(); x++) {
|
||||
|
@ -2506,7 +2506,7 @@ public class Plot {
|
||||
}
|
||||
}
|
||||
int minHeight = getArea().getMinBuildHeight();
|
||||
int maxHeight = getArea().getMaxBuildHeight() - 1;
|
||||
int maxHeight = getArea().getMaxBuildHeight();
|
||||
Location gtopabs = this.area.getPlotAbs(top).getTopAbs();
|
||||
Location gbotabs = this.area.getPlotAbs(bot).getBottomAbs();
|
||||
visited.addAll(Lists.newArrayList((Iterable<? extends PlotId>) PlotId.PlotRangeIterator.range(bot, top)));
|
||||
|
@ -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();
|
||||
}
|
||||
run.run();
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -324,23 +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
|
||||
* @since 6.10.9
|
||||
*/
|
||||
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();
|
||||
@ -385,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);
|
||||
}
|
||||
queue.enqueue();
|
||||
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;
|
||||
|
@ -106,7 +106,7 @@ public class WEManager {
|
||||
.getTrusted().contains(uuid))) && !plot.getFlag(NoWorldeditFlag.class)) {
|
||||
for (CuboidRegion region : plot.getRegions()) {
|
||||
BlockVector3 pos1 = region.getMinimumPoint().withY(area.getMinBuildHeight());
|
||||
BlockVector3 pos2 = region.getMaximumPoint().withY(area.getMaxBuildHeight() - 1);
|
||||
BlockVector3 pos2 = region.getMaximumPoint().withY(area.getMaxBuildHeight());
|
||||
CuboidRegion copy = new CuboidRegion(pos1, pos2);
|
||||
regions.add(copy);
|
||||
}
|
||||
|
@ -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 {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
<p align="center">
|
||||
<img src="https://raw.githubusercontent.com/IntellectualSites/Assets/main/plugins/PlotSquared/PlotSquared.svg" width="250">
|
||||
</p>
|
||||
|
||||
|
||||
---
|
||||
|
||||
PlotSquared is a land and world management plugin for Minecraft.
|
||||
|
@ -18,17 +18,7 @@ plugins {
|
||||
}
|
||||
|
||||
group = "com.plotsquared"
|
||||
version = "6.10.9"
|
||||
|
||||
if (!File("$rootDir/.git").exists()) {
|
||||
logger.lifecycle("""
|
||||
**************************************************************************************
|
||||
You need to fork and clone this repository! Don't download a .zip file.
|
||||
If you need assistance, consult the GitHub docs: https://docs.github.com/get-started/quickstart/fork-a-repo
|
||||
**************************************************************************************
|
||||
""".trimIndent()
|
||||
).also { kotlin.system.exitProcess(1) }
|
||||
}
|
||||
version = "6.10.9-SNAPSHOT"
|
||||
|
||||
subprojects {
|
||||
group = rootProject.group
|
||||
@ -100,9 +90,6 @@ subprojects {
|
||||
java {
|
||||
licenseHeaderFile(rootProject.file("HEADER.txt"))
|
||||
target("**/*.java")
|
||||
endWithNewline()
|
||||
trimTrailingWhitespace()
|
||||
removeUnusedImports()
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user