From bb4113b02cea92045058f916d1a48c22534c6bea Mon Sep 17 00:00:00 2001 From: CrazyCloudCraft | Argantiu <95505222+CrazyCloudCraft@users.noreply.github.com> Date: Mon, 17 Oct 2022 08:39:54 +0200 Subject: [PATCH] Delete PapiExtension-fail.java --- .../world/util/PapiExtension-fail.java | 78 ------------------- 1 file changed, 78 deletions(-) delete mode 100644 src/main/java/de/butzlabben/world/util/PapiExtension-fail.java diff --git a/src/main/java/de/butzlabben/world/util/PapiExtension-fail.java b/src/main/java/de/butzlabben/world/util/PapiExtension-fail.java deleted file mode 100644 index a0206cd..0000000 --- a/src/main/java/de/butzlabben/world/util/PapiExtension-fail.java +++ /dev/null @@ -1,78 +0,0 @@ -package de.butzlabben.world.util; - -import de.butzlabben.world.WorldSystem; -import de.butzlabben.world.config.DependenceConfig; -import de.butzlabben.world.config.WorldConfig; -import de.butzlabben.world.wrapper.SystemWorld; -import de.butzlabben.world.wrapper.WorldPlayer; -import me.clip.placeholderapi.expansion.PlaceholderExpansion; -import me.clip.placeholderapi.PlaceholderAPI; -import org.bukkit.Bukkit; -import org.bukkit.OfflinePlayer; -import org.bukkit.World; -import org.bukkit.entity.Player; - -import java.util.Objects; - -public class PapiExtension extends PlaceholderExpansion { - - private final WorldSystem worldSystem = WorldSystem.getInstance(); - - @Override - public String getIdentifier() { - return "worldsystem"; - } - - @Override - public String getAuthor() { - return "Butzlabben"; - } - - @Override - public String getVersion() { - return worldSystem.getDescription().getVersion(); - } - - @Override - public String onRequest(OfflinePlayer p, String params) { - DependenceConfig config = new DependenceConfig(p); - switch (params) { - case "has_world": - String hasworld = "%worldsystem_has_world%"; - hasworld = PlaceholderAPI.setPlaceholders(event.getPlayer(), hasworld); - event.setJoinMessage(hasworld); - return new DependenceConfig(p).hasWorld() + ""; - case "is_creator": - WorldPlayer player = new WorldPlayer(Objects.requireNonNull(Bukkit.getPlayer(p.getUniqueId()))); - if (!player.isOnSystemWorld()) - return "false"; - return player.isOwnerofWorld() + ""; - case "world_name_of_player": - if (!config.hasWorld()) - return "none"; - else - return config.getWorldname(); - case "world_of_player_loaded": - if (!config.hasWorld()) - return "none"; - return SystemWorld.getSystemWorld(config.getWorldname()).isLoaded() + ""; - case "pretty_world_name": - if (!p.isOnline()) { - if (!config.hasWorld()) { - Player p1 = p.getPlayer(); - if (p1 != null && p1.isOnline()) - return p1.getLocation().getWorld().getName(); - return "none"; - } - return config.getOwner().getName(); - } else { - World world = ((Player) p).getWorld(); - if (WorldConfig.exists(world.getName())) - return WorldConfig.getWorldConfig(world.getName()).getOwnerName(); - return world.getName(); - } - default: - throw new IllegalArgumentException("No placeholder named\"" + getIdentifier() + "_" + params + "\" is known"); - } - } -}