Vector3f dir = new Vector3f(event.getDirection());
dir.scale(4.0f);
Vector3f origin = new Vector3f(event.getOrigin());
origin.add(dir);
Vector3i blockPos = new Vector3i();
int particleEffects = 0;
int blockCounter = MAX_DESTROYED_BLOCKS;
for (int s = 0; s <= 512; s++) {
origin.add(dir);
if (!worldProvider.isBlockRelevant(origin)) {
break;
}
for (int i = 0; i < 64; i++) {
Vector3f direction = random.nextVector3f(1.0f);
Vector3f impulse = new Vector3f(direction);
impulse.scale(200);
for (int j = 0; j < 3; j++) {
Vector3f target = new Vector3f(origin);
target.x += direction.x * j;
target.y += direction.y * j;
target.z += direction.z * j;
blockPos.set((int) target.x, (int) target.y, (int) target.z);
Block currentBlock = worldProvider.getBlock(blockPos);
if (currentBlock.isDestructible()) {
if (particleEffects < MAX_PARTICLE_EFFECTS) {