mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-11-23 11:15:24 +01:00
Fix TNTListener tests
This commit is contained in:
parent
823bc5ceed
commit
5573e9f329
@ -43,10 +43,13 @@ public class TNTListener extends FlagListener {
|
||||
* @param e - event
|
||||
*/
|
||||
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
|
||||
public void onTNTDamage(EntityChangeBlockEvent e) {
|
||||
public void onTNTDamageEvent(EntityChangeBlockEvent e) {
|
||||
onTNTDamage(e);
|
||||
}
|
||||
boolean onTNTDamage(EntityChangeBlockEvent e) {
|
||||
// Check world
|
||||
if (!e.getBlock().getType().equals(Material.TNT) || !getIWM().inWorld(e.getBlock().getLocation())) {
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
// Stop TNT from being damaged if it is being caused by a visitor with a flaming arrow
|
||||
if (e.getEntity() instanceof Projectile projectile) {
|
||||
@ -56,9 +59,10 @@ public class TNTListener extends FlagListener {
|
||||
// Remove the arrow
|
||||
projectile.remove();
|
||||
e.setCancelled(true);
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user