Pass LocalPlayers to the EditSession getters for easy external access
This commit is contained in:
@@ -136,14 +136,15 @@ public class LocalSession {
|
||||
* Performs an undo.
|
||||
*
|
||||
* @param newBlockBag
|
||||
* @param player
|
||||
* @return whether anything was undone
|
||||
*/
|
||||
public EditSession undo(BlockBag newBlockBag) {
|
||||
public EditSession undo(BlockBag newBlockBag, LocalPlayer player) {
|
||||
--historyPointer;
|
||||
if (historyPointer >= 0) {
|
||||
EditSession editSession = history.get(historyPointer);
|
||||
EditSession newEditSession = WorldEdit.getInstance().getEditSessionFactory()
|
||||
.getEditSession(editSession.getWorld(), -1, newBlockBag);
|
||||
.getEditSession(editSession.getWorld(), -1, newBlockBag, player);
|
||||
newEditSession.enableQueue();
|
||||
newEditSession.setFastMode(fastMode);
|
||||
editSession.undo(newEditSession);
|
||||
@@ -158,13 +159,14 @@ public class LocalSession {
|
||||
* Performs a redo
|
||||
*
|
||||
* @param newBlockBag
|
||||
* @param player
|
||||
* @return whether anything was redone
|
||||
*/
|
||||
public EditSession redo(BlockBag newBlockBag) {
|
||||
public EditSession redo(BlockBag newBlockBag, LocalPlayer player) {
|
||||
if (historyPointer < history.size()) {
|
||||
EditSession editSession = history.get(historyPointer);
|
||||
EditSession newEditSession = WorldEdit.getInstance().getEditSessionFactory()
|
||||
.getEditSession(editSession.getWorld(), -1, newBlockBag);
|
||||
.getEditSession(editSession.getWorld(), -1, newBlockBag, player);
|
||||
newEditSession.enableQueue();
|
||||
newEditSession.setFastMode(fastMode);
|
||||
editSession.redo(newEditSession);
|
||||
@@ -700,7 +702,7 @@ public class LocalSession {
|
||||
// Create an edit session
|
||||
EditSession editSession = WorldEdit.getInstance().getEditSessionFactory()
|
||||
.getEditSession(player.isPlayer() ? player.getWorld() : null,
|
||||
getBlockChangeLimit(), blockBag);
|
||||
getBlockChangeLimit(), blockBag, player);
|
||||
editSession.setFastMode(fastMode);
|
||||
if (mask != null) {
|
||||
mask.prepare(this, player, null);
|
||||
|
||||
Reference in New Issue
Block a user