use of com.minecolonies.coremod.tileentities.TileEntityWareHouse in project minecolonies by Minecolonies.
the class BuildingWareHouse method getTileEntity.
/**
* Returns the tile entity that belongs to the colony building.
*
* @return {@link TileEntityColonyBuilding} object of the building.
*/
@Override
public TileEntityWareHouse getTileEntity() {
final Colony colony = getColony();
if ((tileEntity == null || tileEntity.isInvalid()) && colony != null && colony.getWorld().getBlockState(this.getLocation()).getBlock() != null) {
final TileEntity te = getColony().getWorld().getTileEntity(this.getLocation());
if (te instanceof TileEntityWareHouse) {
tileEntity = (TileEntityWareHouse) te;
if (tileEntity.getBuilding() == null) {
tileEntity.setColony(colony);
tileEntity.setBuilding(this);
}
}
}
return tileEntity;
}
Aggregations