Skip to content

Commit 8591aab

Browse files
me4502dordsor21
authored andcommitted
Deprecate MultiStageReorder and ReorderMode (#1999)
* Start deprecating MultiStage reorder * Rather than changing behaviour just deprecate * Add deprecation message * Apply PR review notes
1 parent 1ec09a6 commit 8591aab

File tree

3 files changed

+23
-3
lines changed

3 files changed

+23
-3
lines changed

worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ public enum Stage {
212212
* NONE = Place blocks without worrying about placement order.
213213
* </p>
214214
*/
215+
@Deprecated
215216
public enum ReorderMode {
216217
MULTI_STAGE("multi"),
217218
FAST("fast"),
@@ -398,6 +399,7 @@ public void enableStandardMode() {
398399
*
399400
* @param reorderMode The reorder mode
400401
*/
402+
@Deprecated
401403
public void setReorderMode(ReorderMode reorderMode) {
402404
//FAWE start - we don't do physics so we don't need this
403405
switch (reorderMode) {
@@ -419,6 +421,7 @@ public void setReorderMode(ReorderMode reorderMode) {
419421
*
420422
* @return the reorder mode
421423
*/
424+
@Deprecated
422425
public ReorderMode getReorderMode() {
423426
if (isQueueEnabled()) {
424427
return ReorderMode.MULTI_STAGE;
@@ -480,7 +483,7 @@ public void setBlockChangeLimit(long limit) {
480483
* Returns queue status.
481484
*
482485
* @return whether the queue is enabled
483-
* @deprecated Use {@link EditSession#getReorderMode()} with MULTI_STAGE instead.
486+
* @deprecated Use {@link EditSession#isBufferingEnabled()} instead.
484487
*/
485488
@Deprecated
486489
public boolean isQueueEnabled() {
@@ -493,7 +496,7 @@ public boolean isQueueEnabled() {
493496
* Queue certain types of block for better reproduction of those blocks. Uses
494497
* {@link ReorderMode#MULTI_STAGE}.
495498
*
496-
* @deprecated Use {@link EditSession#setReorderMode(ReorderMode)} with MULTI_STAGE instead.
499+
* @deprecated There is no specific replacement, instead enable what you want specifically.
497500
*/
498501
@Deprecated
499502
public void enableQueue() {
@@ -503,7 +506,9 @@ public void enableQueue() {
503506
}
504507

505508
/**
506-
* Disable the queue. This will close the queue.
509+
* Disable the queue. This will flush the session.
510+
*
511+
* @deprecated Use {@link EditSession#disableBuffering()} instead.
507512
*/
508513
@Deprecated
509514
public void disableQueue() {
@@ -841,6 +846,15 @@ public void setBatchingChunks(boolean batchingChunks) {
841846
//FAWE end
842847
}
843848

849+
/**
850+
* Check if this session has any buffering extents enabled.
851+
*
852+
* @return {@code true} if any extents are buffering
853+
*/
854+
public boolean isBufferingEnabled() {
855+
return isBatchingChunks();
856+
}
857+
844858
/**
845859
* Disable all buffering extents.
846860
*

worldedit-core/src/main/java/com/sk89q/worldedit/LocalSession.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1828,6 +1828,7 @@ public void setFastMode(boolean fastMode) {
18281828
*
18291829
* @return The reorder mode
18301830
*/
1831+
@Deprecated
18311832
public EditSession.ReorderMode getReorderMode() {
18321833
return EditSession.ReorderMode.FAST;
18331834
}
@@ -1837,6 +1838,7 @@ public EditSession.ReorderMode getReorderMode() {
18371838
*
18381839
* @param reorderMode The reorder mode
18391840
*/
1841+
@Deprecated
18401842
public void setReorderMode(EditSession.ReorderMode reorderMode) {
18411843
}
18421844

worldedit-core/src/main/java/com/sk89q/worldedit/extent/reorder/MultiStageReorder.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import com.sk89q.worldedit.WorldEditException;
2323
import com.sk89q.worldedit.extent.AbstractBufferingExtent;
2424
import com.sk89q.worldedit.extent.Extent;
25+
import com.sk89q.worldedit.extent.world.SideEffectExtent;
2526
import com.sk89q.worldedit.function.operation.Operation;
2627
import com.sk89q.worldedit.function.operation.OperationQueue;
2728
import com.sk89q.worldedit.function.operation.RunContext;
@@ -43,7 +44,10 @@
4344

4445
/**
4546
* Re-orders blocks into several stages.
47+
*
48+
* @deprecated Use {@link SideEffectExtent} with {@link SideEffectExtent#setPostEditSimulationEnabled} instead.
4649
*/
50+
@Deprecated
4751
public class MultiStageReorder extends AbstractBufferingExtent implements ReorderingExtent {
4852

4953
private static final Map<BlockType, PlacementPriority> priorityMap = new HashMap<>();

0 commit comments

Comments
 (0)