Fix SchematicWorld NPE

This commit is contained in:
Snownee 2020-11-11 01:48:42 +08:00
parent 5bd6110d59
commit 85b3ab2025

View File

@ -87,8 +87,10 @@ public class SchematicWorld extends WrappedWorld {
BlockState blockState = getBlockState(pos); BlockState blockState = getBlockState(pos);
if (blockState.hasTileEntity()) { if (blockState.hasTileEntity()) {
TileEntity tileEntity = blockState.createTileEntity(this); TileEntity tileEntity = blockState.createTileEntity(this);
if (tileEntity != null) {
tileEntity.setLocation(this, pos); tileEntity.setLocation(this, pos);
tileEntities.put(pos, tileEntity); tileEntities.put(pos, tileEntity);
}
return tileEntity; return tileEntity;
} }
return null; return null;