<commit_before>package com.minelittlepony.gui;

import java.io.IOException;

import com.mumfrey.liteloader.modconfig.ConfigPanel;
import com.mumfrey.liteloader.modconfig.ConfigPanelHost;

import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.resources.I18n;

/**
 * Boilerplate because LiteLoader has to be such a 'special flower' -_-
 */
public class PonySettingsPanel extends GuiPonySettings implements ConfigPanel {

    private int contentHeight;

    @Override
    public String getPanelTitle() {
        return I18n.format(getTitle());
    }

    @Override
    public int getContentHeight() {
        return contentHeight + 40;
    }

    @Override
    protected <T extends GuiButton> T addButton(T button) {
        if (button.y > contentHeight) {
            contentHeight = button.y;
        }
        return super.addButton(button);
    }

    @Override
    public void onPanelShown(ConfigPanelHost host) {
        mc = Minecraft.getMinecraft();
        width = host.getWidth();
        initGui();
    }

    @Override
    public void onPanelResize(ConfigPanelHost host) {
        width = host.getWidth();
        this.buttonList.clear();
        initGui();
    }

    @Override
    public void onPanelHidden() {
        onGuiClosed();
    }

    @Override
    public void onTick(ConfigPanelHost host) {
        updateScreen();
    }

    @Override
    public void drawPanel(ConfigPanelHost host, int mouseX, int mouseY, float partialTicks) {
        drawScreen(mouseX, mouseY, partialTicks);<commit_msg>Fixed buttons triggering their actions twice on the Liteloader pane<commit_after>package com.minelittlepony.gui;

import java.io.IOException;

import com.mumfrey.liteloader.modconfig.ConfigPanel;
import com.mumfrey.liteloader.modconfig.ConfigPanelHost;

import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.resources.I18n;

/**
 * Boilerplate because LiteLoader has to be such a 'special flower' -_-
 */
public class PonySettingsPanel extends GuiPonySettings implements ConfigPanel {

    private int contentHeight;

    @Override
    public String getPanelTitle() {
        return I18n.format(getTitle());
    }

    @Override
    public int getContentHeight() {
        return contentHeight + 40;
    }

    @Override
    protected <T extends GuiButton> T addButton(T button) {
        if (button.y > contentHeight) {
            contentHeight = button.y;
        }
        return super.addButton(button);
    }

    @Override
    public void onPanelShown(ConfigPanelHost host) {
        mc = Minecraft.getMinecraft();
        width = host.getWidth();
        buttonList.clear();
        initGui();
    }

    @Override
    public void onPanelResize(ConfigPanelHost host) {
        width = host.getWidth();
        buttonList.clear();
        initGui();
    }

    @Override
    public void onPanelHidden() {
        onGuiClosed();
    }

    @Override
    public void onTick(ConfigPanelHost host) {
        updateScreen();
    }

    @Override
    public void drawPanel(ConfigPanelHost host, int mouseX, int mouseY, float partialTicks) {
        drawScreen(mouseX, mouseY, partialTicks);
{'fraction_non_alphanumeric': 0.0923220391669257, 'fraction_numerical': 0.003730183400683867, 'mean_word_length': 2.8911729141475213, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '5934246', 'n_tokens_mistral': 960, 'n_tokens_neox': 929, 'n_words': 221}