Jabelpeeps / Sentries

A near-total re-write of the classic Sentry plugin for bukkit/spigot.
3 stars 1 forks source link

issue with import command #8

Closed ghost closed 7 years ago

ghost commented 7 years ago

first off thank you so much for going out of your way to make this rewrite- I am having an issue blanket importing sentinels Ive already made to Sentries. When I run the command this happens...

`[10:25:06 INFO]: Volkenstein13 issued server command: /sentry import

org.bukkit.command.CommandException: Unhandled exception executing command 'sent ry' in plugin Sentries v2.1.2(build-b184) at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46) ~[cus tom.jar:git-Spigot-65a0347-a552117] at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:14 1) ~[custom.jar:git-Spigot-65a0347-a552117] at org.bukkit.craftbukkit.v1_11_R1.CraftServer.dispatchCommand(CraftServ er.java:650) ~[custom.jar:git-Spigot-65a0347-a552117] at net.minecraft.server.v1_11_R1.PlayerConnection.handleCommand(PlayerCo nnection.java:1344) [custom.jar:git-Spigot-65a0347-a552117] at net.minecraft.server.v1_11_R1.PlayerConnection.a(PlayerConnection.jav a:1179) [custom.jar:git-Spigot-65a0347-a552117] at net.minecraft.server.v1_11_R1.PacketPlayInChat.a(PacketPlayInChat.jav a:45) [custom.jar:git-Spigot-65a0347-a552117] at net.minecraft.server.v1_11_R1.PacketPlayInChat.a(PacketPlayInChat.jav a:1) [custom.jar:git-Spigot-65a0347-a552117] at net.minecraft.server.v1_11_R1.PlayerConnectionUtils$1.run(SourceFile: 13) [custom.jar:git-Spigot-65a0347-a552117] at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [ ?:1.8.0_121] at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_121] at net.minecraft.server.v1_11_R1.SystemUtils.a(SourceFile:46) [custom.ja r:git-Spigot-65a0347-a552117] at net.minecraft.server.v1_11_R1.MinecraftServer.D(MinecraftServer.java: 747) [custom.jar:git-Spigot-65a0347-a552117] at net.minecraft.server.v1_11_R1.DedicatedServer.D(DedicatedServer.java: 399) [custom.jar:git-Spigot-65a0347-a552117] at net.minecraft.server.v1_11_R1.MinecraftServer.C(MinecraftServer.java: 678) [custom.jar:git-Spigot-65a0347-a552117] at net.minecraft.server.v1_11_R1.MinecraftServer.run(MinecraftServer.jav a:576) [custom.jar:git-Spigot-65a0347-a552117] at java.lang.Thread.run(Unknown Source) [?:1.8.0_121] Caused by: java.lang.ArrayIndexOutOfBoundsException: 1 at org.jabelpeeps.sentries.CommandHandler.onCommand(CommandHandler.java: 305) ~[?:?] at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[cus tom.jar:git-Spigot-65a0347-a552117]`

(custom.jar is what Ive renamed my latest build Spigot.jar made from BuildTools) I wil gladly remake sentries from scratch if thats what I have to do- but just thought Id throw this out there. As a side note I have started my server with the Sentries jar in my plugin folder then REstarted it and the error still gets thrown. And I also have the Sentinel.jar and Sentinel folder in my plugins folder. Am I doing it right?

Jabelpeeps commented 7 years ago

Hi,

Thanks for your kind review on spigotmc.

Regarding this error, the stack-trace is unusually laid out, and it doesn't have the usual line number to reference where the error occurred. (Has the last line of 5. been cut off when you were posting it?)

Having said that, I may have found the issue, can you confirm which command you were trying when the error occurred?

Jabelpeeps commented 7 years ago

I have now seen that the command you used was '/sentry import', and I suspect the latest dev version will fix this for you.

Let me know how it goes.

ghost commented 7 years ago

[20:50:55 INFO]: Volkenstein13 issued server command: /sentry import all sentine l

org.bukkit.command.CommandException: Unhandled exception executing command 'sent ry' in plugin Sentries v2.1.2(build-b185) at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46) ~[cus tom.jar:git-Spigot-65a0347-a552117] at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:14 1) ~[custom.jar:git-Spigot-65a0347-a552117] at org.bukkit.craftbukkit.v1_11_R1.CraftServer.dispatchCommand(CraftServ er.java:650) ~[custom.jar:git-Spigot-65a0347-a552117] at net.minecraft.server.v1_11_R1.PlayerConnection.handleCommand(PlayerCo nnection.java:1344) [custom.jar:git-Spigot-65a0347-a552117] at net.minecraft.server.v1_11_R1.PlayerConnection.a(PlayerConnection.jav a:1179) [custom.jar:git-Spigot-65a0347-a552117] at net.minecraft.server.v1_11_R1.PacketPlayInChat.a(PacketPlayInChat.jav a:45) [custom.jar:git-Spigot-65a0347-a552117] at net.minecraft.server.v1_11_R1.PacketPlayInChat.a(PacketPlayInChat.jav a:1) [custom.jar:git-Spigot-65a0347-a552117] at net.minecraft.server.v1_11_R1.PlayerConnectionUtils$1.run(SourceFile: 13) [custom.jar:git-Spigot-65a0347-a552117] at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [ ?:1.8.0_121] at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_121] at net.minecraft.server.v1_11_R1.SystemUtils.a(SourceFile:46) [custom.ja r:git-Spigot-65a0347-a552117] at net.minecraft.server.v1_11_R1.MinecraftServer.D(MinecraftServer.java: 747) [custom.jar:git-Spigot-65a0347-a552117] at net.minecraft.server.v1_11_R1.DedicatedServer.D(DedicatedServer.java: 399) [custom.jar:git-Spigot-65a0347-a552117] at net.minecraft.server.v1_11_R1.MinecraftServer.C(MinecraftServer.java: 678) [custom.jar:git-Spigot-65a0347-a552117] at net.minecraft.server.v1_11_R1.MinecraftServer.run(MinecraftServer.jav a:576) [custom.jar:git-Spigot-65a0347-a552117] at java.lang.Thread.run(Unknown Source) [?:1.8.0_121] Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.jabelp eeps.sentries.SentinelImporter at org.jabelpeeps.sentries.commands.ImportCommand.call(ImportCommand.jav a:64) ~[?:?] at org.jabelpeeps.sentries.CommandHandler.onCommand(CommandHandler.java: 309) ~[?:?] at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[cus tom.jar:git-Spigot-65a0347-a552117] ... 15 more

I DID get the bit of dialogue when I typed /sentry import that provided the arguments I would need to type in order to run the command correctly

selecting an npc and then doing /sentry import returns ON SCREEN error spam that says, "Importing has failed, please check the npc's current traits etc..... (the npc in question was indeed a sentinel) however... no error text was thrown in the console. Re-checking the npc's traits after running the import on it returned BOTH the sentinel & sentries trait. Presumably it worked?? but the sentinel trait was not removed

Jabelpeeps commented 7 years ago

I have a new dev version for you to try, hopefully this will fix the new problem.

ghost commented 7 years ago

I got something close to the same error but let me rebuild a spigot.jar before I bother you any more about this- ill post when its finished

ghost commented 7 years ago

I just remade the spigot.jar using BuildTools I downloaded 10 min ago. Same deal basically- I did get this interesting new error when I tried to import a single sentinel into sentries--

19:56:09 WARN]: [Sentries] Task #850 for Sentries v2.1.2(build-b186) generated an exception java.lang.NullPointerException at net.citizensnpcs.util.Util.isLoaded(Util.java:107) ~[?:?] at org.jabelpeeps.sentries.SentryStatus$3.update(SentryStatus.java:96) ~ [?:?] at org.jabelpeeps.sentries.SentryTrait.lambda$onSpawn$7(SentryTrait.java :246) ~[?:?] at org.bukkit.craftbukkit.v1_11_R1.scheduler.CraftTask.run(CraftTask.jav a:71) ~[custom.jar:git-Spigot-d4f98a3-64277ec] at org.bukkit.craftbukkit.v1_11_R1.scheduler.CraftScheduler.mainThreadHe artbeat(CraftScheduler.java:353) [custom.jar:git-Spigot-d4f98a3-64277ec] at net.minecraft.server.v1_11_R1.MinecraftServer.D(MinecraftServer.java: 738) [custom.jar:git-Spigot-d4f98a3-64277ec] at net.minecraft.server.v1_11_R1.DedicatedServer.D(DedicatedServer.java: 399) [custom.jar:git-Spigot-d4f98a3-64277ec] at net.minecraft.server.v1_11_R1.MinecraftServer.C(MinecraftServer.java: 678) [custom.jar:git-Spigot-d4f98a3-64277ec] at net.minecraft.server.v1_11_R1.MinecraftServer.run(MinecraftServer.jav a:576) [custom.jar:git-Spigot-d4f98a3-64277ec] at java.lang.Thread.run(Unknown Source) [?:1.8.0_121]

task #850 and second time it threw the same spam for task #851...

If there is no easy fix for this Ill continue to keep both jars but Im making sentries from now on. As a side note I initially got into that guys craw a little when I noticed that npc's made using citizens2 lost all their combat animations when turned into sentinels. I remember mobs of all types retaining their inherent AI when fighting (skeletons fired bows, golems and zombies swung their arms, creepers exploded when they got close) and when I say skeletons fired bows they wont even fire them now even if theyre EQUIPPED with them... now Im not sure if that has changed due to the citizens plugin or sentinels, but even the "special" items given to npc's to enact special types of attacks he got all wrong- the fireballs used to be like ghast fireballs- something you could actually see flying through the air- now theyre like instant hit projectiles- you barely see them after theyve been fired. Remember how the ender pearls would bounce a player into the air? Well now hes instituted that as well but now the ender pearls fire you like 60 blocks into the air- its an instant kill on landing. Its just a frigging mess. I guess theyve decided to write their own pathfinding code now into the citizens jar? well thats not working either- any slabs or stairs anywhere near the npc's cause them to spin in circles while they spam their own path points around them. Are any of the original authors of these plugins even involved in the projects any more or did they just get sick of it- cause its not going well

also- I just noticed in my Citizens2 folder- Sentries IS successfully making backups of my citizens save file- there were about 7 backups in there

Jabelpeeps commented 7 years ago

I'm still not sure what was up with the earlier stack-traces (with your custom.jar), but this one is much easier to follow, so thanks for that.

This error doesn't isn't in the importing code, so I'm not sure why you're getting it. I've added a null-check into the method that generated the NPE, and there is a new dev version that includes it.

Can I ask, as you haven't actually said, did the import code actually import your Sentinels' settings ok?

Do my fireballs work better than Sentinel's? Sorting out the ballistics code was one of the hardest parts of this re-write, so I hope so :)

I'm not sure I've documented it yet, but I added the ability to configure how high the warlocks with enderpearls throw you - basically the strength value for the sentry is used to determine the vertical distance you are thrown (in blocks).

On the topic of pathfinding, Citizens actually contains two pathfinding routines, without really know the difference, I chose to use the one labelled as "New" - on the assumption that they wrote it as there was something wrong with the old one. I'm not sure what Sentinel does for pathfinding.

I'm glad to hear the backup code works, thx for confirming that.

ghost commented 7 years ago

I tried build #188 - here is a chronological list of screenshots detailing the process I went through as I first tried to import a single npc into sentries then what happened when I ran the blanket import command... javaw 2017-02-21 19-49-47-74 javaw 2017-02-21 19-50-22-76 javaw 2017-02-21 19-50-48-57 javaw 2017-02-21 19-50-53-84 javaw 2017-02-21 19-51-00-33 javaw 2017-02-21 19-51-13-30 javaw 2017-02-21 19-51-44-10 javaw 2017-02-21 19-51-47-27

here is the error text that was thrown when I tried to run the blanket import command--

[20:17:39 ERROR]: null org.bukkit.command.CommandException: Unhandled exception executing command 'sent ry' in plugin Sentries v2.1.2(build-b188) at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46) ~[cus tom.jar:git-Spigot-d4f98a3-64277ec] at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:14 1) ~[custom.jar:git-Spigot-d4f98a3-64277ec] at org.bukkit.craftbukkit.v1_11_R1.CraftServer.dispatchCommand(CraftServ er.java:650) ~[custom.jar:git-Spigot-d4f98a3-64277ec] at net.minecraft.server.v1_11_R1.PlayerConnection.handleCommand(PlayerCo nnection.java:1344) [custom.jar:git-Spigot-d4f98a3-64277ec] at net.minecraft.server.v1_11_R1.PlayerConnection.a(PlayerConnection.jav a:1179) [custom.jar:git-Spigot-d4f98a3-64277ec] at net.minecraft.server.v1_11_R1.PacketPlayInChat.a(PacketPlayInChat.jav a:45) [custom.jar:git-Spigot-d4f98a3-64277ec] at net.minecraft.server.v1_11_R1.PacketPlayInChat.a(PacketPlayInChat.jav a:1) [custom.jar:git-Spigot-d4f98a3-64277ec] at net.minecraft.server.v1_11_R1.PlayerConnectionUtils$1.run(SourceFile: 13) [custom.jar:git-Spigot-d4f98a3-64277ec] at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [ ?:1.8.0_121] at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_121] at net.minecraft.server.v1_11_R1.SystemUtils.a(SourceFile:46) [custom.ja r:git-Spigot-d4f98a3-64277ec] at net.minecraft.server.v1_11_R1.MinecraftServer.D(MinecraftServer.java: 747) [custom.jar:git-Spigot-d4f98a3-64277ec] at net.minecraft.server.v1_11_R1.DedicatedServer.D(DedicatedServer.java: 399) [custom.jar:git-Spigot-d4f98a3-64277ec] at net.minecraft.server.v1_11_R1.MinecraftServer.C(MinecraftServer.java: 678) [custom.jar:git-Spigot-d4f98a3-64277ec] at net.minecraft.server.v1_11_R1.MinecraftServer.run(MinecraftServer.jav a:576) [custom.jar:git-Spigot-d4f98a3-64277ec] at java.lang.Thread.run(Unknown Source) [?:1.8.0_121] Caused by: java.lang.NullPointerException at org.jabelpeeps.sentries.SentinelImporter.importNPC(SentinelImporter.j ava:72) ~[?:?] at org.jabelpeeps.sentries.SentinelImporter.importAll(SentinelImporter.j ava:48) ~[?:?] at org.jabelpeeps.sentries.commands.ImportCommand.call(ImportCommand.jav a:64) ~[?:?] at org.jabelpeeps.sentries.CommandHandler.onCommand(CommandHandler.java: 309) ~[?:?] at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[cus tom.jar:git-Spigot-d4f98a3-64277ec] ... 15 more

ugh I cant figure out how to insert the command console code right- all the numbered bulletins in front of my custom.jar I have no idea

As you can see- the trait sentries was added to the npc but it appears the sentinel stats were ignored. And again the blanket import command failed. I will continue working with you on this for as long as you want to pursue it. Any additional information I can provide let me know

Jabelpeeps commented 7 years ago

Thanks for the continued reports, keep them coming...

I have another new dev version for you.

by-the-by the correct command format for the single npc import should be '/sentry 686 import sentinel'. I have amended the help text to make this clearer.

ghost commented 7 years ago

javaw 2017-02-22 17-25-38-70 javaw 2017-02-22 17-26-10-58 javaw 2017-02-22 17-26-39-03 javaw 2017-02-22 17-26-48-97 javaw 2017-02-22 17-27-03-86

looks like you nailed it with the single target import command- verbage WAS updated as you reported in your last post- so on that front ... WORKING AS INTENDED XD

and now for the not so great news

org.bukkit.command.CommandException: Unhandled exception executing command 'sent ry' in plugin Sentries v2.1.2(build-b189) at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46) ~[cus tom.jar:git-Spigot-d4f98a3-64277ec] at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:14 1) ~[custom.jar:git-Spigot-d4f98a3-64277ec] at org.bukkit.craftbukkit.v1_11_R1.CraftServer.dispatchCommand(CraftServ er.java:650) ~[custom.jar:git-Spigot-d4f98a3-64277ec] at net.minecraft.server.v1_11_R1.PlayerConnection.handleCommand(PlayerCo nnection.java:1344) [custom.jar:git-Spigot-d4f98a3-64277ec] at net.minecraft.server.v1_11_R1.PlayerConnection.a(PlayerConnection.jav a:1179) [custom.jar:git-Spigot-d4f98a3-64277ec] at net.minecraft.server.v1_11_R1.PacketPlayInChat.a(PacketPlayInChat.jav a:45) [custom.jar:git-Spigot-d4f98a3-64277ec] at net.minecraft.server.v1_11_R1.PacketPlayInChat.a(PacketPlayInChat.jav a:1) [custom.jar:git-Spigot-d4f98a3-64277ec] at net.minecraft.server.v1_11_R1.PlayerConnectionUtils$1.run(SourceFile: 13) [custom.jar:git-Spigot-d4f98a3-64277ec] at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [ ?:1.8.0_121] at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_121] at net.minecraft.server.v1_11_R1.SystemUtils.a(SourceFile:46) [custom.ja r:git-Spigot-d4f98a3-64277ec] at net.minecraft.server.v1_11_R1.MinecraftServer.D(MinecraftServer.java: 747) [custom.jar:git-Spigot-d4f98a3-64277ec] at net.minecraft.server.v1_11_R1.DedicatedServer.D(DedicatedServer.java: 399) [custom.jar:git-Spigot-d4f98a3-64277ec] at net.minecraft.server.v1_11_R1.MinecraftServer.C(MinecraftServer.java: 678) [custom.jar:git-Spigot-d4f98a3-64277ec] at net.minecraft.server.v1_11_R1.MinecraftServer.run(MinecraftServer.jav a:576) [custom.jar:git-Spigot-d4f98a3-64277ec] at java.lang.Thread.run(Unknown Source) [?:1.8.0_121] Caused by: java.lang.NullPointerException at org.jabelpeeps.sentries.targets.OwnerTarget.hashCode(OwnerTarget.java :35) ~[?:?] at org.jabelpeeps.sentries.targets.AbstractTargetType.compareTo(Abstract TargetType.java:17) ~[?:?] at org.jabelpeeps.sentries.targets.AbstractTargetType.compareTo(Abstract TargetType.java:5) ~[?:?] at java.util.TreeMap.compare(Unknown Source) ~[?:1.8.0_121] at java.util.TreeMap.put(Unknown Source) ~[?:1.8.0_121] at java.util.TreeSet.add(Unknown Source) ~[?:1.8.0_121] at org.jabelpeeps.sentries.SentinelImporter.importNPC(SentinelImporter.j ava:139) ~[?:?] at org.jabelpeeps.sentries.SentinelImporter.importAll(SentinelImporter.j ava:48) ~[?:?] at org.jabelpeeps.sentries.commands.ImportCommand.call(ImportCommand.jav a:64) ~[?:?] at org.jabelpeeps.sentries.CommandHandler.onCommand(CommandHandler.java: 309) ~[?:?] at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[cus tom.jar:git-Spigot-d4f98a3-64277ec] ... 15 more

(console error from /sentry import all sentinel) by the way am I typing the command correctly? /sentry import all sentinel???

Jabelpeeps commented 7 years ago

Good Evening. Lol.

I was already working on a new dev version that should more reliably import targets and ignores. I have added the fix to the error above as well.

ghost commented 7 years ago

just read the post will check it tomorrow

ghost commented 7 years ago

javaw 2017-02-24 18-15-12-45

whoa....

I just ran it and it appeared to work --- a backup of my citizens save file was made -- a search text for the word "sentinel" in my citizens.saves file returned no results -- after perusing a few of my npc's it looks like the traits were accurately transferred- wow man nice

I will continue to test out the plugin- I have a feeling you wont be able to address the griefs I have about mob-type npc's essentially becoming walking attack logs when given the ability to attack (did I bump into you hard enough? no? well let me bump into you again maybe that will do it) because I think that actually comes from the citizens plugin itself. But I will test out the special attacks -- in the meantime- CASE CLOSED and thanks

Jabelpeeps commented 7 years ago

Thanks for working with me to get this importer fixed, I have given you credit in the update I just released on spigotmc.org.

In reply to your comments about the AI of NPC, you are right that this is from Citizens, although I think this may be by design? What the CitizensAPI gives us is essentially AI-less NPC's and mobs that we (trait developers) can then control however we wish. Sentries is geared toward allowing players more control over who the NPC's attack & guard, and other traits do many other things. What you may not realised (unless you don't read Java, and have looked at the source code) is that I have needed to write my own attack code for each of the attacks in Sentries, as the default attack implemented in Citizens is just for them to get close to the victim, and use their melee attack (or bump into them if they don't have arms).