mirror of
https://github.com/horizon-rust/horizon.git
synced 2026-11-07 11:06:11 -10:00
Merge pull request #10094 from DUzzL/fix/10045-enderman-anger-harming
Splash of harming makes endermen teleport instead of hurting them
This commit is contained in:
1 file changed
+8
-1
@@ -1987,7 +1987,14 @@ impl Game<'_> {
|
||||
}
|
||||
};
|
||||
let m = &mut self.mobs[i];
|
||||
if harm {
|
||||
if harm && m.species() == horizon_client::mobs::Species::Enderman {
|
||||
// `Enderman.hurtServer` for a thrown potion: only water hurts
|
||||
// (`hurtWithCleanWater`), then `repeatedlyTryToTeleport`, which
|
||||
// the AI step runs and which does nothing while it rides.
|
||||
if m.alive() && !m.extra.passenger {
|
||||
m.extra.counter2 = 64;
|
||||
}
|
||||
} else if harm {
|
||||
// HealOrHarmMobEffect.applyInstantaneousEffect: indirectMagic(potion, owner).
|
||||
let harm = (intensity * f64::from(6 << amp) + 0.5) as i32 as f32;
|
||||
let source = Damage::indirect_magic(owner.who(), [at.x, at.y, at.z]);
|
||||
|
||||
Reference in new issue
Block a user