public synchronized void execute(Point position, float size, boolean fire, Cause<?> cause) {
int xoff = position.getBlockX();
int yoff = position.getBlockY();
int zoff = position.getBlockZ();
World world = position.getWorld();
this.blocksToDestroy.clear();
this.root.sourcedamage = size * (0.7F + (float) Math.random() * 0.6F);
//recursively operate on all blocks
float damageFactor;
boolean hasDamage = true;
ExplosionLayer layer;
for (int i = 0; i < this.layers.size() && hasDamage; i++) {
hasDamage = false;
layer = this.layers.get(i);
for (ExplosionSlot slot : layer.slots) {
//prepare the block information
if (!slot.block.isSet) {
slot.block.prepare(world, xoff, yoff, zoff, GenericMath.getRandom());
}
//subtract damage factor
damageFactor = slot.sourcedamage - slot.block.damageFactor;
slot.sourcedamage = 0f;
if (damageFactor <= 0f) {
continue;
}
//this block has been destroyed
if (!slot.block.destroy) {
slot.block.destroy = true;
Block block = world.getBlock(slot.block.realx, slot.block.realy, slot.block.realz);
blocksToDestroy.add(block);
}
//one block layer further...
if ((damageFactor -= 0.225f) <= 0.0f) {