mirror of
https://github.com/architectury/architectury-api.git
synced 2026-03-28 03:56:59 -05:00
Add getCustomEquipmentSlot
This commit is contained in:
@@ -20,10 +20,12 @@
|
||||
package me.shedaniel.architectury.mixin.forge;
|
||||
|
||||
import me.shedaniel.architectury.extensions.ItemExtension;
|
||||
import net.minecraft.world.entity.EquipmentSlot;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraftforge.common.extensions.IForgeItem;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
|
||||
@Mixin(ItemExtension.class)
|
||||
@@ -32,4 +34,10 @@ public interface MixinItemExtension extends IForgeItem {
|
||||
default void onArmorTick(ItemStack stack, Level world, Player player) {
|
||||
((ItemExtension) this).tickArmor(stack, player);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
default EquipmentSlot getEquipmentSlot(ItemStack stack) {
|
||||
return ((ItemExtension) this).getCustomEquipmentSlot(stack);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user