📄
PotatoTimeTravel_rocket_fixed_v2.md
md
2354 lines
▶
# PotatoTimeTravel — Complete Production Development Prompt
## 1. Project
Modify the existing `PotatoTimeTravel` Minecraft plugin.
- Platform: Paper/Purpur 1.21.x
- Java: 21
- Build system: Maven
- Main class: `ir.potatocraft.timetravel.PotatoTimeTravel`
- Output: `PotatoTimeTravel.jar`
- Data file: `plugins/PotatoTimeTravel/data.yml`
The final project MUST compile with:
```text
mvn clean package
```
### CRITICAL
Do NOT delete or break existing working functionality.
Preserve:
- Existing Future World system
- Existing Moon system
- Existing Rocket system
- Existing fuel system
- Existing resource system
- Existing commands
- Existing Resource Pack/custom models
- Existing working functionality that is not explicitly changed here
---
# 2. LANGUAGE
Development code/comments may be English.
ALL player-facing custom item names, GUI titles, recipe names, and important messages MUST be Persian.
Examples:
```text
آلومینیوم
تیتانیوم
فولاد
آلیاژ تیتانیوم
کریستال انرژی
صفحه آبسیدین
شیشه تقویتشده
سیمپیچ مسی
مدار موشک
سپر حرارتی
هسته ناوبری
هسته زمان
دماغه موشک
بدنه موشک
موتور موشک
مخزن سوخت
کابین موشک
کامپیوتر ناوبری
پایدارکننده زمان
هسته کنترل موشک
پایه پرتاب موشک
موشک کامل
سوخت آینده
سوخت برگشت
میز کرفتینگ ناسا
سنگ ماه
ماده قاقالی
برداشت مسلاله
کلو میای
```
---
# 3. MOST IMPORTANT FEATURE — NASA CRAFTING TABLE
Create a NEW custom crafting table:
```text
میز کرفتینگ ناسا
```
This is a custom item with a unique PDC.
## Its ONLY purpose
The NASA Crafting Table MUST ONLY craft:
- Rocket materials
- Rocket components
- Rocket fuel
- Rocket Launch Pad
It MUST NOT craft anything unrelated.
Absolutely do NOT allow:
- Tools
- Armor
- Food
- Normal blocks
- Random vanilla recipes
- Unrelated plugin items
- Any recipe not explicitly listed in this document
This is NON-NEGOTIABLE.
## NASA Crafting Table GUI
### CRITICAL FIX — NASA GUI ITEM PLACEMENT AND REMOVAL MUST WORK
The NASA Crafting Table must allow players to freely place, pick up, and move ingredients in its 3×3 crafting grid. If players currently cannot put items into the grid or take them back out, this is a bug and MUST be fixed.
Implementation requirements:
- Define and use explicit inventory-slot mapping for the 9 input slots, the output slot, and every decorative slot. Never assume that the visible 3×3 grid uses consecutive inventory indexes without verifying the GUI layout.
- On `InventoryClickEvent`, identify the top inventory by its exact custom GUI holder/type or session ID—not by title alone.
- Allow ordinary left-click and right-click placement, pickup, splitting, and merging in the 9 input slots, subject to normal Bukkit inventory rules.
- Allow taking items back out of input slots before crafting. Do not cancel clicks in valid input slots indiscriminately.
- Recompute the recipe and refresh the output safely after every valid input change. Prevent taking a stale output.
- The output slot is controlled separately: allow taking only a valid recipe result, consume the exact required ingredients exactly once, and then refresh the grid/output. Never allow placing items into the output slot.
- Decorative and locked slots must reject insertion and extraction.
- Correctly handle shift-click in both directions: shift-clicking from the player inventory may place items only into valid input slots; shift-clicking from the GUI must not move decorative or output items improperly.
- Correctly handle cursor dragging with `InventoryDragEvent`: permit changes only when every affected top-inventory slot is a valid input slot; reject any drag touching output or decorative slots.
- Explicitly handle number-key hotbar swaps, offhand swaps, double-click/collect-to-cursor, and other click types so they cannot bypass slot restrictions or cause duplication. Valid input slots must remain usable through supported interactions.
- Do not cancel every click or drag event for the entire GUI. Apply cancellation only to protected slots or unsafe operations.
- Keep the GUI's input contents synchronized with the actual inventory state; do not manually add/remove items in a way that conflicts with Bukkit's normal click transaction.
- On close, disconnect, or shutdown, return every remaining ingredient safely exactly once. Track session cleanup to prevent duplicate returns.
- Test with vanilla blocks and items as ingredients as well as custom PDC items. Players must be able to put an item into a grid slot, take it back out, move it to another grid slot, and take a valid output.
Acceptance test (mandatory):
1. Open the NASA Crafting Table.
2. Place an ingredient into each of the 9 input slots and remove it again.
3. Move ingredients between input slots using cursor clicks.
4. Test left-click, right-click, shift-click, drag, number keys, and offhand swap.
5. Verify output crafting consumes ingredients once, with no duplication or loss.
6. Close/reopen the GUI and verify all remaining items are returned safely.
Right-clicking the NASA Crafting Table opens a chest-style custom GUI visually matching the provided reference image.
The GUI MUST contain:
- A real 3×3 crafting area.
- The 3×3 crafting area is the only area where recipe ingredients may be inserted.
- A dedicated output slot.
- Decorative/locked slots around the crafting area to match the reference layout.
- Decorative slots MUST NOT accept or store player items.
The crafting area MUST behave like a real crafting interface:
- Players can place ingredients into the 3×3 slots.
- Players can remove ingredients from the 3×3 slots before crafting.
- Players can move ingredients between valid crafting slots.
- The output item MUST be a real custom ItemStack when the recipe matches.
- Taking the output MUST consume the required ingredients exactly once.
- If the GUI is closed, all remaining player-owned ingredients MUST be returned safely to the player's inventory, or dropped safely if the inventory is full.
- No ingredient may become permanently trapped inside the GUI.
- No item duplication is allowed.
- No item loss is allowed.
Inventory interaction MUST correctly handle:
- Normal click
- Shift-click
- Dragging
- Double-click
- Number-key swapping
- Offhand swapping
- Closing the GUI
- Disconnecting while the GUI is open
- Server restart while the GUI is open
Do NOT globally cancel every inventory event. Only the custom NASA Crafting Table inventory and its protected decorative/output slots may be controlled. Other plugin inventories MUST continue to work normally.
---
# 4. NASA CRAFTING TABLE RECIPE
The NASA Crafting Table itself is crafted in the normal Minecraft Crafting Table.
```text
WOODEN SLAB | WOODEN SLAB | AIR
WOODEN SLAB | WOODEN SLAB | AIR
AIR | AIR | AIR
```
Output:
```text
1 × میز کرفتینگ ناسا
```
The output MUST be a custom ItemStack with PDC.
It must NOT simply be a normal Crafting Table.
---
# 5. CRAFTING TABLE SEPARATION
## Normal Minecraft Crafting Table
It may create:
```text
میز کرفتینگ ناسا
```
ONLY.
Rocket recipes MUST NOT work in the normal Crafting Table.
## NASA Crafting Table
It may create ONLY the rocket/space recipes listed in this document.
No unrelated recipes.
## Rocket Launch Pad
The Complete Rocket is NOT crafted in either crafting table.
It is assembled at the Launch Pad.
---
# 6. CUSTOM ITEM SYSTEM
Every custom item MUST have:
- Unique internal ID
- Unique PDC
- Custom ItemStack
- Persian display name
- Optional lore
- CustomModelData when required by the Resource Pack
PDC is authoritative.
IDs:
```text
nasa_crafting_table
aluminium_ingot
titanium_ingot
steel_ingot
titanium_alloy
energy_crystal
obsidian_plate
reinforced_glass
copper_coil
rocket_circuit
thermal_shield
navigation_core
time_core
rocket_nose
rocket_body
rocket_engine
fuel_tank
cockpit
navigation_computer
time_stabilizer
rocket_control_core
rocket_launch_pad
complete_rocket
future_fuel
return_fuel
moon_stone
moon_qaghali_matter
moon_mesalleh_harvest
moon_klomia
```
Never identify custom items only by Material or display name.
---
# 7. COMPLETE ROCKET RECIPES
ALL recipes below are NASA Crafting Table recipes.
Every output MUST be the correct custom ItemStack.
Never return a vanilla item instead of a custom item.
---
## 7.1 آلومینیوم
ID:
```text
aluminium_ingot
```
Recipe:
```text
IRON INGOT | COPPER INGOT | IRON INGOT
COPPER INGOT | IRON INGOT | COPPER INGOT
IRON INGOT | COPPER INGOT | IRON INGOT
```
Materials:
- Iron Ingot ×5
- Copper Ingot ×4
Output:
```text
آلومینیوم ×1
```
---
## 7.2 تیتانیوم
ID:
```text
titanium_ingot
```
Recipe:
```text
GOLD INGOT | QUARTZ | GOLD INGOT
QUARTZ | GOLD INGOT | QUARTZ
GOLD INGOT | QUARTZ | GOLD INGOT
```
Materials:
- Gold Ingot ×4
- Quartz ×4
Output:
```text
تیتانیوم ×1
```
---
## 7.3 فولاد
ID:
```text
steel_ingot
```
Recipe:
```text
IRON INGOT | COAL | IRON INGOT
COAL | IRON INGOT | COAL
IRON INGOT | COAL | IRON INGOT
```
Materials:
- Iron Ingot ×4
- Coal ×4
Output:
```text
فولاد ×1
```
---
## 7.4 آلیاژ تیتانیوم
ID:
```text
titanium_alloy
```
Recipe:
```text
تیتانیوم | IRON INGOT | تیتانیوم
IRON INGOT | DIAMOND | IRON INGOT
تیتانیوم | IRON INGOT | تیتانیوم
```
Materials:
- تیتانیوم ×4
- Iron Ingot ×3
- Diamond ×1
Output:
```text
آلیاژ تیتانیوم ×1
```
---
## 7.5 کریستال انرژی
ID:
```text
energy_crystal
```
Recipe:
```text
DIAMOND | OBSIDIAN | DIAMOND
OBSIDIAN | AMETHYST SHARD | OBSIDIAN
DIAMOND | OBSIDIAN | DIAMOND
```
Materials:
- Diamond ×4
- Obsidian ×4
- Amethyst Shard ×1
Output:
```text
کریستال انرژی ×1
```
---
## 7.6 صفحه آبسیدین
ID:
```text
obsidian_plate
```
Recipe:
```text
OBSIDIAN | IRON INGOT | OBSIDIAN
IRON INGOT | OBSIDIAN | IRON INGOT
OBSIDIAN | IRON INGOT | OBSIDIAN
```
Materials:
- Obsidian ×5
- Iron Ingot ×4
Output:
```text
صفحه آبسیدین ×1
```
---
## 7.7 شیشه تقویتشده
ID:
```text
reinforced_glass
```
Recipe:
```text
IRON INGOT | GLASS | IRON INGOT
GLASS | QUARTZ | GLASS
IRON INGOT | GLASS | IRON INGOT
```
Materials:
- Iron Ingot ×4
- Glass ×4
- Quartz ×1
Output:
```text
شیشه تقویتشده ×1
```
---
## 7.8 سیمپیچ مسی
ID:
```text
copper_coil
```
Recipe:
```text
COPPER INGOT | COPPER INGOT | COPPER INGOT
COPPER INGOT | REDSTONE | COPPER INGOT
COPPER INGOT | COPPER INGOT | COPPER INGOT
```
Materials:
- Copper Ingot ×8
- Redstone ×1
Output:
```text
سیمپیچ مسی ×1
```
---
## 7.9 مدار موشک
ID:
```text
rocket_circuit
```
Recipe:
```text
REDSTONE | سیمپیچ مسی | REDSTONE
سیمپیچ مسی | GOLD INGOT | سیمپیچ مسی
REDSTONE | سیمپیچ مسی | REDSTONE
```
Materials:
- Redstone ×4
- سیمپیچ مسی ×3
- Gold Ingot ×1
Output:
```text
مدار موشک ×1
```
---
## 7.10 سپر حرارتی
ID:
```text
thermal_shield
```
Recipe:
```text
آلیاژ تیتانیوم | صفحه آبسیدین | آلیاژ تیتانیوم
صفحه آبسیدین | FIRE CHARGE | صفحه آبسیدین
آلیاژ تیتانیوم | صفحه آبسیدین | آلیاژ تیتانیوم
```
Materials:
- آلیاژ تیتانیوم ×4
- صفحه آبسیدین ×4
- Fire Charge ×1
Output:
```text
سپر حرارتی ×1
```
---
## 7.11 هسته ناوبری
ID:
```text
navigation_core
```
Recipe:
```text
IRON INGOT | GOLD INGOT | IRON INGOT
مدار موشک | DIAMOND | مدار موشک
IRON INGOT | GOLD INGOT | IRON INGOT
```
Materials:
- Iron Ingot ×4
- Gold Ingot ×2
- مدار موشک ×2
- Diamond ×1
Output:
```text
هسته ناوبری ×1
```
---
## 7.12 هسته زمان
ID:
```text
time_core
```
Recipe:
```text
کریستال انرژی | آلیاژ تیتانیوم | کریستال انرژی
ENDER PEARL | CLOCK | ENDER PEARL
کریستال انرژی | آلیاژ تیتانیوم | کریستال انرژی
```
Materials:
- کریستال انرژی ×4
- آلیاژ تیتانیوم ×2
- Ender Pearl ×2
- Clock ×1
Output:
```text
هسته زمان ×1
```
IMPORTANT:
سنگ ماه در این Recipe وجود ندارد.
Return Fuel نیز در این Recipe وجود ندارد.
---
# 8. ROCKET COMPONENT RECIPES
## 8.1 دماغه موشک
ID:
```text
rocket_nose
```
```text
تیتانیوم | تیتانیوم | تیتانیوم
تیتانیوم | شیشه تقویتشده | تیتانیوم
AIR | فولاد | AIR
```
Materials:
- تیتانیوم ×5
- شیشه تقویتشده ×1
- فولاد ×1
Output:
```text
دماغه موشک ×1
```
---
## 8.2 بدنه موشک
ID:
```text
rocket_body
```
```text
آلومینیوم | فولاد | آلومینیوم
آلومینیوم | آلیاژ تیتانیوم | آلومینیوم
آلومینیوم | فولاد | آلومینیوم
```
Materials:
- آلومینیوم ×6
- فولاد ×2
- آلیاژ تیتانیوم ×1
Output:
```text
بدنه موشک ×1
```
---
## 8.3 موتور موشک
ID:
```text
rocket_engine
```
```text
فولاد | تیتانیوم | فولاد
تیتانیوم | کریستال انرژی | تیتانیوم
فولاد | سیمپیچ مسی | فولاد
```
Materials:
- فولاد ×4
- تیتانیوم ×3
- کریستال انرژی ×1
- سیمپیچ مسی ×1
Output:
```text
موتور موشک ×1
```
---
## 8.4 مخزن سوخت
ID:
```text
fuel_tank
```
```text
آلومینیوم | فولاد | آلومینیوم
فولاد | صفحه آبسیدین | فولاد
آلومینیوم | فولاد | آلومینیوم
```
Materials:
- آلومینیوم ×4
- فولاد ×4
- صفحه آبسیدین ×1
Output:
```text
مخزن سوخت ×1
```
---
## 8.5 کابین موشک
ID:
```text
cockpit
```
```text
شیشه تقویتشده | شیشه تقویتشده | شیشه تقویتشده
آلومینیوم | هسته ناوبری | آلومینیوم
فولاد | فولاد | فولاد
```
Materials:
- شیشه تقویتشده ×3
- آلومینیوم ×2
- هسته ناوبری ×1
- فولاد ×3
Output:
```text
کابین موشک ×1
```
---
## 8.6 کامپیوتر ناوبری
ID:
```text
navigation_computer
```
```text
مدار موشک | GOLD INGOT | مدار موشک
سیمپیچ مسی | هسته ناوبری | سیمپیچ مسی
مدار موشک | DIAMOND | مدار موشک
```
Materials:
- مدار موشک ×4
- Gold Ingot ×1
- سیمپیچ مسی ×2
- هسته ناوبری ×1
- Diamond ×1
Output:
```text
کامپیوتر ناوبری ×1
```
---
## 8.7 پایدارکننده زمان
ID:
```text
time_stabilizer
```
```text
آلیاژ تیتانیوم | کریستال انرژی | آلیاژ تیتانیوم
کریستال انرژی | هسته زمان | کریستال انرژی
آلیاژ تیتانیوم | کریستال انرژی | آلیاژ تیتانیوم
```
Materials:
- آلیاژ تیتانیوم ×4
- کریستال انرژی ×4
- هسته زمان ×1
Output:
```text
پایدارکننده زمان ×1
```
---
## 8.8 هسته کنترل موشک
ID:
```text
rocket_control_core
```
```text
کامپیوتر ناوبری | مدار موشک | کامپیوتر ناوبری
مدار موشک | هسته زمان | مدار موشک
کامپیوتر ناوبری | مدار موشک | کامپیوتر ناوبری
```
Materials:
- کامپیوتر ناوبری ×3
- مدار موشک ×4
- هسته زمان ×1
Output:
```text
هسته کنترل موشک ×1
```
---
# 9. ROCKET LAUNCH PAD
ID:
```text
rocket_launch_pad
```
Recipe:
```text
فولاد | IRON BLOCK | فولاد
IRON INGOT | OBSIDIAN | IRON INGOT
فولاد | COPPER INGOT | فولاد
```
Materials:
- فولاد ×4
- Iron Block ×1
- Iron Ingot ×2
- Obsidian ×1
- Copper Ingot ×1
Output:
```text
پایه پرتاب موشک ×1
```
CRITICAL:
Output MUST be the custom Rocket Launch Pad ItemStack.
It MUST NOT become a normal Iron Block item.
## ROCKET LAUNCH PAD PLACEMENT
The custom Rocket Launch Pad MUST be placeable normally in the Minecraft world.
When a player places the custom Rocket Launch Pad:
1. Detect the item using its unique PDC `rocket_launch_pad`.
2. Allow the normal `BlockPlaceEvent` to complete successfully.
3. The Launch Pad MUST be placed as a real physical block in the world.
4. The Launch Pad MUST NOT require the target block, clicked block, or placed block to be a TileState, Container, Chest, Furnace, or any other tile entity.
5. NEVER cast the placed Iron Block or clicked block to `TileState`.
6. NEVER require `BlockState` to implement `TileState` for Launch Pad placement.
7. The Launch Pad MUST work when placed on normal solid blocks such as:
- Stone
- Dirt
- Grass Block
- Cobblestone
- Iron Block
- Obsidian
- Any other normally placeable solid block
8. The custom Launch Pad identity MUST be stored separately from the vanilla block type because an Iron Block does not provide a TileState/PDC storage location.
9. Use a persistent location-based data system in `plugins/PotatoTimeTravel/data.yml` to identify placed Launch Pads.
10. Store at minimum:
- World
- X
- Y
- Z
- Launch Pad ID
11. When the Launch Pad is broken, remove its stored Launch Pad data.
12. When the Launch Pad is placed, register its exact location immediately.
13. Right-clicking a registered Launch Pad location MUST open the Rocket Assembly GUI.
14. A normal vanilla Iron Block that was not placed as a custom Launch Pad MUST NOT open the Rocket Assembly GUI.
15. Breaking a custom Launch Pad MUST drop the custom `rocket_launch_pad` ItemStack.
16. Breaking a normal Iron Block MUST continue to behave exactly like normal Minecraft.
17. The placement system MUST NOT interfere with any other plugin's block placement.
18. Do NOT cancel `BlockPlaceEvent` for the custom Launch Pad unless there is an actual placement error.
19. Do NOT display any error message when placing the custom Launch Pad on a valid location.
20. Do NOT use TileState-based storage for identifying placed Launch Pads.
The custom Launch Pad must therefore work as:
```text
Custom Rocket Launch Pad Item
↓
Player places it
↓
Normal block placement succeeds
↓
Physical Launch Pad block appears
↓
Location is registered in data.yml
↓
Player right-clicks that exact location
↓
Rocket Assembly GUI opens
```
The Launch Pad MUST remain persistent after:
- Server restart
- Chunk unload/reload
- Player logout/relogin
- World reload
The Launch Pad MUST NOT disappear or lose its identity after a restart.
CRITICAL:
The Launch Pad MUST be a real placeable custom item.
It MUST NOT require TileState.
It MUST NOT require a Chest.
It MUST NOT require a container block.
It MUST NOT produce a placement error on valid blocks.
It MUST NOT be converted into an ordinary untracked Iron Block.
It MUST preserve all existing Rocket Assembly functionality described in the rest of this document.
# 10. FUTURE FUEL
ID:
```text
future_fuel
```
Name:
```text
سوخت آینده
```
Recipe:
```text
BLAZE POWDER | کریستال انرژی | BLAZE POWDER
کریستال انرژی | هسته زمان | کریستال انرژی
BLAZE POWDER | کریستال انرژی | BLAZE POWDER
```
Materials:
- Blaze Powder ×4
- کریستال انرژی ×4
- هسته زمان ×1
Output:
```text
سوخت آینده ×1
```
Required for Earth → Moon travel:
```text
5 × سوخت آینده
```
---
# 11. RETURN FUEL
ID:
```text
return_fuel
```
Name:
```text
سوخت برگشت
```
Recipe:
```text
ماده قاقالی | برداشت مسلاله | ماده قاقالی
کلو میای | هسته زمان | کلو میای
ماده قاقالی | برداشت مسلاله | ماده قاقالی
```
Materials:
- ماده قاقالی ×4
- برداشت مسلاله ×2
- کلو میای ×2
- هسته زمان ×1
Output:
```text
سوخت برگشت ×1
```
Required for Moon → Earth:
```text
5 × سوخت برگشت
```
CRITICAL:
سنگ ماه MUST NOT be used in Return Fuel.
Do NOT substitute Moon Stone for any ingredient.
---
# 12. COMPLETE ROCKET
ID:
```text
complete_rocket
```
Name:
```text
موشک کامل
```
There MUST be NO normal crafting recipe for the Complete Rocket.
The Complete Rocket is created ONLY at the Launch Pad.
Required:
```text
دماغه موشک ×1
بدنه موشک ×1
موتور موشک ×1
مخزن سوخت ×1
کابین موشک ×1
کامپیوتر ناوبری ×1
پایدارکننده زمان ×1
هسته کنترل موشک ×1
```
Order does not matter.
When all 8 components are inserted:
```text
§a§l🚀 ساخت موشک
```
Construction time:
```text
30 seconds
```
## Visible construction countdown (mandatory)
When construction starts, show a live countdown to the player who started it and anyone viewing the Launch Pad:
- Display a clear on-screen countdown (prefer a BossBar plus ActionBar/title), beginning at `00:30` and updating at least once per second down to `00:01`.
- Show construction progress and remaining time, e.g. `🚀 ساخت موشک: 00:24`.
- When the timer reaches zero, show a completion message and spawn the completed Rocket exactly once.
- Keep the timer accurate using server ticks/time, not a client-only animation.
- If construction is cancelled or interrupted, remove the countdown and safely handle the inserted components according to the existing item-return rules.
- Persist or safely recover the construction state across reload/restart; never restart the timer from 30 seconds or spawn a duplicate Rocket after recovery.
Then:
```text
§a§l🚀 موشک با موفقیت ساخته شد!
```
The components must be consumed exactly once.
No duplication.
No item loss.
## ROCKET SPAWN AFTER CONSTRUCTION
After the 30-second construction timer finishes successfully:
1. Spawn exactly one fully assembled, physical, rideable Rocket at the exact Launch Pad location where construction took place.
2. Do not spawn the completed Rocket before the timer finishes.
3. Align the Rocket vertically above the Launch Pad and make sure it is ready for fueling and boarding.
4. The spawned Rocket must have a unique Rocket UUID and be registered in `plugins/PotatoTimeTravel/data.yml`.
5. Preserve the existing construction sounds, visual effects, and GUI behavior.
6. If construction is interrupted or fails, do not spawn a Rocket.
7. Prevent duplicate spawning from repeated clicks, timer callbacks, GUI reopening, server restarts, or chunk reloads.
The expected sequence is:
```text
Insert all 8 components
↓
Start 30-second construction timer
↓
Construction completes
↓
Spawn one physical Rocket at the Launch Pad
↓
Fuel the Rocket
↓
Board the Rocket
↓
Launch
```
---
# 13. LAUNCH PAD GUI
Right-clicking the Launch Pad opens a chest-style custom GUI visually matching the provided reference image.
The GUI MUST have a decorative layout similar to the reference image, with dedicated empty component slots for the rocket assembly.
Exactly 8 designated slots MUST accept the 8 required rocket components.
Only these 8 designated component slots may accept player items. All decorative/locked slots MUST reject item insertion.
Players can place the 8 required components into any of the 8 designated component slots.
Order is irrelevant.
Players MUST be able to remove any component they placed into the Launch Pad GUI before construction begins.
When all 8 exist:
```text
§a§l🚀 ساخت موشک
```
appears.
The construction takes exactly 30 seconds by default.
When the GUI is closed before construction starts, all remaining components MUST be returned safely to the player. If the player's inventory is full, the remaining items MUST be dropped safely at the player's location.
If construction begins, the 8 components MUST be consumed exactly once and must not be duplicated or lost.
The Launch Pad GUI MUST correctly handle:
- Normal click
- Shift-click
- Dragging
- Double-click
- Number-key swapping
- Offhand swapping
- Closing the GUI
- Disconnecting while the GUI is open
- Server restart while the GUI is open
Prevent:
- Shift-click duplication
- Drag duplication
- Double-click duplication
- Number-key exploits
- Offhand exploits
- Close/reopen exploits
- Disconnect exploits
- Restart exploits
- Item loss
- Duplicate Rocket creation
Do NOT globally cancel every inventory event. Only the custom Launch Pad GUI and its protected decorative slots may be controlled. Other plugin inventories MUST continue to work normally.
---
# 14. PHYSICAL ROCKET MODEL, RELIABLE RIDING, FUEL TANK, AND LAUNCH
## Physical Rocket Model (mandatory)
Build a recognizable, tall Minecraft-style rocket model yourself using supported display/block entities or the plugin's existing custom-model system. Do NOT use a Fireball, a single armor stand as the entire rocket, a particle-only effect, or an ordinary mob as the rocket.
The assembled rocket must visibly resemble a real blocky rocket:
- Tall, vertical, metallic gray body with a pointed nose cone.
- Clearly visible cockpit/upper section and engine/nozzle at the bottom.
- Fins or support legs around the lower body.
- A distinct, visible fuel tank section attached to the rocket, with a clear interaction point.
- Keep the model compact enough for a player to board without collision or camera obstruction.
All visual parts must be grouped and moved as ONE logical Rocket entity/model, tracked by one persistent Rocket UUID. Keep the model stable and aligned; do not let its pieces drift, detach, or remain behind after travel.
## Boarding and riding (critical — must actually work)
Implement boarding with a dedicated, reliable mount/seat mechanism compatible with the server's Paper/Purpur version. Do not use a decorative stair alone as the ride mechanism.
- Add a visible seat/platform on the rocket at a sensible position, where the player can clearly see and interact with it.
- Right-clicking the seat/boarding interaction point mounts the player to the rocket's dedicated invisible seat entity.
- The invisible seat must be a passenger/part of the same rocket assembly and must follow the rocket's exact movement every tick.
- The player must visibly remain seated on the rocket, not be teleported away, stuck inside blocks, or left behind.
- Boarding and dismounting must work reliably. Allow dismounting while the rocket is idle; prevent accidental dismount during ascent/transfer, and safely restore dismounting after arrival.
- Never put the player inside glass or a glass cage. Keep the camera unobstructed.
- On world transfer, recreate or reattach the seat and passenger in a safe, ordered way so the player remains seated on the same logical Rocket. If the server API cannot transfer a passenger directly across worlds, explicitly detach, transfer the player and rocket assembly, then reattach the player to the new seat in the same controlled operation. Do not claim the player is still riding unless the passenger attachment is confirmed.
- Clean up the seat and all model parts when the Rocket is removed, and prevent orphan entities.
## Fuel tank interaction
The rocket must have a visible, functional fuel tank that can be interacted with by right-clicking the tank or using the rocket's fuel interaction.
Open a custom fuel-tank GUI with separate slots/counters for:
- Future Fuel (used for Earth → Moon)
- Return Fuel (used for Moon → Earth)
Players must be able to insert the existing custom Future Fuel and Return Fuel items into the correct tank slot. Validate items by their plugin PDC/custom ID, not display name alone. Reject all unrelated items and return them safely. Display the stored amount and required amount in the GUI (5 Future Fuel for outbound travel; 5 Return Fuel for return travel). Fuel belongs to the Rocket UUID and persists in data.yml. Never mix the two fuel types, consume fuel during GUI opening, or lose/duplicate fuel on close, shift-click, drag, disconnect, or restart.
## Launch authorization and sequence
- Preserve the existing launch command, but allow launch only when the actual pilot is seated on that Rocket.
- Before starting, validate that the Rocket is complete, the pilot is mounted, the correct tank contains the required fuel, a valid destination is configured, and the Rocket is not already traveling.
- If any validation fails, show a clear message and do not consume fuel or start movement.
- Consume exactly 5 Future Fuel for Earth → Moon or 5 Return Fuel for Moon → Earth only after all checks pass and the launch sequence successfully begins.
- Start engine sound and visual effects, then move the physical Rocket and its seated passenger together.
- Do not launch an empty rocket or allow another player to launch a Rocket they are not riding.
---
# 15. ROCKET FUEL STORAGE
Every Rocket has its own persistent data:
```text
Rocket UUID
Future Fuel amount
Return Fuel amount
Fuel Tank State
Rocket model/part entity UUIDs
Seat entity UUID
Current passenger UUID (if any)
Rocket State
```
The fuel tank GUI must display the current Future Fuel and Return Fuel counts, and the travel requirement. Store all values per Rocket UUID in `plugins/PotatoTimeTravel/data.yml`.
Fuel must survive restart, logout/relog, Moon travel, world changes, and chunk unload. Save tank changes immediately and safely. Fuel is consumed only after all launch validations succeed. Prevent item duplication, item loss, cross-rocket fuel sharing, and mixing fuel types.
# 16. MOON WORLD COMMAND
Add:
```text
/moon set
```
Example:
```text
/moon set MoonWorld
```
This sets the Moon destination.
Save it permanently in:
```text
plugins/PotatoTimeTravel/data.yml
```
If the world does not exist:
```text
§cدنیای ماه وجود ندارد!
```
Do not teleport.
Do not consume fuel.
Also preserve:
```text
/rocket moon world
```
Both systems must use the same Moon World configuration.
---
# 17. MOON COMMANDS
Keep:
```text
/rocket moon world
/rocket moon pos1
/rocket moon pos2
/rocket moon random
/rocket moon info
```
Add:
```text
/moon set
```
Example:
```text
/moon set MoonWorld
```
---
# 18. EARTH → MOON
The player must:
1. Have a complete Rocket.
2. Sit on the Rocket.
3. Have 5 Future Fuel.
4. Have a valid Moon World.
5. Start the engine.
Messages:
```text
§aموشک با موفقیت روشن شد!
§eموتور موشک روشن شد...
§bموشک در حال صعود است...
§bدر حال حرکت به ماه...
§aبه ماه رسیدید!
```
Engine sound MUST play.
The Rocket MUST physically ascend:
```text
250 blocks
```
Do NOT instantly teleport.
Flow:
```text
Earth
↓
Engine starts
↓
Engine sound
↓
Physical ascent
↓
250 blocks
↓
Moon World
```
The Rocket and Player must transfer together as one unit. The player must remain seated inside/on the Rocket and must not be teleported separately.
After reaching the required ascent height, transfer the Rocket and its passenger to the configured Moon World. Spawn the same Rocket, preserving its UUID, fuel, state, and passenger, at a safe arrival position in that world. The player must still be seated after arrival.
Do NOT use:
```text
0 0 0
```
Do NOT automatically use Moon spawn.
Find a safe Moon arrival position.
---
# 19. SAVE EXACT EARTH LOCATION
When launching Earth → Moon, save the exact launch position for THAT Rocket UUID.
Save:
```text
World
X
Y
Z
Yaw
Pitch
```
Example:
```text
world: world
x: 125.53
y: 72.00
z: -348.21
yaw: 90
pitch: 0
```
This is the return destination.
Each Rocket must have its own saved location.
---
# 20. MOON → EARTH
Player sits in the Rocket.
Requirements:
```text
5 × سوخت برگشت
```
Start engine.
Play engine sound.
Show:
```text
§eدر حال بازگشت به زمین...
```
Rocket physically ascends:
```text
25 blocks
```
Then transfer:
```text
Moon World
↓
25 block ascent
↓
Earth World
↓
Exact saved Earth launch location
```
NEVER return to:
- Spawn
- World Spawn
- 0,0,0
- Random location
- Hardcoded coordinates
Return ONLY to the exact saved Earth launch position belonging to that Rocket UUID.
The Rocket and its seated passenger must return together. Spawn the same Rocket at the saved world and exact X, Y, Z, yaw, and pitch. Do not teleport the player alone or create a duplicate Rocket. Keep the player seated after arrival and restore the Rocket to its ready state.
---
# 21. MOON RESOURCES
Required custom resources:
```text
سنگ ماه
ماده قاقالی
برداشت مسلاله
کلو میای
```
IDs:
```text
moon_stone
moon_qaghali_matter
moon_mesalleh_harvest
moon_klomia
```
All use PDC.
Moon Stone may be obtained using the Give command.
IMPORTANT:
Moon Stone is NOT a Return Fuel ingredient.
Return Fuel uses only:
```text
ماده قاقالی ×4
برداشت مسلاله ×2
کلو میای ×2
هسته زمان ×1
```
---
# 22. RECIPE BOOK
Commands:
```text
/rocket book
```
and:
```text
/timetravel book
```
Both open the same Recipe Book.
No permission required.
Title:
```text
§e§l✦ POTATO CRAFT — RECIPE BOOK ✦
```
54 slots.
Show ALL rocket/space recipes.
Include:
- NASA Crafting Table
- آلومینیوم
- تیتانیوم
- فولاد
- آلیاژ تیتانیوم
- کریستال انرژی
- صفحه آبسیدین
- شیشه تقویتشده
- سیمپیچ مسی
- مدار موشک
- سپر حرارتی
- هسته ناوبری
- هسته زمان
- دماغه موشک
- بدنه موشک
- موتور موشک
- مخزن سوخت
- کابین موشک
- کامپیوتر ناوبری
- پایدارکننده زمان
- هسته کنترل موشک
- پایه پرتاب موشک
- سوخت آینده
- سوخت برگشت
- اطلاعات ساخت موشک کامل
Clicking a recipe opens a detail GUI.
Show:
- Persian name
- Output
- Amount
- Ingredients
- Ingredient amounts
- Exact 3×3 pattern
- Required station
For Complete Rocket:
```text
موشک کامل با کرفت معمولی ساخته نمیشود.
این موشک در پایه پرتاب ساخته میشود.
۸ قطعه اصلی لازم است.
زمان ساخت: ۳۰ ثانیه
```
Recipe Book is read-only.
No item extraction.
No item insertion.
No shift-click exploit.
No drag exploit.
No double-click exploit.
No number-key exploit.
No offhand exploit.
Do NOT globally cancel every inventory event in a way that breaks other plugin inventories.
---
# 23. ADMIN GIVE COMMAND
Permission:
```text
potatocraft.rocket.admin
```
Command:
```text
/rocket give -
```
Examples:
```text
/rocket give Player nasa_crafting_table 1
/rocket give Player aluminium_ingot 1
/rocket give Player titanium_ingot 1
/rocket give Player steel_ingot 1
/rocket give Player titanium_alloy 1
/rocket give Player energy_crystal 1
/rocket give Player obsidian_plate 1
/rocket give Player reinforced_glass 1
/rocket give Player copper_coil 1
/rocket give Player rocket_circuit 1
/rocket give Player thermal_shield 1
/rocket give Player navigation_core 1
/rocket give Player time_core 1
/rocket give Player rocket_nose 1
/rocket give Player rocket_body 1
/rocket give Player rocket_engine 1
/rocket give Player fuel_tank 1
/rocket give Player cockpit 1
/rocket give Player navigation_computer 1
/rocket give Player time_stabilizer 1
/rocket give Player rocket_control_core 1
/rocket give Player rocket_launch_pad 1
/rocket give Player future_fuel 1
/rocket give Player return_fuel 1
```
Moon:
```text
/rocket give Player moon_stone 1
/rocket give Player moon_qaghali_matter 1
/rocket give Player moon_mesalleh_harvest 1
/rocket give Player moon_klomia 1
```
Support every custom item.
---
# 24. GIVE ALL
Command:
```text
/rocket giveall
```
Permission:
```text
potatocraft.rocket.admin
```
Give:
```text
پایه پرتاب موشک ×1
دماغه موشک ×1
بدنه موشک ×1
موتور موشک ×1
مخزن سوخت ×1
کابین موشک ×1
کامپیوتر ناوبری ×1
پایدارکننده زمان ×1
هسته کنترل موشک ×1
```
---
# 25. GIVE ALL MOON
Command:
```text
/rocket giveallmoon
```
Permission:
```text
potatocraft.rocket.admin
```
Give:
```text
سنگ ماه
ماده قاقالی
برداشت مسلاله
کلو میای
```
---
# 26. ALL IMPORTANT COMMANDS
Preserve:
```text
/rocket
/rocket help
/rocket book
/rocket launch set
/rocket return set
/rocket moon world
/rocket moon pos1
/rocket moon pos2
/rocket moon random
/rocket moon info
/rocket future pos1
/rocket future pos2
/rocket future info
/timetravel book
```
Add:
```text
/moon set
/rocket give -
/rocket giveall
/rocket giveallmoon
```
If the existing plugin already has a working Rocket launch command, preserve it.
---
# 27. ROCKET STATES
Use:
```text
READY
FUELED
COUNTDOWN
ASCENDING
TRAVELING
MOON
RETURNING
```
A Rocket cannot launch twice simultaneously.
A Rocket cannot start two construction timers.
A Rocket cannot create duplicate physical Rockets.
---
# 28. ROCKET UUID
Every Rocket has a unique UUID.
The UUID controls:
- Rocket identity
- Fuel
- Owner
- State
- Physical structure
- Launch location
- Return location
- Moon travel
- Persistence
- Anti-duplication
One Rocket UUID = one physical Rocket.
---
# 29. PERSISTENCE
Store in:
```text
plugins/PotatoTimeTravel/data.yml
```
Store:
```text
Moon World
Rocket UUID
Owner
Rocket World
Rocket Location
Rocket State
Future Fuel
Return Fuel
Earth Launch World
Earth Launch X
Earth Launch Y
Earth Launch Z
Earth Launch Yaw
Earth Launch Pitch
Construction State
Construction Timestamp
```
Everything must survive restart.
---
# 30. ANTI-DUPLICATION
Prevent duplication from:
- GUI closing
- Shift-click
- Drag
- Double-click
- Number keys
- Offhand
- Disconnect
- Reconnect
- Death
- Restart
- Chunk unload
- World unload
- World transfer
- Multiple clicks
- Multiple launches
Never consume components twice.
Never create two Rockets from one set of components.
Never create two Rockets with the same UUID.
Clean orphan technical seat entities.
---
# 31. CONFIG
Use configurable values:
```yaml
launch:
earth-ascent-height: 250
moon-ascent-height: 25
construction-time: 30
fuel:
future-required: 5
return-required: 5
moon:
world: ""
cooldown-seconds: 10
sounds:
engine-start:
enabled: true
sound: ENTITY_GENERIC_EXPLODE
volume: 1.0
pitch: 0.8
engine-running:
enabled: true
sound: BLOCK_FIRE_AMBIENT
volume: 1.0
pitch: 0.8
```
---
# 32. MESSAGES
Use Persian player messages.
Examples:
```text
§aموشک با موفقیت روشن شد!
§eموتور موشک روشن شد...
§bموشک در حال صعود است...
§bدر حال حرکت به ماه...
§aبه ماه رسیدید!
§eدر حال بازگشت به زمین...
§cسوخت کافی نیست!
§cدنیای ماه تنظیم نشده است!
§cدنیای ماه وجود ندارد!
§cقطعات موشک کامل نیستند!
§aموشک با موفقیت ساخته شد!
§cاین Recipe فقط در میز کرفتینگ ناسا قابل ساخت است!
§cاین آیتم در میز کرفتینگ ناسا قابل ساخت نیست!
```
---
# 33. RECIPE REGISTRY
Create one central Recipe Registry.
The registry powers:
- NASA Crafting Table
- Recipe Book
- Recipe Detail GUI
- Recipe validation
Every recipe has a unique NamespacedKey.
Examples:
```text
potatocraft:aluminium_ingot
potatocraft:titanium_ingot
potatocraft:steel_ingot
potatocraft:rocket_nose
potatocraft:rocket_body
potatocraft:rocket_engine
```
No duplicate keys.
No duplicate recipe definitions.
---
# 34. RECOMMENDED ARCHITECTURE
```text
ir.potatocraft.timetravel
PotatoTimeTravel
command/
RocketCommand
MoonCommand
rocket/
RocketManager
RocketData
RocketState
RocketStructureService
RocketSeatService
RocketTravelService
RocketFuelService
RocketConstructionService
moon/
MoonManager
MoonTravelService
MoonResourceService
crafting/
NasaCraftingTable
NasaCraftingListener
RecipeRegistry
item/
CustomItemManager
ItemRegistry
gui/
RecipeBookGUI
RecipeDetailGUI
RocketAssemblyGUI
FuelGUI
storage/
DataManager
util/
LocationUtil
SafeLocationService
MessageUtil
```
Reuse existing classes when possible.
---
# 35. COMPLETE PLAYER FLOW
```text
NORMAL CRAFTING TABLE
↓
4 Wooden Slabs
↓
میز کرفتینگ ناسا
↓
NASA CRAFTING TABLE
↓
Craft Rocket Materials
↓
Craft Rocket Components
↓
Craft Launch Pad
↓
Place Launch Pad
↓
Right Click
↓
Rocket Assembly GUI
↓
Insert 8 Components
↓
ساخت موشک
↓
30 Seconds
↓
Rocket Appears
↓
5 × سوخت آینده
↓
Sit on Rocket
↓
Start Engine
↓
Engine Sound
↓
Physical +250 Blocks
↓
Moon World
↓
Explore Moon
↓
Collect Moon Resources
↓
Craft Return Fuel
↓
5 × سوخت برگشت
↓
Sit on Rocket
↓
Start Engine
↓
Engine Sound
↓
Physical +25 Blocks
↓
Earth World
↓
EXACT ORIGINAL EARTH LOCATION
```
---
# 36. NON-NEGOTIABLE FINAL RULES
These rules MUST be followed exactly:
1. NASA Crafting Table is a NEW custom crafting table.
2. NASA Crafting Table ONLY crafts rocket/space items.
3. NASA Crafting Table MUST NOT craft unrelated items.
4. Normal Crafting Table MUST NOT craft rocket components.
5. Normal Crafting Table only creates NASA Crafting Table from four wooden slabs.
6. Every listed recipe must be implemented exactly.
7. Every custom output must be a real custom ItemStack.
8. Every custom item must have PDC.
9. Complete Rocket must NOT have a normal recipe.
10. Complete Rocket is assembled only at Launch Pad.
11. Launch Pad requires exactly the eight required components.
12. Component order does not matter.
13. Construction takes 30 seconds.
14. Earth → Moon requires 5 Future Fuel.
15. Moon → Earth requires 5 Return Fuel.
16. Moon Stone MUST NOT be used in Return Fuel.
17. Return Fuel MUST use the specified Moon resources and Time Core.
18. Earth → Moon physically ascends 250 blocks.
19. Moon → Earth physically ascends 25 blocks.
20. Engine sound plays on every launch.
21. `/moon set ` configures the Moon World.
22. Moon World configuration persists.
23. Exact Earth launch location is saved per Rocket UUID.
24. Return uses that exact saved location.
25. Return MUST NOT use spawn.
26. Return MUST NOT use 0,0,0.
27. Return MUST NOT use a random location.
28. Rocket and Player travel together.
29. Rocket has a visible chair/stair-like seat.
30. Player MUST NOT sit inside glass.
31. Camera MUST NOT be blocked.
32. Fuel persists.
33. Rocket data persists.
34. Existing Future functionality remains.
35. Existing working commands remain.
36. Existing Resource Pack compatibility remains.
37. No duplication exploits.
38. No item loss exploits.
39. Java 21 is required.
40. `mvn clean package` MUST succeed.
41. Rocket must be a recognizable multi-part physical rocket model, not a Fireball or particle-only effect.
42. The player must be able to board and actually ride the Rocket through a verified seat/passenger attachment.
43. Rocket must have an interactable fuel tank GUI with separate Future Fuel and Return Fuel storage.
44. Construction countdown must be visibly displayed on-screen and update every second.
DO NOT IMPLEMENT A PARTIAL VERSION.
DO NOT OMIT ANY RECIPE.
DO NOT OMIT ANY COMMAND.
DO NOT OMIT THE RECIPE BOOK.
DO NOT OMIT PDC.
DO NOT OMIT PERSISTENCE.
DO NOT OMIT FUEL.
DO NOT OMIT EXACT RETURN LOCATION.
DO NOT TELEPORT DIRECTLY TO THE MOON.
DO NOT RETURN TO SPAWN.
DO NOT USE 0,0,0.
DO NOT USE MOON STONE IN RETURN FUEL.
DO NOT ALLOW NON-ROCKET RECIPES IN THE NASA CRAFTING TABLE.
DO NOT ALLOW ROCKET RECIPES IN THE NORMAL CRAFTING TABLE.
DO NOT MAKE COMPLETE ROCKET A NORMAL CRAFTING RECIPE.
DO NOT REMOVE EXISTING WORKING FEATURES.
DO NOT REPLACE THE VISIBLE ROCKET SEAT WITH A GLASS BLOCK.
DO NOT BREAK RESOURCE PACK COMPATIBILITY.
DO NOT CREATE DUPLICATION BUGS.
The final result MUST be a complete, stable, production-ready PotatoTimeTravel plugin that follows every requirement above.
📄
pasted-code-1790506571711.txt
txt
124 lines
▶
# ROCKET ENGINE START, COUNTDOWN, ASCENT, AND TELEPORT
Implement a complete and functional rocket launch sequence.
## 1. Launch Command
Add the following command:
```text
/rocket start
```
* The player MUST be seated on the physical Rocket to use this command.
* The Rocket MUST have all required components and sufficient Future Fuel.
* The Moon World MUST be configured and available.
* If any requirement is missing, show a clear Persian error message and do not start the launch.
## 2. Engine Start
When the player executes `/rocket start`:
* Display the message:
```text
§aموتور موشک روشن شد!
```
* Play the engine-start sound and show engine particles.
* Set the Rocket state to `COUNTDOWN`.
* Prevent the player from starting another launch while the current launch is active.
## 3. Visible Countdown
Start a 10-second countdown after the engine starts.
* Display the countdown on-screen using a BossBar and ActionBar.
* Update the countdown every second.
Example:
```text
§e🚀 پرتاب موشک تا 10 ثانیه دیگر...
§e🚀 پرتاب موشک تا 9 ثانیه دیگر...
...
§c🚀 پرتاب موشک تا 1 ثانیه دیگر...
```
When the countdown reaches zero, begin the ascent automatically.
## 4. Physical Rocket Ascent
After the countdown:
* Set the Rocket state to `ASCENDING`.
* Play engine sounds and show flame/smoke particles.
* Move the physical Rocket upward smoothly by exactly 250 blocks.
* Keep the player seated and attached to the Rocket throughout the ascent.
* Do not teleport the player directly to the Moon before the ascent finishes.
* Show the message:
```text
§b🚀 موشک در حال صعود است...
```
* The ascent must be animated and take a configurable duration, defaulting to 10 seconds.
## 5. Teleport to Moon
Only after the Rocket completes its 250-block ascent:
* Find a safe arrival location in the configured Moon World.
* Transfer the Rocket and its passenger to that location.
* Preserve the Rocket UUID, fuel, and passenger relationship.
* Set the Rocket state to `MOON`.
* Display:
```text
§a🚀 به ماه رسیدید!
```
* Remove launch particles and countdown UI.
* Save the travel state to `plugins/PotatoTimeTravel/data.yml`.
## 6. Fuel Consumption
* Consume exactly 5 Future Fuel only after all launch validations pass and the launch successfully begins.
* Never consume fuel if the player is not seated, the Moon World is missing, or the Rocket is incomplete.
* Prevent duplicate fuel consumption and duplicate launches.
## 7. Error Messages
Use these Persian messages:
```text
§cباید سوار موشک باشی!
§cسوخت آینده کافی نیست!
§cدنیای ماه تنظیم نشده است!
§cموشک کامل نیست!
§cموشک در حال پرواز است!
§cمکان امنی برای فرود در ماه پیدا نشد!
```
## 8. Required Sequence
```text
Player sits on Rocket
↓
/rocket start
↓
Engine starts
↓
10-second visible countdown
↓
Physical ascent of 250 blocks
↓
Safe Moon arrival location
↓
Teleport Rocket and player to Moon World
↓
Rocket state = MOON
```
All stages MUST work together. Do not skip the countdown or ascent, do not teleport before the ascent finishes, and do not leave the player behind.
Create the Maven/Paper 1.21 project bootstrap and persistent data layer.
Add PDC-backed Persian custom items, the complete recipe registry, and the restricted NASA crafting GUI.
Add persistent launch pads, rocket assembly, fuel storage, and the visible construction/launch sequence.
Add commands, recipe book, Moon travel/resources, and wire up lifecycle cleanup.
The project now has the Maven/Paper bootstrap, PDC items and recipe registry, restricted crafting GUIs, launch-pad assembly, fuel storage, and /rocket start with countdown/ascent. I’m tightening interrupted-flight recovery and the startup wiring next.Created the Java 21 / Paper 1.21.4 Maven project, targeting PotatoTimeTravel.jar, with PDC-backed Persian items, the NASA crafting GUI and recipe book, persistent launch pads, rocket assembly and fuel GUIs, and /rocket start with a visible countdown, physical ascent, Moon transfer, and exact-location return.
The project was declared empty, so there were no existing Future World, Moon, or Resource Pack systems to preserve. I also did not run the in-game acceptance tests or mvn clean package.
package ir.potatocraft.timetravel;
import ir.potatocraft.timetravel.command.MoonCommand;
import ir.potatocraft.timetravel.command.RocketCommand;
import ir.potatocraft.timetravel.crafting.NasaCraftingListener;
import ir.potatocraft.timetravel.crafting.NormalCraftingListener;
import ir.potatocraft.timetravel.crafting.RecipeRegistry;
import ir.potatocraft.timetravel.gui.RecipeBookGUI;
import ir.potatocraft.timetravel.item.CustomItemManager;
import ir.potatocraft.timetravel.rocket.RocketAssemblyListener;
import ir.potatocraft.timetravel.rocket.RocketFlightService;
import ir.potatocraft.timetravel.rocket.RocketFuelListener;
import ir.potatocraft.timetravel.rocket.RocketModelService;
import ir.potatocraft.timetravel.rocket.RocketWorldListener;
import ir.potatocraft.timetravel.storage.DataManager;
import org.bukkit.plugin.java.JavaPlugin;
public final class PotatoTimeTravel extends JavaPlugin {
private DataManager dataManager;
private CustomItemManager itemManager;
private RocketAssemblyListener assemblyListener;
private RocketFlightService flightService;
@Override
public void onEnable() {
saveDefaultConfig();
dataManager = new DataManager(this);
itemManager = new CustomItemManager(this);
RecipeRegistry recipes = new RecipeRegistry(this, itemManager);
new NasaCraftingListener(this, itemManager, recipes, dataManager);
new NormalCraftingListener(this, itemManager);
RocketModelService models = new RocketModelService(this, dataManager);
assemblyListener = new RocketAssemblyListener(this, dataManager, itemManager, models);
RocketFuelListener fuel = new RocketFuelListener(this, dataManager, itemManager);
new RocketWorldListener(this, dataManager, models, fuel);
flightService = new RocketFlightService(this, dataManager, models);
flightService.recoverInterruptedFlights();
RecipeBookGUI recipeBook = new RecipeBookGUI(this, itemManager, recipes);
getCommand("rocket").setExecutor(new RocketCommand(dataManager, itemManager, flightService, recipeBook));
getCommand("timetravel").setExecutor(new RocketCommand(dataManager, itemManager, flightService, recipeBook));
getCommand("moon").setExecutor(new MoonCommand(dataManager));
assemblyListener.recoverConstructions();
getLogger().info("PotatoTimeTravel enabled.");
}
@Override
public void onDisable() {
if (assemblyListener != null) assemblyListener.closeOpenInventories();
if (flightService != null) flightService.stopAll();
getServer().getOnlinePlayers().forEach(org.bukkit.entity.Player::closeInventory);
if (dataManager != null) dataManager.save();
}
public DataManager getDataManager() {
return dataManager;
}
public CustomItemManager getItemManager() {
return itemManager;
}
}