Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public void onEntityExplode(EntityExplodeEvent event) {
if (tnt.getSource() instanceof Player player) {
handlePlayerTntExplosion(event, player);
} else {
handleAnonymousTntExplosion(event);
handleNaturalExplosion(event);
}
return;
}
Expand Down Expand Up @@ -137,11 +137,12 @@ private void notifyCityMembers(City city, City attackerCity, Player attacker) {
}
}

private void handleAnonymousTntExplosion(EntityExplodeEvent event) {
event.blockList().removeIf(block -> !ProtectionsManager.canExplodeNaturally(block.getLocation()));
}

private void handleNaturalExplosion(EntityExplodeEvent event) {
if (!ProtectionsManager.canExplodeNaturally(event.getLocation())) {
event.setCancelled(true);
return;
}

event.blockList().removeIf(block -> !ProtectionsManager.canExplodeNaturally(block.getLocation()));
}
}
Expand Down
Loading