Stop vines spreading when the spread_vines rule is off

VineBlock.randomTick only runs when GameRules.SPREAD_VINES is on; Horizon ignored the rule.
This commit is contained in:
Kacpherek
2026-10-27 22:31:17 +01:00
parent 3fe8aa76b2
commit 785d579f47
3 changed files with 5 additions and 1 deletions
+1
View File
@@ -992,6 +992,7 @@ impl Game<'_> {
spawn_mobs: r.bool("spawn_mobs"),
spawn_monsters: r.bool("spawn_monsters"),
fire_spread_radius_around_player: r.int("fire_spread_radius_around_player"),
spread_vines: r.bool("spread_vines"),
}
}
/// Apply rules mirrored in other state (natural regeneration, difficulty).
+2
View File
@@ -183,6 +183,7 @@ pub struct GameRules {
pub spawn_monsters: bool,
/// `fire_spread_radius_around_player`: -1 spreads everywhere.
pub fire_spread_radius_around_player: i32,
pub spread_vines: bool,
}
impl Default for GameRules {
fn default() -> Self {
@@ -196,6 +197,7 @@ impl Default for GameRules {
spawn_mobs: true,
spawn_monsters: true,
fire_spread_radius_around_player: 128,
spread_vines: true,
}
}
}
+2 -1
View File
@@ -1152,7 +1152,8 @@ impl<L: LevelAccess + ?Sized> Sim<'_, L> {
let b = self.b;
let p = b.props;
let block = b.block(state);
if self.rand_int(4) != 0 {
// The spread_vines rule, checked before the roll.
if !self.level.game_rules().spread_vines || self.rand_int(4) != 0 {
return;
}
let direction = Direction::ALL[self.rand_int(6) as usize];