Apotheosis

Apotheosis

79M Downloads

Causes crashes in some enchantments

ViRb3 opened this issue ยท 8 comments

commented

Coming from AllTheMods/ATM-6#374, we have multiple reports of the Displacement enchantment from Ensorcellation crashing the server. After a conversation with the mod dev, it turns out that the Displacement mod only supports up to level 3, while Apotheosis allows it to reach to level 5 (and beyond), which causes unexpected behavior, and thus a crash. The mod author will add a check to prevent this, but this issue raises a more important question - is it safe to assume that all enchantments can scale infinitely? I can only imagine that a lot of other enchantments will have the same issue in some way or another. As suggested by the Ensorcellation dev, could you make it so that enchantments could opt in to the higher scaling, instead of having to opt out, or apply other forms or sanity checks?

commented

Realiatically speaking this would be up to the modpack developer to apply maximum levels such that the modpack functions within reason. The scaling cannot be opt-in as that would just make it a headache for people to use since it would no longer be automatic.

Recall that vanilla can attain enchantments above normal levels simply just by the /give command, and so the burden would fall on ensorcellation to not explode when the level is greater than 3.

commented

Hard disagree. I don't impose my bow enchantment functionality on other bows. Opt-in is not a headache.

And by your logic, vanilla allows enchantment levels which absolutely break various parts of the game. But they aren't obtainable without commands. You've circumvented that.

commented

This is the difference between a level and level > 3 ? 3 : level or Math.max(3, level) or a dev changing a config file. There's a reason there is a config file.

Making it opt in would be miserable for the vast majority of users who will never look at a config file in their life, as suddenly almost nothing would have an increased level cap anymore.

commented

Opt in by the devs, not by the packmakers. Seriously, make an API.

commented

I could make it opt-out at an api level, but opt-in? I don't have enough faith for most developers to bother, call me pessimistic about it, I guess.

An opt-out IMC message would be sufficient, I think

commented

That is reasonable enough I feel, yes.

commented

Alright, I'm away from a dev env for a while, but the spec will likely end up as sending over a regname list to opt out via nbt string array

commented

The enchantment module is now prepared to receive IMC messages on modid apotheosis at method set_ench_hard_cap.
It expects a single EnchantmentData per message that specifies an explicit hard cap for that enchantment.
858fd72