mirror of
https://github.com/EngineHub/WorldEdit.git
synced 2024-12-15 04:41:37 +08:00
Fixed up the commitRequired checks.
This commit is contained in:
parent
5f2c77b719
commit
6f3016c7f0
@ -386,7 +386,9 @@ public void setBlockChangeLimit(int limit) {
|
||||
* Returns queue status.
|
||||
*
|
||||
* @return whether the queue is enabled
|
||||
* @deprecated Use {@link EditSession#getReorderMode()} with MULTI_STAGE instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public boolean isQueueEnabled() {
|
||||
return reorderMode == ReorderMode.MULTI_STAGE && reorderExtent.isEnabled();
|
||||
}
|
||||
|
@ -73,7 +73,7 @@ public void setEnabled(boolean enabled) {
|
||||
}
|
||||
|
||||
public boolean commitRequired() {
|
||||
return enabled && batches.size() > 0;
|
||||
return enabled;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -88,7 +88,7 @@ public boolean setBlock(BlockVector3 location, BlockStateHolder block) throws Wo
|
||||
|
||||
@Override
|
||||
protected Operation commitBefore() {
|
||||
if (!enabled) {
|
||||
if (!commitRequired()) {
|
||||
return null;
|
||||
}
|
||||
return new Operation() {
|
||||
|
@ -199,7 +199,7 @@ public void setEnabled(boolean enabled) {
|
||||
}
|
||||
|
||||
public boolean commitRequired() {
|
||||
return enabled && stages.values().stream().anyMatch(stage -> stage.size() > 0);
|
||||
return enabled;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -248,7 +248,7 @@ public boolean setBlock(BlockVector3 location, BlockStateHolder block) throws Wo
|
||||
|
||||
@Override
|
||||
public Operation commitBefore() {
|
||||
if (!enabled) {
|
||||
if (!commitRequired()) {
|
||||
return null;
|
||||
}
|
||||
List<Operation> operations = new ArrayList<>();
|
||||
|
@ -114,12 +114,12 @@ public boolean setBlock(BlockVector3 location, BlockStateHolder block) throws Wo
|
||||
}
|
||||
|
||||
public boolean commitRequired() {
|
||||
return (enabled && !dirtyChunks.isEmpty()) || (postEditSimulation && !positions.isEmpty());
|
||||
return enabled || postEditSimulation;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Operation commitBefore() {
|
||||
if (!enabled && !postEditSimulation) {
|
||||
if (!commitRequired()) {
|
||||
return null;
|
||||
}
|
||||
return new Operation() {
|
||||
|
Loading…
Reference in New Issue
Block a user