mirror of
https://github.com/boy0001/FastAsyncWorldedit.git
synced 2024-11-28 21:56:33 +01:00
Fixes #309
This commit is contained in:
parent
f9ee91f192
commit
6d52e47d3f
@ -83,6 +83,7 @@ public class Sniper {
|
||||
|
||||
// Added
|
||||
public AsyncWorld getWorld() {
|
||||
synchronized (this) {
|
||||
if (permanentWorld == null) {
|
||||
permanentWorld = new AsyncWorld(null, null);
|
||||
}
|
||||
@ -104,6 +105,13 @@ public class Sniper {
|
||||
}
|
||||
return permanentWorld;
|
||||
}
|
||||
}
|
||||
|
||||
public void resetMask() {
|
||||
synchronized (this) {
|
||||
maskQueue = null;
|
||||
}
|
||||
}
|
||||
|
||||
public Player getPlayer() {
|
||||
return Bukkit.getPlayer(player);
|
||||
@ -122,7 +130,7 @@ public class Sniper {
|
||||
try {
|
||||
Player player = getPlayer();
|
||||
FawePlayer<Player> fp = FawePlayer.wrap(player);
|
||||
maskQueue = null;
|
||||
resetMask();
|
||||
if (clickedBlock != null) {
|
||||
clickedBlock = getWorld().getBlockAt(clickedBlock.getX(), clickedBlock.getY(), clickedBlock.getZ());
|
||||
}
|
||||
@ -296,7 +304,7 @@ public class Sniper {
|
||||
performerBrush.initP(snipeData);
|
||||
}
|
||||
final FawePlayer<Player> fp = FawePlayer.wrap(getPlayer());
|
||||
fp.runAction(new RunnableVal<Boolean>() {
|
||||
fp.runAsyncIfFree(new RunnableVal<Boolean>() {
|
||||
@Override
|
||||
public void run(Boolean value) {
|
||||
boolean result = brush.perform(snipeAction, snipeData, targetBlock, lastBlock);
|
||||
@ -305,7 +313,7 @@ public class Sniper {
|
||||
}
|
||||
world.commit();
|
||||
}
|
||||
}, true, true);
|
||||
});
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -375,6 +383,7 @@ public class Sniper {
|
||||
}
|
||||
|
||||
public void storeUndo(Undo undo) {
|
||||
synchronized (this) {
|
||||
if (changeQueue != null) {
|
||||
FaweChangeSet changeSet = changeQueue.getChangeSet();
|
||||
FawePlayer<Object> fp = FawePlayer.wrap(getPlayer());
|
||||
@ -389,6 +398,7 @@ public class Sniper {
|
||||
changeQueue = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void undo() {
|
||||
undo(1);
|
||||
|
Loading…
Reference in New Issue
Block a user