N

code cho toi mot plugins AxBoosters xin nhat INVENTORY GUI day du bam duoc\

Kodari AI
KodariJun 30 at 12:37 pm 2

I’ll build a complete AxBoosters plugin with a full GUI system.

AxBoosters
A fully-featured booster system with interactive GUI menus. Supports XP, mob drops, fishing, coins, and mob coin multipliers. Players activate boosters via an intuitive chest GUI, view active server boosters with timers, and manage a personal queue. Includes configurable durations, cooldowns, multipliers, auto-saving, and admin commands. Uses XSeries for cross-version compatibility.

All 22 files created. The plugin is fully functional with:

Core Systems:

  • 5 booster types: XP, DROPS, FISHING, COINS, MOB_COINS

  • Full GUI menu (Main → Active Boosters → Queue management)

  • Multiplier application via event listeners (XP, drops, fishing)

  • Queue system when a booster type is already active

  • Cooldown tracking per player per type

  • Data persistence (saves/loads active boosters, queues, cooldowns)

GUI Flow:

  1. /booster → Main menu with all booster types as clickable items

  2. Click a booster → activates immediately (or queues if already active)

  3. “My Boosters” button → shows all active server boosters with timers

  4. Queue management → view and remove queued boosters

Admin: /boosteradmin give|remove|reload — grant boosters to players, remove active ones, reload configs.

Build: gradle build produces a working jar. XSeries handles cross-version icon/material compatibility automatically.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
28 1,974
src/main/java/com/axboosters/AxBoosters.java
package com.axboosters;

import com.axboosters.command.AdminBoosterCommand;
import com.axboosters.command.BoosterCommand;
import com.axboosters.config.ConfigManager;
import com.axboosters.inventory.gui.GUIListener;
import com.axboosters.inventory.gui.GUIManager;
import com.axboosters.listener.BoosterListener;
import com.axboosters.listener.PlayerListener;
import com.axboosters.manager.BoosterManager;
import com.axboosters.manager.CooldownManager;
import com.axboosters.manager.QueueManager;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

public class AxBoosters extends JavaPlugin {
    private static AxBoosters instance;
    private ConfigManager configManager;
    private BoosterManager boosterManager;
    private QueueManager queueManager;
    private CooldownManager cooldownManager;
    private GUIManager guiManager;

    @Override
    public void onEnable() {
        instance = this;

        this.configManager = new ConfigManager(this);
        this.configManager.loadConfigs();

        this.boosterManager = new BoosterManager(this);
        this.queueManager = new QueueManager(this);
        this.cooldownManager = new CooldownManager(this);

        this.boosterManager.loadData();

        this.guiManager = new GUIManager();

        Bukkit.getPluginManager().registerEvents(new GUIListener(this.guiManager), this);
        Bukkit.getPluginManager().registerEvents(new BoosterListener(this), this);
        Bukkit.getPluginManager().registerEvents(new PlayerListener(this), this);

        getCommand("booster").setExecutor(new BoosterCommand(this));
        getCommand("boosteradmin").setExecutor(new AdminBoosterCommand(this));

        startExpiryTask();

        getLogger().info("AxBoosters v" + getDescription().getVersion() + " enabled!");
    }

    @Override
    public void onDisable() {
        if (this.boosterManager != null) {
            this.boosterManager.saveData();
        }
        getLogger().info("AxBoosters disabled!");
    }

    private void startExpiryTask() {
        Bukkit.getScheduler().runTaskTimer(this, () -> {
            this.boosterManager.checkExpired();
        }, 200L, 200L);
    }

    public static AxBoosters getInstance() {
        return instance;
    }

    public ConfigManager getConfigManager() {
        return this.configManager;
    }

    public BoosterManager getBoosterManager() {
        return this.boosterManager;
    }

    public QueueManager getQueueManager() {
        return this.queueManager;
    }

    public CooldownManager getCooldownManager() {
        return this.cooldownManager;
    }

    public GUIManager getGuiManager() {
        return this.guiManager;
    }
}