mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-01-09 17:27:38 +00:00
Fix #1217
This commit is contained in:
parent
29bebcd034
commit
4050cf238f
@ -576,7 +576,10 @@ public class LocalSession implements TextureHolder {
|
|||||||
public EditSession undo(@Nullable BlockBag newBlockBag, Actor actor) {
|
public EditSession undo(@Nullable BlockBag newBlockBag, Actor actor) {
|
||||||
checkNotNull(actor);
|
checkNotNull(actor);
|
||||||
//FAWE start - use our logic
|
//FAWE start - use our logic
|
||||||
World world = ((Player) actor).getWorldForEditing();
|
World world = (actor instanceof Player) ? ((Player) actor).getWorldForEditing() : getWorldOverride();
|
||||||
|
if (world == null) {
|
||||||
|
throw new MissingWorldException();
|
||||||
|
}
|
||||||
loadSessionHistoryFromDisk(actor.getUniqueId(), world);
|
loadSessionHistoryFromDisk(actor.getUniqueId(), world);
|
||||||
if (getHistoryNegativeIndex() < history.size()) {
|
if (getHistoryNegativeIndex() < history.size()) {
|
||||||
ChangeSet changeSet = getChangeSet(history.get(getHistoryIndex()));
|
ChangeSet changeSet = getChangeSet(history.get(getHistoryIndex()));
|
||||||
@ -617,7 +620,10 @@ public class LocalSession implements TextureHolder {
|
|||||||
//FAWE start - use our logic
|
//FAWE start - use our logic
|
||||||
public EditSession redo(@Nullable BlockBag newBlockBag, Actor actor) {
|
public EditSession redo(@Nullable BlockBag newBlockBag, Actor actor) {
|
||||||
checkNotNull(actor);
|
checkNotNull(actor);
|
||||||
World world = ((Player) actor).getWorldForEditing();
|
World world = (actor instanceof Player) ? ((Player) actor).getWorldForEditing() : getWorldOverride();
|
||||||
|
if (world == null) {
|
||||||
|
throw new MissingWorldException();
|
||||||
|
}
|
||||||
loadSessionHistoryFromDisk(actor.getUniqueId(), world);
|
loadSessionHistoryFromDisk(actor.getUniqueId(), world);
|
||||||
if (getHistoryNegativeIndex() > 0) {
|
if (getHistoryNegativeIndex() > 0) {
|
||||||
setDirty();
|
setDirty();
|
||||||
|
Loading…
Reference in New Issue
Block a user