Solved Teleport player 1.13

Discussion in 'Spigot Plugin Development' started by Lutheron, Aug 3, 2018.

  1. Hello, and I'm updating my 1.8.9 plugin to the newest version.
    When you rankup, everything works fine, you get your new rank, but you don't teleport, and this is the error.
    Code (Text):
    [02:03:53 ERROR]: null
    org.bukkit.command.CommandException: Unhandled exception executing command 'rankup' in plugin RankupSign v1.0
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46) ~[spigot-1.13.jar:git-Spigot-69774b3-391e018]
            at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:141) ~[spigot-1.13.jar:git-Spigot-69774b3-391e018]
            at org.bukkit.craftbukkit.v1_13_R1.CraftServer.dispatchCommand(CraftServer.java:693) ~[spigot-1.13.jar:git-Spigot-69774b3-391e018]
            at net.minecraft.server.v1_13_R1.PlayerConnection.handleCommand(PlayerConnection.java:1634) ~[spigot-1.13.jar:git-Spigot-69774b3-391e018]
            at net.minecraft.server.v1_13_R1.PlayerConnection.a(PlayerConnection.java:1469) ~[spigot-1.13.jar:git-Spigot-69774b3-391e018]
            at net.minecraft.server.v1_13_R1.PacketPlayInChat.a(PacketPlayInChat.java:45) ~[spigot-1.13.jar:git-Spigot-69774b3-391e018]
            at net.minecraft.server.v1_13_R1.PacketPlayInChat.a(PacketPlayInChat.java:1) ~[spigot-1.13.jar:git-Spigot-69774b3-391e018]
            at net.minecraft.server.v1_13_R1.PlayerConnectionUtils.a(SourceFile:10) ~[spigot-1.13.jar:git-Spigot-69774b3-391e018]
            at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_171]
            at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_171]
            at net.minecraft.server.v1_13_R1.SystemUtils.a(SourceFile:198) [spigot-1.13.jar:git-Spigot-69774b3-391e018]
            at net.minecraft.server.v1_13_R1.MinecraftServer.w(MinecraftServer.java:884) [spigot-1.13.jar:git-Spigot-69774b3-391e018]
            at net.minecraft.server.v1_13_R1.DedicatedServer.w(DedicatedServer.java:411) [spigot-1.13.jar:git-Spigot-69774b3-391e018]
            at net.minecraft.server.v1_13_R1.MinecraftServer.v(MinecraftServer.java:819) [spigot-1.13.jar:git-Spigot-69774b3-391e018]
            at net.minecraft.server.v1_13_R1.MinecraftServer.run(MinecraftServer.java:717) [spigot-1.13.jar:git-Spigot-69774b3-391e018]
            at java.lang.Thread.run(Unknown Source) [?:1.8.0_171]
    Caused by: java.lang.IllegalArgumentException: location
            at com.google.common.base.Preconditions.checkArgument(Preconditions.java:122) ~[spigot-1.13.jar:git-Spigot-69774b3-391e018]
            at org.bukkit.craftbukkit.v1_13_R1.entity.CraftPlayer.teleport(CraftPlayer.java:575) ~[spigot-1.13.jar:git-Spigot-69774b3-391e018]
            at org.bukkit.craftbukkit.v1_13_R1.entity.CraftEntity.teleport(CraftEntity.java:286) ~[spigot-1.13.jar:git-Spigot-69774b3-391e018]
            at com.Lutherion.SignRankup.SignListener.RankupCode(SignListener.java:92) ~[?:?]
            at com.Lutherion.SignRankup.SignRankup.onCommand(SignRankup.java:80) ~[?:?]
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[spigot-1.13.jar:git-Spigot-69774b3-391e018]
            ... 15 more
    This is probably the line that gives the error
    Code (Text):
    a.getPlayer().teleport(LocationForSign);
     
  2. md_5

    Administrator Developer

    LocationForSign is null
     
  3. so it's not loading from config properly? i'm pretty sure it's loading from it
    BLocation = new Location(WorldName, SignRankup.xPosition, SignRankup.yPosition, SignRankup.zPosition);
    it works on 1.8.9
     
  4. md_5

    Administrator Developer

    @Override
    public boolean teleport(Location location, PlayerTeleportEvent.TeleportCause cause) {
    Preconditions.checkArgument(location != null, "location");

    Its definitely null.
     
  5. I have no idea why it doesn't work. It works in 1.8.9, but not in 1.13.
     
  6. As per usual, I'd suggest following each part of your code mentioned in the stack trace and putting some debug messages before whatever line it mentions, and printing out if each object being accessed in that line is null. That just looks like two lines in your case, so not too much to do.

    Without seeing the code involved, not an awful lot else to tell you.
     
  7. omg... found the stupid problem. the blocation is only set, if you press a sign, and i haven't done that before typing /rankup...