mirror of
https://github.com/boy0001/FastAsyncWorldedit.git
synced 2024-11-25 03:55:35 +01:00
Possibly fixes #335
This commit is contained in:
parent
bbb6346aff
commit
b71c3ec43e
@ -46,7 +46,9 @@ public class Reload extends FaweCommand {
|
||||
Fawe.debug(elem);
|
||||
}
|
||||
}
|
||||
player.sendMessage("&cSee console.");
|
||||
if (player != null) {
|
||||
player.sendMessage("&cSee console.");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
case "debugpaste":
|
||||
|
@ -87,6 +87,16 @@ public class CPUOptimizedChangeSet extends FaweChangeSet {
|
||||
return changes.iterator();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEmpty() {
|
||||
if (changes.size() == 0) {
|
||||
flush();
|
||||
return changes.size() == 0;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int size() {
|
||||
return changes.size() * 65536; // num chunks * 65536 (guess of 65536 changes per chunk)
|
||||
|
@ -170,6 +170,10 @@ public abstract class FaweChangeSet implements ChangeSet {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return size() == 0;
|
||||
}
|
||||
|
||||
public void add(int x, int y, int z, int combinedFrom, BaseBlock to) {
|
||||
try {
|
||||
if (to.hasNbtData()) {
|
||||
|
@ -221,6 +221,15 @@ public abstract class FaweStreamChangeSet extends FaweChangeSet {
|
||||
return MainUtil.getCompressedOS(os, compression);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEmpty() {
|
||||
if (blockSize > 0) {
|
||||
return false;
|
||||
}
|
||||
flush();
|
||||
return blockSize == 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int size() {
|
||||
// Flush so we can accurately get the size
|
||||
|
@ -449,7 +449,7 @@ public class LocalSession {
|
||||
return;
|
||||
}
|
||||
FaweChangeSet changeSet = (FaweChangeSet) editSession.getChangeSet();
|
||||
if (changeSet.size() == 0) {
|
||||
if (changeSet.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
FawePlayer fp = editSession.getPlayer();
|
||||
|
@ -300,7 +300,7 @@ public class Sniper {
|
||||
if (clickedBlock != null) {
|
||||
targetBlock = clickedBlock;
|
||||
lastBlock = clickedBlock.getRelative(clickedFace);
|
||||
if (lastBlock == null) {
|
||||
if (lastBlock == null || targetBlock == null) {
|
||||
getPlayer().sendMessage(ChatColor.RED + "Snipe target block must be visible.");
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user