Gandon Pidrilov

Сделай так чтобы в предметах где нету каких либо эффектов, по типу заурядного зелья не показывалась плашка "эффекты"

Kodari AI
KodariNov 14 at 2:49 pm 1
  1. Уберу безусловное добавление заголовка эффектов у зелий.

  2. Буду добавлять заголовок только в ветках, где действительно формируется хотя бы один эффект.

Заголовок «Эффекты» теперь добавляется только тогда, когда у зелья есть эффекты. У заурядного зелья без эффектов плашки не будет.

Kodari can make mistakes. Review important code before using.
Files
src
.gitignore
AFGoodItemsLore.iml
dependency-reduced-pom.xml
pom.xml
README.md
Code
12 731
src/main/java/ru/anton_flame/afgooditemslore/AFGoodItemsLore.java
package ru.anton_flame.afgooditemslore;

import org.bukkit.NamespacedKey;
import org.bukkit.command.PluginCommand;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.plugin.java.JavaPlugin;
import ru.anton_flame.afgooditemslore.commands.AFGoodItemsLoreCommand;
import ru.anton_flame.afgooditemslore.tasks.LoreUpdateTask;
import ru.anton_flame.afgooditemslore.utils.ConfigManager;

import java.util.List;

public final class AFGoodItemsLore extends JavaPlugin {

    public NamespacedKey hasEffects = new NamespacedKey(this, "has_effects");
    public NamespacedKey hasEnchants = new NamespacedKey(this, "has_enchants");
    public NamespacedKey stringsCount = new NamespacedKey(this, "string_counts");

    @Override
    public void onEnable() {
        getLogger().info("Плагин был включен!");
        saveDefaultConfig();
        ConfigManager.setupConfigValues(this);

        PluginCommand afGoodItemsLoreCommand = getCommand("afgooditemslore");
        AFGoodItemsLoreCommand commandClass = new AFGoodItemsLoreCommand(this);
        afGoodItemsLoreCommand.setExecutor(commandClass);
        afGoodItemsLoreCommand.setTabCompleter(commandClass);

        LoreUpdateTask loreUpdateTask = new LoreUpdateTask(this);
        loreUpdateTask.runTaskTimer(this, 0, 20);
    }

    @Override
    public void onDisable() {
        getLogger().info("Плагин был выключен!");
    }
}