Skip to content

Commit

Permalink
feat(mixin): mixin enchantment to get valid slots
Browse files Browse the repository at this point in the history
  • Loading branch information
WakelessSloth56 committed Sep 17, 2022
1 parent 6bb8a8b commit c795bcf
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
@@ -0,0 +1,7 @@
package org.auioc.mcmod.arnicalib.api.mixin.common;

import org.auioc.mcmod.arnicalib.api.game.enchantment.IValidSlotsVisibleEnchantment;

public interface IMixinEnchantment extends IValidSlotsVisibleEnchantment {

}
@@ -0,0 +1,22 @@
package org.auioc.mcmod.arnicalib.mixin.common;

import org.auioc.mcmod.arnicalib.api.mixin.common.IMixinEnchantment;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import net.minecraft.world.entity.EquipmentSlot;
import net.minecraft.world.item.enchantment.Enchantment;

@Mixin(value = Enchantment.class)
public class MixinEnchantment implements IMixinEnchantment {

@Shadow
@Final
private EquipmentSlot[] slots;

@Override
public EquipmentSlot[] getValidSlots() {
return this.slots;
}

}
1 change: 1 addition & 0 deletions src/main/resources/arnicalib.mixin.json
Expand Up @@ -11,6 +11,7 @@
"common.MixinProjectile",
"common.MixinArrow",
"common.MixinFoodData",
"common.MixinEnchantment",
"server.MixinServerLifecycleHooks",
"server.MixinLootContext",
"server.MixinPiglinAi",
Expand Down

0 comments on commit c795bcf

Please sign in to comment.