📄
pasted-code-1794293886982.txt
txt
874 lines
▶
# DAVILxTPA ULTIMATE
## Advanced Minecraft Teleport Request Plugin
### Professional Development Specification – Version 1.0
Develop a complete, professional, lightweight and production-ready Minecraft teleport request plugin named **DAVILxTPA ULTIMATE**.
The plugin should provide an advanced TPA system with a professional Minecraft-style interface, customizable buttons, clickable notifications, teleport countdown and a complete YAML configuration system.
The main priority is creating a clean, attractive and reliable teleport request experience while maintaining compatibility with Minecraft 1.21.11.
---
# 1. PROJECT SPECIFICATIONS
**Plugin Name:** DAVILxTPA ULTIMATE
**Target Environment:**
- Minecraft Version: 1.21.11
- Platform: Paper
- Programming Language: Java
- Build System: Maven
- API: Paper API
- Configuration Format: YAML
### IMPORTANT PROJECT RESTRICTIONS
This project must contain ONLY a server-side Paper plugin.
STRICTLY DO NOT:
- Create a Fabric Client Mod.
- Create a Forge Mod.
- Create a NeoForge Mod.
- Create a second project.
- Require additional client-side modifications.
- Require players to install additional software.
The final deliverable must be ONE installable Paper plugin JAR.
Use officially supported Minecraft and Paper APIs.
Never pretend that an unsupported feature is functional.
If a feature cannot be implemented using a server-only plugin, explain the technical limitation and provide the closest reliable alternative.
---
# 2. COMPLETE COMMAND SYSTEM
Implement the following commands:
| Command | Description |
|---|---|
| `/tpa ` | Send a teleport request to another player. |
| `/tpahere ` | Request another player to teleport to you. |
| `/tpaccept` | Accept an incoming request. |
| `/tpadeny` | Deny an incoming request. |
| `/davilxtpa reload` | Reload all plugin configurations. |
### Command Requirements
- Player name autocomplete.
- Command tab completion.
- Permission verification.
- Invalid player handling.
- Offline player handling.
- Self-request prevention.
- Professional error messages.
- Console restrictions where necessary.
- Proper command registration.
---
# 3. PROFESSIONAL CHAT NOTIFICATION SYSTEM
When Player A executes:
`/tpa PlayerB`
Player B should receive a professional notification.
### Default Notification Design
DAVILxTPA
PLAYER_NAME wants to teleport to you!
[ ✔ ACCEPT ] [ ✖ DENY ]
### Requirements
- ACCEPT must be clickable.
- DENY must be clickable.
- Both buttons must support hover messages.
- Custom text.
- Custom prefixes and suffixes.
- RGB/HEX colors wherever supported.
- Configurable notification format.
- Configurable button labels.
- Configurable hover messages.
### Interaction Rules
**When ACCEPT is clicked:**
- Open the custom native Minecraft popup.
- Do not immediately start teleportation.
**When DENY is clicked:**
- Immediately reject the request.
- Do not open the popup.
The popup must NEVER appear automatically when a request arrives.
---
# 4. CUSTOM MINECRAFT NATIVE POPUP
This is one of the highest-priority features.
Create a professional Minecraft-style teleport request popup using Paper's supported native Dialog API.
The popup should resemble Minecraft's original menu interface.
### Default Popup Design
TELEPORT REQUEST
Choose an action.
[ ✔ ACCEPT ] [ ✖ DENY ]
### Popup Requirements
- Native Minecraft Dialog API.
- Professional appearance.
- Centered dialog layout.
- Configurable title.
- Configurable subtitle.
- Two buttons displayed together.
- Proper button alignment.
- Proper button spacing.
- Configurable button labels.
- Configurable tooltips.
- Configurable button order.
- Configurable button width wherever supported.
Do not replace the popup with:
- Chest GUIs.
- Inventory GUIs.
- Ordinary menu inventories.
- Unrelated interfaces.
## 4.1 POPUP POSITIONING – CRITICAL REQUIREMENT
The popup must appear in the CENTER of the player's screen.
Requirements:
- Horizontally centered.
- Vertically centered.
- Both buttons displayed together.
- Equal and balanced spacing.
- Consistent alignment.
- Proper layout even when button text changes.
### VERY IMPORTANT
The default popup position must ALWAYS remain CENTER.
Do not move the popup towards the bottom of the screen.
Do not change the existing popup position when customizing button text or icons.
Do not introduce unnecessary positioning changes.
Use the native Dialog API's actual supported layout behavior.
---
# 5. ADVANCED BUTTON CUSTOMIZATION
Both ACCEPT and DENY buttons must have independent configurations.
Administrators must be able to customize their text, symbols, tooltips and supported appearance properties.
## 5.1 ACCEPT BUTTON
Default:
✔ ACCEPT
Customizable properties:
- Button text.
- Button prefix.
- Button suffix.
- Unicode symbol.
- Custom text formatting.
- Text color wherever supported.
- Tooltip.
- Button width wherever supported.
- Enabled/disabled state.
## 5.2 DENY BUTTON
Default:
✖ DENY
Customizable properties:
- Button text.
- Button prefix.
- Button suffix.
- Unicode symbol.
- Custom text formatting.
- Text color wherever supported.
- Tooltip.
- Button width wherever supported.
- Enabled/disabled state.
## 5.3 INDEPENDENT BUTTON CONFIGURATION
Changing ACCEPT must never automatically change DENY.
Both buttons must have separate configuration sections.
Example:
```yaml
buttons:
accept:
enabled: true
text: "ACCEPT"
prefix: "✔ "
suffix: ""
tooltip: "Click to accept the teleport request"
deny:
enabled: true
text: "DENY"
prefix: "✖ "
suffix: ""
tooltip: "Click to reject the teleport request"
```
---
# 6. MINECRAFT ITEM ICON CUSTOMIZATION
This is an important requested feature.
I want the ability to customize button icons using Minecraft-style symbols.
Examples of desired icons:
- Lime Dye.
- Purple Dye.
- Red Dye.
- Diamond.
- Emerald.
- Emerald Block.
- Redstone Block.
- Shield.
- Barrier.
- Nether Star.
- Other Minecraft blocks and items.
### Important Technical Requirements
Investigate whether Paper's native Dialog API supports actual ItemStack icons inside buttons.
If it does not support actual item icons:
1. Do not pretend that actual item rendering works.
2. Do not create fake YAML settings.
3. Support Unicode symbols and custom text glyphs wherever possible.
4. Optionally support custom-font glyphs through a compatible resource pack if the native text component supports them.
5. Document the resource pack requirement.
6. Keep the plugin fully functional without a resource pack.
Example configuration:
```yaml
buttons:
accept:
icon:
enabled: true
type: "TEXT"
value: "✔"
deny:
icon:
enabled: true
type: "TEXT"
value: "✖"
```
The administrator must be able to change the symbols without modifying Java source code.
Do not claim that a Unicode symbol is an actual Minecraft ItemStack icon.
---
# 7. EXACT POPUP INTERACTION SEQUENCE
The following interaction sequence is mandatory.
**STEP 1**
Player A executes `/tpa PlayerB`.
**STEP 2**
Player B receives the clickable chat notification.
**STEP 3**
No popup appears automatically.
**STEP 4**
Player B clicks ACCEPT in chat.
**STEP 5**
The native Minecraft Dialog popup opens in the exact CENTER.
**STEP 6**
Player B sees:
✔ ACCEPT
✖ DENY
**STEP 7**
If Player B clicks ACCEPT inside the popup:
- Begin the teleport countdown.
- Close the popup.
- Display the teleporting indicator.
If Player B clicks DENY inside the popup:
- Immediately reject the request.
- Close the popup.
- Notify both players.
Never change this sequence.
---
# 8. TELEPORTING HUD INDICATOR – NEW FEATURE
This is another high-priority feature.
After the player clicks ACCEPT inside the popup, display a small and professional teleporting indicator on the player's screen.
### Default Appearance
TELEPORTING...
5
4
3
2
1
The display must be clean, minimal and attractive.
It must not cover a large portion of the screen.
## 8.1 EXACT POSITION REQUIREMENT
The TELEPORTING indicator must appear:
- Horizontally centered.
- In the lower-middle area of the screen.
- Slightly ABOVE the health and hunger bars.
- Around the area immediately above the player's normal HUD.
- Not at the very bottom of the screen.
- Not at the top.
- Not overlapping the health bar.
- Not overlapping the hunger bar.
- Not overlapping the hotbar.
The indicator should remain in the same position throughout the countdown.
### Default Alignment
CENTER
### Visual Requirements
- Small text.
- Professional appearance.
- Clear visibility.
- Proper spacing.
- Attractive countdown presentation.
- No unnecessary screen obstruction.
## 8.2 COUNTDOWN CUSTOMIZATION
Allow administrators to customize:
- Indicator title.
- Countdown format.
- Text color.
- Prefix.
- Suffix.
- Bold formatting.
- Countdown duration.
- Display duration.
- Enable/disable.
- Countdown sounds.
Example:
```yaml
teleport-indicator:
enabled: true
title: "&b&lTELEPORTING..."
countdown:
enabled: true
format: "&f%seconds%"
alignment: CENTER
position: ABOVE_HUD
```
### IMPORTANT TECHNICAL REQUIREMENT
Use the closest reliable server-side display method supported by Paper.
Paper-only APIs do not necessarily provide arbitrary pixel positioning for HUD text.
If exact positioning above the health and hunger bars is not possible:
- Explain the limitation.
- Implement the closest suitable supported display.
- Do not claim that an ActionBar has arbitrary positioning.
- Do not create fake positioning settings.
Do not use a BossBar as a substitute.
Do not use a large title that obstructs gameplay.
---
# 9. TELEPORTATION SYSTEM
Default teleport countdown: 5 seconds.
### Teleport Direction
For `/tpa`:
Teleport the request sender to the target player.
For `/tpahere`:
Teleport the target player to the request sender.
### Teleport Requirements
- Configurable countdown.
- Movement-based cancellation.
- Disconnect cancellation.
- World-change cancellation.
- Invalid destination handling.
- Safe teleport execution.
- Multiple countdown prevention.
- Countdown sounds.
- Teleport success notification.
- Teleport cancellation notification.
- Proper request cleanup.
### Movement Cancellation
If the player moves during the countdown, cancel the teleport.
Movement detection should be configurable.
Allow administrators to decide whether looking around or changing camera direction should count as movement.
Do not cancel merely because of harmless server-side location updates.
---
# 10. REQUEST MANAGEMENT SYSTEM
Default settings:
| Feature | Default |
|---|---|
| Request expiration | 60 seconds |
| Teleport countdown | 5 seconds |
| Duplicate requests | Disabled |
| Maximum pending requests | Configurable |
| Request cooldown | Configurable |
Implement:
- Request expiration.
- Cooldown management.
- Duplicate request prevention.
- Self-request prevention.
- Maximum pending requests.
- Automatic expired request cleanup.
- Disconnect handling.
- Multiple request management.
- Cooldown bypass.
- Expiration bypass.
Never leave requests stuck in an active state.
---
# 11. COMPLETE CONFIGURATION SYSTEM
Create separate YAML configuration files.
## 11.1 config.yml
Include:
### General Settings
- Plugin prefix.
- Debug mode.
- Default language.
- Default settings.
### Request Settings
- Expiration time.
- Cooldown.
- Maximum pending requests.
- Duplicate prevention.
- Self-request prevention.
### Teleport Settings
- Countdown duration.
- Movement cancellation.
- Disconnect cancellation.
- World-change cancellation.
- Countdown format.
- Teleport behavior.
### Popup Settings
- Enable/disable popup.
- Default title.
- Default subtitle.
- Default button labels.
- Default alignment.
### Teleport Indicator Settings
- Enable/disable.
- Display text.
- Countdown format.
- Alignment.
- Display duration.
## 11.2 messages.yml
Every plugin message must be editable.
Include:
- Plugin prefix.
- Request sent.
- Request received.
- ACCEPT text.
- DENY text.
- Hover messages.
- Accepted messages.
- Denied messages.
- Expired messages.
- Countdown messages.
- Teleport success.
- Teleport cancellation.
- Movement cancellation.
- Cooldown messages.
- Invalid player messages.
- Permission messages.
- Reload messages.
- Error messages.
Support Minecraft color formatting and RGB/HEX wherever supported.
## 11.3 gui.yml
Include:
- Popup title.
- Popup subtitle.
- Popup alignment.
- ACCEPT button text.
- DENY button text.
- ACCEPT symbol.
- DENY symbol.
- Button prefixes.
- Button suffixes.
- Button tooltips.
- Button order.
- Supported button widths.
- Supported native Dialog properties.
Do not include unsupported settings.
## 11.4 sounds.yml
Include:
- Request sent sound.
- Request received sound.
- Request accepted sound.
- Request denied sound.
- Countdown sounds.
- Teleport success sound.
- Teleport cancellation sound.
Allow customization of:
- Sound type.
- Volume.
- Pitch.
- Enable/disable.
## 11.5 permissions.yml
Document all permission nodes.
---
# 12. LUCKPERMS COMPATIBILITY
The plugin must fully support LuckPerms through Bukkit/Paper's standard permission system.
### Permission Nodes
| Permission | Purpose |
|---|---|
| davilxtpa.tpa | Use TPA |
| davilxtpa.tpahere | Use TPAHERE |
| davilxtpa.accept | Accept requests |
| davilxtpa.deny | Deny requests |
| davilxtpa.admin | Administrative access |
| davilxtpa.reload | Reload configurations |
| davilxtpa.bypass.cooldown | Bypass cooldown |
| davilxtpa.bypass.expiration | Bypass expiration |
Requirements:
- Support LuckPerms groups.
- Support individual permissions.
- Support inherited permissions.
- No unnecessary OP requirement.
- Permission changes should apply without server restart.
---
# 13. RELOAD SYSTEM
Implement:
`/davilxtpa reload`
Reload all configuration files:
- config.yml
- messages.yml
- gui.yml
- sounds.yml
- permissions.yml
Apply changes wherever technically possible without server restart.
Support:
- Updated messages.
- Updated button labels.
- Updated button symbols.
- Updated tooltips.
- Updated sounds.
- Updated countdown duration.
- Updated teleporting indicator text.
- Updated supported GUI properties.
Validate YAML files.
Handle invalid configuration safely.
Display clear success or failure messages.
---
# 14. PERFORMANCE AND OPTIMIZATION
The plugin must be lightweight and suitable for SMP, Survival and Lifesteal servers.
Requirements:
- Efficient request storage.
- Avoid unnecessary repeating tasks.
- Automatically clean expired requests.
- Avoid memory leaks.
- Cancel unnecessary scheduled tasks.
- Handle player disconnects.
- Avoid unnecessary database operations.
- Maintain stable server performance.
Use proper Bukkit/Paper scheduler practices.
All Bukkit API operations must execute on the appropriate server thread.
---
# 15. ERROR HANDLING
Properly handle:
- Player not found.
- Player offline.
- Invalid commands.
- Missing permissions.
- Expired requests.
- Duplicate requests.
- Request cooldown.
- Player movement.
- Player disconnect.
- Invalid teleport destination.
- World changes.
- Configuration errors.
- Popup interaction failures.
- Teleportation failures.
Never leave players stuck in an active request or teleport state.
---
# 16. COMPATIBILITY
Target environment:
- Minecraft 1.21.11.
- Paper Server.
- Java.
- LuckPerms.
- No unnecessary dependencies.
Requirements:
- Use APIs compatible with the exact target version.
- Do not require players to change Minecraft versions.
- Do not modify existing worlds.
- Do not introduce unnecessary dependencies.
- Do not break existing server functionality.
---
# 17. PROJECT STRUCTURE
Create a clean and organized Maven project.
```text
DAVILxTPA/
│
├── src/
│ └── main/
│ ├── java/
│ │ └── davilxtpa/
│ │ ├── DAVILxTPA.java
│ │ ├── commands/
│ │ ├── requests/
│ │ ├── teleport/
│ │ ├── popup/
│ │ ├── chat/
│ │ ├── listeners/
│ │ ├── permissions/
│ │ ├── config/
│ │ └── utils/
│ │
│ └── resources/
│ ├── plugin.yml
│ ├── config.yml
│ ├── messages.yml
│ ├── gui.yml
│ ├── sounds.yml
│ └── permissions.yml
│
├── pom.xml
└── README.md
```
---
# 18. FINAL DELIVERABLES
Provide:
1. Complete Java source code.
2. Compiled plugin JAR.
3. All YAML configuration files.
4. plugin.yml.
5. Maven build configuration.
6. README.md.
7. Installation instructions.
8. Command documentation.
9. LuckPerms permission documentation.
10. Popup implementation explanation.
11. Button customization documentation.
12. Icon customization documentation.
13. Teleporting indicator implementation explanation.
14. Compatibility documentation.
15. Testing instructions.
Do not provide incomplete code, pseudocode, placeholder methods or missing classes.
Verify that the complete project compiles successfully.
---
# 19. FINAL DEVELOPMENT PRIORITIES
The following requirements have the highest priority:
1. Minecraft 1.21.11 compatibility.
2. Complete TPA and TPAHERE functionality.
3. Clickable chat notifications.
4. Popup opens ONLY after clicking ACCEPT in chat.
5. Popup remains in the exact CENTER by default.
6. ACCEPT and DENY buttons appear together.
7. Custom button text.
8. Independent button symbols and prefixes.
9. Unicode and custom-font icon support wherever possible.
10. Honest documentation of actual Minecraft ItemStack icon limitations.
11. ACCEPT and DENY must have independent configurations.
12. Five-second configurable teleport countdown.
13. Small TELEPORTING indicator.
14. Indicator positioned above the health and hunger HUD wherever technically supported.
15. Movement-based cancellation.
16. Complete YAML configuration.
17. LuckPerms compatibility.
18. Reliable reload functionality.
19. Lightweight performance.
20. Complete installation-ready plugin JAR.
---
# FINAL DEVELOPER INSTRUCTION
Develop DAVILxTPA ULTIMATE as a complete, professional and production-ready Minecraft 1.21.11 Paper plugin.
Follow the specifications carefully.
Do not silently remove requested functionality.
Do not create fake configuration options.
Do not claim unsupported Minecraft GUI or HUD functionality.
Do not generate any client-side mod.
If a requested feature is technically impossible using a server-only Paper plugin, explain the limitation and implement the closest reliable alternative.
Prioritize stability, compatibility, professional presentation and clean Java architecture.
The final result must be a properly structured, compilable, installable and fully documented Minecraft plugin.
Build the Paper 1.21.11 Maven plugin and its command/permission registrations.
Implement request lifecycle, clickable chat actions, native dialogs, and safe countdown teleportation.
Add editable YAML defaults and concise operational documentation, while documenting server-only UI limits.
Created DAVILxTPA ULTIMATE as a Java 21 Maven plugin for Paper 1.21.11, with TPA/TPAHERE requests, clickable chat actions, native confirmation dialogs, configurable countdowns, cancellation handling, permissions, YAML files, and documentation.
The dialog opens only after the recipient chooses ACCEPT in chat or runs /tpaccept. Its buttons use text glyphs, not item icons. The countdown uses an ActionBar; Paper does not provide arbitrary pixel positioning above the health and hunger bars.
To get the installable JAR: click Compile in the top bar (on phone: ⋮ → Compile Project), click Compile, then download the successful build.
package davilxtpa;
import davilxtpa.commands.TpaCommand;
import davilxtpa.config.ConfigManager;
import davilxtpa.listeners.PlayerListener;
import davilxtpa.popup.PopupManager;
import davilxtpa.requests.RequestManager;
import davilxtpa.teleport.TeleportManager;
import org.bukkit.command.PluginCommand;
import org.bukkit.plugin.java.JavaPlugin;
public final class DAVILxTPA extends JavaPlugin {
private ConfigManager configManager;
private RequestManager requestManager;
private TeleportManager teleportManager;
private PopupManager popupManager;
@Override
public void onEnable() {
saveDefaultConfig();
for (String resource : new String[]{"messages.yml", "gui.yml", "sounds.yml", "permissions.yml"}) {
if (!getDataFolder().toPath().resolve(resource).toFile().exists()) {
saveResource(resource, false);
}
}
configManager = new ConfigManager(this);
if (!configManager.loadAll()) {
getLogger().severe("A configuration file is invalid; DAVILxTPA ULTIMATE will be disabled.");
getServer().getPluginManager().disablePlugin(this);
return;
}
requestManager = new RequestManager(this);
teleportManager = new TeleportManager(this);
popupManager = new PopupManager(this);
TpaCommand commandHandler = new TpaCommand(this);
for (String name : new String[]{"tpa", "tpahere", "tpaccept", "tpadeny", "davilxtpa"}) {
PluginCommand command = getCommand(name);
if (command != null) {
command.setExecutor(commandHandler);
command.setTabCompleter(commandHandler);
}
}
getServer().getPluginManager().registerEvents(new PlayerListener(this), this);
getLogger().info("DAVILxTPA ULTIMATE enabled.");
}
@Override
public void onDisable() {
if (teleportManager != null) {
teleportManager.cancelAll();
}
if (requestManager != null) {
requestManager.clear();
}
}
public ConfigManager configs() {
return configManager;
}
public RequestManager requests() {
return requestManager;
}
public TeleportManager teleports() {
return teleportManager;
}
public PopupManager popups() {
return popupManager;
}
public void debug(String message) {
if (configManager != null && configManager.config().getBoolean("general.debug", false)) {
getLogger().info("[debug] " + message);
}
}
}