jackychein13-ui

1.21.4 papermc plugin for minecraft server named VortalBattleRoyale Read booth prompts before creating

📎 2 files 10,195 chars
📄
pasted-code-1783037743130.txt
txt 400 lines
▶
# Project Name: VortalBattleRoyale

You are an expert Minecraft plugin developer.

Create a **premium-quality**, **production-ready**, **fully optimized** Battle Royale event plugin for **Paper 1.21.4** using **Java 21**, **Gradle**, and the latest **Paper API**.

The code must be modular, scalable, well-documented, and compile without errors. Do not use deprecated APIs. Follow modern OOP practices and separate managers, listeners, commands, INVENTORY GUI, and utility classes.

---

# Plugin Overview

The plugin creates automated Battle Royale events that administrators can host at any time.

Players choose whether to participate. Once registration ends, one of the configured maps is randomly selected, participants are teleported to unique spawn points, receive predefined kits, fight until one player remains, and then everything is restored.

The plugin should support multiple maps and easy management through commands.

---

# Permission

```text
vortalbattleroyale.admin
```

---

# Main Command

```text
/battleroyale
```

Only administrators may execute administrative subcommands.

---

# Map Management

Administrators must be able to create and remove maps.

## Create Map

```text
/battleroyale mapekle 
```

When executed:

* Create a new map entry.
* Save the world name automatically.
* Save the administrator's current location as the map center.
* Send:

> Map created successfully.
>
> Please configure 10 spawn points using:
>
> /battleroyale spawn1 
>
> ...
>
> /battleroyale spawn10 

---

## Delete Map

```text
/battleroyale mapsil 
```

Deletes:

* Map
* Spawn points
* Configuration

---

# Spawn Management

Each map supports exactly **10 spawn points**.

Commands:

```text
/battleroyale spawn1 
/battleroyale spawn2 
...
/battleroyale spawn10 
```

Each command saves the administrator's current location.

The plugin should verify all 10 spawn points exist before allowing that map to be used.

---

# Starting an Event

Command:

```text
/battleroyale
```

Starting the event should **NOT** instantly teleport players.

Instead it broadcasts a clickable participation message.

Example:

━━━━━━━━━━━━━━━━━━━━━━

⚔ **Battle Royale Event**

A Battle Royale event has started!

Click **[JOIN]** to participate.

Registration closes in **60 seconds**.

━━━━━━━━━━━━━━━━━━━━━━

Requirements:

* Clickable JOIN button
* Hover text
* Sound when joining
* Players may also join with:

```text
/br join
```

Duplicate joins are ignored.

---

# Registration Phase

After the countdown:

* Registration closes.
* If fewer than 2 players joined:

Cancel the event automatically.

Broadcast:

> Event cancelled due to insufficient players.

---

# Map Selection

If enough players joined:

Randomly choose **one** of the configured maps.

Every configured map should have an equal chance.

Broadcast:

> Selected Map:
>
> 

---

# Player Preparation

Before teleporting:

Save each participant's:

* Inventory
* Armor
* Offhand
* XP
* Hunger
* Health
* Potion Effects
* GameMode
* Location

Everything must later be restored perfectly.

---

# Teleportation

Teleport every participant to a different spawn point.

Rules:

* No two players may spawn at the same location.
* Shuffle spawn points randomly.
* Maximum supported players: 10.

If fewer players than spawn points exist, simply use random unique spawns.

---

# Battle Royale Kit

Immediately after teleportation:

Clear inventory.

Give:

* Iron Sword
* Bow
* 2 Stacks of Arrows (128 arrows)

Nothing else.

Restore:

* Full Health
* Full Hunger

---

# Game Rules

Participants fight until only one player remains alive.

When a player dies:

* Eliminate them.
* Remove them from the event.
* Restore:

  * Inventory
  * Armor
  * XP
  * Hunger
  * Health
  * Potion Effects
  * Original Location
  * Original GameMode

Broadcast:

> PlayerName has been eliminated!

Dead players are no longer participants.

---

# Winner

When only one participant remains:

Broadcast:

━━━━━━━━━━━━━━━━━━━━━━

🏆 Winner



has won the Battle Royale!

━━━━━━━━━━━━━━━━━━━━━━

Restore the winner exactly like every eliminated player.

Clear all event data.

---

# Force Stop

Command:

```text
/battleroyale bitir
```

Requirements:

* Stop the event immediately.
* Restore every participant.
* Clear memory.
* Broadcast:

> The Battle Royale event has been cancelled by an administrator.

---

# Disconnect Handling

If a participant disconnects:

Treat them as eliminated.

Restore all saved data when they reconnect if necessary.

Prevent inventory loss.

---

# Safety Requirements

Never permanently delete inventories.

Restore everything even if:

* server reloads unexpectedly
* player disconnects
* administrator stops the event
* winner is determined

---

# Configuration

Store maps inside:

```yaml
maps.yml
```

Each map should contain:

* Name
* World
* Center
* Spawn1
* Spawn2
* ...
* Spawn10

---

# Additional Features

Implement:

* ActionBar countdown
* BossBar showing remaining players
* Scoreboard displaying:

  * Remaining players
  * Current map
  * Alive count
* Join/Leave sounds
* Colored MiniMessage messages
* Configurable messages.yml
* Configurable kit in config.yml
* Configurable registration time
* Configurable minimum players
* Configurable maximum players

---

# Technical Requirements

* Java 21
* Paper 1.21.4
* Adventure API
* Gradle
* YAML storage
* UUID-based player tracking
* Async-safe code
* Proper event cleanup
* No memory leaks
* Modern package structure
* Manager-based architecture
* INVENTORY GUI utilities where appropriate

---

# Final Output

Generate the **entire plugin**, including:

* Complete Java source code
* All command classes
* Managers
* Event listeners
* Inventory backup system
* Map management system
* Spawn management
* Registration system
* Event lifecycle manager
* Scoreboard manager
* BossBar manager
* plugin.yml
* config.yml
* messages.yml
* maps.yml

The project must compile successfully and be immediately usable on a Paper 1.21.4 server without requiring additional modifications.
📄
pasted-code-1783037746445.txt
txt 275 lines
▶
# Language Requirement

**The entire plugin must use Turkish for all player-facing text.**

Do **NOT** use English messages anywhere in the plugin unless they are internal code comments.

All chat messages, INVENTORY GUI titles, buttons, lore, ActionBar messages, BossBars, Scoreboards, broadcasts, and system notifications must be written in Turkish.

---

# Turkish Messages

## Event Started

```
━━━━━━━━━━━━━━━━━━━━━━
⚔ §6§lBattle Royale Etkinliği

§eSunucuda bir Battle Royale etkinliği başladı!

§fKatılmak için aşağıdaki butona tıkla.

§a§l[ ✔ KATIL ]

§7Kayıt süresi: §e60 saniye
━━━━━━━━━━━━━━━━━━━━━━
```

---

## Player Joined

```
§a✔ §e%player% §7Battle Royale etkinliğine katıldı.
```

---

## Player Left

```
§c✘ §e%player% §7Battle Royale etkinliğinden ayrıldı.
```

---

## Registration Closed

```
§6⏰ Kayıt süresi sona erdi!

§eOyuncular haritaya gönderiliyor...
```

---

## Not Enough Players

```
§cBattle Royale etkinliği yeterli oyuncu olmadığı için iptal edildi.
```

---

## Selected Map

```
§b🗺 Seçilen Harita: §e%map%
```

---

## Battle Started

```
§6⚔ Battle Royale başladı!

§eHerkese bol şans!
```

---

## Player Eliminated

```
§4☠ §e%player% §7Battle Royale'den elendi!
```

---

## Winner

```
━━━━━━━━━━━━━━━━━━━━━━
🏆 §6§lBattle Royale Kazananı

§e%player%

§aTebrikler! Etkinliği kazandın!
━━━━━━━━━━━━━━━━━━━━━━
```

---

## Admin Force Stop

```
§c🛑 Battle Royale etkinliği bir yetkili tarafından sonlandırıldı.
```

---

## Map Created

```
§a✔ §e%map% §aisimli harita başarıyla oluşturuldu.

§7Lütfen aşağıdaki komutlarla 10 adet doğma noktası belirleyin.

§f/battleroyale spawn1 %map%
...
§f/battleroyale spawn10 %map%
```

---

## Map Deleted

```
§c🗑 §e%map% §7isimli harita başarıyla silindi.
```

---

## Spawn Saved

```
§a📍 %map% haritası için Spawn %number% kaydedildi.
```

---

## All Spawns Configured

```
§a✔ Bu harita için gerekli olan 10 doğma noktası tamamlandı.

§eHarita artık Battle Royale etkinliklerinde kullanılabilir.
```

---

## Already Joined

```
§eZaten bu etkinliğe katıldın.
```

---

## Successfully Joined

```
§aBattle Royale etkinliğine başarıyla katıldın.
```

---

## Player Quit

```
§c%player% oyundan ayrıldığı için Battle Royale'den elendi.
```

---

## Permission

```
§cBu komutu kullanma yetkin bulunmuyor.
```

---

## Map Not Found

```
§cBu isimde bir harita bulunamadı.
```

---

## Missing Spawn Points

```
§cBu haritanın tüm doğma noktaları henüz ayarlanmamış.
```

---

## Event Already Running

```
§cZaten aktif bir Battle Royale etkinliği bulunuyor.
```

---

## No Active Event

```
§cŞu anda aktif bir Battle Royale etkinliği bulunmuyor.
```

---

## Registration Closed

```
§cKatılım süresi sona erdi.
```

---

## Maximum Players

```
§cMaksimum oyuncu sayısına ulaşıldı.
```

---

# ActionBar

```
§e⏳ Başlangıca: %time%

§a👥 Kalan Oyuncu: %alive%

§b🗺 Harita: %map%
```

---

# BossBar

```
⚔ Battle Royale | Kalan Oyuncu: %alive%
```

---

# Scoreboard

```
§6§lBattle Royale

§7Harita:
§f%map%

§7Hayatta:
§a%alive%

§7Toplam:
§e%players%

§6Son Kalan Kazanır!
```

---

# INVENTORY GUI Language

Every inventory title, button, lore, tooltip, confirmation dialog, and clickable message must also be completely translated into Turkish and use MiniMessage/Adventure Components where possible. The plugin must feel like it was originally designed for Turkish-speaking Minecraft servers.
Kodari AI
KodariJul 3 at 12:19 am 2

I’ll create VortalBattleRoyale — a comprehensive Battle Royale event plugin for Paper 1.21.4 with full Turkish localization.

VortalBattleRoyale
Premium Battle Royale event plugin for Paper 1.21.4 servers. Administrators can host automated Battle Royale events with configurable maps, spawn points, kits, and registration timers. Features include clickable join invitations, ActionBar/BossBar/Scoreboard tracking, player data backup and restoration, elimination system, winner announcements, and complete Turkish localization. Supports up to 10 players per event with random map selection.

Starting with build configuration and resource files:

Now creating the utility classes:

Now creating model classes:

Now the inventory GUI system:

Now creating the managers — the core of the plugin:

Now creating the listeners:

Now the command class:

And finally, the main plugin class:

All 24 files created. Let me verify the structure and ensure everything compiles together correctly by checking for any missing dependencies or method references.

Let me trace through the key flows:

  1. Event start flow: /battleroyale (no args) → BattleRoyaleCommand.onCommand → EventManager.startRegistration() → broadcasts clickable message → countdown → finishRegistration() → startGame() → teleport + give kit

  2. Join flow: Click [KATIL] or /br join → EventManager.joinEvent() → adds player to participants set

  3. Death flow: Player dies → GameListener.onPlayerDeath() → EventManager.eliminatePlayer() → restores data + broadcasts + checks winner

  4. Disconnect flow: GameListener.onPlayerQuit() → EventManager.handleDisconnect() → eliminates or removes participant

  5. Force stop: /battleroyale bitir → EventManager.forceStop() → restores all + resets

  6. Map management: /battleroyale mapekle/spawn1-10/mapsil → MapManager CRUD operations

The plugin looks complete. All references check out:

  • VortalBattleRoyale creates all managers, registers commands and listeners

  • EventManager uses MapManager, PlayerDataManager, ScoreboardManager, BossBarManager

  • GameListener uses EventManager

  • BattleRoyaleCommand uses EventManager and MapManager

  • MessageUtil uses static VortalBattleRoyale reference and FileConfiguration

  • ScoreboardManager uses VortalBattleRoyale to get messages config

  • BossBarManager uses VortalBattleRoyale to get messages config

  • ColorUtil is standalone with only Adventure API dependencies

All imports are from Paper API (paper-api:1.21.4) which is declared as compileOnly. No external runtime dependencies needed.

The plugin uses:

  • Adventure API (MiniMessage, Component, BossBar, Title) - built into Paper

  • Bukkit/Paper API - declared as compileOnly

  • No XSeries needed since we’re targeting Paper 1.21.4 specifically

All player-facing text is in Turkish through messages.yml. The code uses MessageUtil methods which read from messages.yml.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
settings.gradle
Code
24 1,806
src/main/java/com/vortal/battleroyale/VortalBattleRoyale.java
package com.vortal.battleroyale;

import com.vortal.battleroyale.command.BattleRoyaleCommand;
import com.vortal.battleroyale.inventory.gui.GUIListener;
import com.vortal.battleroyale.inventory.gui.GUIManager;
import com.vortal.battleroyale.listener.GameListener;
import com.vortal.battleroyale.manager.*;
import com.vortal.battleroyale.util.MessageUtil;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.plugin.java.JavaPlugin;

import java.io.File;
import java.io.IOException;

public class VortalBattleRoyale extends JavaPlugin {
    private MapManager mapManager;
    private PlayerDataManager playerDataManager;
    private ScoreboardManager scoreboardManager;
    private BossBarManager bossBarManager;
    private EventManager eventManager;
    private GUIManager guiManager;
    private FileConfiguration messagesConfig;
    private File messagesFile;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        saveMessagesConfig();

        MessageUtil.init(this);

        this.guiManager = new GUIManager();

        this.mapManager = new MapManager(this);
        this.playerDataManager = new PlayerDataManager(this);
        this.scoreboardManager = new ScoreboardManager(this);
        this.bossBarManager = new BossBarManager(this);
        this.eventManager = new EventManager(this, mapManager, playerDataManager,
                scoreboardManager, bossBarManager);

        BattleRoyaleCommand command = new BattleRoyaleCommand(this, eventManager, mapManager);
        getCommand("battleroyale").setExecutor(command);
        getCommand("battleroyale").setTabCompleter(command);

        getServer().getPluginManager().registerEvents(new GameListener(this, eventManager), this);
        getServer().getPluginManager().registerEvents(new GUIListener(guiManager), this);

        getLogger().info("VortalBattleRoyale başarıyla aktif edildi!");
    }

    @Override
    public void onDisable() {
        if (eventManager != null) {
            eventManager.forceStop();
        }
        if (playerDataManager != null) {
            playerDataManager.cleanupAll();
        }
        getLogger().info("VortalBattleRoyale devre dışı bırakıldı.");
    }

    public FileConfiguration getMessagesConfig() {
        if (messagesConfig == null) {
            reloadMessagesConfig();
        }
        return messagesConfig;
    }

    public void reloadMessagesConfig() {
        if (messagesFile == null) {
            messagesFile = new File(getDataFolder(), "messages.yml");
        }
        messagesConfig = YamlConfiguration.loadConfiguration(messagesFile);
        MessageUtil.reload();
    }

    private void saveMessagesConfig() {
        if (messagesFile == null) {
            messagesFile = new File(getDataFolder(), "messages.yml");
        }
        if (!messagesFile.exists()) {
            saveResource("messages.yml", false);
        }
    }

    public MapManager getMapManager() {
        return mapManager;
    }

    public EventManager getEventManager() {
        return eventManager;
    }

    public PlayerDataManager getPlayerDataManager() {
        return playerDataManager;
    }

    public GUIManager getGuiManager() {
        return guiManager;
    }
}