This commit is contained in:
Jesse Boyd 2019-04-16 13:08:57 +10:00
parent c220e30ecc
commit 8c30c72b73
No known key found for this signature in database
GPG Key ID: 59F1DE6293AF6E1F

View File

@ -54,10 +54,14 @@ public class BlockReplacer implements DoubleActionBlockTool {
public boolean actPrimary(Platform server, LocalConfiguration config, Player player, LocalSession session, com.sk89q.worldedit.util.Location clicked) {
BlockBag bag = session.getBlockBag(player);
EditSession editSession = session.createEditSession(player);
try {
editSession.setBlock(clicked.toBlockPoint(), pattern);
try (EditSession editSession = session.createEditSession(player)) {
try {
BlockVector3 position = clicked.toVector().toBlockPoint();
editSession.setBlock(position, pattern.apply(position));
} catch (MaxChangedBlocksException ignored) {
} finally {
session.remember(editSession);
}
} finally {
if (bag != null) {
bag.flushChanges();