Skip to content

Instantly share code, notes, and snippets.

View jascotty2's full-sized avatar

jascotty2

View GitHub Profile
<?php
/**
* Copyright (C) 2020 Jacob Scott <jascottytechie@gmail.com>
*
* Description: THEOS Disk Image File Extraction
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later
* version.
@EventHandler(ignoreCancelled = true, priority = EventPriority.HIGHEST)
public void onBlockExplode(final EntityExplodeEvent e) {
e.setCancelled(true);
final HashSet<BlockState> toRestoreStates = new HashSet();
final HashSet<FallingBlock> generatedBlocks = new HashSet();
for (final Block explodedBlock : e.blockList()) {
final BlockState state = explodedBlock.getState();
toRestoreStates.add(state);