jaoafa / MyMaid

It is Git of the plugin "MyMaid" used by jao Minecraft Server.
https://jaoafa.com/
0 stars 0 forks source link

/city showの改善 #34

Open jaotan opened 6 years ago

jaotan commented 6 years ago

コード修正等を行って年末年始で仕上げたいところだけど出来るかな? https://pastebin.com/aZ8zsHWg

Discordから、tomachi(#2201)が作成しました。

book000 commented 6 years ago

LOCATION_X, LOCATION_Zとは…?

book000 commented 6 years ago

Caused by: java.lang.StackOverflowError

book000 commented 6 years ago

[07:10:18] [Server thread/INFO]: [0;37;22m[mine_book000: mine_book000 は Tomachi_Station にワープしました][m
[07:10:20] [Server thread/INFO]: mine_book000 issued server command: /city show
[07:10:20] [Server thread/ERROR]: null
org.bukkit.command.CommandException: Unhandled exception executing command 'city' in plugin MyMaid v0.0.1
    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46) ~[spigot-1.8.8.jar:git-Spigot-21fe707-e1ebe52]
    at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:141) ~[spigot-1.8.8.jar:git-Spigot-21fe707-e1ebe52]
    at org.bukkit.craftbukkit.v1_8_R3.CraftServer.dispatchCommand(CraftServer.java:641) ~[spigot-1.8.8.jar:git-Spigot-21fe707-e1ebe52]
    at net.minecraft.server.v1_8_R3.PlayerConnection.handleCommand(PlayerConnection.java:1162) [spigot-1.8.8.jar:git-Spigot-21fe707-e1ebe52]
    at net.minecraft.server.v1_8_R3.PlayerConnection.a(PlayerConnection.java:997) [spigot-1.8.8.jar:git-Spigot-21fe707-e1ebe52]
    at net.minecraft.server.v1_8_R3.PacketPlayInChat.a(PacketPlayInChat.java:45) [spigot-1.8.8.jar:git-Spigot-21fe707-e1ebe52]
    at net.minecraft.server.v1_8_R3.PacketPlayInChat.a(PacketPlayInChat.java:1) [spigot-1.8.8.jar:git-Spigot-21fe707-e1ebe52]
    at net.minecraft.server.v1_8_R3.PlayerConnectionUtils$1.run(SourceFile:13) [spigot-1.8.8.jar:git-Spigot-21fe707-e1ebe52]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_151]
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_151]
    at net.minecraft.server.v1_8_R3.SystemUtils.a(SourceFile:44) [spigot-1.8.8.jar:git-Spigot-21fe707-e1ebe52]
    at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:715) [spigot-1.8.8.jar:git-Spigot-21fe707-e1ebe52]
    at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:374) [spigot-1.8.8.jar:git-Spigot-21fe707-e1ebe52]
    at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:654) [spigot-1.8.8.jar:git-Spigot-21fe707-e1ebe52]
    at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:557) [spigot-1.8.8.jar:git-Spigot-21fe707-e1ebe52]
    at java.lang.Thread.run(Thread.java:748) [?:1.8.0_151]
Caused by: java.lang.StackOverflowError
    at org.bukkit.craftbukkit.v1_8_R3.CraftServer.getWorlds(CraftServer.java:608) ~[spigot-1.8.8.jar:git-Spigot-21fe707-e1ebe52]
    at org.bukkit.Bukkit.getWorlds(Bukkit.java:450) ~[spigot-1.8.8.jar:git-Spigot-21fe707-e1ebe52]
    at xyz.jaoafa.mymaid.Command.Cmd_City.inArea(Cmd_City.java:464) ~[?:?]
    at xyz.jaoafa.mymaid.Command.Cmd_City.inArea(Cmd_City.java:490) ~[?:?]
    at xyz.jaoafa.mymaid.Command.Cmd_City.inArea(Cmd_City.java:490) ~[?:?]
    ※この後、at ~が1022行記載される
book000 commented 6 years ago
例えば
inArea(player.getLoc, Set<Loc>, false, 20)->inArea(中略,19)->18
...->0->thrw new IllegalArgumentException("inAreaで再帰しすぎ")
みたいな。?

参考: 再帰関数の末尾再帰(最適化)について