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:
@@ -450,8 +450,12 @@ public class ArenaListener
|
||||
if (!softRestoreDrops)
|
||||
event.setYield(0);
|
||||
|
||||
handleExplodeEventBlocks(event.blockList());
|
||||
}
|
||||
|
||||
private void handleExplodeEventBlocks(List<Block> 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()) {
|
||||
|
||||
Reference in New Issue
Block a user