AudioPlayer

AudioPlayer

157k Downloads

audioplayer play and stop commands don't work in functions

SmajloSlovakian opened this issue ยท 2 comments

commented

tested on

  • dedicated 1.20.4 fabric server (0.15.3)
  • audioplayer-fabric-1.20.4-1.8.6
  • fabric-api-0.92.0+1.20.4
  • voicechat-fabric-1.20.4-2.4.32

i also have another server with more mods (mainly optimization mods and some utilities like worldedit and more) and command blocks seem to not work as well (similarly to #62)

datapack for testing: test.zip

to see if it works, look in the log after /reload or try to type in chat /function audioplayer:test - if autocompletion works, it most probably works

Console log when loading the function from datapack:

[20:19:39] [Server thread/ERROR]: Failed to load function audioplayer:test
java.util.concurrent.CompletionException: java.lang.NullPointerException: Cannot invoke "net.minecraft.server.MinecraftServer.method_21714()" because the return value of "net.minecraft.class_2168.method_9211()" is null
at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315) ~[?:?]
at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320) ~[?:?]
at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1770) ~[?:?]
at java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1760) ~[?:?]
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373) ~[?:?]
at java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182) ~[?:?]
at java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655) ~[?:?]
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622) ~[?:?]
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165) ~[?:?]
Caused by: java.lang.NullPointerException: Cannot invoke "net.minecraft.server.MinecraftServer.method_21714()" because the return value of "net.minecraft.class_2168.method_9211()" is null
at de.maxhenkel.audioplayer.AudioPlayerPermissionManager.hasPermission(AudioPlayerPermissionManager.java:39) ~[audioplayer-fabric-1.20.4-1.8.6.jar:?]
at de.maxhenkel.audioplayer.AudioPlayerPermissionManager.hasPermission(AudioPlayerPermissionManager.java:13) ~[audioplayer-fabric-1.20.4-1.8.6.jar:?]
at de.maxhenkel.admiral.impl.permissions.PermissionNode.hasPermission(PermissionNode.java:25) ~[admiral-0.4.4+1.20.4-18d14e3e2c3ec76b.jar:?]
at de.maxhenkel.admiral.impl.AdmiralMethod.lambda$permission$2(AdmiralMethod.java:122) ~[admiral-0.4.4+1.20.4-18d14e3e2c3ec76b.jar:?]
at java.util.stream.MatchOps$1MatchSink.accept(MatchOps.java:90) ~[?:?]
at java.util.ArrayList$ArrayListSpliterator.tryAdvance(ArrayList.java:1602) ~[?:?]
at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:129) ~[?:?]
at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:527) ~[?:?]
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:513) ~[?:?]
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[?:?]
at java.util.stream.MatchOps$MatchOp.evaluateSequential(MatchOps.java:230) ~[?:?]
at java.util.stream.MatchOps$MatchOp.evaluateSequential(MatchOps.java:196) ~[?:?]
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:?]
at java.util.stream.ReferencePipeline.allMatch(ReferencePipeline.java:637) ~[?:?]
at de.maxhenkel.admiral.impl.AdmiralMethod.lambda$permission$3(AdmiralMethod.java:122) ~[admiral-0.4.4+1.20.4-18d14e3e2c3ec76b.jar:?]
at java.util.stream.MatchOps$1MatchSink.accept(MatchOps.java:90) ~[?:?]
at java.util.ArrayList$ArrayListSpliterator.tryAdvance(ArrayList.java:1602) ~[?:?]
at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:129) ~[?:?]
at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:527) ~[?:?]
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:513) ~[?:?]
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[?:?]
at java.util.stream.MatchOps$MatchOp.evaluateSequential(MatchOps.java:230) ~[?:?]
at java.util.stream.MatchOps$MatchOp.evaluateSequential(MatchOps.java:196) ~[?:?]
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:?]
at java.util.stream.ReferencePipeline.anyMatch(ReferencePipeline.java:632) ~[?:?]
at de.maxhenkel.admiral.impl.AdmiralMethod.lambda$permission$4(AdmiralMethod.java:122) ~[admiral-0.4.4+1.20.4-18d14e3e2c3ec76b.jar:?]
at com.mojang.brigadier.tree.CommandNode.canUse(CommandNode.java:65) ~[brigadier-1.2.9.jar:?]
at com.mojang.brigadier.CommandDispatcher.parseNodes(CommandDispatcher.java:301) ~[brigadier-1.2.9.jar:?]
at com.mojang.brigadier.CommandDispatcher.parseNodes(CommandDispatcher.java:335) ~[brigadier-1.2.9.jar:?]
at com.mojang.brigadier.CommandDispatcher.parse(CommandDispatcher.java:291) ~[brigadier-1.2.9.jar:?]
at net.minecraft.class_2158.method_54417(class_2158.java:85) ~[server-intermediary.jar:?]
at net.minecraft.class_2158.method_9195(class_2158.java:74) ~[server-intermediary.jar:?]
at net.minecraft.class_5349.method_29451(class_5349.java:83) ~[server-intermediary.jar:?]
at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768) ~[?:?]
... 6 more

Notes:

the commands also don't work on command blocks for whatever reason with this mod config on the same server software:

  • audioplayer-fabric-1.20.4-1.8.6.jar
  • c2me-fabric-mc1.20.4-0.2.0+alpha.11.38.jar
  • fabric-api-0.92.0+1.20.4.jar
  • fabrictailor-2.3.0.jar
  • Fastload+1.18.2-1.20-3.4.0.jar
  • lazydfu-0.1.3.jar
  • lithium-fabric-mc1.20.4-0.12.1.jar
  • multiworldborders-1.6.3-fabric-1.20.2.jar
  • NoChatReports-FABRIC-1.20.4-v2.5.0.jar
  • PerfectAccuracy-1.2-1.19.jar
  • server-hats-0.16.jar
  • servertick-mc1.20.2-1.9.jar
  • starlight-1.1.3+fabric.f5dcd1a.jar
  • voicechat-fabric-1.20.4-2.4.32.jar
  • worldedit-mod-7.3.0-beta-03-dist.jar
commented

Thank you for reporting this issue! This should be fixed in the next version.

commented

there is a workaround:
you can make the line inside that function a macro line... this makes it so that the line isn't parsed when loading the function but at every* call of the function and it seems to work then