mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-01-09 17:27:38 +00:00
Fix repl
This commit is contained in:
parent
c220e30ecc
commit
8c30c72b73
@ -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) {
|
public boolean actPrimary(Platform server, LocalConfiguration config, Player player, LocalSession session, com.sk89q.worldedit.util.Location clicked) {
|
||||||
BlockBag bag = session.getBlockBag(player);
|
BlockBag bag = session.getBlockBag(player);
|
||||||
|
|
||||||
EditSession editSession = session.createEditSession(player);
|
try (EditSession editSession = session.createEditSession(player)) {
|
||||||
|
try {
|
||||||
try {
|
BlockVector3 position = clicked.toVector().toBlockPoint();
|
||||||
editSession.setBlock(clicked.toBlockPoint(), pattern);
|
editSession.setBlock(position, pattern.apply(position));
|
||||||
|
} catch (MaxChangedBlocksException ignored) {
|
||||||
|
} finally {
|
||||||
|
session.remember(editSession);
|
||||||
|
}
|
||||||
} finally {
|
} finally {
|
||||||
if (bag != null) {
|
if (bag != null) {
|
||||||
bag.flushChanges();
|
bag.flushChanges();
|
||||||
|
Loading…
Reference in New Issue
Block a user