Use the mob's own chunk for its local difficulty
This commit is contained in:
@@ -549,6 +549,9 @@ impl Game<'_> {
|
||||
..base.clone()
|
||||
};
|
||||
let m = &mut mobs[i];
|
||||
// getCurrentDifficultyAt(blockPosition()): the mob's own chunk,
|
||||
// not the local player's (a server thread has no player).
|
||||
w.difficulty = self.local_difficulty([m.position.x, m.position.y, m.position.z]);
|
||||
w.nearest_player = super::natural_spawning::nearest_player(
|
||||
&players,
|
||||
m.position.x,
|
||||
|
||||
@@ -1503,7 +1503,8 @@ pub struct MobWorld<'a> {
|
||||
pub biomes: &'a crate::biome::Biomes,
|
||||
/// The `mob_griefing` game rule.
|
||||
pub mob_griefing: bool,
|
||||
/// `getCurrentDifficultyAt` near the player.
|
||||
/// `getCurrentDifficultyAt` at the mob being ticked (near the player
|
||||
/// outside the mob tick).
|
||||
pub difficulty: spawning::LocalDifficulty,
|
||||
/// The End (its dimension type's monster spawn light rules).
|
||||
pub end: bool,
|
||||
|
||||
Reference in New Issue
Block a user