AstralSorcery icon indicating copy to clipboard operation
AstralSorcery copied to clipboard

Resplendent Prism adding enchantment levels to armor when adding cosmetic circles via Mahoujin Projector

Open stepsword opened this issue 3 years ago • 1 comments

Hi, I'm the Mahou dev, recently a player reported that they were able to get infinite protection levels on their armor by doing the following:

To replicate:

  1. Get Mahou Tsukai and Astral Sorcery
  2. Get a resplendent prism which adds levels to protection, and wear it.
  3. Put down a mahoujin projector from mahou
  4. Right click with the armor on the projector, and get free levels.

The projector adds an enchantment to the armor when right clicking, and having that enchant lets the cosmetic circle display on the armor. This seems to be triggering the Resplendent Prism to add free levels of stuff to the item.

Here is my code for adding the enchantment, if it's helpful:

public static void addEnchantment(ItemStack s, Enchantment e, int value) {
    Map<Enchantment, Integer> enchants = EnchantmentHelper.getEnchantments(s);
    enchants.put(e,value);
    EnchantmentHelper.setEnchantments(enchants,s);
}

I guess this may be a slightly abnormal way of adding enchantments to items, but would it be possible to get a config or tag or something so people can blacklist specific problematic enchants from triggering this interaction?

stepsword avatar Feb 17 '22 03:02 stepsword

Uhm, well the hook for the resplendent prism's addition of enchantments is during EnchantmentHelper.getEnchantments(s); So you could derive the enchantments from NBT directly yourself instead of doing getEnchantments and that would solve it.

HellFirePvP avatar May 29 '22 17:05 HellFirePvP