mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-01 02:46:41 +00:00
Flush or disable buffers in tools
This commit is contained in:
@ -460,7 +460,7 @@ public class UtilityCommands {
|
||||
|
||||
if (editSession != null) {
|
||||
session.remember(editSession);
|
||||
editSession.flushQueue();
|
||||
editSession.flushSession();
|
||||
}
|
||||
}
|
||||
|
||||
@ -520,7 +520,7 @@ public class UtilityCommands {
|
||||
|
||||
if (editSession != null) {
|
||||
session.remember(editSession);
|
||||
editSession.flushQueue();
|
||||
editSession.flushSession();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -83,7 +83,7 @@ public class AreaPickaxe implements BlockTool {
|
||||
} catch (MaxChangedBlocksException e) {
|
||||
player.printError("Max blocks change limit reached.");
|
||||
} finally {
|
||||
editSession.flushQueue();
|
||||
editSession.flushSession();
|
||||
session.remember(editSession);
|
||||
}
|
||||
|
||||
|
@ -53,16 +53,17 @@ public class BlockReplacer implements DoubleActionBlockTool {
|
||||
BlockBag bag = session.getBlockBag(player);
|
||||
|
||||
EditSession editSession = session.createEditSession(player);
|
||||
editSession.disableBuffering();
|
||||
|
||||
try {
|
||||
Vector position = clicked.toVector();
|
||||
editSession.setBlock(position, pattern.apply(position));
|
||||
} catch (MaxChangedBlocksException ignored) {
|
||||
} finally {
|
||||
session.remember(editSession);
|
||||
if (bag != null) {
|
||||
bag.flushChanges();
|
||||
}
|
||||
session.remember(editSession);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -193,10 +193,11 @@ public class BrushTool implements TraceTool {
|
||||
} catch (MaxChangedBlocksException e) {
|
||||
player.printError("Max blocks change limit reached.");
|
||||
} finally {
|
||||
session.remember(editSession);
|
||||
editSession.flushSession();
|
||||
if (bag != null) {
|
||||
bag.flushChanges();
|
||||
}
|
||||
session.remember(editSession);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -75,7 +75,7 @@ public class RecursivePickaxe implements BlockTool {
|
||||
} catch (MaxChangedBlocksException e) {
|
||||
player.printError("Max blocks change limit reached.");
|
||||
} finally {
|
||||
editSession.flushQueue();
|
||||
editSession.flushSession();
|
||||
session.remember(editSession);
|
||||
}
|
||||
|
||||
|
@ -57,7 +57,7 @@ public class SinglePickaxe implements BlockTool {
|
||||
} catch (MaxChangedBlocksException e) {
|
||||
player.printError("Max blocks change limit reached.");
|
||||
} finally {
|
||||
editSession.flushQueue();
|
||||
editSession.flushSession();
|
||||
}
|
||||
|
||||
world.playEffect(clicked.toVector(), 2001, blockType.getLegacyId());
|
||||
|
Reference in New Issue
Block a user