Damage type not found with LegendarySurvivalOverhaul
sfiomn opened this issue ยท 25 comments
Hello there,
We have found an error when dummmmy is used with our mod (LSO).
The damage type for hyperthermia was not found when applied, any idea on this ?
As the damage type is included in the /data, I don't know why it can't find it
java.lang.AssertionError: Damage type not found in registry. This is a but from that mod that added it!: DamageType[msgId=legendarysurvivaloverhaul.hyperthermia, scaling=NEVER, exhaustion=0.1, effects=BURNING, deathMessageType=DEFAULT] at net.mehvahdjukaar.dummmmmmy.network.ClientBoundDamageNumberMessage.encodeDamage(ClientBoundDamageNumberMessage.java:46) ~[dummmmmmy-1.20-1.8.19.jar%23436!/:?] {re:classloading} at net.mehvahdjukaar.dummmmmmy.network.ClientBoundDamageNumberMessage.<init>(ClientBoundDamageNumberMessage.java:37) ~[dummmmmmy-1.20-1.8.19.jar%23436!/:?] {re:classloading} at net.mehvahdjukaar.dummmmmmy.common.ModEvents.onEntityDamage(ModEvents.java:73) ~[dummmmmmy-1.20-1.8.19.jar%23436!/:?] {re:mixin,re:classloading} at net.minecraft.world.entity.player.Player.wrapOperation$deb000$dummmmmmy$actuallyHurt_setHealth(Player.java:8734) ~[client-1.20.1-20230612.114412-srg.jar%23594!/:?] {re:computing_frames,pl:accesstransformer:B,pl:connector_pre_launch:A,mixin:APP:dummmmmmy-common.mixins.json:PlayerMixin from mod dummmmmmy} at net.minecraft.world.entity.LivingEntity.m_6469_(LivingEntity.java:1112) ~[client-1.20.1-20230612.114412-srg.jar%23594!/:?] {re:computing_frames,pl:accesstransformer:B,xf:fml:connectormod:insertInjectionTarget,xf:fml:connectormod:updateItemUseStartTreshold,pl:connector_pre_launch:A,re:mixin,pl:accesstransformer:B,xf:fml:connectormod:insertInjectionTarget,xf:fml:connectormod:updateItemUseStartTreshold,pl:connector_pre_launch:A,re:classloading,pl:mixin:APP:dummmmmmy-common.mixins.json:LivingEntityMixin from mod dummmmmmy} at net.minecraft.world.entity.player.Player.m_6469_(Player.java:840) ~[client-1.20.1-20230612.114412-srg.jar%23594!/:?] {re:computing_frames,pl:accesstransformer:B,pl:connector_pre_launch:A,re:mixin,pl:accesstransformer:B,pl:connector_pre_launch:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:dummmmmmy-common.mixins.json:PlayerMixin from mod dummmmmmy} at net.minecraft.server.level.ServerPlayer.m_6469_(ServerPlayer.java:695) ~[client-1.20.1-20230612.114412-srg.jar%23594!/:?] {re:computing_frames,pl:accesstransformer:B,pl:connector_pre_launch:A,re:mixin,pl:accesstransformer:B,pl:connector_pre_launch:A,re:classloading,pl:accesstransformer:B} at sfiomn.legendarysurvivaloverhaul.common.effects.HeatStrokeEffect.m_6742_(HeatStrokeEffect.java:30) ~[legendarysurvivaloverhaul-1.20.1-1.3.9.jar%23496!/:1.20.1-1.3.9] {re:classloading} at net.minecraft.world.effect.MobEffectInstance.m_19550_(MobEffectInstance.java:204) ~[client-1.20.1-20230612.114412-srg.jar%23594!/:?] {re:mixin,pl:accesstransformer:B,xf:fml:forge:potion,pl:connector_pre_launch:A,re:classloading,pl:accesstransformer:B,xf:fml:forge:potion,pl:mixin:APP:bookshelf.common.mixins.json:accessors.effect.AccessorMobEffectInstance from mod bookshelf,pl:mixin:A,pl:connector_pre_launch:A} at net.minecraft.world.effect.MobEffectInstance.m_19552_(MobEffectInstance.java:171) ~[client-1.20.1-20230612.114412-srg.jar%23594!/:?] {re:mixin,pl:accesstransformer:B,xf:fml:forge:potion,pl:connector_pre_launch:A,re:classloading,pl:accesstransformer:B,xf:fml:forge:potion,pl:mixin:APP:bookshelf.common.mixins.json:accessors.effect.AccessorMobEffectInstance from mod bookshelf,pl:mixin:A,pl:connector_pre_launch:A} at net.minecraft.world.entity.LivingEntity.m_21217_(LivingEntity.java:758) ~[client-1.20.1-20230612.114412-srg.jar%23594!/:?] {re:computing_frames,pl:accesstransformer:B,xf:fml:connectormod:insertInjectionTarget,xf:fml:connectormod:updateItemUseStartTreshold,pl:connector_pre_launch:A,re:mixin,pl:accesstransformer:B,xf:fml:connectormod:insertInjectionTarget,xf:fml:connectormod:updateItemUseStartTreshold,pl:connector_pre_launch:A,pl:mixin:APP:dummmmmmy-common.mixins.json:LivingEntityMixin from mod dummmmmmy}
what it says there. its a bug from mod that added that damage type. They domehow managed to create a damage type without registering it without the game crashing on boot
Yeah, that's my guess as well, but I don't see what's wrong with the current registering
https://github.com/sfiomn/LegendarySurvivalOverhaul/blob/1.20.1/src/main/java/sfiomn/legendarysurvivaloverhaul/api/ModDamageTypes.java
As it uses datapacks to register new damage types ...
Any clue on this ?
That code throws when registry returns null is for a given damage type. Damage types are data driven so unless one does something unsafe like storing them in a static field or something this should never happen
Ah didn't realize it was datagen code. Anyways I'll look more into it but I'm not sure. That is clearly coming from a registry.getID call which is retuning null for a given damage type
I don't really see why the way I register the damage types isn't the correct way of doing
That all checks out. No idea how it manages to first get it from registry then say it doesn't have an id
Arf our problem opens issues on our side
https://legacy.curseforge.com/minecraft/mc-mods/legendary-survival-overhaul/issues/10
I don't really know what's going on. After you create your damage source in your code call registry get key on the object
I've just tried on the RightClickBlock event, this works:
event.getEntity().hurt(new DamageSource(event.getLevel().registryAccess().registryOrThrow(Registries.DAMAGE_TYPE).getHolderOrThrow(ResourceKey.create(Registries.DAMAGE_TYPE, new ResourceLocation(LegendarySurvivalOverhaul.MOD_ID, "hypothermia")))), 1.0f)
Might it be a client side issue on your side ?
Just tried the same logic locally on the client side, and it finds correctly the damage type as well
Except if I misunderstood something, this is the normal way of doing
Hello there, do you think you could take a quick look about what's going on between our mods ?
Would be great if we could fix our incompatibility :)
crash-2024-10-26_23.47.41-server.txt
Crash still occured with latest version
I tried to test this in dev and i cant replicate it. Are you using other mods?
It's coming from effects :
https://github.com/sfiomn/LegendarySurvivalOverhaul/blob/1.20.1/src/main/java/sfiomn/legendarysurvivaloverhaul/common/effects/HeatStrokeEffect.java
And yes, other mods are used, but this log has been shared by a user of our mod, I'll investigate a bit which mod is problematic