mirror of
https://github.com/EngineHub/WorldEdit.git
synced 2024-12-15 04:41:37 +08:00
Merge pull request #434 from sk89q/bugfix/flushing-when-done-2
Flush / unbuffer more tools
This commit is contained in:
commit
d7c528247b
@ -79,7 +79,8 @@ private boolean handleCycle(Platform server, LocalConfiguration config,
|
||||
index = (index + 1) % currentProperty.getValues().size();
|
||||
BlockState newBlock = block.with(currentProperty, currentProperty.getValues().get(index));
|
||||
|
||||
EditSession editSession = session.createEditSession(player);
|
||||
try (EditSession editSession = session.createEditSession(player)) {
|
||||
editSession.disableBuffering();
|
||||
|
||||
try {
|
||||
editSession.setBlock(clicked.toVector(), newBlock);
|
||||
@ -89,6 +90,7 @@ private boolean handleCycle(Platform server, LocalConfiguration config,
|
||||
} finally {
|
||||
session.remember(editSession);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
List<Property<?>> properties = Lists.newArrayList(block.getStates().keySet());
|
||||
int index = properties.indexOf(currentProperty);
|
||||
|
@ -76,8 +76,7 @@ public boolean actPrimary(Platform server, LocalConfiguration config,
|
||||
return true;
|
||||
}
|
||||
|
||||
final EditSession editSession = session.createEditSession(player);
|
||||
|
||||
try (EditSession editSession = session.createEditSession(player)) {
|
||||
try {
|
||||
final Set<Vector> blockSet = bfs(world, clicked.toVector());
|
||||
if (blockSet == null) {
|
||||
@ -96,6 +95,7 @@ public boolean actPrimary(Platform server, LocalConfiguration config,
|
||||
} finally {
|
||||
session.remember(editSession);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -69,8 +69,7 @@ public boolean actPrimary(Platform server, LocalConfiguration config, Player pla
|
||||
return true;
|
||||
}
|
||||
|
||||
EditSession editSession = session.createEditSession(player);
|
||||
|
||||
try (EditSession editSession = session.createEditSession(player)) {
|
||||
try {
|
||||
recurse(editSession, clicked.toVector().toBlockVector(),
|
||||
clicked.toVector(), range, initialType, new HashSet<>());
|
||||
@ -79,6 +78,7 @@ public boolean actPrimary(Platform server, LocalConfiguration config, Player pla
|
||||
} finally {
|
||||
session.remember(editSession);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -53,8 +53,8 @@ public boolean canUse(Actor player) {
|
||||
public boolean actSecondary(Platform server, LocalConfiguration config, Player player, LocalSession session) {
|
||||
Location pos = getTargetFace(player);
|
||||
if (pos == null) return false;
|
||||
EditSession eS = session.createEditSession(player);
|
||||
try {
|
||||
try (EditSession eS = session.createEditSession(player)) {
|
||||
eS.disableBuffering();
|
||||
BlockStateHolder applied = secondary.apply(pos.toVector());
|
||||
if (applied.getBlockType().getMaterial().isAir()) {
|
||||
eS.setBlock(pos.toVector(), secondary);
|
||||
@ -73,8 +73,8 @@ public boolean actSecondary(Platform server, LocalConfiguration config, Player p
|
||||
public boolean actPrimary(Platform server, LocalConfiguration config, Player player, LocalSession session) {
|
||||
Location pos = getTargetFace(player);
|
||||
if (pos == null) return false;
|
||||
EditSession eS = session.createEditSession(player);
|
||||
try {
|
||||
try (EditSession eS = session.createEditSession(player)) {
|
||||
eS.disableBuffering();
|
||||
BlockStateHolder applied = primary.apply(pos.toVector());
|
||||
if (applied.getBlockType().getMaterial().isAir()) {
|
||||
eS.setBlock(pos.toVector(), primary);
|
||||
|
@ -48,8 +48,7 @@ public boolean canUse(Actor player) {
|
||||
@Override
|
||||
public boolean actPrimary(Platform server, LocalConfiguration config, Player player, LocalSession session, Location clicked) {
|
||||
|
||||
EditSession editSession = session.createEditSession(player);
|
||||
|
||||
try (EditSession editSession = session.createEditSession(player)) {
|
||||
try {
|
||||
boolean successful = false;
|
||||
|
||||
@ -68,6 +67,7 @@ public boolean actPrimary(Platform server, LocalConfiguration config, Player pla
|
||||
} finally {
|
||||
session.remember(editSession);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user