Move explosion event block handling to private method.

Just a tiny little refactoring that makes reusing this logic a little
easier _without_ obfuscating the commit history for the code itself.
Just git things, really...

We'll want to reuse as much of the original method as possible for the
two explosion events, but because of the direct method calls, we can't
really reuse a good chunk of it. Still, this is better than nothing.
This commit is contained in:
Andreas Troelsen
2024-07-23 02:20:42 +02:00
parent ced55b8a89
commit 8122c535df
@@ -450,8 +450,12 @@ public class ArenaListener
if (!softRestoreDrops) if (!softRestoreDrops)
event.setYield(0); event.setYield(0);
handleExplodeEventBlocks(event.blockList());
}
private void handleExplodeEventBlocks(List<Block> blocks) {
// Handle all the blocks in the block list. // Handle all the blocks in the block list.
for (Block b : event.blockList()) { for (Block b : blocks) {
BlockState state = b.getState(); BlockState state = b.getState();
if (state.getData() instanceof Door && ((Door) state.getData()).isTopHalf()) { if (state.getData() instanceof Door && ((Door) state.getData()).isTopHalf()) {