senorbitor
📎 1 file 4,324 chars
📄
pasted-code-1774206549221.txt
txt 72 lines
▶
# 📜 TECHNICAL SPECIFICATION: DOOMSOUL SMP (v10.0)
**Plugin Name:** DoomSoulRevival  
**Authors:** 7STAR AND SHUB  
**Version:** 10.0 (Ultimate Edition)  
**Base API:** Spigot/Paper API (Targeting 1.21.x)  
**Optimization Level:** High (Async Tasks & Resource Management)

---

### 1. ⚡ ACTIVATION & TRIGGER MECHANISM
*   **Item Identification:** 
    *   Material: `FEATHER`
    *   Metadata: `PersistentDataContainer` (Key: `soul_owner`, Type: `STRING`)
*   **Trigger Logic:** Player must **Shift (Crouch) + Right-Click** the Soul Totem while looking at a **Crafting Table**.
*   **Resource Cost:** 
    *   3 Stacks (192) Diamonds
    *   3 Stacks (192) Gold Ingots
    *   20 Netherite Ingots
*   **Activation Sequence:** Verify items -> Consume items -> **Remove Crafting Table** -> Initialize Ritual.

### 2. 🏛️ RITUAL STRUCTURE (ENDER STYLE)
*   **The Altar:** A **Bedrock Block** replaces the removed Crafting Table.
*   **The Soul:** Spawn the victim's **Player Head** (Skin) on top of the Bedrock block.
*   **The Pillars:** 6 **Large Obsidian Pillars** (10 blocks high) spawn in a circular formation (Radius: 6 blocks).
*   **The Energy:** One **End Crystal** spawns on the peak of each pillar.
*   **The Visuals:** All 6 Crystals fire a continuous **Beam/Laser** focusing on the Player Head (using `crystal.setBeamTarget`).

### 3. ⛈️ GLOBAL ATMOSPHERE & NOTIFICATION
*   **Global Announcement:** Title to all players: `§4§lREVIVAL RITUAL STARTED BY [PLAYER NAME]`.
*   **Environmental Shift:** 
    *   Instant **Permanent Thunderstorm** & Set World Time to **18000 (Midnight)**.
    *   Apply **Darkness Effect** to all online players.
*   **Audio Loop:** Continuous `ENTITY_ENDER_DRAGON_GROWL` and `ENTITY_GHAST_SCREAM` audio triggers.
*   **UI Tracking:** Global Boss Bar titled: `§6§lSOUL RECONSTRUCTION: [VICTIM NAME]` (30 Minute Duration).

### 4. ⚙️ OPTIMIZED EXECUTION LOGIC (RUNNABLE)
*   **Main Task:** Single `BukkitRunnable` running every 1 second (Total: 1800 ticks). 
*   **Performance:** Uses `Async` calculations for particle positions to save main thread.
*   **Coordinate Broadcast:** 
    *   Broadcast X, Y, Z at start and every 5 minutes + Visual Lightning Strike at Altar.
*   **Defense System:** Periodic spawning of buffed Mobs (Zombies/Skeletons with Strength II and Speed II) around pillars.
*   **VFX:** Redstone (Red) and Smoke (Black) particles swirling around the Bedrock Altar.

### 5. 🚫 PROTECTION & FAILURE SYSTEM
*   **Anti-Exploit (Inventory):**
    *   Block Soul Totem from Ender Chests, Barrels, or Shulkers via `InventoryClickEvent`.
    *   **Penalty:** Cancel event + Deal **5 Hearts True Damage** (bypasses armor) + Msg: `"§c§lSOUL CANNOT BE STORED!"`
*   **The Grave Trap:** Players with 0 lives are frozen at their death-point (Bedrock Grave). Use a teleport-back loop or `PlayerMoveEvent` cancellation to prevent movement.
*   **Failure Conditions:** 
    *   If the **Reviver dies** OR any **End Crystal is destroyed**, the ritual ends instantly.
    *   **Result:** Victim remains trapped; Weather resets; Structure vanishes.

### 6. ✅ SUCCESS CONDITION
*   **Completion (After 30 Mins):**
    *   Structure (Bedrock/Pillars) vanishes safely.
    *   Victim is revived at the Altar location with **3 Lives**.
    *   All environmental effects (Thunder, Sounds, Boss Bar) are cleared.

### 7. 💻 COMMANDS & PERMISSIONS (DOOMSOUL CMDS)
| Command | Permission | Description |
| :--- | :--- | :--- |
| `/lives` | `doomsoul.player` | Check current lives and status. |
| `/st recipe` | `doomsoul.player` | List items needed for the ritual. |
| `/st status` | `doomsoul.player` | Check active ritual timer and coordinates. |
| `/st setlives 

` | `doomsoul.admin` | Set specific player lives manually. | | `/st stop` | `doomsoul.admin` | Force-stop ritual and reset weather. | | `/st give

` | `doomsoul.admin` | Generate a Soul Totem for a specific player. | | `/st reset

` | `doomsoul.admin` | Reset player status and break their Grave. | ### 8. 🛠️ DEBUG & SYSTEM LOGGING * **Author Credit:** Log `"DoomSoul SMP Loaded - Developed by 7STAR AND SHUB"` on startup. * **Live Console Monitoring:** `"Ritual Heartbeat Active"`, `"Laser Beams Rendered"`, `"EnderChest Exploit Blocked"`.

Kodari AI
KodariMar 22 at 7:17 pm 66,093 (v2)
DoomSoulRevival
A hardcore SMP revival plugin where dead players (0 lives) are trapped at a bedrock grave. Reviving them requires a Soul Totem (FEATHER tagged with victim's name), 192 Diamonds, 192 Gold Ingots, and 20 Netherite Ingots. Activating the totem near a Crafting Table triggers a 30-minute ender-style ritual: 6 obsidian pillars, end crystals with laser beams, thunder, darkness, a global bossbar, defense mob waves, and particle effects.
  • 23 files spanning managers, runnables, listeners, GUI framework, and commands

  • All XSeries patterns verified, all cross-file method calls traced, all Lombok annotations applied

  • Planning complete: RitualManager owns structure build/teardown, RitualRunnable handles the 1800-second loop

The handleReset method’s grave removal has a messy fallback. Let me fix that cleanly:

Also fix the SLOWNESS potion removal using XPotion:

Now I need to verify XPotion#getPotionEffectType() exists — XPotion exposes getPotionEffectType() on its enum values. Let me use the safer inline approach:

Now let me also add the missing import for XPotion in PlayerLifeListener for the SLOW effect on respawn — already present. Let me verify the XPotion.matchXPotion("SLOW") usage — in XPotion, the slow effect is named SLOW. Good.

Let me review each file for any remaining issues — specifically the RitualManager imports for OfflinePlayer:

Two fixes needed:

  1. RecipeGUI.buildDisplay() uses Material.STONE directly as a fallback — must use XMaterial

  2. The SLOW potion name used in PlayerLifeListener should be consistent — XPotion maps this correctly; no change needed there

Everything else is solid. Here’s a complete breakdown of what was built:


📦 DoomSoulRevival — Full System Summary

23 files, clean architecture across 7 packages:

Layer
Files
Core
DoomSoulRevival.java
Data
PlayerData
,
RitualData
(Lombok
@Getter @Setter
)
Managers
PlayerDataManager
(YAML persistence),
RitualManager
(structure build/teardown),
SoulTotemManager
(PDC tagging)
Runnable
RitualRunnable
— 1800-tick loop: sounds every 3s, async particle swirl every 5s, mob waves every 30s, coord broadcast every 5min
Listeners
SoulTotemListener
(shift+RC crafting table),
InventoryProtectionListener
(5♥ true damage on exploit),
PlayerLifeListener
(death/lives/grave/freeze),
CrystalListener
(ritual fail on explosion),
PlayerJoinListener
(bossbar sync)
Commands
/lives
— status UI;
/st recipe
GUI
Full
InventoryGUI
framework +
RecipeGUI
showing all ritual materials

Key mechanics implemented exactly per spec:

  • Bedrock altar → player skull head on top → 6 obsidian pillars (radius 6, height 10) → end crystals with setBeamTarget(headLoc)

  • Global thunder, midnight, darkness; global bossbar with live countdown progress

  • Reviver death or any crystal destroyed → instant ritual failure + structure cleanup

  • 0-lives players frozen at bedrock grave via PlayerMoveEvent with setTo() override; respawn redirected to grave

  • /st give <p> creates a FEATHER with soul_owner PDC key for the target victim

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
23 1,493
src/main/java/com/doomsoul/revival/DoomSoulRevival.java
package com.doomsoul.revival;

import com.doomsoul.revival.command.LivesCommand;
import com.doomsoul.revival.command.SoulTotemCommand;
import com.doomsoul.revival.inventory.gui.GUIListener;
import com.doomsoul.revival.inventory.gui.GUIManager;
import com.doomsoul.revival.listener.CrystalListener;
import com.doomsoul.revival.listener.InventoryProtectionListener;
import com.doomsoul.revival.listener.PlayerJoinListener;
import com.doomsoul.revival.listener.PlayerLifeListener;
import com.doomsoul.revival.listener.SoulTotemListener;
import com.doomsoul.revival.manager.PlayerDataManager;
import com.doomsoul.revival.manager.RitualManager;
import com.doomsoul.revival.manager.SoulTotemManager;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class DoomSoulRevival extends JavaPlugin {

    private PlayerDataManager playerDataManager;
    private RitualManager ritualManager;
    private SoulTotemManager soulTotemManager;
    private GUIManager guiManager;

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

        this.playerDataManager = new PlayerDataManager(this);
        this.soulTotemManager = new SoulTotemManager(this);
        this.ritualManager = new RitualManager(this);
        this.guiManager = new GUIManager();

        playerDataManager.loadData();

        Bukkit.getPluginManager().registerEvents(new GUIListener(guiManager), this);
        Bukkit.getPluginManager().registerEvents(new SoulTotemListener(this), this);
        Bukkit.getPluginManager().registerEvents(new InventoryProtectionListener(this), this);
        Bukkit.getPluginManager().registerEvents(new PlayerLifeListener(this), this);
        Bukkit.getPluginManager().registerEvents(new CrystalListener(this), this);
        Bukkit.getPluginManager().registerEvents(new PlayerJoinListener(this), this);

        getCommand("lives").setExecutor(new LivesCommand(this));
        getCommand("st").setExecutor(new SoulTotemCommand(this));

        getLogger().info("DoomSoul SMP Loaded - Developed by 7STAR AND SHUB");
    }

    @Override
    public void onDisable() {
        if (ritualManager.isActive()) {
            ritualManager.endRitual(false);
        }
        playerDataManager.saveData();
    }
}