mirror of
https://github.com/boy0001/FastAsyncWorldedit.git
synced 2024-11-24 11:36:52 +01:00
Allow EditSession construction with no allowed regions
Not sure why WorldEdit creates an EditSession for commands which clearly do not need one. This change now means players without an allowed region can use informational and navigation commands without a region. The error will be instead thrown when the EditSession is first used.
This commit is contained in:
parent
814ac60823
commit
46887623bc
@ -248,9 +248,6 @@ public class EditSession implements Extent {
|
||||
throw new FaweException(BBC.WORLDEDIT_CANCEL_REASON_LOW_MEMORY);
|
||||
}
|
||||
}
|
||||
if (allowedRegions != null && allowedRegions.length == 0) {
|
||||
throw new FaweException(BBC.WORLDEDIT_CANCEL_REASON_NO_REGION);
|
||||
}
|
||||
this.blockBag = blockBag;
|
||||
this.originalLimit = limit;
|
||||
this.limit = limit.copy();
|
||||
@ -273,7 +270,11 @@ public class EditSession implements Extent {
|
||||
}
|
||||
}
|
||||
if (allowedRegions != null) {
|
||||
this.extent = new ProcessedWEExtent(this.extent, allowedRegions, limit);
|
||||
if (allowedRegions.length == 0) {
|
||||
this.extent = new NullExtent(this.extent, BBC.NO_REGION);
|
||||
} else {
|
||||
this.extent = new ProcessedWEExtent(this.extent, allowedRegions, limit);
|
||||
}
|
||||
}
|
||||
this.extent = wrapExtent(this.extent, bus, event, Stage.BEFORE_HISTORY);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user