<commit_before>package main;

import org.bukkit.block.*;
import org.bukkit.event.*;
import org.bukkit.event.player.*;
import org.bukkit.metadata.*;

/**
 * Event handler class.
 * 
 * @author <NAME>
 * 
 */
public class SignEditorEvents implements Listener {

    @EventHandler()
    public void onLogin(PlayerLoginEvent e) {
        e.getPlayer().setMetadata(SignEditor.signEdit, new FixedMetadataValue(SignEditor.plugin, false));
        e.getPlayer().setMetadata(SignEditor.signLines, new FixedMetadataValue(SignEditor.plugin, new String[4]));
    }

    @EventHandler()
    public void onInteract(PlayerInteractEvent e) {
        if ((boolean) SignEditor.getMetadata(e.getPlayer(), SignEditor.signEdit, SignEditor.plugin)) {
            Block clickedBlock = e.getClickedBlock();

            if (clickedBlock != null) {
                BlockState clickedBlockState = clickedBlock.getState();

                if (clickedBlockState instanceof Sign) {
                    Sign s = (Sign) clickedBlockState;
                    e.getPlayer().setMetadata(SignEditor.sign, new FixedMetadataValue(SignEditor.plugin, s));
                    SignEditor.say(e.getPlayer(), "Sign active.");
                }
            } else {
                SignEditor.say(e.getPlayer(), "Do not use a block to select a sign. Instead use your hand or some other item that cannot be placed.");
            }
        }
    }
}<commit_msg>Added an active sign toggle.<commit_after>package main;

import org.bukkit.block.*;
import org.bukkit.event.*;
import org.bukkit.event.player.*;
import org.bukkit.metadata.*;

/**
 * Event handler class.
 * 
 * @author <NAME>
 * 
 */
public class SignEditorEvents implements Listener {

    @EventHandler()
    public void onLogin(PlayerLoginEvent e) {
        e.getPlayer().setMetadata(SignEditor.signEdit, new FixedMetadataValue(SignEditor.plugin, false));
        e.getPlayer().setMetadata(SignEditor.signLines, new FixedMetadataValue(SignEditor.plugin, new String[4]));
    }

    @EventHandler()
    public void onInteract(PlayerInteractEvent e) {
        if ((boolean) SignEditor.getMetadata(e.getPlayer(), SignEditor.signEdit, SignEditor.plugin)) {
            Block clickedBlock = e.getClickedBlock();

            if (clickedBlock != null) {
                BlockState clickedBlockState = clickedBlock.getState();

                if (clickedBlockState instanceof Sign) {
                    Sign s = (Sign) clickedBlockState;
                    Sign prevSign = (Sign) SignEditor.getMetadata(e.getPlayer(), SignEditor.sign, SignEditor.plugin);

                    if (prevSign != null && prevSign.equals(s)) {
                        e.getPlayer().setMetadata(SignEditor.sign, new FixedMetadataValue(SignEditor.plugin, null));
                        SignEditor.say(e.getPlayer(), "Sign inactive.");
                    } else {
                        e.getPlayer().setMetadata(SignEditor.sign, new FixedMetadataValue(SignEditor.plugin, s));
                        SignEditor.say(e.getPlayer(), "Sign active.");
                    }
                }
            } else {
                SignEditor.say(e.getPlayer(), "Do not use a block to select a sign. Instead use your hand or some other item that cannot be placed.");
            }
        }
    }
}
{'fraction_non_alphanumeric': 0.11317310617584424, 'fraction_numerical': 0.000608457560085184, 'mean_word_length': 2.382716049382716, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '4601892', 'n_tokens_mistral': 894, 'n_tokens_neox': 847, 'n_words': 206}