infernalstudios / Sortilege

Simple magic staffs, enchanting and brewing tweaks, and more!
https://www.curseforge.com/minecraft/mc-mods/sortilege
Other
5 stars 4 forks source link

Compatibility issues with ProbeJS #2

Open Rimevel opened 9 months ago

Rimevel commented 9 months ago

Forge 1.19.2 Mod version: 1.0

Using the /probejs dump command to generate typings errors out consistently with Sortilage in the same pack. This seem to be related to Sortilege antidotes.

See link for more info: https://github.com/Prunoideae/ProbeJS/issues/56

Prunoideae commented 9 months ago

This can be fixed on the ProbeJS side by adding a try-catch here. But I noticed that in your code

https://github.com/infernalstudios/Sortilege/blob/9dd3902bae84af0b5537351dabeb6dc1a9866b0f/src/main/java/net/lyof/sortilege/items/custom/potion/AntidotePotionItem.java#L45

has an assertion of the Potion must have at least one effect, where the potion can actually have none considering intermediate potions like Potions.WATER or Potions.AWKWARD:

    EMPTY = register(EMPTY_ID, new Potion(new MobEffectInstance[0]));
    WATER = register("water", new Potion(new MobEffectInstance[0]));
    MUNDANE = register("mundane", new Potion(new MobEffectInstance[0]));
    THICK = register("thick", new Potion(new MobEffectInstance[0]));
    AWKWARD = register("awkward", new Potion(new MobEffectInstance[0]));

The default instance of a Potion item is the water bottle, so that's why an exception is thrown.