mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-01-09 17:27:38 +00:00
Fixed block bags not being flushed in super pickaxe modes.
This commit is contained in:
parent
6adab71160
commit
3e8b2edff9
@ -20,6 +20,7 @@
|
|||||||
package com.sk89q.worldedit.superpickaxe;
|
package com.sk89q.worldedit.superpickaxe;
|
||||||
|
|
||||||
import com.sk89q.worldedit.*;
|
import com.sk89q.worldedit.*;
|
||||||
|
import com.sk89q.worldedit.bags.BlockBag;
|
||||||
import com.sk89q.worldedit.blocks.BaseBlock;
|
import com.sk89q.worldedit.blocks.BaseBlock;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -37,15 +38,17 @@ public class BlockReplacer implements SuperPickaxeMode {
|
|||||||
@Override
|
@Override
|
||||||
public boolean act(ServerInterface server, LocalConfiguration config,
|
public boolean act(ServerInterface server, LocalConfiguration config,
|
||||||
LocalPlayer player, LocalSession session, WorldVector clicked) {
|
LocalPlayer player, LocalSession session, WorldVector clicked) {
|
||||||
|
|
||||||
|
BlockBag bag = session.getBlockBag(player);
|
||||||
|
|
||||||
LocalWorld world = clicked.getWorld();
|
LocalWorld world = clicked.getWorld();
|
||||||
EditSession editSession = new EditSession(server, world, -1,
|
EditSession editSession = new EditSession(server, world, -1, bag);
|
||||||
session.getBlockBag(player));
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
editSession.setBlock(clicked, targetBlock);
|
editSession.setBlock(clicked, targetBlock);
|
||||||
} catch (MaxChangedBlocksException e) {
|
} catch (MaxChangedBlocksException e) {
|
||||||
} finally {
|
} finally {
|
||||||
|
bag.flushChanges();
|
||||||
session.remember(editSession);
|
session.remember(editSession);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
package com.sk89q.worldedit.superpickaxe;
|
package com.sk89q.worldedit.superpickaxe;
|
||||||
|
|
||||||
import com.sk89q.worldedit.*;
|
import com.sk89q.worldedit.*;
|
||||||
|
import com.sk89q.worldedit.bags.BlockBag;
|
||||||
import com.sk89q.worldedit.blocks.BaseBlock;
|
import com.sk89q.worldedit.blocks.BaseBlock;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -47,9 +48,11 @@ public class SphereBrush implements SuperPickaxeMode {
|
|||||||
player.printError("No block in sight!");
|
player.printError("No block in sight!");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BlockBag bag = session.getBlockBag(player);
|
||||||
|
|
||||||
ReplacingEditSession editSession = new ReplacingEditSession(server, target.getWorld(),
|
ReplacingEditSession editSession = new ReplacingEditSession(server, target.getWorld(),
|
||||||
session.getBlockChangeLimit(), session.getBlockBag(player));
|
session.getBlockChangeLimit(), bag);
|
||||||
|
|
||||||
if (nonReplacing) {
|
if (nonReplacing) {
|
||||||
editSession.disableReplacing();
|
editSession.disableReplacing();
|
||||||
@ -60,6 +63,7 @@ public class SphereBrush implements SuperPickaxeMode {
|
|||||||
} catch (MaxChangedBlocksException e) {
|
} catch (MaxChangedBlocksException e) {
|
||||||
player.printError("Max blocks change limit reached.");
|
player.printError("Max blocks change limit reached.");
|
||||||
} finally {
|
} finally {
|
||||||
|
bag.flushChanges();
|
||||||
editSession.enableReplacing();
|
editSession.enableReplacing();
|
||||||
session.remember(editSession);
|
session.remember(editSession);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user