use of binnie.botany.api.gardening.EnumSoilType in project Binnie by ForestryMC.
the class BlockSoil method degrade.
@Override
public boolean degrade(World world, BlockPos pos, EnumSoilType minLevel) {
EnumSoilType type = getType(world, pos);
if (type.ordinal() <= minLevel.ordinal()) {
return false;
}
IBlockState old = world.getBlockState(pos);
IBlockState newState = BotanyCore.getGardening().getSoil(minLevel, weedKilled, old.getValue(MOISTURE), old.getValue(ACIDITY));
return world.setBlockState(pos, newState, 2);
}
use of binnie.botany.api.gardening.EnumSoilType in project Binnie by ForestryMC.
the class TileEntityFlower method checkIfDead.
public boolean checkIfDead(boolean wasCut) {
if (getSection() != 0) {
return getRoot().checkIfDead(wasCut);
}
EnumSoilType soil = BotanyCore.getGardening().getSoilType(world, pos);
int maxAge = (int) (flower.getMaxAge() * (1.0f + soil.ordinal() * 0.25f));
if (flower.getAge() > maxAge) {
if (!wasCut && flower.getMate() != null) {
world.setBlockToAir(pos);
IFlower offspring = flower.getOffspring(world, pos.down());
TileEntity above = world.getTileEntity(pos.up());
if (above instanceof TileEntityFlower) {
world.setBlockToAir(pos.up());
}
BotanyCore.getFlowerRoot().plant(world, pos, offspring, getOwner());
} else {
kill();
}
return true;
}
return false;
}
Aggregations