Supplementaries

Supplementaries

82M Downloads

Need to connect multiplayer server twice with ’scaling health‘ installed

Tidy-Bear opened this issue · 2 comments

commented

Versions

  • Supplementaries: 1.16.5-0.14.3
  • Selene: 1.16.5-1.3
  • Forge: 36.1.24
  • Optifine: HD_U_G7
  • Scaling Health: 1.16.5-4.1.5+11
  • Silent Lib (the required dependency of scaling health): 1.16.3-4.9.6

Description
When installing ‘scaling health’ and ‘supplementaries’ together, client always get stuck on the screen of 'Joining world...' at the first connect. Player has to click the cancel btn and connect again to join the server normally.
In fact, player still join the server logically in the first conn. One example is that they may be killed by monsters and can neither aware of it or do anything until the death msg is displayed in the second conn.

Logs
Error details is recorded only in client log.

[08七月2021 12:43:59.651] [Render thread/INFO] [net.minecraft.client.gui.screen.ConnectingScreen/]: Connecting to localhost, 25565
[08七月2021 12:44:01.748] [Netty Client IO #1/INFO] [net.minecraftforge.fml.network.NetworkHooks/]: Connected to a modded server.
[08七月2021 12:44:02.102] [Render thread/ERROR] [net.minecraftforge.eventbus.EventBus/EVENTBUS]: Exception caught during firing event: Tag scalinghealth:difficulty_exempt used before it was bound
	Index: 2
	Listeners:
		0: NORMAL
		1: ASM: class net.mehvahdjukaar.supplementaries.events.ServerEvents onAttachItemCapabilities(Lnet/minecraftforge/event/AttachCapabilitiesEvent;)V
		2: ASM: class net.silentchaos512.scalinghealth.event.DifficultyEvents onAttachEntityCapabilities(Lnet/minecraftforge/event/AttachCapabilitiesEvent;)V
		3: ASM: class net.silentchaos512.scalinghealth.event.DifficultyEvents onAttachWorldCapabilities(Lnet/minecraftforge/event/AttachCapabilitiesEvent;)V
java.lang.IllegalStateException: Tag scalinghealth:difficulty_exempt used before it was bound
	at net.minecraft.tags.TagRegistry$NamedTag.func_232944_c_(TagRegistry.java:131)
	at net.minecraft.tags.TagRegistry$NamedTag.func_230235_a_(TagRegistry.java:142)
	at net.silentchaos512.scalinghealth.utils.config.SHMobs.allowsDifficultyChanges(SHMobs.java:15)
	at net.silentchaos512.scalinghealth.capability.DifficultyAffectedCapability.canAttachTo(DifficultyAffectedCapability.java:100)
	at net.silentchaos512.scalinghealth.event.DifficultyEvents.onAttachEntityCapabilities(DifficultyEvents.java:49)
	at net.minecraftforge.eventbus.ASMEventHandler_29_DifficultyEvents_onAttachEntityCapabilities_AttachCapabilitiesEvent.invoke(.dynamic)
	at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:85)
	at net.minecraftforge.eventbus.EventBus.post(EventBus.java:302)
	at net.minecraftforge.eventbus.EventBus.post(EventBus.java:283)
	at net.minecraftforge.event.ForgeEventFactory.gatherCapabilities(ForgeEventFactory.java:589)
	at net.minecraftforge.event.ForgeEventFactory.gatherCapabilities(ForgeEventFactory.java:583)
	at net.minecraftforge.common.capabilities.CapabilityProvider.gatherCapabilities(CapabilityProvider.java:48)
	at net.minecraftforge.common.capabilities.CapabilityProvider.gatherCapabilities(CapabilityProvider.java:44)
	at net.minecraft.entity.Entity.<init>(Entity.java:221)
	at net.minecraft.entity.LivingEntity.<init>(LivingEntity.java:205)
	at net.minecraft.entity.MobEntity.<init>(MobEntity.java:137)
	at net.minecraft.entity.CreatureEntity.<init>(SourceFile:12)
	at net.minecraft.entity.AgeableEntity.<init>(SourceFile:28)
	at net.minecraft.entity.passive.AnimalEntity.<init>(AnimalEntity.java:37)
	at net.minecraft.entity.passive.PigEntity.<init>(PigEntity.java:59)
	at net.mehvahdjukaar.supplementaries.client.renderers.CapturedMobCache.onWorldLoad(CapturedMobCache.java:57)
	at net.minecraftforge.eventbus.ASMEventHandler_78_CapturedMobCache_onWorldLoad_Load.invoke(.dynamic)
	at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:85)
	at net.minecraftforge.eventbus.EventBus.post(EventBus.java:302)
	at net.minecraftforge.eventbus.EventBus.post(EventBus.java:283)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at net.optifine.reflect.Reflector.call(Reflector.java:1084)
	at net.optifine.reflect.Reflector.postForgeBusEvent(Reflector.java:1357)
	at net.optifine.reflect.Reflector.postForgeBusEvent(Reflector.java:1343)
	at net.minecraft.client.world.ClientWorld.<init>(ClientWorld.java:128)
	at net.minecraft.client.network.play.ClientPlayNetHandler.func_147282_a(ClientPlayNetHandler.java:375)
	at net.minecraft.network.play.server.SJoinGamePacket.func_148833_a(SourceFile:110)
	at net.minecraft.network.play.server.SJoinGamePacket.func_148833_a(SourceFile:18)
	at net.minecraft.network.PacketThreadUtil.lambda$checkThreadAndEnqueue$0(PacketThreadUtil.java:34)
	at net.minecraft.util.concurrent.ThreadTaskExecutor.func_213166_h(ThreadTaskExecutor.java:191)
	at net.minecraft.util.concurrent.RecursiveEventLoop.func_213166_h(SourceFile:23)
	at net.minecraft.util.concurrent.ThreadTaskExecutor.func_213168_p(ThreadTaskExecutor.java:153)
	at net.minecraft.util.concurrent.ThreadTaskExecutor.func_213160_bf(ThreadTaskExecutor.java:130)
	at net.minecraft.client.Minecraft.func_195542_b(Minecraft.java:947)
	at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:607)
	at net.minecraft.client.main.Main.main(Main.java:184)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at net.minecraftforge.fml.loading.FMLClientLaunchProvider.lambda$launchService$0(FMLClientLaunchProvider.java:51)
	at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37)
	at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54)
	at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72)
	at cpw.mods.modlauncher.Launcher.run(Launcher.java:82)
	at cpw.mods.modlauncher.Launcher.main(Launcher.java:66)

Other
The main cause seems over here:

defaultPig = new PigEntity(EntityType.PIG, (World) world);

commented

From my point of view, it's your mod that caused the error, so currenly the issue is only raised here. But it's a cross-compability bug after all, i'll give feedback to 'scaling health' if you think it's necessary.

commented

I'll fix that. Honestly I think the problem was on both end. one one hand it might have been unsafe for me to create an entity that early but on the other hand I think it is the same unsafe to not expect a tag to be not loaded yet when attaching a capability since one could have very well done like I did