<commit_before>package im.wma.Creepair;

import java.util.ArrayList;
import org.bukkit.Effect;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.entity.EntityType;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityExplodeEvent;
import org.bukkit.plugin.java.JavaPlugin;

public class Creepair extends JavaPlugin implements Listener {
    private final ArrayList<String> worlds = new ArrayList<String>();
    private int y;
    private RepairHelper helper;

    @Override
    public void onEnable() {
        if (!this.getConfig().contains("config"))
            this.getConfig().options().copyDefaults(true);

        worlds.addAll(this.getConfig().getStringList("worlds"));
        y = this.getConfig().getInt("above_y", 50);

        this.helper = new RepairHelper();
        this.getServer().getScheduler().scheduleSyncRepeatingTask(this, this.helper, 10, 10);

        this.getServer().getPluginManager().registerEvents(this, this);
    }

    @EventHandler
    public void onEntityExplode(EntityExplodeEvent event) {
        if (!worlds.contains(event.getLocation().getWorld().getName()) || event.getEntityType() != EntityType.CREEPER) {
            return;
        }

        if (event.getLocation().getBlockY() >= y) {
            event.setYield(0F);

            for (Block block : event.blockList()) {
                if (block.getType() == Material.GRASS || block.getType() == Material.DIRT)
                    helper.add(new CreepairBlock(block, block.getType()));
            }
        }
    }

    public class CreepairBlock {
        public Block block;
        public Material original;

        public CreepairBlock(Block block, Material original) {
            this.block = block;
            this.original = original;
        }
    }

    public class RepairHelper implements Runnable {
        private final ArrayList<CreepairBlock> blocks = new ArrayList<CreepairBlock>();

        public void add(CreepairBlock block) {
            blocks.add(block);
        }

        @Override
        public void run() {
            for (int i = 0; i < 5; i++) {
                if (blocks.size() == 0) {
                    return;
                }

                if (blocks.get(0) != null) {
                    CreepairBlock block = blocks.get(0);
                    block.block.getLocation().getWorld().playEffect(block.block.getLocation(), Effect.STEP_SOUND, block.original.getId());
                    block.block.setType(block.original);
                    blocks.remove(0);
                }
            }
        }
    }

}
<commit_msg>Added @WizardCM code sample<commit_after>package im.wma.Creepair;

import java.util.ArrayList;
import org.bukkit.Effect;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.entity.EntityType;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityExplodeEvent;
import org.bukkit.plugin.java.JavaPlugin;

public class Creepair extends JavaPlugin implements Listener {
    private final ArrayList<String> worlds = new ArrayList<String>();
    private int y;
    private RepairHelper helper;

    @Override
    public void onEnable() {
        if (!this.getConfig().contains("config"))
            this.getConfig().options().copyDefaults(true);

        worlds.addAll(this.getConfig().getStringList("worlds"));
        y = this.getConfig().getInt("above_y", 50);

        this.helper = new RepairHelper();
        this.getServer().getScheduler().scheduleSyncRepeatingTask(this, this.helper, 10, 10);

        this.getServer().getPluginManager().registerEvents(this, this);
    }

    @EventHandler
    public void onEntityExplode(EntityExplodeEvent event) {
        if (!worlds.contains(event.getLocation().getWorld().getName()) || event.getEntityType() != EntityType.CREEPER) {
            return;
        }

        if (event.getLocation().getBlockY() >= y) {
            event.setYield(0F);
        for (Block block : new ArrayList<Block>(event.blockList()))
            if (block.getType() == Material.GRASS || block.getType() == Material.DIRT){
                event.blockList().remove(block);
            }
        }
    }

    public class CreepairBlock {
        public Block block;
        public Material original;

        public CreepairBlock(Block block, Material original) {
            this.block = block;
            this.original = original;
        }
    }

    public class RepairHelper implements Runnable {
        private final ArrayList<CreepairBlock> blocks = new ArrayList<CreepairBlock>();

        public void add(CreepairBlock block) {
            blocks.add(block);
        }

        @Override
        public void run() {
            for (int i = 0; i < 5; i++) {
                if (blocks.size() == 0) {
                    return;
                }

                if (blocks.get(0) != null) {
                    CreepairBlock block = blocks.get(0);
                    block.block.getLocation().getWorld().playEffect(block.block.getLocation(), Effect.STEP_SOUND, block.original.getId());
                    block.block.setType(block.original);
                    blocks.remove(0);
                }
            }
        }
    }

}

{'fraction_non_alphanumeric': 0.12018140589569161, 'fraction_numerical': 0.0049130763416477706, 'mean_word_length': 2.249232658072437, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4991140', 'n_tokens_mistral': 1528, 'n_tokens_neox': 1439, 'n_words': 292}