<commit_before>package think.rpgitems.power;

import org.bukkit.ChatColor;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.entity.Player;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
import think.rpgitems.data.Locale;
import think.rpgitems.power.types.PowerTick;

public class PowerPotionTick extends Power implements PowerTick {

    public int amplifier = 2;
    public PotionEffectType effect = PotionEffectType.SPEED;

    @Override
    public void tick(Player player) {
        if (item.getHasPermission() == true && player.hasPermission(item.getPermission()) == false) {
            player.sendMessage(ChatColor.RED + String.format(Locale.get("message.error.permission")));
        } else {
            boolean hasEffect = false;
            for (PotionEffect potionEffect : player.getActivePotionEffects()) {
                if (potionEffect.getType().equals(effect)) {
                    hasEffect = true;
                    if (potionEffect.getDuration() <= 10 || potionEffect.getAmplifier() < amplifier)
                        player.addPotionEffect(new PotionEffect(effect, 30, amplifier, true), true);
                    break;
                }
            }
            if (!hasEffect) {
                player.addPotionEffect(new PotionEffect(effect, 30, amplifier, true), true);
            }
        }

    }

    @Override
    public void init(ConfigurationSection s) {
        amplifier = s.getInt("amplifier");
        effect = PotionEffectType.getByName(s.getString("effect", "heal"));

    }

    @Override
    public void save(ConfigurationSection s) {
        s.set("amplifier", amplifier);
        s.set("effect", effect.getName());

    }

    @Override
    public String getName() {
        return "potiontick";
    }

    @Override
    public String displayText() {
        return ChatColor.GREEN + String.format(Locale.get("power.potiontick"), effect.getName().toLowerCase().replaceAll("_", " "), amplifier + 1);<commit_msg>PowerPotionTick time extended. close #75<commit_after>package think.rpgitems.power;

import org.bukkit.ChatColor;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.entity.Player;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
import think.rpgitems.data.Locale;
import think.rpgitems.power.types.PowerTick;

public class PowerPotionTick extends Power implements PowerTick {

    public int amplifier = 2;
    public PotionEffectType effect = PotionEffectType.SPEED;

    @Override
    public void tick(Player player) {
        if (item.getHasPermission() == true && player.hasPermission(item.getPermission()) == false) {
            player.sendMessage(ChatColor.RED + String.format(Locale.get("message.error.permission")));
        } else {
            boolean hasEffect = false;
            for (PotionEffect potionEffect : player.getActivePotionEffects()) {
                if (potionEffect.getType().equals(effect)) {
                    hasEffect = true;
                    if (potionEffect.getDuration() <= 5 || potionEffect.getAmplifier() < amplifier)
                        player.addPotionEffect(new PotionEffect(effect, 60, amplifier, true), true);
                    break;
                }
            }
            if (!hasEffect) {
                player.addPotionEffect(new PotionEffect(effect, 60, amplifier, true), true);
            }
        }

    }

    @Override
    public void init(ConfigurationSection s) {
        amplifier = s.getInt("amplifier");
        effect = PotionEffectType.getByName(s.getString("effect", "heal"));

    }

    @Override
    public void save(ConfigurationSection s) {
        s.set("amplifier", amplifier);
        s.set("effect", effect.getName());

    }

    @Override
    public String getName() {
        return "potiontick";
    }

    @Override
    public String displayText() {
        return ChatColor.GREEN + String.format(Locale.get("power.potiontick"), effect.getName().toLowerCase().replaceAll("_", " "), amplifier + 1);
{'fraction_non_alphanumeric': 0.11422944362383063, 'fraction_numerical': 0.004185130477597243, 'mean_word_length': 2.666967509025271, 'pattern_counts': {'":': 0, '<': 7, '<?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': '5392345', 'n_tokens_mistral': 1160, 'n_tokens_neox': 1097, 'n_words': 223}