Botania

Botania

133M Downloads

TileSpecialFlower logic is broken for enchanted soil

SquidDev opened this issue · 2 comments

commented

The checks for enchanted soil are broken, meaning overgrowthBoost will always be false and onUpdate is executed twice. It should probably be:

boolean special = isOnSpecialSoil();
boolean special = isOnSpecialSoil();
if(special) {
    subTile.overgrowth = true;
    subTile.onUpdate();
    if(subTile.isOvergrowthAffected())
        subTile.overgrowthBoost = true;

} else {
    subTile.onUpdate();
    subTile.overgrowth = false;
    subTile.overgrowthBoost = false;
}
commented

No, that looks right to me...
On Thu, Jan 7, 2016 at 5:57 AM SquidDev [email protected] wrote:

The checks for enchanted soil
https://github.com/Vazkii/Botania/blob/master/src/main/java/vazkii/botania/common/block/tile/TileSpecialFlower.java#L93-L103
are broken, meaning overgrowthBoost will always be false and onUpdate is
executed twice. It should probably be:

boolean special = isOnSpecialSoil();
boolean special = isOnSpecialSoil();
if(special) {
subTile.overgrowth = true;
subTile.onUpdate();
if(subTile.isOvergrowthAffected())
subTile.overgrowthBoost = true;

} else {
subTile.onUpdate();
subTile.overgrowth = false;
subTile.overgrowthBoost = false;
}


Reply to this email directly or view it on GitHub
#1720.

commented

Same here, looks right to me. It checks if its on Enchanted Soil, if it is then it checks if its allowed to be boosted and runs an update if it is, then carries on to run the standard update that should be run anyway.