Fix history height for MCPE

This commit is contained in:
Jesse Boyd 2016-09-05 16:32:42 +10:00
parent e610b2fabb
commit 56384ebba1

View File

@ -56,36 +56,36 @@ public class HistoryExtent extends AbstractDelegateExtent {
@Override
public boolean setBlock(int x, int y, int z, BaseBlock block) throws WorldEditException {
if (y > 255 || y < 0) {
return false;
}
int combined = queue.getCombinedId4DataDebug(x, y, z, 0, session);
int id = (combined >> 4);
if (id == block.getId()) {
if (!FaweCache.hasData(id)) {
return false;
if (extent.setBlock(x, y, z, block)) {
int combined = queue.getCombinedId4DataDebug(x, y, z, 0, session);
int id = (combined >> 4);
if (id == block.getId()) {
if (!FaweCache.hasData(id)) {
return false;
}
int data = combined & 0xF;
if (data == block.getData()) {
return false;
}
}
int data = combined & 0xF;
if (data == block.getData()) {
return false;
}
}
if (!FaweCache.hasNBT(id)) {
if (FaweCache.hasNBT(block.getId())) {
this.changeSet.add(x, y, z, combined, block);
if (!FaweCache.hasNBT(id)) {
if (FaweCache.hasNBT(block.getId())) {
this.changeSet.add(x, y, z, combined, block);
} else {
this.changeSet.add(x, y, z, combined, (block.getId() << 4) + block.getData());
}
} else {
this.changeSet.add(x, y, z, combined, (block.getId() << 4) + block.getData());
}
} else {
try {
CompoundTag tag = queue.getTileEntity(x, y, z);
this.changeSet.add(x, y, z, new BaseBlock(id, combined & 0xF, tag), block);
} catch (Throwable e) {
e.printStackTrace();
this.changeSet.add(x, y, z, combined, block);
try {
CompoundTag tag = queue.getTileEntity(x, y, z);
this.changeSet.add(x, y, z, new BaseBlock(id, combined & 0xF, tag), block);
} catch (Throwable e) {
e.printStackTrace();
this.changeSet.add(x, y, z, combined, block);
}
}
return true;
}
return extent.setBlock(x, y, z, block);
return false;
}
@Override