StephenGss / PAL

Polycraft World AI Lab
3 stars 6 forks source link

[HUGA] `NullPointerException` when issuing START command #60

Closed jhostetler closed 2 years ago

jhostetler commented 2 years ago

In d587e7994ec4e1544a5e3b1134c256972f930e64, we see an error during PAL startup after issuing the START command. Same code on our end worked correctly under b4fc46747e568ec2a0406fb966ccb81320ea08bb. Note that our system waits until it sees the log message "Minecraft finished loading" before issuing START.

[17:36:58] [Client thread/INFO]: Minecraft finished loading
I0405 17:36:58.916511  3404 remote_controller.py:215] PAL initialized
[17:36:58] [BOT API THREAD/INFO]: [edu.utd.minecraft.mod.polycraft.aitools.BotAPI$1:run:736]: START
[17:36:58] [Client thread/INFO]: OC mode enabled: FPS=500
[17:36:58] [BOT API THREAD/INFO]: [AGENT]START
[17:36:59] [Client thread/FATAL]: Error executing task
java.util.concurrent.ExecutionException: java.lang.NullPointerException
at java.util.concurrent.FutureTask.report(FutureTask.java:122) ~[?:1.8.0_232]
at java.util.concurrent.FutureTask.get(FutureTask.java:192) ~[?:1.8.0_232]
at net.minecraft.util.Util.runTask(SourceFile:45) [Util.class:?]
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1014) [Minecraft.class:?]
at net.minecraft.client.Minecraft.run(Minecraft.java:349) [Minecraft.class:?]
at net.minecraft.client.main.Main.main(SourceFile:124) [Main.class:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_232]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_232]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_232]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_232]
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_232]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_232]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_232]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_232]
at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
at GradleStart.main(GradleStart.java:26) [start/:?]
Caused by: java.lang.NullPointerException
at edu.utd.minecraft.mod.polycraft.aitools.BotAPI.ClientCheckEntities(BotAPI.java:919) ~[BotAPI.class:?]
at edu.utd.minecraft.mod.polycraft.aitools.BotAPI.onClientTick(BotAPI.java:625) ~[BotAPI.class:?]
at edu.utd.minecraft.mod.polycraft.aitools.BotAPI$1$1.run(BotAPI.java:786) ~[BotAPI$1$1.class:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_232]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_232]
at net.minecraft.util.Util.runTask(SourceFile:44) ~[Util.class:?]
... 15 more
[17:37:01] [BOT API THREAD/INFO]: [edu.utd.minecraft.mod.polycraft.aitools.BotAPI$1:run:863]: AGENT API THREAD ERROR. Client dissconnected?
******** Last PAL Response ******** [17:37:01] [BOT API THREAD/INFO]: [edu.utd.minecraft.mod.polycraft.aitools.BotAPI$1:run:865]: java.lang.NullPointerException
[17:37:01] [BOT API THREAD/INFO]: [edu.utd.minecraft.mod.polycraft.aitools.BotAPI$1:run:865]:   at edu.utd.minecraft.mod.polycraft.aitools.BotAPI$1.run(BotAPI.java:814)
[17:37:01] [BOT API THREAD/INFO]: AGENT API LISTENING ON PORT: 23049
StephenGss commented 2 years ago

I pushed a fix in 09464e4c39590c4198b34aa736751cecc2631423 This was only occurring for the agent socket start command.