Jssjsjs Jsjsjswj

The warp system isn't working like I can set warp thr gui and everything is working when I type /warp warp name timer is also working fine but it just dosnt teleports you to the warp only this is the problem other things are fine

Kodari AI
KodariSep 27 at 6:43 pm 1
  • Trace the warp location read and delayed teleport behavior.

  • Fix the destination resolution failure so valid saved warps teleport reliably.

  • Keep existing countdown and cancellation behavior unchanged.

Updated warp destination loading: if the saved world isn’t currently loaded, the plugin now loads it before building the destination location. This should let the existing countdown complete with an actual teleport.

Jssjsjs Jsjsjswj

Still warp dosnt teleports to thr warp and it's not diff world problem the warp I set is 10 block away to test the teleport countdown eds and I just dosn't get teleported fix this please this time

Kodari AI
KodariSep 27 at 6:54 pm 1

Updated delayed teleports to use Bukkit’s COMMAND teleport cause instead of the generic plugin cause, which can be rejected by other plugins’ teleport rules. The code now also detects a rejected teleport and tells the player rather than silently failing.

Jssjsjs Jsjsjswj

Ok so warp warpname Or toing with /warp gui or /dialogwaro gui just does the timer 5 4 3 2 1 and timer ends but it never teleports do 1 thing remake the warp teleport and warp system from scrach don't change gui and dialogdui but and make sure it works like 5 4 3 2 1 and then teleports to the saved location there are no error no console error it just dosnt teleports to the setted warp try to find what is the problem here like it is not able to veryfy world name or what is wrong in the teleporting because it's susch a simple feature what can be broken in this

Kodari AI
KodariSep 27 at 7:18 pm 1
  • Trace how /warp, GUI, and dialog warp requests reach the countdown and teleport.

  • Replace only warp lookup and completion logic; leave the GUI and dialog interfaces intact.

  • Ensure failed teleports are reported instead of silently ending the countdown.

Rebuilt the warp teleport completion while leaving the GUI and dialog unchanged. The warp location is now resolved and validated before the countdown, then Paper’s async teleport API is used when it ends. If the destination is invalid or another plugin blocks the teleport, the player now gets an explanation instead of a silent failure.

Jssjsjs Jsjsjswj

Of I found the problem when inset warp or spawn snd then when I tried to to to it it says no warp snd no spawn but when I restarted the server then I tried they started working again so it means plugin isn't reading details from config only reads when server is started next 1 thing to add is when I type /warps warpname it should also tp directly to that warp instead of opening warpgui no matter what the argument is after /warps is and also add a reload command snd make the plugin read data bro cause this plugin has dats files like money and pv and everything or is it the glitch was just for spawn and warp reading

Kodari AI
KodariSep 27 at 7:36 pm 1
  1. Fix warp/spawn data so newly set locations are immediately available without restarting.

  2. Make /warps <anything> teleport directly while preserving /warps GUI behavior.

  3. Add a reload command that reloads the plugin’s persisted data/configuration.

/warps <name> already routes directly to the warp command; only /warps with no argument opens the GUI. I’ve also made spawn and warp lookups reload their saved YAML before reading it, so continue with the dedicated reload command.

Fixed the /warps <name> issue: the GUI command interceptor was swallowing every /warps command, even when a warp name was supplied. Now /warps <name> reaches teleport handling, while /warps with no argument still opens the GUI.

Spawn and warp lookups now reload their saved YAML before reading locations. Added /soulshardcore reload to reload the plugin’s configuration files; it keeps the existing reload permission. Money and vault data are loaded from their files when used.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
34 2,673
src/main/java/com/soulshard/simplecore/SoulShardSimpleCore.java
package com.soulshard.simplecore;

import com.soulshard.simplecore.command.CoreCommands;
import com.soulshard.simplecore.data.PlayerDataStore;
import com.soulshard.simplecore.listener.CoreListener;
import com.soulshard.simplecore.service.CoreEconomy;
import com.soulshard.simplecore.service.CoreFiles;
import com.soulshard.simplecore.service.MessageService;
import com.soulshard.simplecore.service.TeleportService;
import com.soulshard.simplecore.service.VaultService;
import me.clip.placeholderapi.PlaceholderAPI;
import net.milkbowl.vault.economy.Economy;
import org.bukkit.Bukkit;
import org.bukkit.OfflinePlayer;
import org.bukkit.command.PluginCommand;
import org.bukkit.entity.Player;
import org.bukkit.plugin.ServicePriority;
import org.bukkit.plugin.java.JavaPlugin;

import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.Locale;
import java.util.Map;
import java.util.UUID;

public final class SoulShardSimpleCore extends JavaPlugin {
    private CoreFiles files;
    private PlayerDataStore playerData;
    private MessageService messages;
    private TeleportService teleports;
    private VaultService vaults;
    private Economy economy;
    private CoreCommands commands;

    @Override
    public void onEnable() {
        files = new CoreFiles(this);
        files.loadAll();
        playerData = new PlayerDataStore(this);
        messages = new MessageService(this);
        teleports = new TeleportService(this);
        vaults = new VaultService(this);
        economy = new CoreEconomy(this);
        getServer().getServicesManager().register(Economy.class, economy, this, ServicePriority.High);
        commands = new CoreCommands(this);
        CoreListener listener = new CoreListener(this);
        getServer().getPluginManager().registerEvents(listener, this);
        registerCommands();
        Bukkit.getScheduler().runTask(this, this::prioritizeKillCommand);
        if (Bukkit.getPluginManager().isPluginEnabled("PlaceholderAPI")) new SoulShardExpansion(this).register();
        long interval = Math.max(1, files.config("phantomtoggle").getLong("phantomtoggle.interval-seconds", 60)) * 20L;
        Bukkit.getScheduler().runTaskTimer(this, () -> {
            for (Player player : Bukkit.getOnlinePlayers()) {
                if (playerData.get(player, "phantomtoggle", true)) player.setStatistic(org.bukkit.Statistic.TIME_SINCE_REST, 0);
            }
        }, interval, interval);
    }

    @Override
    public void onDisable() {
        if (vaults != null) vaults.saveAll();
        if (economy != null) getServer().getServicesManager().unregister(Economy.class, economy);
    }

    private void registerCommands() {
        String[] names = {"bal", "pay", "paymenttoggle", "chainmailtoggle", "mobtoggle", "phantomtoggle", "nightvision", "fly", "doublejump", "find", "ping", "spawn", "setspawn", "warp", "warps", "dialogwarp", "setwarp", "delwarp", "pv", "kill", "dialogkill", "broadcast", "broadcastworld", "announcement", "announcementworld", "soulshardcore", "eco"};
        for (String name : names) {
            PluginCommand command = getCommand(name);
            if (command != null) {
                command.setExecutor(commands);
                command.setTabCompleter(commands);
            }
        }
    }

    @SuppressWarnings("unchecked")
    private void prioritizeKillCommand() {
        PluginCommand kill = getCommand("kill");
        if (kill == null) return;
        try {
            Method accessor = getServer().getClass().getMethod("getCommandMap");
            Object commandMap = accessor.invoke(getServer());
            Field knownCommands = null;
            for (Class<?> type = commandMap.getClass(); type != null && knownCommands == null; type = type.getSuperclass()) {
                try { knownCommands = type.getDeclaredField("knownCommands"); }
                catch (NoSuchFieldException ignored) { }
            }
            if (knownCommands == null) throw new NoSuchFieldException("knownCommands");
            knownCommands.setAccessible(true);
            ((Map<String, org.bukkit.command.Command>) knownCommands.get(commandMap)).put("kill", kill);
        } catch (ReflectiveOperationException | RuntimeException exception) {
            getLogger().warning("Could not give /kill command priority over other plugins: " + exception.getMessage());
        }
    }

    public CoreFiles files() { return files; }
    public PlayerDataStore playerData() { return playerData; }
    public MessageService messages() { return messages; }
    public TeleportService teleports() { return teleports; }
    public VaultService vaults() { return vaults; }
    public Economy economy() { return economy; }

    public OfflinePlayer findPlayer(String name) {
        for (Player online : Bukkit.getOnlinePlayers()) if (online.getName().equalsIgnoreCase(name)) return online;
        for (OfflinePlayer offline : Bukkit.getOfflinePlayers()) {
            if (offline.hasPlayedBefore() && offline.getName() != null && offline.getName().equalsIgnoreCase(name)) return offline;
        }
        return null;
    }

    public String toggleStatus(Player player, String key) {
        boolean enabled = switch (key.toLowerCase(Locale.ROOT)) {
            case "paytoggle" -> playerData.get(player, key, true);
            case "chainmailtoggle" -> playerData.get(player, key, true);
            case "mobtoggle" -> playerData.get(player, key, false);
            case "doublejumptoggle" -> playerData.get(player, key, true);
            case "phantomtoggle" -> playerData.get(player, key, true);
            case "nightvisiontoggle" -> playerData.get(player, key, false);
            default -> false;
        };
        return files.config("settings").getString("placeholder-text." + (enabled ? "enabled" : "disabled"), enabled ? "&aEnabled" : "&cDisabled");
    }
}