Eternal Starlight

Eternal Starlight

5M Downloads

Attribute Load Order issue

Noaaan opened this issue ยท 1 comments

commented

Originally found in Noaaan/MythicMetals#259

The method which adds attributes for LivingEntities is cancellable, meaning depending on what order mods load in, it could cause attributes from other mods to be misisng.

@Inject(method = "createLivingAttributes", at = @At("RETURN"), cancellable = true)
private static void createLivingAttributes(CallbackInfoReturnable<AttributeSupplier.Builder> cir) {
cir.setReturnValue(cir.getReturnValue().add(ESAttributes.THROWN_POTION_DISTANCE.asHolder()).add(ESAttributes.ETHER_RESISTANCE.asHolder()));

The fix for this is quite simple - adding to the return value simply works, as the map is mutable in this state.
See https://github.com/Noaaan/MythicMetals/blob/5673317bb5401a631db4c960b103e9e71339761e/src/main/java/nourl/mythicmetals/mixin/LivingEntityMixin.java#L98-L101

commented

Thanks for reporting! But it seems to be already fixed here. It should be fixed in 0.1.6.