mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-07-15 11:54:43 +02:00
Compare commits
6 Commits
refactor/v
...
6.10.9
Author | SHA1 | Date | |
---|---|---|---|
be8903128d | |||
08800ec16d | |||
83e274ff9f | |||
0dd8b1053c | |||
0558fcf5d5 | |||
c45bbe3ec5 |
@ -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 = "TODO")
|
@Deprecated(forRemoval = true, since = "6.10.9")
|
||||||
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 = "TODO")
|
@Deprecated(forRemoval = true, since = "6.10.9")
|
||||||
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,
|
||||||
|
@ -56,6 +56,7 @@ import com.plotsquared.core.util.TabCompletions;
|
|||||||
import com.plotsquared.core.util.WorldUtil;
|
import com.plotsquared.core.util.WorldUtil;
|
||||||
import com.plotsquared.core.util.task.RunnableVal3;
|
import com.plotsquared.core.util.task.RunnableVal3;
|
||||||
import com.sk89q.worldedit.EditSession;
|
import com.sk89q.worldedit.EditSession;
|
||||||
|
import com.sk89q.worldedit.EditSessionBuilder;
|
||||||
import com.sk89q.worldedit.LocalSession;
|
import com.sk89q.worldedit.LocalSession;
|
||||||
import com.sk89q.worldedit.WorldEdit;
|
import com.sk89q.worldedit.WorldEdit;
|
||||||
import com.sk89q.worldedit.entity.Player;
|
import com.sk89q.worldedit.entity.Player;
|
||||||
@ -228,10 +229,9 @@ 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);
|
||||||
final EditSession editSession = WorldEdit
|
EditSessionBuilder editSessionBuilder = WorldEdit.getInstance().newEditSessionBuilder();
|
||||||
.getInstance()
|
editSessionBuilder.world(selectedRegion.getWorld());
|
||||||
.getEditSessionFactory()
|
final EditSession editSession = editSessionBuilder.build();
|
||||||
.getEditSession(selectedRegion.getWorld(), -1);
|
|
||||||
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);
|
||||||
|
@ -62,7 +62,7 @@ public class ComponentPreset implements ConfigurationSerializable {
|
|||||||
public static ComponentPreset deserialize(final @NonNull Map<String, Object> map) {
|
public static ComponentPreset deserialize(final @NonNull Map<String, Object> map) {
|
||||||
final ClassicPlotManagerComponent classicPlotManagerComponent = ClassicPlotManagerComponent
|
final ClassicPlotManagerComponent classicPlotManagerComponent = ClassicPlotManagerComponent
|
||||||
.fromString(map.getOrDefault("component", "").toString()).orElseThrow(() ->
|
.fromString(map.getOrDefault("component", "").toString()).orElseThrow(() ->
|
||||||
new IllegalArgumentException("The preset needs a valid target component"));
|
new IllegalArgumentException("The preset in components.yml needs a valid target component, got: " + map.get("component")));
|
||||||
final String pattern = map.getOrDefault("pattern", "").toString();
|
final String pattern = map.getOrDefault("pattern", "").toString();
|
||||||
final double cost = Double.parseDouble(map.getOrDefault("cost", "0.0").toString());
|
final double cost = Double.parseDouble(map.getOrDefault("cost", "0.0").toString());
|
||||||
final String permission = map.getOrDefault("permission", "").toString();
|
final String permission = map.getOrDefault("permission", "").toString();
|
||||||
|
@ -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);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -321,7 +324,23 @@ 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
|
||||||
|
* @since 6.10.9
|
||||||
|
*/
|
||||||
|
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 +385,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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ plugins {
|
|||||||
}
|
}
|
||||||
|
|
||||||
group = "com.plotsquared"
|
group = "com.plotsquared"
|
||||||
version = "6.10.9-SNAPSHOT"
|
version = "6.10.9"
|
||||||
|
|
||||||
if (!File("$rootDir/.git").exists()) {
|
if (!File("$rootDir/.git").exists()) {
|
||||||
logger.lifecycle("""
|
logger.lifecycle("""
|
||||||
|
Reference in New Issue
Block a user