Apotheosis

Apotheosis

79M Downloads

Crash and corruption of data with RFTools tablet

GAsplund opened this issue ยท 2 comments

commented

This is a somewhat specific issue, but it causes data corruption so I've chosen to report it here.
In order to reproduce the issue, you hold an affix item (I've only tested it on a shield since that's what I've held all the time) and change the screen module in an RFTools tablet. This will sometimes cause Apotheosis (presumably) to attempt to overwrite data on the tablet, which results in error spam in the console and the player to be kicked/unable to join due to an "internal server error". When the inventory is explored in an NBT editor, it shows the following:
image
There are two distinct errors occurring when trying to rejoin: Exception caught during firing event: null and Failed to handle packet for [REDACTED].

Their stacktraces are as following:

[22Aug2021 19:18:56.532] [Server thread/ERROR] [net.minecraftforge.eventbus.EventBus/EVENTBUS]: Exception caught during firing event: null
	Index: 1
	Listeners:
		0: NORMAL
		1: ASM: shadows.apotheosis.deadly.affix.AffixEvents@54d7da9 affixModifiers(Lnet/minecraftforge/event/ItemAttributeModifierEvent;)V
		2: ASM: com.blamejared.crafttweaker.impl.events.CTEventHandler@2685af1d attribute(Lnet/minecraftforge/event/ItemAttributeModifierEvent;)V
		3: LOWEST
		4: ASM: shadows.apotheosis.deadly.affix.AffixEvents@54d7da9 sortModifiers(Lnet/minecraftforge/event/ItemAttributeModifierEvent;)V
java.lang.NullPointerException
	at shadows.apotheosis.deadly.affix.impl.AttributeAffix.addModifiers(AttributeAffix.java:75)
	at shadows.apotheosis.deadly.affix.AffixEvents.lambda$affixModifiers$9(AffixEvents.java:420)
	at java.util.HashMap.forEach(Unknown Source)
	at shadows.apotheosis.deadly.affix.AffixEvents.affixModifiers(AffixEvents.java:420)
	at net.minecraftforge.eventbus.ASMEventHandler_97_AffixEvents_affixModifiers_ItemAttributeModifierEvent.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.common.ForgeHooks.getAttributeModifiers(ForgeHooks.java:1069)
	at net.minecraft.item.ItemStack.func_111283_C(ItemStack.java:850)
	at net.minecraft.entity.LivingEntity.func_241354_r_(LivingEntity.java:2279)
	at net.minecraft.entity.LivingEntity.func_241353_q_(LivingEntity.java:2239)
	at net.minecraft.entity.LivingEntity.func_70071_h_(LivingEntity.java:2141)
	at net.minecraft.entity.player.PlayerEntity.func_70071_h_(PlayerEntity.java:223)
	at net.minecraft.entity.player.ServerPlayerEntity.func_71127_g(ServerPlayerEntity.java:404)
	at net.minecraft.network.play.ServerPlayNetHandler.func_73660_a(ServerPlayNetHandler.java:207)
	at net.minecraft.network.NetworkManager.func_74428_b(NetworkManager.java:226)
	at net.minecraft.network.NetworkSystem.func_151269_c(NetworkSystem.java:134)
	at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:865)
	at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:291)
	at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:787)
	at net.minecraft.server.MinecraftServer.func_240802_v_(MinecraftServer.java:642)
	at net.minecraft.server.MinecraftServer.func_240783_a_(MinecraftServer.java:232)
	at java.lang.Thread.run(Unknown Source)

and

[22Aug2021 19:18:56.536] [Server thread/FATAL] [net.minecraftforge.common.ForgeMod/]: Preparing crash report with UUID 44bb5c8d-e471-415c-9d64-c15d45920968
[22Aug2021 19:18:56.536] [Server thread/WARN] [net.minecraft.network.NetworkSystem/]: Failed to handle packet for [REDACTED]
net.minecraft.crash.ReportedException: Ticking player
	at net.minecraft.entity.player.ServerPlayerEntity.func_71127_g(ServerPlayerEntity.java:467) ~[?:?]
	at net.minecraft.network.play.ServerPlayNetHandler.func_73660_a(ServerPlayNetHandler.java:207) ~[?:?]
	at net.minecraft.network.NetworkManager.func_74428_b(NetworkManager.java:226) ~[?:?]
	at net.minecraft.network.NetworkSystem.func_151269_c(NetworkSystem.java:134) ~[?:?]
	at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:865) ~[?:?]
	at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:291) ~[?:?]
	at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:787) ~[?:?]
	at net.minecraft.server.MinecraftServer.func_240802_v_(MinecraftServer.java:642) ~[?:?]
	at net.minecraft.server.MinecraftServer.func_240783_a_(MinecraftServer.java:232) ~[?:?]
	at java.lang.Thread.run(Unknown Source) [?:1.8.0_301]
Caused by: java.lang.NullPointerException
	at shadows.apotheosis.deadly.affix.impl.AttributeAffix.addModifiers(AttributeAffix.java:75) ~[apotheosis:4.5.4]
	at shadows.apotheosis.deadly.affix.AffixEvents.lambda$affixModifiers$9(AffixEvents.java:420) ~[apotheosis:4.5.4]
	at java.util.HashMap.forEach(Unknown Source) ~[?:1.8.0_301]
	at shadows.apotheosis.deadly.affix.AffixEvents.affixModifiers(AffixEvents.java:420) ~[apotheosis:4.5.4]
	at net.minecraftforge.eventbus.ASMEventHandler_97_AffixEvents_affixModifiers_ItemAttributeModifierEvent.invoke(.dynamic) ~[?:?]
	at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:85) ~[eventbus-4.0.0.jar:?]
	at net.minecraftforge.eventbus.EventBus.post(EventBus.java:302) ~[eventbus-4.0.0.jar:?]
	at net.minecraftforge.eventbus.EventBus.post(EventBus.java:283) ~[eventbus-4.0.0.jar:?]
	at net.minecraftforge.common.ForgeHooks.getAttributeModifiers(ForgeHooks.java:1069) ~[forge:?]
	at net.minecraft.item.ItemStack.func_111283_C(ItemStack.java:850) ~[?:?]
	at net.minecraft.entity.LivingEntity.func_241354_r_(LivingEntity.java:2279) ~[?:?]
	at net.minecraft.entity.LivingEntity.func_241353_q_(LivingEntity.java:2239) ~[?:?]
	at net.minecraft.entity.LivingEntity.func_70071_h_(LivingEntity.java:2141) ~[?:?]
	at net.minecraft.entity.player.PlayerEntity.func_70071_h_(PlayerEntity.java:223) ~[?:?]
	at net.minecraft.entity.player.ServerPlayerEntity.func_71127_g(ServerPlayerEntity.java:404) ~[?:?]
	... 9 more
commented

How did you end up with a tablet with affixes on it in the first place?
Both of those errors stem from the fact that (as of the current release) an affix on an item that does not support having any affixes will just crash outright - but that nbt data shouldn't ever have been there in the first place.

I have no clue what that tablet actually does, but it looks like it cloned the nbt data of the shield?
Anyway, will be fixed next update - but it's gonna be pretty spammy about having an item with affix nbt that doesn't support it.

commented

Glad to hear that the issue won't cause crashing anymore. For what it's worth, I've uploaded a video demonstrating how to reproduce it in case it could give any information on what's actually going on so that the underlying issue may be fixed.

https://youtu.be/-f4q4Mnmt2k