dasdfdsd
📎 1 file 29,669 chars
📄
pasted-code-1788896483396.txt
txt 1576 lines
▶
Build a complete, professional, production-ready Minecraft prison plugin called "ZendanMashhadi" for Paper/Purpur 1.21.11.

==================================================
1. PROJECT INFORMATION
==================================================

Plugin Name:
ZendanMashhadi

Display Name:
Zendan Mashhadi

Main Class:
ir.zendanmashhadi.ZendanMashhadi

Java:
21

Minecraft:
Paper/Purpur 1.21.11

Build System:
Maven

Final JAR:
ZendanMashhadi.jar

The project MUST compile successfully using:

mvn clean package

The final JAR must be generated at:

target/ZendanMashhadi.jar

Use native Bukkit/Paper APIs whenever possible.

Do not add unnecessary dependencies.

==================================================
2. LANGUAGE REQUIREMENT — VERY IMPORTANT
==================================================

The entire source code, configuration keys, Java classes, comments, command names, permission nodes, internal IDs, PDC keys, and technical identifiers may remain in English.

However:

EVERYTHING THAT IS SHOWN TO PLAYERS INSIDE THE GAME MUST BE IN PERSIAN (FARSI).

This is mandatory.

Player-facing Persian content includes:

- Chat messages
- NPC dialogue
- Haji Mashhadi dialogue
- GUI titles
- GUI buttons
- Menu items
- Item names
- Item lore
- Holograms
- Boss bars
- Action bars
- Titles
- Subtitles
- Error messages
- Success messages
- Prison messages
- Arrest messages
- Release messages
- Escape messages
- Parkour messages
- Countdown messages
- Help messages
- Confirmation messages
- Warning messages

DO NOT show English player-facing text unless it is a command, permission node, technical ID, or another explicitly technical value.

Commands themselves MUST remain English/Finglish.

For example:

/zndan handcuffs

is correct.

But the item given to the player must have a Persian name such as:

دستبند زندان

NOT:

Prison Handcuffs

==================================================
3. HAJI MASHHADI DIALOGUE — VERY IMPORTANT
==================================================

Haji Mashhadi is a Persian-speaking NPC.

ALL Haji Mashhadi dialogue MUST be written in Persian and displayed in Minecraft chat.

Use these exact default dialogue lines:

Haji Mashhadi:
"سلام مشتی"

Then:

"چی می‌خوای؟"

When the player says/types:

"فرار"

Haji Mashhadi responds:

"پولشو بده، آیتمو بگیر بده حاج مشهدی"

The dialogue must appear in the Minecraft chat.

Example:

§6حاج مشهدی§f: سلام مشتی

§6حاج مشهدی§f: چی می‌خوای؟

§6حاج مشهدی§f: پولشو بده، آیتمو بگیر بده حاج مشهدی

The Persian dialogue must NOT be translated into English.

Do not replace it with:

"Hello my friend"

or:

"What do you want?"

The actual in-game dialogue must be Persian.

All Haji Mashhadi dialogue must be configurable in config.yml.

==================================================
4. COMMAND LANGUAGE
==================================================

Commands must remain English/Finglish.

The main command is:

/zndan

Aliases:

/zendan
/zindan

Do NOT create Persian command names.

Examples:

/zndan handcuffs
/zndan uncuff 
/zndan unjail 
/zndan jail   
Kodari AI
KodariSep 8 at 7:54 pm 4
ZendanMashhadi
A comprehensive prison management plugin for Paper/Purpur 1.21.11 with full Persian (Farsi) player-facing content. Features include a persistent prisoner system with data.yml storage, custom PDC-validated handcuff items, three configurable prison cells with villager NPC guards, sentence timers with absolute timestamps, a central release system guaranteeing SURVIVAL gamemode restoration, and a unique escape mechanic. Cell 1 and Cell 2 offer separate escape systems requiring cell-specific keys, ropes, and beacons obtained via time-wait or diamond payment, then delivered to Haji Mashhadi NPCs who initiate parkour courses. Cell 3 has no escape. Includes follow system, holograms, damage preservation (no god mode), anti-exploit protections, full tab completion, and comprehensive Persian configuration.
  1. Create the Maven/Paper project metadata, Persian defaults, permissions, and documentation.

  2. Create the persistence, location, prisoner-state, release, item-security, NPC, hologram, command, and event systems.

  3. Wire all managers in the main plugin and provide the complete command/tab-completion surface.

  1. Created the complete Maven project for ZendanMashhadi.

  2. Added Persian player-facing configuration, dialogue, messages, item names, holograms, NPC names, and escape text.

  3. Implemented persistent prisoner data in plugins/ZendanMashhadi/data.yml.

  4. Added handcuffs with PersistentDataContainer validation, arresting, cell delivery, jail, uncuff, unjail, sentence timers, reconnect handling, and centralized release logic.

  5. Added cell guards, Haji Mashhadi dialogue, cell-specific escape items, beacons, parkour setup, failure penalties, and death handling.

  6. Added prisoner restrictions without cancelling damage events, preserving fall, PvP, mob, fire, lava, projectile, explosion, drowning, suffocation, and void damage.

  7. Added all requested commands, aliases, permissions, and tab completion.

  8. Added pom.xml, plugin.yml, config.yml, Java source files, and README.md; the configured output is target/ZendanMashhadi.jar.

Kodari can make mistakes. Review important code before using.
Files
src
pom.xml
README.md
Code
17 1,732
src/main/java/ir/zendanmashhadi/ZendanMashhadi.java
package ir.zendanmashhadi;

import org.bukkit.Bukkit;
import org.bukkit.command.PluginCommand;
import org.bukkit.plugin.java.JavaPlugin;

public class ZendanMashhadi extends JavaPlugin {
    private DataManager dataManager;
    private LocationManager locationManager;
    private PrisonManager prisonManager;
    private HandcuffManager handcuffManager;
    private EscapeManager escapeManager;
    private NpcManager npcManager;
    private HologramManager hologramManager;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        dataManager = new DataManager(this);
        dataManager.load();
        locationManager = new LocationManager(this);
        prisonManager = new PrisonManager(this, dataManager, locationManager);
        handcuffManager = new HandcuffManager(this);
        escapeManager = new EscapeManager(this, prisonManager, locationManager);
        npcManager = new NpcManager(this, locationManager);
        hologramManager = new HologramManager(this, locationManager, prisonManager);

        npcManager.loadPersistentNpcs();
        hologramManager.load();

        PrisonListener listener = new PrisonListener(this, prisonManager, handcuffManager, escapeManager, npcManager);
        Bukkit.getPluginManager().registerEvents(listener, this);
        CommandManager commandManager = new CommandManager(this, prisonManager, handcuffManager, escapeManager, npcManager, locationManager);
        PluginCommand command = getCommand("zndan");
        if (command != null) {
            command.setExecutor(commandManager);
            command.setTabCompleter(commandManager);
        }
        Bukkit.getScheduler().runTaskTimer(this, () -> {
            prisonManager.tick();
            hologramManager.update();
        }, 20L, 20L);
    }

    @Override
    public void onDisable() {
        if (dataManager != null) dataManager.save();
        if (hologramManager != null) hologramManager.removeAll();
    }

    public DataManager getDataManager() { return dataManager; }
    public LocationManager getLocationManager() { return locationManager; }
    public PrisonManager getPrisonManager() { return prisonManager; }
    public HandcuffManager getHandcuffManager() { return handcuffManager; }
    public EscapeManager getEscapeManager() { return escapeManager; }
    public NpcManager getNpcManager() { return npcManager; }
}