Remove stub injector methods

This commit is contained in:
Jesse Boyd
2018-08-13 02:36:39 +10:00
parent fa06ff357e
commit e7c27b08bf
124 changed files with 241 additions and 411 deletions

View File

@ -36,6 +36,6 @@ public interface Chunk {
* @return block the block
* @throws DataException thrown on data error
*/
BaseBlock getBlock(Vector position) throws DataException;
BlockState getBlock(Vector position) throws DataException;
}

View File

@ -155,8 +155,8 @@ public class OldChunk implements Chunk {
}
@Override
public BaseBlock getBlock(Vector position) throws DataException {
if(position.getBlockY() >= 128) new BaseBlock(BlockTypes.AIR);
public BlockState getBlock(Vector position) throws DataException {
if(position.getBlockY() >= 128) return BlockTypes.AIR.getDefaultState();
int id, dataVal;
int x = position.getBlockX() - rootX * 16;
@ -183,9 +183,11 @@ public class OldChunk implements Chunk {
}
BlockState state = LegacyMapper.getInstance().getBlockFromLegacy(id, dataVal);
CompoundTag tileEntity = getBlockTileEntity(position);
return new BaseBlock(state, tileEntity);
if (state.getBlockType().getMaterial().hasContainer()) {
CompoundTag tileEntity = getBlockTileEntity(position);
if (tileEntity != null) return new BaseBlock(state, tileEntity);
}
return state;
}
}