xpertx2

Make this plugin for me

📎 1 file 7,509 chars
📄
pasted-code-1782932443727.txt
txt 675 lines
▶
# BROKITS Advanced Plot System Plugin

I want a fully custom Minecraft Paper plugin (1.21+) that recreates and significantly improves my existing Skript Plot System. The plugin should be built for performance, use proper OOP design, save everything in YAML or SQLite/MySQL, support reloads, and integrate with WorldGuard and Vault.

---

# Overview

The plugin is a complete plot renting system.

Players rent predefined WorldGuard regions using a custom currency item.

Every plot has:

* Owner
* Members
* Rent timer
* Upgradeable member slots
* Sign displaying information
* INVENTORY GUI management
* Like system
* Logs/history
* Illegal block protection
* Automatic expiration
* Plot selector INVENTORY GUI

The plugin should NOT rely on Skript variables.

Everything should be stored properly in files/database.

---

# Dependencies

Required:

* Paper 1.21+
* WorldGuard
* WorldEdit

Optional:

* Vault
* PlaceholderAPI

---

# Plot Creation

Admins create plots from existing WorldGuard regions.

Example:

/plot create 

The plugin should:

* register the region
* save it
* ask the admin to place the plot sign
* save sign location
* assign default rent
* assign default member slots
* initialize logs
* initialize likes
* initialize status

---

# Plot Information

Every plot stores:

Plot ID

WorldGuard region

Owner UUID

Owner name

Members

Rent cost

Expiration time

Maximum expiration

Current slots

Maximum slots

Like count

Players who liked

Logs

Status

Sign location

Teleport location

Creation date

---

# Renting

Players right-click the plot sign.

If available:

Plugin checks:

* player owns enough currency item
* player has not exceeded rent limit
* plot is available

If successful:

* removes currency item
* sets owner
* adds owner as member
* adds WorldGuard owner
* starts expiration timer
* updates sign
* logs action

---

# Automatic Expiration

Every few seconds plugin checks plots.

Expired plots:

Remove owner

Remove members

Remove WorldGuard owners

Remove WorldGuard members

Reset slots

Reset likes

Reset logs (optional)

Reset expiration

Set status available

Update sign

---

# Plot Signs

Signs automatically update.

Available plot:

Unrented

Rent Price

Slots

Available

Rented plot:

Rented

Remaining time

Owner

Current Members

Updates automatically.

---

# Plot Management INVENTORY GUI

Owner can open management INVENTORY GUI.

Contains:

Members

Pay Rent

Upgrade Slots

Logs

Sell Plot

Back buttons

Nice decorative layout

Configurable items

---

# Member Management

Members INVENTORY GUI

Shows:

Owner

Members

Empty slots

Locked slots

Owner can:

Add player

Remove player

Maximum slots configurable

Adding player:

Click empty slot

Type player name in chat

Player gets added

WorldGuard member updated

Removing:

Click player head

Removes player

Updates WorldGuard

Logs action

---

# Rent Extension

Owner clicks:

Pay Rent

Plugin:

Checks currency

Removes currency

Extends expiration

Respects maximum rent limit

Updates sign

Logs action

---

# Slot Upgrades

Owner buys additional member slots.

Configurable price.

Maximum slots configurable.

Updates INVENTORY GUI.

Logs purchase.

---

# Selling Plot

Owner can sell plot.

Confirmation INVENTORY GUI.

When confirmed:

Remove owner

Remove members

Reset likes

Reset slots

Reset timer

Reset status

Reset WorldGuard

Update sign

Log sale

---

# Plot Logs

Every important action creates a log.

Examples:

Player rented plot

Member added

Member removed

Rent extended

Slot purchased

Plot sold

Plot expired

Like added

Like removed

Illegal block attempted

Logs stored permanently.

INVENTORY GUI supports:

Pagination

Clear logs

Admin bypass

---

# Plot Likes

Players can like rented plots.

One like per player.

Can unlike.

Stores UUIDs.

Shows:

Current likes

Top plots

INVENTORY GUI leaderboard

Cooldown between likes.

---

# Plot Like INVENTORY GUI

Command:

/plotlike

Shows:

Top liked plots

All plots

Current likes

Whether player liked

Click to like/unlike

Supports pagination.

---

# Plot Status INVENTORY GUI

Admin command.

Shows every plot.

Green:

Available

Red:

Occupied

Useful for management.

---

# Plot Selector

Physical block opens selector INVENTORY GUI.

INVENTORY GUI displays different plot worlds/types.

Click teleports player.

Admin commands:

Set selector locations

Delete selector locations

Configurable INVENTORY GUI.

---

# Currency System

Uses custom item instead of Vault money.

Admin can define currency item.

Default:

Sunflower named Coin.

Rent consumes item stack.

Slot upgrades consume item.

Rent extension consumes item.

Everything configurable.

---

# Illegal Block Protection

Inside plots only.

Plugin blocks configurable blocks/items.

Examples:

TNT

End Crystal

Respawn Anchor

Lava

Water Bucket

TNT Minecart

Permission bypass.

Optional owner bypass.

Logs attempts.

Completely configurable.

---

# WorldGuard Integration

Plugin automatically manages:

Region owners

Members

Removal

Expiration

Everything synchronized.

---

# Commands

Admin:

/plot create

/plot delete

/plot info

/plot setrent

/plot setslots

/plot addrent

/plot setowner

/plot add

/plot kick

/plot evict

/plot deleteallplots

/plot status

/plot setcoin

/plot givecoin

/plot setblock

/plot delblock

/plot setlocation

/plot dellocation

Player:

/plotlike

Future:

/plots

/myplot

/plot home

---

# Permissions

plots.admin

plots.maxrentbypass

plots.delaybypass

plots.illegalbypass

plots.owner

plots.member

---

# Configuration

Everything configurable:

Messages

INVENTORY GUI titles

Items

Rent prices

Currency

Cooldowns

Max rent

Max slots

Illegal blocks

INVENTORY GUI layouts

Sounds

Permissions

World name

Selector locations

Update intervals

---

# PlaceholderAPI Support

Examples:

%plots_owned%

%plots_available%

%plots_total%

%plot_likes%

%plot_owner%

%plot_time_left%

%plot_members%

%plot_status%

---

# Performance Improvements

Unlike the Skript, this plugin should:

Never loop all plots every tick.

Cache plot data.

Use asynchronous saving.

Use UUIDs instead of player names.

Avoid unnecessary WorldGuard calls.

Support hundreds of plots without lag.

---

# Additional Improvements I Want

I do NOT want a direct Skript conversion.

I want a modern, polished plugin with:

* Better INVENTORY GUI design
* Better code structure
* Proper API usage
* Clean configuration
* Better performance
* Automatic backups
* SQLite/MySQL support
* Full PlaceholderAPI support
* Adventure/MiniMessage support
* Hex color support
* Tab completion
* Better logging
* Better error handling
* Modular architecture
* Easy future expansion

The final plugin should feel like a premium, production-quality plots plugin rather than a Skript conversion.
Kodari AI
KodariJul 1 at 7:09 pm 6

I’ll build the BrokitsPlotSystem - a comprehensive plot renting plugin for Paper 1.21+.

BrokitsPlotSystem
A premium plot renting system for Paper 1.21+ that allows admins to create rentable plots from WorldGuard regions. Players rent plots using a custom currency item, manage members through an interactive GUI, extend rent, upgrade slots, and like plots. Features automatic expiration, illegal block protection, detailed logging, GUI management, PlaceholderAPI support, and SQLite/YAML data storage with hex color support and async saving.

Creating all project files. Starting with foundation, data layer, utilities, GUI framework, implementations, listeners, commands, and integration.

Let me check what I’ve already created and what’s still needed

Good, all core files are in place. I need to create the missing utility, command, listener, task, and build files.

Kodari can make mistakes. Review important code before using.
Files
src
Code
21 2,101
src/main/java/com/brokits/plots/BrokitsPlotsPlugin.java
package com.brokits.plots;

import com.brokits.plots.command.CommandManager;
import com.brokits.plots.config.ConfigManager;
import com.brokits.plots.config.MessageManager;
import com.brokits.plots.data.PlotManager;
import com.brokits.plots.economy.CurrencyManager;
import com.brokits.plots.gui.GUIListener;
import com.brokits.plots.gui.GUIManager;
import com.brokits.plots.integration.PlaceholderManager;
import com.brokits.plots.integration.WorldGuardManager;
import com.brokits.plots.listener.IllegalBlockListener;
import com.brokits.plots.listener.PlotSelectorListener;
import com.brokits.plots.listener.SignClickListener;
import com.brokits.plots.task.PlotExpireTask;
import com.brokits.plots.task.SignUpdateTask;
import com.brokits.plots.task.BackupTask;
import org.bukkit.plugin.java.JavaPlugin;

public class BrokitsPlotsPlugin extends JavaPlugin {

    private static BrokitsPlotsPlugin instance;
    private ConfigManager configManager;
    private MessageManager messageManager;
    private PlotManager plotManager;
    private CurrencyManager currencyManager;
    private WorldGuardManager worldGuardManager;
    private GUIManager guiManager;
    private CommandManager commandManager;
    private PlaceholderManager placeholderManager;

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

        saveDefaultConfig();
        this.configManager = new ConfigManager(this);
        this.messageManager = new MessageManager(this);
        this.worldGuardManager = new WorldGuardManager();
        this.plotManager = new PlotManager(this);
        this.currencyManager = new CurrencyManager(this);
        this.guiManager = new GUIManager();
        this.commandManager = new CommandManager(this);

        getServer().getPluginManager().registerEvents(new GUIListener(guiManager), this);
        getServer().getPluginManager().registerEvents(new SignClickListener(this), this);
        getServer().getPluginManager().registerEvents(new IllegalBlockListener(this), this);
        getServer().getPluginManager().registerEvents(new PlotSelectorListener(this), this);

        commandManager.registerCommands();

        new PlotExpireTask(this).runTaskTimer(this, expireCheckInterval(), expireCheckInterval());
        new SignUpdateTask(this).runTaskTimer(this, signUpdateInterval(), signUpdateInterval());

        int backupInterval = configManager.getBackupInterval();
        if (backupInterval > 0) {
            new BackupTask(this).runTaskTimerAsynchronously(this, 20L * 60 * backupInterval, 20L * 60 * backupInterval);
        }

        plotManager.loadPlots();

        if (getServer().getPluginManager().getPlugin("PlaceholderAPI") != null) {
            this.placeholderManager = new PlaceholderManager(this);
            this.placeholderManager.register();
            getLogger().info("PlaceholderAPI expansion registered.");
        }

        getLogger().info("BrokitsPlotSystem enabled successfully!");
    }

    @Override
    public void onDisable() {
        if (plotManager != null) {
            plotManager.saveAll();
        }
        instance = null;
        getLogger().info("BrokitsPlotSystem disabled.");
    }

    public static BrokitsPlotsPlugin getInstance() {
        return instance;
    }

    public ConfigManager getConfigManager() {
        return configManager;
    }

    public MessageManager getMessageManager() {
        return messageManager;
    }

    public PlotManager getPlotManager() {
        return plotManager;
    }

    public CurrencyManager getCurrencyManager() {
        return currencyManager;
    }

    public WorldGuardManager getWorldGuardManager() {
        return worldGuardManager;
    }

    public GUIManager getGuiManager() {
        return guiManager;
    }

    public long expireCheckInterval() {
        return getConfig().getLong("expire-check-interval", 40);
    }

    public long signUpdateInterval() {
        return getConfig().getLong("sign-update-interval", 100);
    }
}