mirror of
https://github.com/EngineHub/WorldEdit.git
synced 2025-03-07 13:48:00 +08:00
Deprecate MultiStageReorder and ReorderMode (#1999)
* Start deprecating MultiStage reorder * Rather than changing behaviour just deprecate * Add deprecation message * Apply PR review notes
This commit is contained in:
parent
7cc90a7b63
commit
f667474f18
@ -177,6 +177,7 @@ public enum Stage {
|
||||
* NONE = Place blocks without worrying about placement order.
|
||||
* </p>
|
||||
*/
|
||||
@Deprecated
|
||||
public enum ReorderMode {
|
||||
MULTI_STAGE("multi"),
|
||||
FAST("fast"),
|
||||
@ -213,6 +214,7 @@ public String getDisplayName() {
|
||||
|
||||
private final @Nullable List<TracingExtent> tracingExtents;
|
||||
|
||||
@Deprecated
|
||||
private ReorderMode reorderMode = ReorderMode.FAST;
|
||||
|
||||
private Mask oldMask;
|
||||
@ -363,6 +365,7 @@ public void enableStandardMode() {
|
||||
*
|
||||
* @param reorderMode The reorder mode
|
||||
*/
|
||||
@Deprecated
|
||||
public void setReorderMode(ReorderMode reorderMode) {
|
||||
if (reorderMode == ReorderMode.FAST && sideEffectExtent == null) {
|
||||
throw new IllegalArgumentException("An EditSession without a fast mode tried to use it for reordering!");
|
||||
@ -406,6 +409,7 @@ public void setReorderMode(ReorderMode reorderMode) {
|
||||
*
|
||||
* @return the reorder mode
|
||||
*/
|
||||
@Deprecated
|
||||
public ReorderMode getReorderMode() {
|
||||
return reorderMode;
|
||||
}
|
||||
@ -451,7 +455,7 @@ public void setBlockChangeLimit(int limit) {
|
||||
* Returns queue status.
|
||||
*
|
||||
* @return whether the queue is enabled
|
||||
* @deprecated Use {@link EditSession#getReorderMode()} with MULTI_STAGE instead.
|
||||
* @deprecated Use {@link EditSession#isBufferingEnabled()} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public boolean isQueueEnabled() {
|
||||
@ -461,7 +465,7 @@ public boolean isQueueEnabled() {
|
||||
/**
|
||||
* Queue certain types of block for better reproduction of those blocks.
|
||||
*
|
||||
* @deprecated Use {@link EditSession#setReorderMode(ReorderMode)} with MULTI_STAGE instead.
|
||||
* @deprecated There is no specific replacement, instead enable what you want specifically.
|
||||
*/
|
||||
@Deprecated
|
||||
public void enableQueue() {
|
||||
@ -471,7 +475,7 @@ public void enableQueue() {
|
||||
/**
|
||||
* Disable the queue. This will flush the session.
|
||||
*
|
||||
* @deprecated Use {@link EditSession#setReorderMode(ReorderMode)} with another mode instead.
|
||||
* @deprecated Use {@link EditSession#disableBuffering()} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public void disableQueue() {
|
||||
@ -614,6 +618,15 @@ public void setBatchingChunks(boolean batchingChunks) {
|
||||
chunkBatchingExtent.setEnabled(batchingChunks);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if this session has any buffering extents enabled.
|
||||
*
|
||||
* @return {@code true} if any extents are buffering
|
||||
*/
|
||||
public boolean isBufferingEnabled() {
|
||||
return isBatchingChunks() || (sideEffectExtent != null && sideEffectExtent.isPostEditSimulationEnabled());
|
||||
}
|
||||
|
||||
/**
|
||||
* Disable all buffering extents.
|
||||
*
|
||||
@ -625,6 +638,9 @@ public void disableBuffering() {
|
||||
if (commitRequired()) {
|
||||
internalFlushSession();
|
||||
}
|
||||
if (sideEffectExtent != null) {
|
||||
sideEffectExtent.setPostEditSimulationEnabled(false);
|
||||
}
|
||||
setReorderMode(ReorderMode.NONE);
|
||||
if (chunkBatchingExtent != null) {
|
||||
chunkBatchingExtent.setEnabled(false);
|
||||
|
@ -48,7 +48,6 @@
|
||||
import com.sk89q.worldedit.session.request.Request;
|
||||
import com.sk89q.worldedit.util.Countable;
|
||||
import com.sk89q.worldedit.util.SideEffectSet;
|
||||
import com.sk89q.worldedit.util.concurrency.LazyReference;
|
||||
import com.sk89q.worldedit.util.formatting.text.TranslatableComponent;
|
||||
import com.sk89q.worldedit.util.nbt.CompoundBinaryTag;
|
||||
import com.sk89q.worldedit.world.World;
|
||||
@ -1120,6 +1119,7 @@ public void setFastMode(boolean fastMode) {
|
||||
*
|
||||
* @return The reorder mode
|
||||
*/
|
||||
@Deprecated
|
||||
public EditSession.ReorderMode getReorderMode() {
|
||||
return reorderMode;
|
||||
}
|
||||
@ -1129,6 +1129,7 @@ public EditSession.ReorderMode getReorderMode() {
|
||||
*
|
||||
* @param reorderMode The reorder mode
|
||||
*/
|
||||
@Deprecated
|
||||
public void setReorderMode(EditSession.ReorderMode reorderMode) {
|
||||
this.reorderMode = reorderMode;
|
||||
}
|
||||
|
@ -22,6 +22,7 @@
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
import com.sk89q.worldedit.extent.AbstractBufferingExtent;
|
||||
import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.extent.world.SideEffectExtent;
|
||||
import com.sk89q.worldedit.function.operation.Operation;
|
||||
import com.sk89q.worldedit.function.operation.OperationQueue;
|
||||
import com.sk89q.worldedit.function.operation.RunContext;
|
||||
@ -42,7 +43,10 @@
|
||||
|
||||
/**
|
||||
* Re-orders blocks into several stages.
|
||||
*
|
||||
* @deprecated Use {@link SideEffectExtent} with {@link SideEffectExtent#setPostEditSimulationEnabled} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public class MultiStageReorder extends AbstractBufferingExtent implements ReorderingExtent {
|
||||
|
||||
private static final Map<BlockType, PlacementPriority> priorityMap = new HashMap<>();
|
||||
|
Loading…
Reference in New Issue
Block a user