Use exploding sheep as source for explosion.
Makes the sheep entity the source of the explosion that's created when it triggers close to a player. This, in turn, makes the damage event listener handle the explosion damage as if the sheep is the damager, which means it will respect the `monster-infight` flag. Fixes #758
This commit is contained in:
@@ -74,7 +74,7 @@ public class SheepBouncer implements Runnable
|
||||
// Create an explosion if there's a player amongst the nearby entities.
|
||||
for (Entity entity : e.getNearbyEntities(2D, 2D, 2D)) {
|
||||
if (entity instanceof Player) {
|
||||
e.getWorld().createExplosion(e.getLocation(), 2f);
|
||||
e.getWorld().createExplosion(e.getLocation(), 2f, false, true, e);
|
||||
e.remove();
|
||||
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user