Modak

Some changes are first change the name of every tool from small caps to normal text like the name that is shows like anything drill it is written in small cap make sure now it's returning normal text next when a tools brakes brakes instead of making it like when you try to use it says error tool expired but change so as soon as the timer hits zero delete the item from inv and even if its in other gui like auction chest enderchest delete that item and if cannot delete item like it can only be deleted on inv on update if so make it like if timrr ended and player tried to mine a block say thet error tool expired and delete that tool remove it and it goes for all tools and the name change is also for all tools

Kodari AI
KodariSep 30 at 8:31 am 1
  1. Normalize display names for every tool.

  2. Remove expired tools as soon as their timer ends, including tools in inventories/containers where possible; still reject and remove them on use.

  1. Tool names: Changed all eight configured names to normal text—e.g. “Amethyst Drill”—while preserving their colors.

  2. Expiration: Expired tools are removed during a scan every second from online players’ inventories, armor, offhand, ender chests, and currently open GUI inventories. Opening a GUI also triggers a cleanup. Existing use-time checks still reject and remove expired tools.

Closed storage managed by another plugin isn’t accessible to this plugin’s inventory scan; expired items there are cleaned up when they become available in an online player’s inventory or open GUI.

Modak

so I need you to change one thing because like don't like if someone has a tool with zero expiry timer zero day zero so we have made it like it expire when player tries to use that item but what if player like it has zero expiry date and put slash ah cell like other cell in other plugin auction house so the other player might get scammed or anything so can you make it like if a tool is expired and it is in your inventory so it doesn't need an update or like have we have to break a block then the tool is expired if the tool is in inventory and the timer expire or if you buy an zero day zero hour zero minute tool because if someone did this can also happen because if someone has put like one minute remaining in auction and it will stay there until someone buys it or the listing expires so make it like player cannot repeat that bug so as soon as the timer expires even if you have that item in inventory it should delete it does not need a move from a inventory update or break a block update it just removes and says that message and break sound

Kodari AI
KodariSep 30 at 9:02 am 1

The generation was stopped before any content could be produced.

Modak

Also add a command /tools give playername snd then in tab completion add two commands time and ammount in ammount we can type like tools give playernamd ammount 10 and in timer we can give tools give playername ammount eg 10m 1m 1h 10m , 12h 15m , 2d 4h 10m custum expiry tools and also remove the tab completion /tools give toolname the command should go like tools give playername toolname not like tools give toolname

📎 1 file 1,055 chars
📄
pasted-code-1790758976700.txt
txt 1 lines
▶
so I need you to change one thing because like don't like if someone has a tool with zero expiry timer zero day zero so we have made it like it expire when player tries to use that item but what if player like it has zero expiry date and put slash ah cell like other cell in other plugin auction house so the other player might get scammed or anything so can you make it like if a tool is expired and it is in your inventory so it doesn't need an update or like have we have to break a block then the tool is expired if the tool is in inventory and the timer expire or if you buy an zero day zero hour zero minute tool because if someone did this can also happen because if someone has put like one minute remaining in auction and it will stay there until someone buys it or the listing expires so make it like player cannot repeat that bug so as soon as the timer expires even if you have that item in inventory it should delete it does not need a move from a inventory update or break a block update it just removes and says that message and break sound
Kodari AI
KodariSep 30 at 9:07 am 1
  1. Make expiry proactive: remove timed-out tools from online players’ accessible inventories and notify them with the expired message and break sound.

  2. Add /tools give <player> <tool> [amount] [time], with player-first completion and amount/time arguments; remove the old tool-first completion.

Expiry is now proactive: the one-second online-player scan removes expired tools from their inventory, armor/offhand, ender chest, and open GUI, then sends the configured expired message and break sound. Next I’m checking the command implementation to add the player-first give syntax and completions.

  1. Expiry: Online-player scans now remove expired tools without waiting for an inventory action, and send the configured expired message and break sound. The scan covers inventory, armor/offhand, ender chest, and the currently open GUI.

  2. Give command: Changed to /tools give <player> <tool> [amount <number>] [time <duration>]. For example: /tools give Alex drill amount 10 time 2d 4h 10m. Tab completion now suggests players first, then tools, amount/time, and example values. Custom lifetimes apply to drills and configured tools, including zero-duration tools.

An auction plugin may store listings outside the player’s inventory and open GUI; this plugin can’t scan that private storage.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
manifest.kod
settings.gradle
Code
26 2,328
src/main/java/com/kodari/soultools/SoulToolsPlugin.java
package com.kodari.soultools;

import com.kodari.soultools.command.ToolCommand;
import com.kodari.soultools.config.DrillSettings;
import com.kodari.soultools.listener.DrillListener;
import com.kodari.soultools.listener.BucketListener;
import com.kodari.soultools.listener.FireworkListener;
import com.kodari.soultools.listener.HoeListener;
import com.kodari.soultools.listener.ShovelListener;
import com.kodari.soultools.listener.ToolIntegrityListener;
import com.kodari.soultools.listener.TreeChopperListener;
import com.kodari.soultools.message.MessageService;
import com.kodari.soultools.tool.ConfiguredToolService;
import com.kodari.soultools.tool.DrillItemService;
import com.tcoded.folialib.FoliaLib;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;

import java.util.concurrent.TimeUnit;

public final class SoulToolsPlugin extends JavaPlugin {
    private FoliaLib foliaLib;
    private DrillSettings drillSettings;
    private DrillItemService drillItems;
    private ConfiguredToolService configuredTools;
    private MessageService messages;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        saveResource("drill.yml", false);
        for (String tool : new String[]{"enderpearl", "firework", "hoe", "lavabucket", "shovel", "treechopper", "waterbucket"}) {
            saveResource(tool + ".yml", false);
        }
        foliaLib = new FoliaLib(this);
        reloadSoulTools();
        drillItems = new DrillItemService(this);
        configuredTools = new ConfiguredToolService(this);
        messages = new MessageService(this);
        Bukkit.getPluginManager().registerEvents(new DrillListener(this), this);
        Bukkit.getPluginManager().registerEvents(new BucketListener(this), this);
        Bukkit.getPluginManager().registerEvents(new FireworkListener(this), this);
        Bukkit.getPluginManager().registerEvents(new HoeListener(this), this);
        Bukkit.getPluginManager().registerEvents(new ShovelListener(this), this);
        Bukkit.getPluginManager().registerEvents(new TreeChopperListener(this), this);
        Bukkit.getPluginManager().registerEvents(new ToolIntegrityListener(this), this);

        ToolCommand command = new ToolCommand(this);
        getCommand("tool").setExecutor(command);
        getCommand("tool").setTabCompleter(command);
        startLoreRefresh();
    }

    @Override
    public void onDisable() {
        if (foliaLib != null) {
            foliaLib.getScheduler().cancelAllTasks();
        }
    }

    public void reloadSoulTools() {
        reloadConfig();
        drillSettings = new DrillSettings(this);
        drillSettings.reload();
    }

    public FoliaLib getFoliaLib() {
        return foliaLib;
    }

    public DrillSettings getDrillSettings() {
        return drillSettings;
    }

    public DrillItemService getDrillItems() {
        return drillItems;
    }

    public ConfiguredToolService getConfiguredTools() {
        return configuredTools;
    }

    public MessageService getMessages() {
        return messages;
    }

    private void startLoreRefresh() {
        foliaLib.getScheduler().runTimer(() -> {
            for (Player player : Bukkit.getOnlinePlayers()) {
                foliaLib.getScheduler().runAtEntity(player, task -> {
                    drillItems.refreshPlayer(player);
                    configuredTools.refreshPlayer(player);
                });
            }
        }, 1_000L, 1_000L, TimeUnit.MILLISECONDS);
    }
}