Daripher / Apothic-Curios

Compatibility bridge between Apotheosis and Curios mods
Other
0 stars 1 forks source link

Crash when reforging an unregistered curios type #9

Closed medsal15 closed 4 months ago

medsal15 commented 5 months ago

No idea whether this is a duplicate of #5 or a separate issue, but my game crashed when I tried to reforge Greed Of Nidhoggur from L2 Hostility

The error is java.lang.RuntimeException: Failed to locate any affixes for greed_of_nidhoggur{null} with category LootCategory[curios:hostility_curse] and rarity LootRarity{apotheosis:mythic}.

SiverDX commented 5 months ago

@Daripher personally I'm doing this

@Mixin(value = LootController.class, remap = false)
public abstract class MixinLootController {
    @Inject(method = "createLootItem(Lnet/minecraft/world/item/ItemStack;Lshadows/apotheosis/adventure/loot/LootCategory;Lshadows/apotheosis/adventure/loot/LootRarity;Lnet/minecraft/util/RandomSource;)Lnet/minecraft/world/item/ItemStack;", at = @At(value = "NEW", target = "(Ljava/lang/String;)Ljava/lang/RuntimeException;", shift = At.Shift.BEFORE), cancellable = true)
    private static void stopException(final ItemStack stack, final LootCategory category, final LootRarity rarity, final RandomSource random, final CallbackInfoReturnable<ItemStack> callback) {
        callback.setReturnValue(stack);
        TrialAndError.LOG.error("Failed to locate any affixes for [{} | {}] with category {} and rarity {}.", stack.getItem(), stack.getTag(), category, rarity);
    }
}
medsal15 commented 4 months ago

Fixed in 1.0.3b which no longer allows unreforgable curios in the reforging table