xcrowley_

Rol:

Sen, büyük network’lerde (1000+ concurrent) Paper/Spigot plugin’leri yazmış, exploit avcısı, performans takıntılı kıdemli bir Minecraft backend geliştiricisisin. “Çalışıyor” yetmez; hızlı, güvenli, abuse-proof olmak zorunda.

Amaç Paper / Spigot 1.24 için, DonutSMP Auction House hissini veren, modern, sade, profesyonel ve büyük SMP sunucularına uygun bir Auction House plugin’i yaz.

Plugin adı: VeltharAuctionHouse Bu plugin: 100+ oyuncu aynı anda AH açıkken TPS düşürmemeli Database tarafında main thread ASLA bloklanmamalı Dupe, double-buy, click abuse, lag abuse imkânsız olmalı

Genel Teknik Standartlar Dil: Java 21 API: Paper API (Spigot fallback düşünme) Build: Gradle Economy: Vault (economy null check zorunlu) Database:

Varsayılan: SQLite Opsiyonel: MySQL Async işlemler + connection pooling Threading:

DB → Async Economy + Inventory → Main thread Deprecated API: ❌ KULLANMA

Komutlar (Net Davranış) /ah Ana Auction House INVENTORY GUI açılır Varsayılan: en yeni itemler Sayfa başına limit configurable --- /ah sell <price> Eldeki item tek seferde satışa çıkar Satış süresi:

INVENTORY GUI üzerinden seçilir (12h / 24h / 48h) Satıcı itemi sattıktan sonra:

Item env’den silinir DB’ye transaction ile yazılır Boş el, price <= 0, banned item → iptal --- /ah search <player|item> Case-insensitive Hem item display name hem seller name Async search + cached result --- /ah cancel <id> Sadece satıcı iptal edebilir Item güvenli şekilde iade edilir DB + Inventory atomic davranmalı

🧩 INVENTORY GUI TASARIMI (DonutSMP Hissi) Chest INVENTORY GUI ❌ Cam spam YOK ✔ Minimalist, boşluklu, simetrik BULUNACAK: → Auction itemleri → Önceki sayfa → Sonraki sayfa → Sıralama (ASC / DESC) → Kategori → Arama

🧠 Auction Mantığı (ÖNEMLİ) Satın alma anı:

Para → alıcıdan düş Para → satıcıya ekle (offline destek) Item → alıcının inventory’sine Çifte satın alma imkânsız Transaction başarısızsa → rollback

⏱ Süre & Expire Sistemi Süresi dolan itemler:

Otomatik expire task Satıcıya mailbox / direkt inventory Sunucu restart olsa bile:

Expire zamanı DB’den hesaplanır

🔒 Exploit Koruması (TAVİZ YOK) Aşağıdakiler tamamen engellenecek:

Shift-click Double-click Inventory drag Number key swap Lag sırasında spam click INVENTORY GUI içinde hiçbir item hareket edemez Dupe ihtimali olan her senaryo düşünülmeli

📁 Config Dosyaları config.yml Page size Max active listings per player Allowed worlds Database credentials Expire durations Tax (opsiyonel % kesinti)

🚫 Yapılmayacaklar “Basit örnek” Hard-coded INVENTORY GUI Sync DB BukkitScheduler abuse Static singleton çöplüğü

✅ Kabul Kriteri Bu plugin:

DonutSMP Auction House hissini verir Büyük SMP’de gönül rahatlığıyla kullanılır Kod okunur, genişletilebilir, production-ready olur

Kodari AI
KodariFeb 4 at 3:18 pm 24,498 (v2)

I’ll create a production-ready VeltharAuctionHouse plugin that mimics DonutSMP’s feel with zero exploits and async database operations.

VeltharAuctionHouse
A high-performance auction house plugin for large SMP servers supporting 1000+ concurrent players. Features async database operations, exploit-proof transaction system, minimalist GUI design, and offline seller payment delivery. Includes configurable listing durations, search functionality, category filtering, and automatic expiry handling with mailbox system. Built with zero TPS impact, complete dupe prevention, and production-grade transaction safety.

Production-ready VeltharAuctionHouse complete. Features:

  • Async database (SQLite/MySQL) with HikariCP pooling

  • Exploit-proof GUI (all clicks cancelled, no item movement)

  • Transaction-safe purchases with synchronized locks preventing double-buy

  • DonutSMP-style minimalist design (no glass spam)

  • Offline seller payment via Vault

  • Mailbox system for expired/cancelled items

  • Configurable durations (12h/24h/48h)

  • Search functionality

  • Tax system

  • World restrictions

  • Zero TPS impact with proper async/sync separation

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
manifest.kod
Code
27 1,957
src/main/java/com/velthara/auctionhouse/VeltharAuctionHouse.java
package com.velthara.auctionhouse;

import com.velthara.auctionhouse.command.AuctionCommand;
import com.velthara.auctionhouse.config.ConfigManager;
import com.velthara.auctionhouse.database.Database;
import com.velthara.auctionhouse.database.MySQLDatabase;
import com.velthara.auctionhouse.database.SQLiteDatabase;
import com.velthara.auctionhouse.inventory.gui.GUIListener;
import com.velthara.auctionhouse.inventory.gui.GUIManager;
import com.velthara.auctionhouse.manager.AuctionManager;
import com.velthara.auctionhouse.manager.EconomyManager;
import com.velthara.auctionhouse.manager.MailboxManager;
import com.velthara.auctionhouse.task.ExpiryTask;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class VeltharAuctionHouse extends JavaPlugin {
    
    private ConfigManager configManager;
    private Database database;
    private EconomyManager economyManager;
    private GUIManager guiManager;
    private AuctionManager auctionManager;
    private MailboxManager mailboxManager;
    private ExpiryTask expiryTask;
    
    @Override
    public void onEnable() {
        this.configManager = new ConfigManager(this);
        
        this.economyManager = new EconomyManager(this);
        if (!this.economyManager.setupEconomy()) {
            getLogger().severe("Vault not found! Disabling plugin...");
            Bukkit.getPluginManager().disablePlugin(this);
            return;
        }
        
        String dbType = getConfig().getString("database.type", "SQLITE");
        if (dbType.equalsIgnoreCase("MYSQL")) {
            this.database = new MySQLDatabase(this);
        } else {
            this.database = new SQLiteDatabase(this);
        }
        
        this.database.connect().thenRun(() -> {
            getLogger().info("Database connected successfully.");
        }).exceptionally(ex -> {
            getLogger().severe("Failed to connect to database: " + ex.getMessage());
            Bukkit.getPluginManager().disablePlugin(this);
            return null;
        });
        
        this.guiManager = new GUIManager();
        this.mailboxManager = new MailboxManager(this);
        this.auctionManager = new AuctionManager(this);
        
        Bukkit.getPluginManager().registerEvents(new GUIListener(guiManager), this);
        
        this.getCommand("ah").setExecutor(new AuctionCommand(this));
        
        long checkInterval = getConfig().getLong("expire.check-interval", 300) * 20L;
        this.expiryTask = new ExpiryTask(this);
        this.expiryTask.runTaskTimerAsynchronously(this, checkInterval, checkInterval);
        
        getLogger().info("VeltharAuctionHouse enabled successfully.");
    }
    
    @Override
    public void onDisable() {
        if (this.expiryTask != null) {
            this.expiryTask.cancel();
        }
        
        if (this.database != null) {
            this.database.disconnect();
        }
        
        getLogger().info("VeltharAuctionHouse disabled.");
    }
}