mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-22 17:27:38 +00:00
Added a workaround for onBlockDestroy providing (0, 0, 0). Setting air no longer sets the data.
This commit is contained in:
parent
9e9cd627a3
commit
c947083640
@ -113,20 +113,23 @@ public class EditSession {
|
||||
*/
|
||||
private boolean rawSetBlock(Vector pt, BaseBlock block) {
|
||||
boolean result = server.setBlockType(pt, block.getID());
|
||||
// Changes in block data don't take effect if the block type doesn't
|
||||
// change, so here's a hack!
|
||||
if (!result && block.getID() != 0) {
|
||||
server.setBlockType(pt, 0);
|
||||
result = server.setBlockType(pt, block.getID());
|
||||
}
|
||||
server.setBlockData(pt, block.getData());
|
||||
if (block.getID() != 0) {
|
||||
// Changes in block data don't take effect if the block type doesn't
|
||||
// change, so here's a hack!
|
||||
if (!result) {
|
||||
server.setBlockType(pt, 0);
|
||||
result = server.setBlockType(pt, block.getID());
|
||||
}
|
||||
server.setBlockData(pt, block.getData());
|
||||
|
||||
// Signs
|
||||
if (block instanceof SignBlock) {
|
||||
SignBlock signBlock = (SignBlock)block;
|
||||
String[] text = signBlock.getText();
|
||||
server.setSignText(pt, text);
|
||||
// Signs
|
||||
if (block instanceof SignBlock) {
|
||||
SignBlock signBlock = (SignBlock)block;
|
||||
String[] text = signBlock.getText();
|
||||
server.setSignText(pt, text);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -92,6 +92,12 @@ public class SMWorldEditListener extends PluginListener {
|
||||
blockClicked.getY(),
|
||||
blockClicked.getZ());
|
||||
|
||||
// Bug workaround
|
||||
if (cur.getBlockX() == 0 && cur.getBlockY() == 0
|
||||
&& cur.getBlockZ() == 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
try {
|
||||
if (session.getPos1().equals(cur)) {
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user