[1.16.5] Crafttweaker spams logs upon joining world, with player event listener in the script.
Blue-Beaker opened this issue ยท 2 comments
Issue description
Crafttweaker spam logs upon joining world like this:
[30Jan2022 22:02:40.502] [Render thread/INFO] [STDERR/]: [com.blamejared.crafttweaker.api.CraftTweakerAPI:logThrowing:245]: java.lang.NullPointerException [30Jan2022 22:02:40.503] [Render thread/INFO] [STDERR/]: [com.blamejared.crafttweaker.api.CraftTweakerAPI:logThrowing:245]: at com.blamejared.crafttweaker.impl_native.entity.ExpandEntity.setNoGravity(ExpandEntity.java:479) [30Jan2022 22:02:40.503] [Render thread/INFO] [STDERR/]: [com.blamejared.crafttweaker.api.CraftTweakerAPI:logThrowing:245]: at j_util_function_Consumer_1.accept(Unknown Source) [30Jan2022 22:02:40.504] [Render thread/INFO] [STDERR/]: [com.blamejared.crafttweaker.api.CraftTweakerAPI:logThrowing:245]: at j_util_function_Consumer_1.accept(Unknown Source) [30Jan2022 22:02:40.504] [Render thread/INFO] [STDERR/]: [com.blamejared.crafttweaker.api.CraftTweakerAPI:logThrowing:245]: at com.blamejared.crafttweaker.impl.events.EventHandlerWrapper.accept(EventHandlerWrapper.java:21) [30Jan2022 22:02:40.505] [Render thread/INFO] [STDERR/]: [com.blamejared.crafttweaker.api.CraftTweakerAPI:logThrowing:245]: at com.blamejared.crafttweaker.impl.events.EventHandlerWrapper.accept(EventHandlerWrapper.java:8) [30Jan2022 22:02:40.506] [Render thread/INFO] [STDERR/]: [com.blamejared.crafttweaker.api.CraftTweakerAPI:logThrowing:245]: at net.minecraftforge.eventbus.EventBus.doCastFilter(EventBus.java:247) [30Jan2022 22:02:40.508] [Render thread/INFO] [STDERR/]: [com.blamejared.crafttweaker.api.CraftTweakerAPI:logThrowing:245]: at net.minecraftforge.eventbus.EventBus.lambda$addListener$11(EventBus.java:239) [30Jan2022 22:02:40.508] [Render thread/INFO] [STDERR/]: [com.blamejared.crafttweaker.api.CraftTweakerAPI:logThrowing:245]: at net.minecraftforge.eventbus.EventBus.post(EventBus.java:302) [30Jan2022 22:02:40.510] [Render thread/INFO] [STDERR/]: [com.blamejared.crafttweaker.api.CraftTweakerAPI:logThrowing:245]: at net.minecraftforge.eventbus.EventBus.post(EventBus.java:283) [30Jan2022 22:02:40.511] [Render thread/INFO] [STDERR/]: [com.blamejared.crafttweaker.api.CraftTweakerAPI:logThrowing:245]: at net.minecraftforge.event.ForgeEventFactory.onItemTooltip(ForgeEventFactory.java:289) [30Jan2022 22:02:40.511] [Render thread/INFO] [STDERR/]: [com.blamejared.crafttweaker.api.CraftTweakerAPI:logThrowing:245]: at net.minecraft.item.ItemStack.func_82840_a(ItemStack.java:701) [30Jan2022 22:02:40.512] [Render thread/INFO] [STDERR/]: [com.blamejared.crafttweaker.api.CraftTweakerAPI:logThrowing:245]: at net.minecraft.client.Minecraft.lambda$null$11(Minecraft.java:665) [30Jan2022 22:02:40.513] [Render thread/INFO] [STDERR/]: [com.blamejared.crafttweaker.api.CraftTweakerAPI:logThrowing:245]: at java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:269) [30Jan2022 22:02:40.513] [Render thread/INFO] [STDERR/]: [com.blamejared.crafttweaker.api.CraftTweakerAPI:logThrowing:245]: at java.util.Collections$2.tryAdvance(Collections.java:4719) [30Jan2022 22:02:40.514] [Render thread/INFO] [STDERR/]: [com.blamejared.crafttweaker.api.CraftTweakerAPI:logThrowing:245]: at java.util.Collections$2.forEachRemaining(Collections.java:4727) [30Jan2022 22:02:40.514] [Render thread/INFO] [STDERR/]: [com.blamejared.crafttweaker.api.CraftTweakerAPI:logThrowing:245]: at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482) [30Jan2022 22:02:40.515] [Render thread/INFO] [STDERR/]: [com.blamejared.crafttweaker.api.CraftTweakerAPI:logThrowing:245]: at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472) [30Jan2022 22:02:40.515] [Render thread/INFO] [STDERR/]: [com.blamejared.crafttweaker.api.CraftTweakerAPI:logThrowing:245]: at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150) [30Jan2022 22:02:40.516] [Render thread/INFO] [STDERR/]: [com.blamejared.crafttweaker.api.CraftTweakerAPI:logThrowing:245]: at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173) [30Jan2022 22:02:40.516] [Render thread/INFO] [STDERR/]: [com.blamejared.crafttweaker.api.CraftTweakerAPI:logThrowing:245]: at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) [30Jan2022 22:02:40.517] [Render thread/INFO] [STDERR/]: [com.blamejared.crafttweaker.api.CraftTweakerAPI:logThrowing:245]: at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:485) [30Jan2022 22:02:40.517] [Render thread/INFO] [STDERR/]: [com.blamejared.crafttweaker.api.CraftTweakerAPI:logThrowing:245]: at net.minecraft.client.util.SearchTree.func_194042_b(SourceFile:36) [30Jan2022 22:02:40.518] [Render thread/INFO] [STDERR/]: [com.blamejared.crafttweaker.api.CraftTweakerAPI:logThrowing:245]: at net.minecraft.client.util.SearchTreeReloadable.func_217872_a(SourceFile:48) [30Jan2022 22:02:40.519] [Render thread/INFO] [STDERR/]: [com.blamejared.crafttweaker.api.CraftTweakerAPI:logThrowing:245]: at com.google.common.collect.ImmutableList.forEach(ImmutableList.java:408) [30Jan2022 22:02:40.519] [Render thread/INFO] [STDERR/]: [com.blamejared.crafttweaker.api.CraftTweakerAPI:logThrowing:245]: at net.minecraft.client.network.play.ClientPlayNetHandler.func_199525_a(ClientPlayNetHandler.java:1312) [30Jan2022 22:02:40.522] [Render thread/INFO] [STDERR/]: [com.blamejared.crafttweaker.api.CraftTweakerAPI:logThrowing:245]: at net.minecraft.network.play.server.SUpdateRecipesPacket.func_148833_a(SourceFile:27) [30Jan2022 22:02:40.523] [Render thread/INFO] [STDERR/]: [com.blamejared.crafttweaker.api.CraftTweakerAPI:logThrowing:245]: at net.minecraft.network.play.server.SUpdateRecipesPacket.func_148833_a(SourceFile:15) [30Jan2022 22:02:40.524] [Render thread/INFO] [STDERR/]: [com.blamejared.crafttweaker.api.CraftTweakerAPI:logThrowing:245]: at net.minecraft.network.PacketThreadUtil.func_225383_a(SourceFile:21) [30Jan2022 22:02:40.524] [Render thread/INFO] [STDERR/]: [com.blamejared.crafttweaker.api.CraftTweakerAPI:logThrowing:245]: at net.minecraft.util.concurrent.ThreadTaskExecutor.func_213166_h(SourceFile:144) [30Jan2022 22:02:40.525] [Render thread/INFO] [STDERR/]: [com.blamejared.crafttweaker.api.CraftTweakerAPI:logThrowing:245]: at net.minecraft.util.concurrent.RecursiveEventLoop.func_213166_h(SourceFile:23) [30Jan2022 22:02:40.525] [Render thread/INFO] [STDERR/]: [com.blamejared.crafttweaker.api.CraftTweakerAPI:logThrowing:245]: at net.minecraft.util.concurrent.ThreadTaskExecutor.func_213168_p(SourceFile:118) [30Jan2022 22:02:40.526] [Render thread/INFO] [STDERR/]: [com.blamejared.crafttweaker.api.CraftTweakerAPI:logThrowing:245]: at net.minecraft.util.concurrent.ThreadTaskExecutor.func_213160_bf(SourceFile:103) [30Jan2022 22:02:40.526] [Render thread/INFO] [STDERR/]: [com.blamejared.crafttweaker.api.CraftTweakerAPI:logThrowing:245]: at net.minecraft.client.Minecraft.func_195542_b(Minecraft.java:948) [30Jan2022 22:02:40.527] [Render thread/INFO] [STDERR/]: [com.blamejared.crafttweaker.api.CraftTweakerAPI:logThrowing:245]: at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:607) [30Jan2022 22:02:40.527] [Render thread/INFO] [STDERR/]: [com.blamejared.crafttweaker.api.CraftTweakerAPI:logThrowing:245]: at net.minecraft.client.main.Main.main(Main.java:184) [30Jan2022 22:02:40.528] [Render thread/INFO] [STDERR/]: [com.blamejared.crafttweaker.api.CraftTweakerAPI:logThrowing:245]: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [30Jan2022 22:02:40.528] [Render thread/INFO] [STDERR/]: [com.blamejared.crafttweaker.api.CraftTweakerAPI:logThrowing:245]: at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [30Jan2022 22:02:40.529] [Render thread/INFO] [STDERR/]: [com.blamejared.crafttweaker.api.CraftTweakerAPI:logThrowing:245]: at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [30Jan2022 22:02:40.529] [Render thread/INFO] [STDERR/]: [com.blamejared.crafttweaker.api.CraftTweakerAPI:logThrowing:245]: at java.lang.reflect.Method.invoke(Method.java:498) [30Jan2022 22:02:40.530] [Render thread/INFO] [STDERR/]: [com.blamejared.crafttweaker.api.CraftTweakerAPI:logThrowing:245]: at net.minecraftforge.fml.loading.FMLClientLaunchProvider.lambda$launchService$0(FMLClientLaunchProvider.java:51) [30Jan2022 22:02:40.530] [Render thread/INFO] [STDERR/]: [com.blamejared.crafttweaker.api.CraftTweakerAPI:logThrowing:245]: at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [30Jan2022 22:02:40.531] [Render thread/INFO] [STDERR/]: [com.blamejared.crafttweaker.api.CraftTweakerAPI:logThrowing:245]: at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [30Jan2022 22:02:40.532] [Render thread/INFO] [STDERR/]: [com.blamejared.crafttweaker.api.CraftTweakerAPI:logThrowing:245]: at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [30Jan2022 22:02:40.532] [Render thread/INFO] [STDERR/]: [com.blamejared.crafttweaker.api.CraftTweakerAPI:logThrowing:245]: at cpw.mods.modlauncher.Launcher.run(Launcher.java:82) [30Jan2022 22:02:40.533] [Render thread/INFO] [STDERR/]: [com.blamejared.crafttweaker.api.CraftTweakerAPI:logThrowing:245]: at cpw.mods.modlauncher.Launcher.main(Launcher.java:66) [30Jan2022 22:02:40.533] [Render thread/INFO] [STDERR/]: [com.blamejared.crafttweaker.api.CraftTweakerAPI:logThrowing:245]: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [30Jan2022 22:02:40.534] [Render thread/INFO] [STDERR/]: [com.blamejared.crafttweaker.api.CraftTweakerAPI:logThrowing:245]: at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [30Jan2022 22:02:40.534] [Render thread/INFO] [STDERR/]: [com.blamejared.crafttweaker.api.CraftTweakerAPI:logThrowing:245]: at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [30Jan2022 22:02:40.535] [Render thread/INFO] [STDERR/]: [com.blamejared.crafttweaker.api.CraftTweakerAPI:logThrowing:245]: at java.lang.reflect.Method.invoke(Method.java:498) [30Jan2022 22:02:40.535] [Render thread/INFO] [STDERR/]: [com.blamejared.crafttweaker.api.CraftTweakerAPI:logThrowing:245]: at io.github.zekerzhayard.forgewrapper.installer.Main.main(Main.java:57) [30Jan2022 22:02:40.536] [Render thread/INFO] [STDERR/]: [com.blamejared.crafttweaker.api.CraftTweakerAPI:logThrowing:245]: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [30Jan2022 22:02:40.537] [Render thread/INFO] [STDERR/]: [com.blamejared.crafttweaker.api.CraftTweakerAPI:logThrowing:245]: at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [30Jan2022 22:02:40.537] [Render thread/INFO] [STDERR/]: [com.blamejared.crafttweaker.api.CraftTweakerAPI:logThrowing:245]: at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [30Jan2022 22:02:40.538] [Render thread/INFO] [STDERR/]: [com.blamejared.crafttweaker.api.CraftTweakerAPI:logThrowing:245]: at java.lang.reflect.Method.invoke(Method.java:498) [30Jan2022 22:02:40.539] [Render thread/INFO] [STDERR/]: [com.blamejared.crafttweaker.api.CraftTweakerAPI:logThrowing:245]: at org.multimc.onesix.OneSixLauncher.launchWithMainClass(OneSixLauncher.java:210) [30Jan2022 22:02:40.540] [Render thread/INFO] [STDERR/]: [com.blamejared.crafttweaker.api.CraftTweakerAPI:logThrowing:245]: at org.multimc.onesix.OneSixLauncher.launch(OneSixLauncher.java:245) [30Jan2022 22:02:40.540] [Render thread/INFO] [STDERR/]: [com.blamejared.crafttweaker.api.CraftTweakerAPI:logThrowing:245]: at org.multimc.EntryPoint.listen(EntryPoint.java:143) [30Jan2022 22:02:40.542] [Render thread/INFO] [STDERR/]: [com.blamejared.crafttweaker.api.CraftTweakerAPI:logThrowing:245]: at org.multimc.EntryPoint.main(EntryPoint.java:34)
Steps to reproduce
1.Install forge, crafttweaker, and the provided script.
2.Start Minecraft.
3.Create or join a singleplayer world.
4.After spawn chunks 100% loaded, crafttweaker starts spamming logs for a while.
Script used
https://gist.github.com/Blue-Beaker/533b3bf96eb6a25c009f4aa52756d7e9
The crafttweaker.log file
https://gist.github.com/Blue-Beaker/313976458949595b5cc8d863a05cc469#file-crafttweaker-log
Minecraft version
1.16
Modloader
Forge
Modloader version
36.2.20
CraftTweaker version
7.1.2.491
Other relevant information
OS: Kubuntu 20.04
Launcher: MultiMC 0.6.14-develop-2995 on lin64
Crafttweaker 7.1.0.314 doesn't have this bug, but breaks JEI when installed with it.
The latest.log file
https://gist.github.com/Blue-Beaker/313976458949595b5cc8d863a05cc469#file-latest-log
PlayerEvent is a supertype event that you probably wouldn't want to use in the first place.
But as your CraftTweaker log tells you, you have a Nullpointer Exception when trying to call .setNoGravity
on the player.
Therefore it's likely that some of the playerevents are fired before the player properly exists.
Try subscribing to a more precise event, like MCPlayerLoggedInEvent
?
PlayerEvent is a supertype event that you probably wouldn't want to use in the first place. But as your CraftTweaker log tells you, you have a Nullpointer Exception when trying to call
.setNoGravity
on the player.Therefore it's likely that some of the playerevents are fired before the player properly exists. Try subscribing to a more precise event, like
MCPlayerLoggedInEvent
?
MCPlayerLoggedInEvent works upon login, and MCPlayerRespawnEvent works for respawn.
Modified my script to subscribe both event worked,thanks!