Make patch to MagicalScrubber to stop a server crash loop

This commit is contained in:
zontreck 2024-05-07 19:20:00 -07:00
parent a83fda1f01
commit 85b5228d27
2 changed files with 4 additions and 2 deletions

View file

@ -47,7 +47,7 @@ mod_name=Thresholds
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
mod_license=GPLv3
# The mod version. See https://semver.org/
mod_version=1201.4.043024.0441
mod_version=1201.4.050724.1919
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
# This should match the base package used for the mod sources.
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html

View file

@ -25,6 +25,7 @@ import net.minecraft.world.item.EnchantedBookItem;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Items;
import net.minecraft.world.item.enchantment.Enchantment;
import net.minecraft.world.item.enchantment.EnchantmentHelper;
import net.minecraft.world.item.enchantment.EnchantmentInstance;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.entity.BlockEntity;
@ -254,7 +255,8 @@ public class MagicalScrubberBlockEntity extends BlockEntity implements MenuProvi
ItemStack main = entity.itemsHandler.getStackInSlot(0);
//Map<Enchantment, Integer> enchants = main.getAllEnchantments();
Map<Enchantment, Integer> enchantments = ItemUtils.getEnchantments(main.copy());
Map<Enchantment, Integer> enchantments = EnchantmentHelper.getEnchantments(main.copy());
if(!main.is(ModItems.PARTIAL_ITEM.get()))
{