K

Make it like that so it can contain 3 days backup and after that it will delete it auto and change icons Join → Lime concrete Leave → Red concrete Death → Wither Skeleton Skull Chest → Barrel Ender Chest → Ender Chest All → Bookshelf Next → arrow → slot 51 previus→ arrow → slot 49 air→ air → slot 46,47,48,50,52,53,54

preview, Ender Chest → Ender Chest → slot 46 Back→ barrier → slot 54 restore→ light blue concrete → slot 47 tp→ enderarl → slot 51 paper→ book→ slot 53 shalkerbox→ shalkerbox→ slot 49 Rename the Shulker Box, which will be received, to Restored Shulker Box. After taking all the loot, it will disappear.

Kodari AI
KodariJul 16 at 10:25 am 70
  1. Map the existing backup, GUI, event, and persistence flow.

  2. Add three-day automatic retention and the requested inventory icons/navigation.

  3. Implement preview actions, shulker restoration/rename behavior, and verify registrations/configuration.

  1. Use a fixed three-day retention window and run cleanup automatically on startup and at the configured interval.

  2. Paginate history into the requested bottom-row controls, using the requested category icons and concrete materials.

  3. Move preview controls to the requested slots, apply the requested icons, and name exported boxes “Restored Shulker Box”.

  4. Remove an emptied placed shulker box after its contents are taken.

  1. Fix the history bottom-row cleanup so it never addresses the invalid slot 54.

  2. Remove restored shulker blocks automatically when their stored contents are emptied and the container closes.

  3. Keep the three-day cleanup schedule and requested preview/history slot layout intact.The requested slot numbers are treated as 1-based labels, so the implementation must use the corresponding Bukkit 0-based indexes; slot 54 is index 53, not a valid raw index 54.The automatic retention is now three days, with cleanup on enable and every six hours. The final GUI changes use Bukkit’s zero-based inventory indexes for the user-facing slots.

The preview controls are aligned to the user-facing slot numbers (with Bukkit’s zero-based indexes), and the shulker cleanup uses XSeries for the air material.Implemented:

  • Backups now automatically delete after 3 days.

  • Cleanup runs on startup and every 6 hours.

  • History GUI:

    • Join → Lime Concrete

    • Leave → Red Concrete

    • Death → Wither Skeleton Skull

    • Chest → Barrel

    • Ender Chest → Ender Chest

    • All → Bookshelf

    • Previous → Arrow, slot 49

    • Next → Arrow, slot 51

    • Empty slots are cleared

  • Preview GUI:

    • Ender Chest → slot 46

    • Restore → Light Blue Concrete, slot 47

    • Shulker Box → slot 49

    • Teleport → Ender Pearl, slot 51

    • Backup information → Book, slot 53

    • Back → Barrier, slot 54

  • Exported shulkers are renamed Restored Shulker Box.

  • Restored shulkers are marked internally and automatically disappear after all contents are removed, both as items and placed blocks.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
manifest.kod
settings.gradle
Code
36 2,094
src/main/java/com/kodari/flameinventory/FlameInventoryPlugin.java
package com.kodari.flameinventory;

import com.kodari.flameinventory.api.FlameInventoryAPI;
import com.kodari.flameinventory.backup.BackupManager;
import com.kodari.flameinventory.backup.SQLiteBackupRepository;
import com.kodari.flameinventory.command.InventoryCommand;
import com.kodari.flameinventory.gui.GUIListener;
import com.kodari.flameinventory.gui.GUIManager;
import com.kodari.flameinventory.listener.InventoryListener;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

import java.io.File;

public class FlameInventoryPlugin extends JavaPlugin {
    private SQLiteBackupRepository repository;
    private BackupManager backupManager;
    private GUIManager guiManager;
    private FlameInventoryAPI api;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        saveBundledConfiguration("database.yml");
        saveBundledConfiguration("backup.yml");
        saveBundledConfiguration("restore.yml");
        saveBundledConfiguration("inventory-gui.yml");
        saveBundledConfiguration("messages.yml");
        saveBundledConfiguration("cleanup.yml");
        saveBundledConfiguration("permissions.yml");
        saveBundledConfiguration("integrations.yml");

        this.repository = new SQLiteBackupRepository(this);
        this.repository.initialize();

        this.guiManager = new GUIManager();
        this.backupManager = new BackupManager(this, repository);
        this.api = new FlameInventoryAPI(this, backupManager);

        Bukkit.getPluginManager().registerEvents(new GUIListener(guiManager), this);
        Bukkit.getPluginManager().registerEvents(new InventoryListener(this), this);
        backupManager.cleanup();
        Bukkit.getScheduler().runTaskTimer(this, () -> backupManager.cleanup(), 20L * 60L * 60L * 6L, 20L * 60L * 60L * 6L);

        InventoryCommand command = new InventoryCommand(this);
        if (getCommand("finv") != null) {
            getCommand("finv").setExecutor(command);
            getCommand("finv").setTabCompleter(command);
        }

        getLogger().info("FlameInventory enabled with SQLite storage.");
    }

    @Override
    public void onDisable() {
        if (repository != null) {
            repository.close();
        }
    }

    private void saveBundledConfiguration(String name) {
        File file = new File(getDataFolder(), name);
        if (!file.exists()) {
            saveResource(name, false);
        }
    }

    public void runSync(Runnable task) {
        if (Bukkit.isPrimaryThread()) {
            task.run();
            return;
        }
        Bukkit.getScheduler().runTask(this, task);
    }

    public SQLiteBackupRepository getRepository() {
        return repository;
    }

    public BackupManager getBackupManager() {
        return backupManager;
    }

    public GUIManager getGuiManager() {
        return guiManager;
    }

    public FlameInventoryAPI getApi() {
        return api;
    }
}