fngngg
📎 1 file 57,455 chars
📄
ZendanMashhadi_FINAL_COMPLETE_PROMPT_60KB.md
md 2518 lines
▶
You are an expert Minecraft Paper/Purpur plugin developer.

I have an existing Minecraft prison plugin named ZendanMashhadi. I want you to MODIFY AND COMPLETE the existing plugin, not create a simplified demo.

TARGET:
- Minecraft: Paper/Purpur 1.21.11
- Java: 21
- Maven
- Plugin name: ZendanMashhadi
- Main class: ir.zendanmashhadi.ZendanMashhadi
- Final JAR: ZendanMashhadi.jar
- Build command: mvn clean package

IMPORTANT:
Preserve all existing working prison functionality, but fix bugs and implement every feature below.

DO NOT REMOVE OR CHANGE ANY EXISTING FEATURE THAT IS NOT EXPLICITLY REQUESTED TO BE CHANGED BELOW.

==================================================
1. LANGUAGE
==================================================

EVERYTHING VISIBLE TO PLAYERS MUST BE IN PERSIAN.

This includes:
- NPC names
- NPC dialogue
- chat messages
- GUI titles
- item names
- item lore
- holograms
- actionbars
- bossbars
- titles
- subtitles
- error messages
- success messages
- prison messages
- escape messages
- sentence timer messages

Commands, Java class names, permissions, internal IDs and PDC keys may remain English.

Never show English NPC dialogue to players.

==================================================
2. PRISON WORLD
==================================================

Default:

prison-world: PrisonWorld
release-world: world

There are 3 cells:

Cell 1
Cell 2
Cell 3

All cells are inside PrisonWorld.

==================================================
3. CELL COMMANDS
==================================================

Keep:

/zndan cell set 1
/zndan cell set 2
/zndan cell set 3
/zndan cell setexit

Parkour setup:

/zndan cell parkour set 1
/zndan cell parkour set 2

/zndan cell parkour finish 1
/zndan cell parkour finish 2

Cell 3 has no escape parkour.

Aliases:

/zendan
/zindan

The existing commands must continue working exactly as before.

==================================================
4. HANDCUFFS
==================================================

Commands:

/zndan handcuffs
/zndan handcuff

Permission:

prison.arrest

Give exactly one custom handcuff.

Material:

IRON_BARS

Name:

§cدستبند زندان

Use a unique PersistentDataContainer ID.

Normal renamed Iron Bars must NOT work.

Only the real custom handcuff can arrest players.

Right-clicking a player with the valid handcuff arrests them.

Store:

- prisoner UUID
- prisoner name
- arresting staff UUID
- arresting staff name
- cell
- arrest timestamp
- release timestamp (ONLY starts when the correct cell guard accepts the prisoner)
- remaining sentence time
- arrested state
- handcuffed/transport state
- escaping state
- parkour state

IMPORTANT HANDCUFF DELIVERY BEHAVIOR:

When a staff member arrests a player with the valid handcuff:

- DO NOT instantly teleport the prisoner to the prison.
- The prisoner must remain connected to/follow the arresting staff member.
- The prisoner must be pulled/dragged along with the staff member during transportation.
- If the prisoner gets too far from the staff member, pull the prisoner back close to the staff member.
- IMMEDIATELY apply the real Minecraft `SLOW_FALLING` potion effect to the handcuffed prisoner.
- The `SLOW_FALLING` effect MUST actually be active on the prisoner while they are handcuffed and being transported.
- Keep `SLOW_FALLING` active throughout the entire handcuff transportation/follow state.
- `SLOW_FALLING` is only for preventing fall damage during the transportation/follow system.
- When the correct Cell Guard accepts the prisoner, stop the transportation state and remove ONLY the `SLOW_FALLING` effect added by this plugin.
- Do NOT make the prisoner invulnerable.
- Do NOT cancel normal damage.
- Do NOT change the normal Minecraft damage system.

The prisoner must stay in this transportation state until the staff member delivers them to the correct prison guard.

==================================================
5. JAIL COMMAND
==================================================

Command:

/zndan jail   
Kodari AI
KodariSep 10 at 7:06 pm 8
ZendanMashhadiPrisonSystem
Complete Persian prison plugin for Paper/Purpur 1.21.11. Features persistent timestamp-based sentences (25m/40m/1h20m per cell), handcuff arrest with real SLOW_FALLING and follow/drag transport, cell guard NPC delivery system, Haji Mashhadi escape shops with PDC-validated items, Cell 2 charge timer producing custom Beacon, Haji Reza GUI submission with exact 3-second parkour teleport delay, and immediate release via correct-cell آزادی NPC. Prisoners take normal damage, keep inventory on death, and sentences pause on logout/resume on reconnect. All player-facing text in Persian.
  1. Create the Maven/Paper project metadata and Persian configuration.

  2. Implement persistent prisoner data, timestamp sentences, cell locations, releases, follow transport, and NPC infrastructure.

  3. Implement handcuffs, restrictions, death/logout persistence, holograms, commands, and tab completion.

  4. Implement both escape shops, PDC validation, Cell 2 charging, Haji Reza GUIs, delayed parkour starts, and Freedom NPC release.

The core project files are created. I’m tightening the restart recovery, parkour finish tracking, and prisoner restriction handlers before stopping.ساخت پروژه ZendanMashhadi انجام شد، شامل:

  • پروژه Maven با Java 21 و Paper API

  • plugin.yml و config.yml فارسی

  • سیستم persistent زندانیان در data.yml

  • sentence timestamp-based با توقف هنگام خروج

  • دستگیری با PDC و دستبند واقعی

  • سیستم دنبال‌کردن زندانی و Slow Falling

  • تحویل فقط به نگهبان سلول صحیح

  • حفظ inventory هنگام مرگ و ادامه حبس

  • release مرکزی برای sentence، uncuff، unjail و Freedom NPC

  • NPCهای نگهبان، حاج مشهدی، حاج رضا و آزادی

  • آیتم‌های فرار با PDC

  • شارژ ۳۰ ثانیه‌ای Cell 2 و ساخت Beacon

  • GUI حاج رضا با چند slot ورودی

  • تأخیر دقیق ۶۰ تیک قبل از شروع پارکور

  • مکان جداگانه برای سلول، خروج و شروع پارکور

  • محدودیت‌های زندانیان

  • hologram زمان باقی‌مانده

  • دستورات و tab completion پایه برای /zndan

fngngg

چقد. مونده تموم شه

Kodari AI
KodariSep 11 at 1:30 am 1

هنوز کاری برای تکمیل در این گفتگو شروع نشده؛ اگر منظورت پروژه یا کاری خاص است، اسمش را بگو تا وضعیتش را بگویم.

fngngg

پروژه حاج مشهدی زندان

Kodari AI
KodariSep 11 at 1:31 am 1

متوجه شدم؛ منظورت پروژه حاج مشهدی زندان است.
در این گفتگو هنوز وضعیت یا میزان پیشرفت پروژه در دسترسم نیست، بنابراین نمی‌توانم دقیق بگویم چقدر مانده.

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

import org.bukkit.ChatColor;
import org.bukkit.command.PluginCommand;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;

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

    @Override
    public void onEnable() {
        saveDefaultConfig();
        dataManager = new DataManager(this);
        locationManager = new LocationManager(this);
        itemUtil = new ItemUtil(this);
        npcManager = new NpcManager(this);
        hologramManager = new HologramManager(this);
        handcuffManager = new HandcuffManager(this);
        escapeManager = new EscapeManager(this);
        prisonManager = new PrisonManager(this);
        npcManager.restore();
        prisonManager.start();
        getServer().getPluginManager().registerEvents(new PrisonListener(this), this);
        CommandManager commands = new CommandManager(this);
        PluginCommand command = getCommand("zndan");
        if (command != null) {
            command.setExecutor(commands);
            command.setTabCompleter(commands);
        }
        getLogger().info("ZendanMashhadi فعال شد.");
    }

    @Override
    public void onDisable() {
        if (prisonManager != null) prisonManager.stop();
    }

    public long getCellSentence(int cell) { return TimeUtil.parse(getConfig().getString("cells." + cell + ".sentence", "25m")); }
    public long getFailurePenalty() { return TimeUtil.parse(getConfig().getString("escape.failure-penalty", "5m")); }
    public boolean isRestricted(Player player) { return prisonManager != null && prisonManager.isJailed(player) && !player.hasPermission("prison.bypass"); }

    public void handleHaji(Player player, int cell) {
        PrisonerData prisoner = prisonManager.get(player.getUniqueId());
        if (prisoner == null || !prisoner.isJailed() || prisoner.getCell() != cell) return;
        if (cell == 1) {
            player.sendMessage("§eحاج مشهدی§f: اِ اِ... تو اینجا چی کار می‌کنی جوون؟");
            player.sendMessage("§eحاج مشهدی§f: می‌بینم که افتادی تو سلول اول...");
            player.sendMessage("§eحاج مشهدی§f: ولی نگران نباش، شاید یه راه کوچیک برای فرار داشته باشم. 😉");
            player.sendMessage("§eحاج مشهدی§f: یه چیزی دارم به اسم §aنخ فرار§f.");
            if (hasValid(player, itemUtil.thread())) player.sendMessage("§eحاج مشهدی§f: نخ فرار رو که داری جوون! برو پیش §eحاج رضا§f.");
            else if (count(player, org.bukkit.Material.DIAMOND) >= getConfig().getInt("escape.cell1.diamond-price", 2)) {
                remove(player, org.bukkit.Material.DIAMOND, getConfig().getInt("escape.cell1.diamond-price", 2));
                player.getInventory().addItem(itemUtil.thread());
                player.sendMessage("§eحاج مشهدی§f: آفرین... این نخ رو خوب نگه دار. حالا برو پیش §eحاج رضا§f.");
            } else player.sendMessage("§eحاج مشهدی§f: الماس کم داری جوون! برو §b۲ الماس§f جور کن، بعد بیا پیش خودم.");
        } else if (cell == 2) {
            player.sendMessage("§eحاج مشهدی§f: اوه اوه... سلول دومی؟");
            player.sendMessage("§eحاج مشهدی§f: برای این فرار، یه مقدار §fشیشه§f و §8آبسیدین§f مخصوص لازم داری.");
            player.sendMessage("§eحاج مشهدی§f: شیشه باید تو دست اصلیت باشه و آبسیدین تو دست چپت.");
            if (hasValid(player, itemUtil.glass()) && hasValid(player, itemUtil.obsidian())) player.sendMessage("§eحاج مشهدی§f: به‌به... می‌بینم که وسایل رو جور کردی. حالا آماده‌ای برای شروع؟");
            else player.sendMessage("§eحاج مشهدی§f: هنوز وسایل کامل نیست جوون. اول شیشه و آبسیدین مخصوص رو جور کن.");
            player.sendMessage("§7برای خرید، دوباره با حاج مشهدی صحبت کن و مواد لازم را همراه داشته باش.");
            if (!hasValidAnywhere(player, itemUtil.glass()) && count(player, org.bukkit.Material.OBSIDIAN) > 0) {
                remove(player, org.bukkit.Material.OBSIDIAN, 1); player.getInventory().addItem(itemUtil.glass());
            }
            if (!hasValidAnywhere(player, itemUtil.obsidian()) && count(player, org.bukkit.Material.DIAMOND) > 0) {
                remove(player, org.bukkit.Material.DIAMOND, 1); player.getInventory().addItem(itemUtil.obsidian());
            }
        } else player.sendMessage("§eحاج مشهدی§f: سلول سومی؟! فعلاً چیزی برای فروش بهت ندارم.");
    }

    private boolean hasValid(Player player, org.bukkit.inventory.ItemStack item) { return player.getInventory().containsAtLeast(item, 1); }
    private boolean hasValidAnywhere(Player player, org.bukkit.inventory.ItemStack item) { return hasValid(player, item); }
    private int count(Player player, org.bukkit.Material material) { int total = 0; for (org.bukkit.inventory.ItemStack item : player.getInventory().getContents()) if (item != null && item.getType() == material) total += item.getAmount(); return total; }
    private void remove(Player player, org.bukkit.Material material, int amount) { for (org.bukkit.inventory.ItemStack item : player.getInventory().getContents()) { if (item == null || item.getType() != material) continue; int remove = Math.min(amount, item.getAmount()); item.setAmount(item.getAmount() - remove); amount -= remove; if (amount == 0) break; } }

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