geforkt von Mirrors/FastAsyncWorldEdit
Fixed block bags not being flushed in super pickaxe modes.
Dieser Commit ist enthalten in:
Ursprung
6adab71160
Commit
3e8b2edff9
@ -20,6 +20,7 @@
|
||||
package com.sk89q.worldedit.superpickaxe;
|
||||
|
||||
import com.sk89q.worldedit.*;
|
||||
import com.sk89q.worldedit.bags.BlockBag;
|
||||
import com.sk89q.worldedit.blocks.BaseBlock;
|
||||
|
||||
/**
|
||||
@ -38,14 +39,16 @@ public class BlockReplacer implements SuperPickaxeMode {
|
||||
public boolean act(ServerInterface server, LocalConfiguration config,
|
||||
LocalPlayer player, LocalSession session, WorldVector clicked) {
|
||||
|
||||
BlockBag bag = session.getBlockBag(player);
|
||||
|
||||
LocalWorld world = clicked.getWorld();
|
||||
EditSession editSession = new EditSession(server, world, -1,
|
||||
session.getBlockBag(player));
|
||||
EditSession editSession = new EditSession(server, world, -1, bag);
|
||||
|
||||
try {
|
||||
editSession.setBlock(clicked, targetBlock);
|
||||
} catch (MaxChangedBlocksException e) {
|
||||
} finally {
|
||||
bag.flushChanges();
|
||||
session.remember(editSession);
|
||||
}
|
||||
|
||||
|
@ -20,6 +20,7 @@
|
||||
package com.sk89q.worldedit.superpickaxe;
|
||||
|
||||
import com.sk89q.worldedit.*;
|
||||
import com.sk89q.worldedit.bags.BlockBag;
|
||||
import com.sk89q.worldedit.blocks.BaseBlock;
|
||||
|
||||
/**
|
||||
@ -48,8 +49,10 @@ public class SphereBrush implements SuperPickaxeMode {
|
||||
return true;
|
||||
}
|
||||
|
||||
BlockBag bag = session.getBlockBag(player);
|
||||
|
||||
ReplacingEditSession editSession = new ReplacingEditSession(server, target.getWorld(),
|
||||
session.getBlockChangeLimit(), session.getBlockBag(player));
|
||||
session.getBlockChangeLimit(), bag);
|
||||
|
||||
if (nonReplacing) {
|
||||
editSession.disableReplacing();
|
||||
@ -60,6 +63,7 @@ public class SphereBrush implements SuperPickaxeMode {
|
||||
} catch (MaxChangedBlocksException e) {
|
||||
player.printError("Max blocks change limit reached.");
|
||||
} finally {
|
||||
bag.flushChanges();
|
||||
editSession.enableReplacing();
|
||||
session.remember(editSession);
|
||||
}
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren