Fixed zap apple trees not progressing

This commit is contained in:
Sollace 2023-08-04 18:28:35 +01:00
parent 97f56ea4ed
commit 7868db90b5
No known key found for this signature in database
GPG key ID: E52FACE7B5C773DB
2 changed files with 4 additions and 3 deletions

View file

@ -26,10 +26,11 @@ public class ZapAppleLeavesPlaceholderBlock extends AirBlock {
ZapAppleStageStore store = ZapAppleStageStore.get(world);
ZapAppleStageStore.Stage newStage = store.getStage();
if (!world.isDay() && ZapAppleStageStore.Stage.HIBERNATING.mustChangeIntoInstantly(newStage)) {
world.setBlockState(pos, newStage.getNewState(state));
state = newStage.getNewState(state);
world.setBlockState(pos, state);
BaseZapAppleLeavesBlock.onStageChanged(store, newStage, world, state, pos, random);
}
world.scheduleBlockTick(pos, this, 1);
world.scheduleBlockTick(pos, state.getBlock(), 1);
}
}

View file

@ -171,7 +171,7 @@ public class ZapAppleStageStore extends PersistentState implements Tickable {
if (this == ZapAppleStageStore.Stage.FLOWERING) {
return UBlocks.FLOWERING_ZAP_LEAVES.getDefaultState();
}
return currentState.withIfExists(ZapAppleLeavesBlock.STAGE, this);
return UBlocks.FLOWERING_ZAP_LEAVES.getDefaultState().withIfExists(ZapAppleLeavesBlock.STAGE, this);
}
@Override