Skip to content

Commit

Permalink
Fix for PAPI Hooks.
Browse files Browse the repository at this point in the history
  • Loading branch information
creatorfromhell committed Mar 31, 2024
1 parent 47048ea commit eea4bad
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>me.lokka30</groupId>
<artifactId>PhantomWorlds</artifactId>
<version>2.0.9</version>
<version>2.0.10</version>

<name>PhantomWorlds</name>
<description>The Robust World Manager for Minecraft Servers</description>
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/me/lokka30/phantomworlds/PhantomWorlds.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import me.lokka30.phantomworlds.listeners.player.PlayerJoinListener;
import me.lokka30.phantomworlds.listeners.player.PlayerPortalListener;
import me.lokka30.phantomworlds.listeners.player.PlayerTeleportListener;
import me.lokka30.phantomworlds.listeners.plugin.PluginEnableListener;
import me.lokka30.phantomworlds.listeners.world.WorldInitListener;
import me.lokka30.phantomworlds.managers.FileManager;
import me.lokka30.phantomworlds.managers.WorldManager;
Expand Down Expand Up @@ -130,10 +131,11 @@ public void onEnable() {

instance = this;

getLogger().info("Starting up Placeholder Registration...");
if(Bukkit.getPluginManager().isPluginEnabled("PlaceholderAPI")) {
new PAPIHook().register();
} else {

getServer().getPluginManager().registerEvents(new PluginEnableListener(), this);
}

createTabs.addAll(generateCreateSuggestions());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public void loadManagedWorlds() {
public WorldLoadResponse loadWorld(final String worldName) {

if(Bukkit.getWorld(worldName) != null) {
return WorldLoadResponse.NOT_FOUND;
return WorldLoadResponse.ALREADY_LOADED;
}

final File worldFolder = new File(Bukkit.getWorldContainer(), worldName);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/me/lokka30/phantomworlds/misc/PAPIHook.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
public class PAPIHook extends PlaceholderExpansion {
@Override
public @NotNull String getIdentifier() {
return "pw";
return "pworlds";
}

@Override
Expand Down
20 changes: 20 additions & 0 deletions src/main/java/me/lokka30/phantomworlds/misc/WorldLoadResponse.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,29 @@
* @since 2.0.5.0
*/
public enum WorldLoadResponse {

/**
* Success: World load response.
*/
LOADED,

/**
* Failure: World not found.
*/
NOT_FOUND,

/**
* Failure: Already loaded.
*/
ALREADY_LOADED,

/**
* Failure: Invalid world.
*/
INVALID,

/**
* Failure: Marked as skipped in data.yml
*/
CONFIG_SKIPPED
}
5 changes: 4 additions & 1 deletion src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# / / | `.__/| / | \__/ `._.' / ' / |,' \,' `._.' / /\__ `___,' \___.'

name: 'PhantomWorlds'
version: '2.09'
version: '2.0.10'
description: 'The Robust World Manager for Minecraft Servers'
authors: [ 'creatorfromhell', 'lokka30' ]
website: 'https://github.com/lokka30/PhantomWorlds'
Expand All @@ -14,6 +14,9 @@ main: 'me.lokka30.phantomworlds.PhantomWorlds'
api-version: '1.13'
load: STARTUP

softdepend:
- PlaceholderAPI

permissions:
phantomworlds.*:
default: op
Expand Down

0 comments on commit eea4bad

Please sign in to comment.