fix paste tile npe

This commit is contained in:
Jesse Boyd 2019-11-29 02:56:07 +00:00
parent 0fcac39592
commit a36778794b
No known key found for this signature in database
GPG Key ID: 59F1DE6293AF6E1F
2 changed files with 6 additions and 0 deletions

View File

@ -96,6 +96,9 @@ public class BukkitGetBlocks_1_13 extends CharGetBlocks {
@Override @Override
public CompoundTag getTag(int x, int y, int z) { public CompoundTag getTag(int x, int y, int z) {
TileEntity tileEntity = getChunk().getTileEntity(new BlockPosition((x & 15) + (X << 4), y, (z & 15) + (Z << 4))); TileEntity tileEntity = getChunk().getTileEntity(new BlockPosition((x & 15) + (X << 4), y, (z & 15) + (Z << 4)));
if (tileEntity == null) {
return null;
}
return new LazyCompoundTag_1_13(Suppliers.memoize(() -> tileEntity.save(new NBTTagCompound()))); return new LazyCompoundTag_1_13(Suppliers.memoize(() -> tileEntity.save(new NBTTagCompound())));
} }

View File

@ -103,6 +103,9 @@ public class BukkitGetBlocks_1_14 extends CharGetBlocks {
@Override @Override
public CompoundTag getTag(int x, int y, int z) { public CompoundTag getTag(int x, int y, int z) {
TileEntity tileEntity = getChunk().getTileEntity(new BlockPosition((x & 15) + (X << 4), y, (z & 15) + (Z << 4))); TileEntity tileEntity = getChunk().getTileEntity(new BlockPosition((x & 15) + (X << 4), y, (z & 15) + (Z << 4)));
if (tileEntity == null) {
return null;
}
return new LazyCompoundTag_1_14(Suppliers.memoize(() -> tileEntity.save(new NBTTagCompound()))); return new LazyCompoundTag_1_14(Suppliers.memoize(() -> tileEntity.save(new NBTTagCompound())));
} }