📄
pasted-code-1791029672356.txt
txt
708 lines
▶
Create a BRAND NEW Minecraft RTP plugin project completely from scratch.
IMPORTANT:
Do NOT use, copy, modify, or reuse my previous RTP project.
I want a completely new project with all files created from zero.
==================================================
SERVER ENVIRONMENT
==================================================
My actual server is:
Paper 26.3
Minecraft 26.3
Java 25
Linux
Build the plugin specifically for this environment.
Use the correct Paper API for Minecraft/Paper 26.3.
Use Java 25.
Build system:
Maven
==================================================
CRITICAL PLUGIN NAME FIX
==================================================
The previous project failed because Paper showed:
Restricted name, cannot use 0x20 (space character) in a plugin name.
This MUST NOT happen again.
The internal plugin name MUST be:
RTPPlugin
There must be NO SPACE in the plugin.yml name.
CORRECT:
name: RTPPlugin
WRONG:
name: RTP Plugin
Do NOT use "RTP Plugin" anywhere in plugin.yml.
The final JAR should be:
rtpplugin-1.0.0.jar
The JAR filename may contain no spaces.
==================================================
NEW PROJECT
==================================================
Project name:
RTPPlugin
Main package:
com.kodari.rtpplugin
Main class:
com.kodari.rtpplugin.RTPPlugin
Final JAR:
target/rtpplugin-1.0.0.jar
==================================================
PLUGIN.YML
==================================================
Create a completely new plugin.yml.
It MUST contain:
name: RTPPlugin
version: 1.0.0
main: com.kodari.rtpplugin.RTPPlugin
api-version: '26'
commands:
rtp:
description: Open the RTP menu
usage: /rtp
permission: rtpplugin.use
permissions:
rtpplugin.use:
description: Allows players to use RTP
default: true
rtpplugin.admin:
description: RTP administration
default: op
rtpplugin.bypass.cooldown:
description: Bypass RTP cooldown
default: op
rtpplugin.bypass.cost:
description: Bypass RTP cost
default: op
rtpplugin.bypass.combat:
description: Bypass combat restriction
default: op
VERY IMPORTANT:
Before building, inspect plugin.yml and verify that:
name: RTPPlugin
NOT:
name: RTP Plugin
There must NEVER be a space in the plugin's internal name.
==================================================
MAVEN
==================================================
Create a new pom.xml from scratch.
Use:
Java 25
Paper API compatible with Paper 26.3
Do NOT use:
XSeries
old Paper API
1.21.4 API
1.21.11 API
Use only the APIs actually required.
Make sure Maven can execute:
mvn clean package
The final output MUST be:
target/rtpplugin-1.0.0.jar
==================================================
COMMAND
==================================================
Create:
/rtp
When a player types:
/rtp
the RTP GUI opens.
Also create:
/rtp reload
/rtp unlock nether
/rtp unlock end
/rtp lock nether
/rtp lock end
Admin commands require:
rtpplugin.admin
==================================================
RTP GUI
==================================================
Create a 45-slot chest GUI.
The GUI should look premium and clean.
EXACT POSITION:
Top center:
SERVER NAME BOX
Second row:
LEFT:
🔥 NETHER
CENTER:
🌎 OVERWORLD
RIGHT:
🌌 END
Use this layout:
┌─────────────────────────────┐
│ 🟩 🟩 🟩 🟩 🏆 🟩 🟩 🟩 🟩 │
│ 🟩 🟩 🔥 🟩 🌎 🟩 🌌 🟩 🟩 │
│ 🟩 🟩 🟩 🟩 🟩 🟩 🟩 🟩 🟩 │
│ 🟩 🟩 🟩 🟩 🟩 🟩 🟩 🟩 🟩 │
│ 🟩 🟩 🟩 🟩 🟩 🟩 🟩 🟩 🟩 │
└─────────────────────────────┘
NETHER = LEFT
OVERWORLD = EXACT CENTER
END = RIGHT
Do not put them directly against the GUI edge.
Keep the three buttons evenly spaced.
==================================================
SERVER NAME BOX
==================================================
Top center.
Use:
NETHER_STAR
The name MUST come from config.yml.
Example:
gui:
server-name: "&b&lYOUR SERVER NAME"
I should be able to change it later without changing Java.
Example:
gui:
server-name: "&6&lMY SERVER"
The server name is NOT the plugin name.
Plugin internal name:
RTPPlugin
GUI server name:
configurable
Do not hard-code a server name.
==================================================
GREEN GLASS BACKGROUND
==================================================
Fill every unused slot with:
GREEN_STAINED_GLASS_PANE
Display name:
" "
Players cannot take or move these items.
==================================================
NETHER
==================================================
LEFT position.
Material:
NETHERITE_SCRAP
Name:
&c&l🔥 NETHER
Lore:
&7Teleport to a random location
&7inside the Nether.
&eClick to teleport
Default:
LOCKED
==================================================
OVERWORLD
==================================================
CENTER position.
Material:
GRASS_BLOCK
Name:
&a&l🌎 OVERWORLD
Lore:
&7Teleport to a random location
&7inside the Overworld.
&eClick to teleport
Default:
UNLOCKED
==================================================
END
==================================================
RIGHT position.
Material:
ENDER_EYE
Name:
&5&l🌌 END
Lore:
&7Teleport to a random location
&7inside the End.
&eClick to teleport
Default:
LOCKED
==================================================
GUI PROTECTION
==================================================
Players must NOT be able to:
- take GUI items
- move GUI items
- shift click
- drag items
- double click
- number-key swap
- hotbar swap
- offhand swap
- drop GUI items
- place items into GUI
Handle all relevant inventory events.
==================================================
RTP SYSTEM
==================================================
When a player clicks an unlocked world:
Close the GUI.
Start a 5-second countdown.
Show:
RTP
Teleporting in 5
Then:
4
3
2
1
Then teleport.
After teleport:
TELEPORTED!
==================================================
MOVEMENT CANCEL
==================================================
If the player actually moves during the countdown:
Cancel teleport.
Send:
&c&lRTP CANCELLED
&7You moved during the countdown.
Head rotation alone must NOT cancel.
==================================================
SAFE LOCATION
==================================================
Find a safe random location.
Never teleport into:
- lava
- fire
- water
- cactus
- magma
- void
- suffocation blocks
- dangerous locations
Require:
- solid ground
- two safe blocks above
- safe player position
Config:
rtp:
min-distance: 500
max-distance: 5000
max-attempts: 30
Never use an infinite loop.
==================================================
COOLDOWN
==================================================
Default:
300 seconds
Configurable.
Permission:
rtpplugin.bypass.cooldown
Message:
&cYou must wait &e%time% &cbefore using RTP again.
==================================================
WORLD LOCK SYSTEM
==================================================
Default:
Overworld = unlocked
Nether = locked
End = locked
Commands:
/rtp unlock nether
/rtp unlock end
/rtp lock nether
/rtp lock end
Permission:
rtpplugin.admin
Save the lock state so it survives restart.
==================================================
CONFIG
==================================================
Create config.yml:
gui:
title: "&8✦ &fRTP &8✦"
server-name: "&b&lYOUR SERVER NAME"
server-name-lore:
- "&7Choose your destination"
- "&8✦ Premium RTP"
background:
material: GREEN_STAINED_GLASS_PANE
name: " "
nether:
name: "&c&l🔥 NETHER"
overworld:
name: "&a&l🌎 OVERWORLD"
end:
name: "&5&l🌌 END"
countdown:
seconds: 5
cancel-on-move: true
rtp:
min-distance: 500
max-distance: 5000
max-attempts: 30
cooldown:
enabled: true
seconds: 300
worlds:
overworld:
enabled: true
name: world
nether:
enabled: true
name: world_nether
end:
enabled: true
name: world_the_end
effects:
particles: true
sounds: true
==================================================
PARTICLES
==================================================
Use lightweight effects.
Countdown:
END_ROD
PORTAL
CLOUD
Teleport:
PORTAL
END_ROD
CLOUD
Do not spam particles.
==================================================
SOUNDS
==================================================
Use valid sounds for the actual Minecraft/Paper 26.3 API.
Countdown:
BLOCK_NOTE_BLOCK_PLING
Teleport:
ENTITY_ENDERMAN_TELEPORT
Success:
ENTITY_PLAYER_LEVELUP
Cancel:
BLOCK_NOTE_BLOCK_BASS
==================================================
RELOAD
==================================================
/rtp reload
Permission:
rtpplugin.admin
Reload config without restarting the server.
==================================================
PLAYER CLEANUP
==================================================
If player:
- disconnects
- dies
- changes world
during countdown:
Cancel the pending RTP.
Cancel scheduled tasks.
Remove player from active teleport tracking.
Prevent memory leaks.
==================================================
PROJECT STRUCTURE
==================================================
Create this completely from scratch:
RTPPlugin/
├── pom.xml
└── src/
└── main/
├── java/
│ └── com/
│ └── kodari/
│ └── rtpplugin/
│ ├── RTPPlugin.java
│ ├── command/
│ │ └── RTPCommand.java
│ ├── gui/
│ │ ├── RTPMenu.java
│ │ └── RTPMenuListener.java
│ ├── rtp/
│ │ ├── RTPManager.java
│ │ ├── SafeLocationFinder.java
│ │ └── RTPCooldownManager.java
│ └── listener/
│ └── RTPPlayerListener.java
│
└── resources/
├── plugin.yml
└── config.yml
Add helper classes only if actually needed.
==================================================
FINAL ERROR CHECK
==================================================
This is extremely important.
Before finishing the project:
1. Open plugin.yml.
2. Verify:
name: RTPPlugin
3. Search the entire project for:
name: RTP Plugin
4. If found, remove/fix it.
5. Verify main class.
6. Verify command registration.
7. Verify package names.
8. Verify all imports.
9. Verify Paper 26.3 API.
10. Verify Java 25.
11. Verify config.yml.
12. Verify GUI positions.
13. Verify inventory protection.
14. Verify /rtp command.
15. Verify /rtp reload.
16. Verify world lock system.
Then actually run:
mvn clean package
Do NOT just say that it should compile.
Actually check the Maven build.
The final file MUST be:
target/rtpplugin-1.0.0.jar
The resulting JAR must contain a correct plugin.yml with:
name: RTPPlugin
There must be NO plugin name containing a space.
==================================================
FINAL RESPONSE
==================================================
After building, tell me:
1. Project created from scratch.
2. Files created.
3. Whether compilation succeeded.
4. Exact JAR filename.
5. Any errors fixed.
6. How to install the JAR.
Do not reuse my old RTP project.
Create everything from zero.
Create the Maven project metadata and plugin/config files for Java 25 and Paper 26.3.
Implement the GUI, command handling, safe-location search, countdown/cooldown, and player cleanup.
Created the RTPPlugin project from scratch with the requested package, Java 25 Maven setup, Paper API dependency, configurable GUI, RTP countdown and safety checks, cooldown, world locks, commands, and cleanup handlers.
Created 11 files:
pom.xml,plugin.yml,config.yml, and the nine Java classes undercom.kodari.rtpplugin.plugin.ymlspecifiesname: RTPPluginwith no space, and the Maven artifact is configured asrtpplugin-1.0.0.Build not verified: Maven cannot be run in this environment, so I can’t confirm compilation or that the JAR has been generated. The expected output path after a successful
mvn clean packageistarget/rtpplugin-1.0.0.jar.To install, build the project with
mvn clean package, then copy that JAR into the server’spluginsfolder and restart the server.
📄
pasted-code-1791029672356.txt
txt
708 lines
▶
Create a BRAND NEW Minecraft RTP plugin project completely from scratch.
IMPORTANT:
Do NOT use, copy, modify, or reuse my previous RTP project.
I want a completely new project with all files created from zero.
==================================================
SERVER ENVIRONMENT
==================================================
My actual server is:
Paper 26.3
Minecraft 26.3
Java 25
Linux
Build the plugin specifically for this environment.
Use the correct Paper API for Minecraft/Paper 26.3.
Use Java 25.
Build system:
Maven
==================================================
CRITICAL PLUGIN NAME FIX
==================================================
The previous project failed because Paper showed:
Restricted name, cannot use 0x20 (space character) in a plugin name.
This MUST NOT happen again.
The internal plugin name MUST be:
RTPPlugin
There must be NO SPACE in the plugin.yml name.
CORRECT:
name: RTPPlugin
WRONG:
name: RTP Plugin
Do NOT use "RTP Plugin" anywhere in plugin.yml.
The final JAR should be:
rtpplugin-1.0.0.jar
The JAR filename may contain no spaces.
==================================================
NEW PROJECT
==================================================
Project name:
RTPPlugin
Main package:
com.kodari.rtpplugin
Main class:
com.kodari.rtpplugin.RTPPlugin
Final JAR:
target/rtpplugin-1.0.0.jar
==================================================
PLUGIN.YML
==================================================
Create a completely new plugin.yml.
It MUST contain:
name: RTPPlugin
version: 1.0.0
main: com.kodari.rtpplugin.RTPPlugin
api-version: '26'
commands:
rtp:
description: Open the RTP menu
usage: /rtp
permission: rtpplugin.use
permissions:
rtpplugin.use:
description: Allows players to use RTP
default: true
rtpplugin.admin:
description: RTP administration
default: op
rtpplugin.bypass.cooldown:
description: Bypass RTP cooldown
default: op
rtpplugin.bypass.cost:
description: Bypass RTP cost
default: op
rtpplugin.bypass.combat:
description: Bypass combat restriction
default: op
VERY IMPORTANT:
Before building, inspect plugin.yml and verify that:
name: RTPPlugin
NOT:
name: RTP Plugin
There must NEVER be a space in the plugin's internal name.
==================================================
MAVEN
==================================================
Create a new pom.xml from scratch.
Use:
Java 25
Paper API compatible with Paper 26.3
Do NOT use:
XSeries
old Paper API
1.21.4 API
1.21.11 API
Use only the APIs actually required.
Make sure Maven can execute:
mvn clean package
The final output MUST be:
target/rtpplugin-1.0.0.jar
==================================================
COMMAND
==================================================
Create:
/rtp
When a player types:
/rtp
the RTP GUI opens.
Also create:
/rtp reload
/rtp unlock nether
/rtp unlock end
/rtp lock nether
/rtp lock end
Admin commands require:
rtpplugin.admin
==================================================
RTP GUI
==================================================
Create a 45-slot chest GUI.
The GUI should look premium and clean.
EXACT POSITION:
Top center:
SERVER NAME BOX
Second row:
LEFT:
🔥 NETHER
CENTER:
🌎 OVERWORLD
RIGHT:
🌌 END
Use this layout:
┌─────────────────────────────┐
│ 🟩 🟩 🟩 🟩 🏆 🟩 🟩 🟩 🟩 │
│ 🟩 🟩 🔥 🟩 🌎 🟩 🌌 🟩 🟩 │
│ 🟩 🟩 🟩 🟩 🟩 🟩 🟩 🟩 🟩 │
│ 🟩 🟩 🟩 🟩 🟩 🟩 🟩 🟩 🟩 │
│ 🟩 🟩 🟩 🟩 🟩 🟩 🟩 🟩 🟩 │
└─────────────────────────────┘
NETHER = LEFT
OVERWORLD = EXACT CENTER
END = RIGHT
Do not put them directly against the GUI edge.
Keep the three buttons evenly spaced.
==================================================
SERVER NAME BOX
==================================================
Top center.
Use:
NETHER_STAR
The name MUST come from config.yml.
Example:
gui:
server-name: "&b&lYOUR SERVER NAME"
I should be able to change it later without changing Java.
Example:
gui:
server-name: "&6&lMY SERVER"
The server name is NOT the plugin name.
Plugin internal name:
RTPPlugin
GUI server name:
configurable
Do not hard-code a server name.
==================================================
GREEN GLASS BACKGROUND
==================================================
Fill every unused slot with:
GREEN_STAINED_GLASS_PANE
Display name:
" "
Players cannot take or move these items.
==================================================
NETHER
==================================================
LEFT position.
Material:
NETHERITE_SCRAP
Name:
&c&l🔥 NETHER
Lore:
&7Teleport to a random location
&7inside the Nether.
&eClick to teleport
Default:
LOCKED
==================================================
OVERWORLD
==================================================
CENTER position.
Material:
GRASS_BLOCK
Name:
&a&l🌎 OVERWORLD
Lore:
&7Teleport to a random location
&7inside the Overworld.
&eClick to teleport
Default:
UNLOCKED
==================================================
END
==================================================
RIGHT position.
Material:
ENDER_EYE
Name:
&5&l🌌 END
Lore:
&7Teleport to a random location
&7inside the End.
&eClick to teleport
Default:
LOCKED
==================================================
GUI PROTECTION
==================================================
Players must NOT be able to:
- take GUI items
- move GUI items
- shift click
- drag items
- double click
- number-key swap
- hotbar swap
- offhand swap
- drop GUI items
- place items into GUI
Handle all relevant inventory events.
==================================================
RTP SYSTEM
==================================================
When a player clicks an unlocked world:
Close the GUI.
Start a 5-second countdown.
Show:
RTP
Teleporting in 5
Then:
4
3
2
1
Then teleport.
After teleport:
TELEPORTED!
==================================================
MOVEMENT CANCEL
==================================================
If the player actually moves during the countdown:
Cancel teleport.
Send:
&c&lRTP CANCELLED
&7You moved during the countdown.
Head rotation alone must NOT cancel.
==================================================
SAFE LOCATION
==================================================
Find a safe random location.
Never teleport into:
- lava
- fire
- water
- cactus
- magma
- void
- suffocation blocks
- dangerous locations
Require:
- solid ground
- two safe blocks above
- safe player position
Config:
rtp:
min-distance: 500
max-distance: 5000
max-attempts: 30
Never use an infinite loop.
==================================================
COOLDOWN
==================================================
Default:
300 seconds
Configurable.
Permission:
rtpplugin.bypass.cooldown
Message:
&cYou must wait &e%time% &cbefore using RTP again.
==================================================
WORLD LOCK SYSTEM
==================================================
Default:
Overworld = unlocked
Nether = locked
End = locked
Commands:
/rtp unlock nether
/rtp unlock end
/rtp lock nether
/rtp lock end
Permission:
rtpplugin.admin
Save the lock state so it survives restart.
==================================================
CONFIG
==================================================
Create config.yml:
gui:
title: "&8✦ &fRTP &8✦"
server-name: "&b&lYOUR SERVER NAME"
server-name-lore:
- "&7Choose your destination"
- "&8✦ Premium RTP"
background:
material: GREEN_STAINED_GLASS_PANE
name: " "
nether:
name: "&c&l🔥 NETHER"
overworld:
name: "&a&l🌎 OVERWORLD"
end:
name: "&5&l🌌 END"
countdown:
seconds: 5
cancel-on-move: true
rtp:
min-distance: 500
max-distance: 5000
max-attempts: 30
cooldown:
enabled: true
seconds: 300
worlds:
overworld:
enabled: true
name: world
nether:
enabled: true
name: world_nether
end:
enabled: true
name: world_the_end
effects:
particles: true
sounds: true
==================================================
PARTICLES
==================================================
Use lightweight effects.
Countdown:
END_ROD
PORTAL
CLOUD
Teleport:
PORTAL
END_ROD
CLOUD
Do not spam particles.
==================================================
SOUNDS
==================================================
Use valid sounds for the actual Minecraft/Paper 26.3 API.
Countdown:
BLOCK_NOTE_BLOCK_PLING
Teleport:
ENTITY_ENDERMAN_TELEPORT
Success:
ENTITY_PLAYER_LEVELUP
Cancel:
BLOCK_NOTE_BLOCK_BASS
==================================================
RELOAD
==================================================
/rtp reload
Permission:
rtpplugin.admin
Reload config without restarting the server.
==================================================
PLAYER CLEANUP
==================================================
If player:
- disconnects
- dies
- changes world
during countdown:
Cancel the pending RTP.
Cancel scheduled tasks.
Remove player from active teleport tracking.
Prevent memory leaks.
==================================================
PROJECT STRUCTURE
==================================================
Create this completely from scratch:
RTPPlugin/
├── pom.xml
└── src/
└── main/
├── java/
│ └── com/
│ └── kodari/
│ └── rtpplugin/
│ ├── RTPPlugin.java
│ ├── command/
│ │ └── RTPCommand.java
│ ├── gui/
│ │ ├── RTPMenu.java
│ │ └── RTPMenuListener.java
│ ├── rtp/
│ │ ├── RTPManager.java
│ │ ├── SafeLocationFinder.java
│ │ └── RTPCooldownManager.java
│ └── listener/
│ └── RTPPlayerListener.java
│
└── resources/
├── plugin.yml
└── config.yml
Add helper classes only if actually needed.
==================================================
FINAL ERROR CHECK
==================================================
This is extremely important.
Before finishing the project:
1. Open plugin.yml.
2. Verify:
name: RTPPlugin
3. Search the entire project for:
name: RTP Plugin
4. If found, remove/fix it.
5. Verify main class.
6. Verify command registration.
7. Verify package names.
8. Verify all imports.
9. Verify Paper 26.3 API.
10. Verify Java 25.
11. Verify config.yml.
12. Verify GUI positions.
13. Verify inventory protection.
14. Verify /rtp command.
15. Verify /rtp reload.
16. Verify world lock system.
Then actually run:
mvn clean package
Do NOT just say that it should compile.
Actually check the Maven build.
The final file MUST be:
target/rtpplugin-1.0.0.jar
The resulting JAR must contain a correct plugin.yml with:
name: RTPPlugin
There must be NO plugin name containing a space.
==================================================
FINAL RESPONSE
==================================================
After building, tell me:
1. Project created from scratch.
2. Files created.
3. Whether compilation succeeded.
4. Exact JAR filename.
5. Any errors fixed.
6. How to install the JAR.
Do not reuse my old RTP project.
Create everything from zero.
Inspect the generated project files and check the plugin metadata/configuration.
Fix any implementation or consistency issues, then run the Maven build if the environment permits.
The project files are in place, and I corrected the safe-location height calculation so players spawn above the highest solid block. Countdown particle effects are also emitted during the countdown.
Files: 11 total —
pom.xml,plugin.yml,config.yml, and 8 Java classes.Name check:
plugin.ymlcontainsname: RTPPlugin; the project search found noname: RTP Plugin.Build: I couldn’t run
mvn clean packagein this environment, so compilation and JAR contents are unverified.Expected JAR:
target/rtpplugin-1.0.0.jar(configured in Maven, but not generated here).Install: Run
mvn clean package, then copy the resulting JAR into the server’spluginsdirectory and restart.
package com.kodari.rtpplugin;
import com.kodari.rtpplugin.command.RTPCommand;
import com.kodari.rtpplugin.gui.RTPMenu;
import com.kodari.rtpplugin.gui.RTPMenuListener;
import com.kodari.rtpplugin.listener.RTPPlayerListener;
import com.kodari.rtpplugin.rtp.RTPCooldownManager;
import com.kodari.rtpplugin.rtp.RTPManager;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.command.PluginCommand;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
public final class RTPPlugin extends JavaPlugin {
private RTPManager rtpManager;
private RTPCooldownManager cooldownManager;
private RTPMenu rtpMenu;
@Override
public void onEnable() {
saveDefaultConfig();
ensureLockDefaults();
cooldownManager = new RTPCooldownManager(this);
rtpManager = new RTPManager(this);
rtpMenu = new RTPMenu(this);
Bukkit.getPluginManager().registerEvents(new RTPMenuListener(this, rtpManager), this);
Bukkit.getPluginManager().registerEvents(new RTPPlayerListener(rtpManager), this);
PluginCommand command = getCommand("rtp");
if (command == null) {
getLogger().severe("The rtp command is missing from plugin.yml.");
Bukkit.getPluginManager().disablePlugin(this);
return;
}
command.setExecutor(new RTPCommand(this));
}
@Override
public void onDisable() {
if (rtpManager != null) {
rtpManager.cancelAll();
}
}
public RTPManager getRtpManager() {
return rtpManager;
}
public RTPCooldownManager getCooldownManager() {
return cooldownManager;
}
public RTPMenu getRtpMenu() {
return rtpMenu;
}
public boolean isDestinationUnlocked(String destination) {
boolean defaultValue = destination.equalsIgnoreCase("overworld");
return getConfig().getBoolean("locks." + destination.toLowerCase(), defaultValue);
}
public boolean isDestinationEnabled(String destination) {
return getConfig().getBoolean("worlds." + destination.toLowerCase() + ".enabled", true);
}
public String getDestinationWorldName(String destination) {
String fallback = switch (destination.toLowerCase()) {
case "nether" -> "world_nether";
case "end" -> "world_the_end";
default -> "world";
};
return getConfig().getString("worlds." + destination.toLowerCase() + ".name", fallback);
}
public void setDestinationUnlocked(String destination, boolean unlocked) {
getConfig().set("locks." + destination.toLowerCase(), unlocked);
saveConfig();
}
public void reloadPluginConfig() {
reloadConfig();
ensureLockDefaults();
}
public void sendMessage(Player player, String message) {
player.sendMessage(color(message));
}
public static String color(String text) {
return ChatColor.translateAlternateColorCodes('&', text);
}
private void ensureLockDefaults() {
boolean changed = false;
if (!getConfig().isSet("locks.overworld")) {
getConfig().set("locks.overworld", true);
changed = true;
}
if (!getConfig().isSet("locks.nether")) {
getConfig().set("locks.nether", false);
changed = true;
}
if (!getConfig().isSet("locks.end")) {
getConfig().set("locks.end", false);
changed = true;
}
if (changed) {
saveConfig();
}
}
}