From 8122c535dfe33890e86bb3607b7bb9c10e9f7529 Mon Sep 17 00:00:00 2001 From: Andreas Troelsen Date: Tue, 23 Jul 2024 01:59:28 +0200 Subject: [PATCH] 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. --- src/main/java/com/garbagemule/MobArena/ArenaListener.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/garbagemule/MobArena/ArenaListener.java b/src/main/java/com/garbagemule/MobArena/ArenaListener.java index 93cf389..3475dc5 100644 --- a/src/main/java/com/garbagemule/MobArena/ArenaListener.java +++ b/src/main/java/com/garbagemule/MobArena/ArenaListener.java @@ -450,8 +450,12 @@ public class ArenaListener if (!softRestoreDrops) event.setYield(0); + handleExplodeEventBlocks(event.blockList()); + } + + private void handleExplodeEventBlocks(List blocks) { // Handle all the blocks in the block list. - for (Block b : event.blockList()) { + for (Block b : blocks) { BlockState state = b.getState(); if (state.getData() instanceof Door && ((Door) state.getData()).isTopHalf()) {