Add AutoSell feature with commands and tasks for automated item selling

This commit is contained in:
2025-07-23 03:11:46 +02:00
parent 36c92fcdb3
commit 1909c6d5bc
8 changed files with 406 additions and 7 deletions
@@ -0,0 +1,32 @@
package com.alttd.events;
import com.alttd.util.auto_sell.AutoSellTask;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityPickupItemEvent;
import java.util.UUID;
public class ItemPickupEvent implements Listener {
private final AutoSellTask autoSellTask;
public ItemPickupEvent(AutoSellTask autoSellTask) {
this.autoSellTask = autoSellTask;
}
@EventHandler(priority = EventPriority.MONITOR)
public void onItemPickupEvent(EntityPickupItemEvent event) {
if (!(event.getEntity() instanceof Player player)) {
return;
}
UUID uuid = player.getUniqueId();
if (!autoSellTask.autoSellEnabled(uuid, event.getItem().getItemStack().getType())) {
return;
}
autoSellTask.putAutoSellPlayer(uuid);
}
}