Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-09-06 16:12:51 +02:00
Apply watchdog mode to undo/redo. Abstract EditSession creation logic.
Dieser Commit ist enthalten in:
Ursprung
3093c45675
Commit
91f92a46fe
@ -239,12 +239,7 @@ public class LocalSession {
|
|||||||
EditSession editSession = history.get(historyPointer);
|
EditSession editSession = history.get(historyPointer);
|
||||||
try (EditSession newEditSession = WorldEdit.getInstance().getEditSessionFactory()
|
try (EditSession newEditSession = WorldEdit.getInstance().getEditSessionFactory()
|
||||||
.getEditSession(editSession.getWorld(), -1, newBlockBag, actor)) {
|
.getEditSession(editSession.getWorld(), -1, newBlockBag, actor)) {
|
||||||
newEditSession.enableStandardMode();
|
prepareEditingExtents(editSession, actor);
|
||||||
newEditSession.setReorderMode(reorderMode);
|
|
||||||
newEditSession.setFastMode(fastMode);
|
|
||||||
if (newEditSession.getSurvivalExtent() != null) {
|
|
||||||
newEditSession.getSurvivalExtent().setStripNbt(!actor.hasPermission("worldedit.setnbt"));
|
|
||||||
}
|
|
||||||
editSession.undo(newEditSession);
|
editSession.undo(newEditSession);
|
||||||
}
|
}
|
||||||
return editSession;
|
return editSession;
|
||||||
@ -267,12 +262,7 @@ public class LocalSession {
|
|||||||
EditSession editSession = history.get(historyPointer);
|
EditSession editSession = history.get(historyPointer);
|
||||||
try (EditSession newEditSession = WorldEdit.getInstance().getEditSessionFactory()
|
try (EditSession newEditSession = WorldEdit.getInstance().getEditSessionFactory()
|
||||||
.getEditSession(editSession.getWorld(), -1, newBlockBag, actor)) {
|
.getEditSession(editSession.getWorld(), -1, newBlockBag, actor)) {
|
||||||
newEditSession.enableStandardMode();
|
prepareEditingExtents(editSession, actor);
|
||||||
newEditSession.setReorderMode(reorderMode);
|
|
||||||
newEditSession.setFastMode(fastMode);
|
|
||||||
if (newEditSession.getSurvivalExtent() != null) {
|
|
||||||
newEditSession.getSurvivalExtent().setStripNbt(!actor.hasPermission("worldedit.setnbt"));
|
|
||||||
}
|
|
||||||
editSession.redo(newEditSession);
|
editSession.redo(newEditSession);
|
||||||
}
|
}
|
||||||
++historyPointer;
|
++historyPointer;
|
||||||
@ -954,15 +944,19 @@ public class LocalSession {
|
|||||||
}
|
}
|
||||||
Request.request().setEditSession(editSession);
|
Request.request().setEditSession(editSession);
|
||||||
|
|
||||||
|
editSession.setMask(mask);
|
||||||
|
prepareEditingExtents(editSession, actor);
|
||||||
|
|
||||||
|
return editSession;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void prepareEditingExtents(EditSession editSession, Actor actor) {
|
||||||
editSession.setFastMode(fastMode);
|
editSession.setFastMode(fastMode);
|
||||||
editSession.setReorderMode(reorderMode);
|
editSession.setReorderMode(reorderMode);
|
||||||
editSession.setMask(mask);
|
|
||||||
if (editSession.getSurvivalExtent() != null) {
|
if (editSession.getSurvivalExtent() != null) {
|
||||||
editSession.getSurvivalExtent().setStripNbt(!actor.hasPermission("worldedit.setnbt"));
|
editSession.getSurvivalExtent().setStripNbt(!actor.hasPermission("worldedit.setnbt"));
|
||||||
}
|
}
|
||||||
editSession.setTickingWatchdog(tickingWatchdog);
|
editSession.setTickingWatchdog(tickingWatchdog);
|
||||||
|
|
||||||
return editSession;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren