Closed WhalerP closed 8 months ago
I browsed through the code and it seems that the bsm_lastRoll
member is somehow being accessed on the server. I don't have time right now to browse through the chain of inheritance to figure out where this is happening. I suspect the culprit is the function at https://github.com/BloomhouseMC/Besmirchment/blob/f5693f2b516b70c85806e9fd4cf8551d609638d5/src/main/java/dev/mrsterner/besmirchment/mixin/LivingEntityMixin.java#L238C4-L238C4 being called on the server side, but since this is a mixin and an implementation of an interface, when this function is called isn't immediately obvious to me.
+1 I'm also having an issue on my server.
Besmirchment runs perfectly fine on servers with Fabric Loader 0.14.25. But it fails to run on servers with Fabric Loader 0.15.0 and above.
Fabric Loader 0.15.0 fixed environment annotation stripping for fields. It must have to do with the @Environment(EnvType.CLIENT)
annotation here.
I think the fix is to remove any @Environment(EnvType.CLIENT)
, restoring the behaviour where Fabric Loader ignored it. I think the right way to do environment-only mixins is to have two completely separate mixins: one for common, one for client.
See https://github.com/MoriyaShiine/extra-origins/commit/e6d4cd4ab32adc7114e420926e3b358ad65acaf7 for example
@Poopooracoocoo I can confirm this solves the issue. I compiled a custom version that does this about a week ago and have been running it on the server without issue. Notably, this fix only needs to be applied on the server .jar, so it didn't require modifying the client modpack at all.
Also to note, there is another field that will raise this error if not also stripped of its environment annotation: https://github.com/BloomhouseMC/Besmirchment/blob/f5693f2b516b70c85806e9fd4cf8551d609638d5/src/main/java/dev/mrsterner/besmirchment/mixin/PlayerEntityMixin.java#L56-L57
If I remember correctly, these are the only two modifications I had to make.
I think the right way to do environment-only mixins is to have two completely separate mixins: one for common, one for client.
I agree this is probably correct. Since the issue is caused by the initializer not being removed while the field is, I attempted a few things like making a second constructor that only runs on the client and manually initializes the member there, but everything I tried ended up with compile errors due to the stripping happening at runtime. I actually used the solution you came up with as a last resort after not being able to figure out how to do it correctly, and I had not thought of your suggestion.
Note that removing only the @Environment(EnvType.CLIENT)
annotations in LivingEntityMixin.java
and playerentitymixin.java
results in a java.lang.NoSuchFieldError: jumpBeginProgress
crash on the server when a Werepyre is spawned. There's more that needs to be removed.
You need to remove the environment annotations in the following mixins:
https://github.com/BloomhouseMC/Besmirchment/blob/f5693f2b516b70c85806e9fd4cf8551d609638d5/src/main/java/dev/mrsterner/besmirchment/mixin/DemonEntityMixin.java#L177 https://github.com/BloomhouseMC/Besmirchment/blob/f5693f2b516b70c85806e9fd4cf8551d609638d5/src/main/java/dev/mrsterner/besmirchment/mixin/BewitchmentAPIMixin.java#L33 https://github.com/BloomhouseMC/Besmirchment/blob/f5693f2b516b70c85806e9fd4cf8551d609638d5/src/main/java/dev/mrsterner/besmirchment/mixin/MobEntityMixin.java#L22 https://github.com/BloomhouseMC/Besmirchment/blob/f5693f2b516b70c85806e9fd4cf8551d609638d5/src/main/java/dev/mrsterner/besmirchment/mixin/PlayerEntityMixin.java#L56 https://github.com/BloomhouseMC/Besmirchment/blob/f5693f2b516b70c85806e9fd4cf8551d609638d5/src/main/java/dev/mrsterner/besmirchment/mixin/PlayerEntityMixin.java#L159 https://github.com/BloomhouseMC/Besmirchment/blob/f5693f2b516b70c85806e9fd4cf8551d609638d5/src/main/java/dev/mrsterner/besmirchment/mixin/LivingEntityMixin.java#L62 https://github.com/BloomhouseMC/Besmirchment/blob/f5693f2b516b70c85806e9fd4cf8551d609638d5/src/main/java/dev/mrsterner/besmirchment/common/transformation/WerepyreAccessor.java#L13 https://github.com/BloomhouseMC/Besmirchment/blob/f5693f2b516b70c85806e9fd4cf8551d609638d5/src/main/java/dev/mrsterner/besmirchment/common/entity/interfaces/TameableDemon.java#L31 https://github.com/BloomhouseMC/Besmirchment/blob/f5693f2b516b70c85806e9fd4cf8551d609638d5/src/main/java/dev/mrsterner/besmirchment/common/item/DemonicDeedItem.java#L30 https://github.com/BloomhouseMC/Besmirchment/blob/f5693f2b516b70c85806e9fd4cf8551d609638d5/src/main/java/dev/mrsterner/besmirchment/common/entity/WerepyreEntity.java#L40 https://github.com/BloomhouseMC/Besmirchment/blob/f5693f2b516b70c85806e9fd4cf8551d609638d5/src/main/java/dev/mrsterner/besmirchment/common/packet/LichRevivePacket.java#L36 https://github.com/BloomhouseMC/Besmirchment/blob/f5693f2b516b70c85806e9fd4cf8551d609638d5/src/main/java/dev/mrsterner/besmirchment/common/entity/InfectiousSpitEntity.java#L43 https://github.com/BloomhouseMC/Besmirchment/blob/f5693f2b516b70c85806e9fd4cf8551d609638d5/src/main/java/dev/mrsterner/besmirchment/common/entity/LichGemItem.java#L26 https://github.com/BloomhouseMC/Besmirchment/blob/f5693f2b516b70c85806e9fd4cf8551d609638d5/src/main/java/dev/mrsterner/besmirchment/common/packet/SparklePacket.java#L32
I've gone and compiled it: https://github.com/Poopooracoocoo/Besmirchment-fork/releases
Can someone help me with this fix on 1.19.2? I have no idea how to code.
Can someone help me with this fix on 1.19.2? I have no idea how to code.
It should be relatively safe to remove the mod from your world. That's where I'm ending up, I guess.
I fixed it for 1.19.2 but I honestly cant be bothered to make a github page for it, so heres the jar: https://www.mediafire.com/file/6wf2f64ubhfixjj/besmirchment-1.19.2-11.jar/file https://we.tl/t-Q40LmMSYmS https://file.io/gHXbCN3wlYCB https://filetransfer.io/data-package/2EK1etPH#link
https://drive.google.com/file/d/1XUBfNUe454gAcLt7891Yty03LMFJaSN-/view?usp=drive_link
also if anyone is wondering how, I just did what Poopooracoocoo said to do so all credits to him
(also I use multiple upload sites just incase one doesnt work anymore)
Hey there, I was running besmirchment 2 version 1.20.1-2 and it crashed my server upon launch. Error Specified was something with 'java.lang.NoSuchFieldError: bsm_lastRoll' as it seems that it could not either access it or find it. I will be linking the associated crash log file. 2024-01-03-6.log