Use the real local difficulty for the phantom spawn check
The phantom spawn gate assumed a fixed effective difficulty of 2. Use the local difficulty at the player instead, so easy, hard, a long-played chunk and the moon phase change how often phantoms spawn.
This commit is contained in:
@@ -366,9 +366,10 @@ impl Game<'_> {
|
||||
if pos[1] < 63 || !self.can_see_sky(pos) {
|
||||
return;
|
||||
}
|
||||
// DifficultyInstance.isHarderThan(random * 3) at normal difficulty.
|
||||
// `getCurrentDifficultyAt(playerPos).isHarderThan(random * 3)`.
|
||||
let difficulty = self.local_difficulty([position.x, position.y, position.z]);
|
||||
let r = &mut self.world.random;
|
||||
if r.next_float() * 3.0 >= 2.0 {
|
||||
if difficulty.effective <= r.next_float() * 3.0 {
|
||||
return;
|
||||
}
|
||||
if r.next_int_bound(since_rest.max(1)).unwrap_or(0) < 72000 {
|
||||
|
||||
Reference in New Issue
Block a user