<commit_before>package net.glowstone.block.itemtype;

import net.glowstone.EventFactory;
import net.glowstone.block.GlowBlock;
import net.glowstone.block.ItemTable;
import net.glowstone.block.blocktype.BlockTNT;
import net.glowstone.entity.GlowPlayer;
import org.bukkit.Material;
import org.bukkit.block.BlockFace;
import org.bukkit.event.block.BlockIgniteEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.util.Vector;

public class ItemFlintAndSteel extends ItemTool {

    public ItemFlintAndSteel() {
        super(Material.FLINT_AND_STEEL.getMaxDurability());
    }

    @Override
    public boolean onToolRightClick(GlowPlayer player, ItemStack holding, GlowBlock target, BlockFace face, Vector clickedLoc) {
        if (target.getType() == Material.OBSIDIAN) {
            fireNetherPortal();
        } 
        if (target.getType() == Material.TNT) {
            fireTnt(target);
        } 
        if (target.getType() == Material.STONE) {
            setBlockOnFire(player, target, face, holding, clickedLoc);
        } 
        if (target.isFlammable()) {
            setBlockOnFire(player, target, face, holding, clickedLoc);
        } 
        return true;
    }

    private void fireNetherPortal() {
        // TODO: check for nether portal and activate it
    }

    private void fireTnt(GlowBlock tnt) {
        BlockTNT.igniteBlock(tnt, false);
    }

    private boolean setBlockOnFire(GlowPlayer player, GlowBlock clicked, BlockFace face, ItemStack holding, Vector clickedLoc) {
        GlowBlock fireBlock = clicked.getRelative(face);
        if (fireBlock.getType() != Material.AIR) {
            return true;
        }<commit_msg>Correct which blocks should be lit by Flint and Steel<commit_after>package net.glowstone.block.itemtype;

import net.glowstone.EventFactory;
import net.glowstone.block.GlowBlock;
import net.glowstone.block.ItemTable;
import net.glowstone.block.blocktype.BlockTNT;
import net.glowstone.entity.GlowPlayer;
import org.bukkit.Material;
import org.bukkit.block.BlockFace;
import org.bukkit.event.block.BlockIgniteEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.util.Vector;

public class ItemFlintAndSteel extends ItemTool {

    public ItemFlintAndSteel() {
        super(Material.FLINT_AND_STEEL.getMaxDurability());
    }

    @Override
    public boolean onToolRightClick(GlowPlayer player, ItemStack holding, GlowBlock target, BlockFace face, Vector clickedLoc) {
        if (target.getType() == Material.OBSIDIAN) {
            fireNetherPortal();
        } 
        if (target.getType() == Material.TNT) {
            fireTnt(target);
        } 
        if (target.isFlammable() || target.getType().isOccluding() || target.getType() == Material.STONE) {
            setBlockOnFire(player, target, face, holding, clickedLoc);
        } 
        return true;
    }

    private void fireNetherPortal() {
        // TODO: check for nether portal and activate it
    }

    private void fireTnt(GlowBlock tnt) {
        BlockTNT.igniteBlock(tnt, false);
    }

    private boolean setBlockOnFire(GlowPlayer player, GlowBlock clicked, BlockFace face, ItemStack holding, Vector clickedLoc) {
        GlowBlock fireBlock = clicked.getRelative(face);
        if (fireBlock.getType() != Material.AIR) {
            return true;
        }
{'fraction_non_alphanumeric': 0.09933574879227053, 'fraction_numerical': 0.0, 'mean_word_length': 3.1620603015075375, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3522626', 'n_tokens_mistral': 1023, 'n_tokens_neox': 994, 'n_words': 214}