Cannot invoke "java.util.List.size()" because "wildcardCommands" is null
nelsnelson opened this issue ยท 1 comments
Example config.txt
:
autorun[PvE nerd.nu]=auto_rejoin pve
Resulting error upon connection to server:
[09:38:07] [Render thread/INFO]: Connecting to p.nerd.nu, 25565
[09:38:09] [Render thread/INFO]: New Xaero hud session initialized!
[09:38:09] [Render thread/INFO]: Using 3 total BufferBuilder caches
[09:38:09] [Render thread/INFO]: [System] [CHAT] nels_nelson joined the game
[09:38:09] [Render thread/INFO]: Loaded 972 advancements
[09:38:09] [Render thread/INFO]: Configured file extension `.py` for commands: CommandConfig[extension=.py, command=[/usr/bin/python3, -u, {command}, {args}], environment=[PYTHONPATH=/Users/nelsnelson/Library/Application Support/PrismLauncher/instances/1.20.4/.minecraft/minescript/system/lib:/Users/nelsnelson/Library/Application Support/PrismLauncher/instances/1.20.4/.minecraft/minescript]]
[09:38:09] [Render thread/INFO]: Setting config var: python = "/usr/bin/python3" (CommandConfig[extension=.py, command=[/usr/bin/python3, -u, {command}, {args}], environment=[PYTHONPATH=/Users/nelsnelson/Library/Application Support/PrismLauncher/instances/1.20.4/.minecraft/minescript/system/lib:/Users/nelsnelson/Library/Application Support/PrismLauncher/instances/1.20.4/.minecraft/minescript]])
[09:38:09] [Render thread/INFO]: Added autorun command `Message[type=MINESCRIPT_COMMAND, value=auto_rejoin example, data=null]` for `PvE nerd.nu`
[09:38:09] [Render thread/INFO]: Handling autorun for world `PvE nerd.nu`
[09:38:09] [Render thread/ERROR]: Unreported exception thrown!
java.lang.NullPointerException: Cannot invoke "java.util.List.size()" because "wildcardCommands" is null
at net.minescript.common.Minescript.handleAutorun(Minescript.java:3764) ~[minescript-mc1.20.4-fabric-mod-4.0-beta2.jar:?]
at net.minescript.common.Minescript.onClientWorldTick(Minescript.java:3797) ~[minescript-mc1.20.4-fabric-mod-4.0-beta2.jar:?]
at net.minescript.fabric.MinescriptFabricClientMod.lambda$onInitializeClient$2(MinescriptFabricClientMod.java:32) ~[minescript-mc1.20.4-fabric-mod-4.0-beta2.jar:?]
at net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents.lambda$static$4(ClientTickEvents.java:52) ~[fabric-lifecycle-events-v1-2.3.1+a67ffb5d4f-acb38e9ac085196e.jar:?]
at net.minecraft.class_638.handler$zfo000$fabric-lifecycle-events-v1$startWorldTick(class_638.java:2139) ~[client-intermediary.jar:?]
at net.minecraft.class_638.method_18116(class_638.java) ~[client-intermediary.jar:?]
at net.minecraft.class_310.method_1574(class_310.java:2011) ~[client-intermediary.jar:?]
at net.minecraft.class_310.method_1523(class_310.java:1289) ~[client-intermediary.jar:?]
at net.minecraft.class_310.method_1514(class_310.java:888) ~[client-intermediary.jar:?]
at net.minecraft.client.main.Main.main(Main.java:265) ~[minecraft-1.20.4-client.jar:?]
at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:470) ~[fabric-loader-0.15.11.jar:?]
at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74) ~[fabric-loader-0.15.11.jar:?]
at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23) ~[fabric-loader-0.15.11.jar:?]
at org.prismlauncher.launcher.impl.StandardLauncher.launch(StandardLauncher.java:100) ~[NewLaunch.jar:?]
at org.prismlauncher.EntryPoint.listen(EntryPoint.java:129) ~[NewLaunch.jar:?]
at org.prismlauncher.EntryPoint.main(EntryPoint.java:70) ~[NewLaunch.jar:?]
[09:38:10] [minescript-world-listener/INFO]: Entered world
[09:38:10] [Render thread/INFO]: Xaero hud session finalized.
---- Minecraft Crash Report ----
// Ouch. That hurt :(
Time: 2024-07-16 09:38:11
Description: Unexpected error
java.lang.NullPointerException: Cannot invoke "java.util.List.size()" because "wildcardCommands" is null
at net.minescript.common.Minescript.handleAutorun(Minescript.java:3764)
at net.minescript.common.Minescript.onClientWorldTick(Minescript.java:3797)
at net.minescript.fabric.MinescriptFabricClientMod.lambda$onInitializeClient$2(MinescriptFabricClientMod.java:32)
at net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents.lambda$static$4(ClientTickEvents.java:52)
at net.minecraft.class_638.handler$zfo000$fabric-lifecycle-events-v1$startWorldTick(class_638.java:2139)
at net.minecraft.class_638.method_18116(class_638.java)
at net.minecraft.class_310.method_1574(class_310.java:2011)
at net.minecraft.class_310.method_1523(class_310.java:1289)
at net.minecraft.class_310.method_1514(class_310.java:888)
at net.minecraft.client.main.Main.main(Main.java:265)
at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:470)
at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74)
at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23)
at org.prismlauncher.launcher.impl.StandardLauncher.launch(StandardLauncher.java:100)
at org.prismlauncher.EntryPoint.listen(EntryPoint.java:129)
at org.prismlauncher.EntryPoint.main(EntryPoint.java:70)
A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------
-- Head --
Thread: Render thread
Stacktrace:
at net.minescript.common.Minescript.handleAutorun(Minescript.java:3764)
at net.minescript.common.Minescript.onClientWorldTick(Minescript.java:3797)
at net.minescript.fabric.MinescriptFabricClientMod.lambda$onInitializeClient$2(MinescriptFabricClientMod.java:32)
at net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents.lambda$static$4(ClientTickEvents.java:52)
at net.minecraft.class_638.handler$zfo000$fabric-lifecycle-events-v1$startWorldTick(class_638.java:2139)
at net.minecraft.class_638.method_18116(class_638.java)
-- Uptime --
Details:
JVM uptime: 1125.655s
Wall uptime: 1121.500s
High-res time: 1120.846s
Client ticks: 22335 ticks / 1116.750s
Stacktrace:
at net.minecraft.class_310.method_1587(class_310.java:2564)
at net.minecraft.class_310.method_54580(class_310.java:995)
at net.minecraft.class_310.method_1514(class_310.java:911)
at net.minecraft.client.main.Main.main(Main.java:265)
at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:470)
at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74)
at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23)
at org.prismlauncher.launcher.impl.StandardLauncher.launch(StandardLauncher.java:100)
at org.prismlauncher.EntryPoint.listen(EntryPoint.java:129)
at org.prismlauncher.EntryPoint.main(EntryPoint.java:70)
-- Affected level --
Details:
All players: 1 total; [class_746['nels_nelson'/385698, l='ClientLevel', x=-2499.50, y=0.88, z=525.31]]
Chunk stats: 5041, 19
Level dimension: minecraft:the_nether
Level spawn location: World: (0,66,0), Section: (at 0,2,0 in 0,4,0; chunk contains blocks 0,0,0 to 15,255,15), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511)
Level time: 606100932 game time, 606100932 day time
Server brand: BungeeCord (git:BungeeCord-Bootstrap:1.20-R0.2-SNAPSHOT:19918c6:1788)
Server type: Non-integrated multiplayer server
Tracked entity count: 5
Root cause explanation:
Line 3766 of Minescript.java:
LOGGER.info("Matched {} command(s) with autorun[{}]", wildcardCommands.size(), worldName);
Should be:
LOGGER.info("Matched {} command(s) with autorun[{}]", worldCommands.size(), worldName);
Workaround
Instead of this config.txt
:
python="/usr/bin/python3"
autorun[PvE nerd.nu]=example pve
Use this workaround:
python="/usr/bin/python3"
autorun[*]=autorun
The autorun.py
module:
import minescript
world = minescript.world_info()
if world.name == 'PvE nerd.nu':
minescript.execute("\\example pve")
elif world.address == 'other.example.com':
minescript.execute("\\example other")
Fix patch submitted.
See: #15