use of forestry.core.owner.IOwnedTile in project Binnie by ForestryMC.
the class GardenLogic method trySetCrop.
private boolean trySetCrop(World world, BlockPos position, FarmDirection direction, IFarmHousing housing) {
for (IFarmable farmable : farmables) {
if (!housing.plantGermling(farmable, world, position, direction)) {
continue;
}
if (housing instanceof IOwnedTile) {
TileEntity tile = world.getTileEntity(position);
if (tile instanceof TileEntityFlower) {
TileEntityFlower flower = (TileEntityFlower) tile;
IOwnedTile owned = (IOwnedTile) housing;
flower.setOwner(owned.getOwnerHandler().getOwner());
}
}
return true;
}
return false;
}
Aggregations