mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-24 05:47:59 +01:00
Fixed not being able to equip amulets, bracelets, and necklaces when trinkets is not installed
This commit is contained in:
parent
e45ec6e1ff
commit
c8dc41a68e
2 changed files with 4 additions and 3 deletions
|
@ -6,6 +6,7 @@ import java.util.stream.Stream;
|
||||||
|
|
||||||
import com.minelittlepony.unicopia.EntityConvertable;
|
import com.minelittlepony.unicopia.EntityConvertable;
|
||||||
import com.minelittlepony.unicopia.container.SpellbookScreenHandler;
|
import com.minelittlepony.unicopia.container.SpellbookScreenHandler;
|
||||||
|
|
||||||
import net.fabricmc.loader.api.FabricLoader;
|
import net.fabricmc.loader.api.FabricLoader;
|
||||||
import net.minecraft.entity.EquipmentSlot;
|
import net.minecraft.entity.EquipmentSlot;
|
||||||
import net.minecraft.entity.LivingEntity;
|
import net.minecraft.entity.LivingEntity;
|
||||||
|
@ -67,7 +68,7 @@ public interface TrinketsDelegate {
|
||||||
}
|
}
|
||||||
|
|
||||||
default Set<Identifier> getAvailableTrinketSlots(LivingEntity entity, Set<Identifier> probedSlots) {
|
default Set<Identifier> getAvailableTrinketSlots(LivingEntity entity, Set<Identifier> probedSlots) {
|
||||||
return probedSlots.stream().filter(slot -> getEquipped(entity, slot).count() == 0).collect(Collectors.toSet());
|
return probedSlots.stream().filter(slot -> getEquipped(entity, slot).anyMatch(ItemStack::isEmpty)).collect(Collectors.toSet());
|
||||||
}
|
}
|
||||||
|
|
||||||
default Stream<ItemStack> getEquipped(LivingEntity entity, Identifier slot) {
|
default Stream<ItemStack> getEquipped(LivingEntity entity, Identifier slot) {
|
||||||
|
|
|
@ -51,11 +51,11 @@ public abstract class WearableItem extends Item implements Equipment {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public final EquipmentSlot getSlotType() {
|
public final EquipmentSlot getSlotType() {
|
||||||
return EquipmentSlot.OFFHAND;
|
return getSlotType(getDefaultStack());
|
||||||
}
|
}
|
||||||
|
|
||||||
public EquipmentSlot getSlotType(ItemStack stack) {
|
public EquipmentSlot getSlotType(ItemStack stack) {
|
||||||
return getSlotType();
|
return EquipmentSlot.OFFHAND;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean dispenseArmor(BlockPointer pointer, ItemStack armor) {
|
public static boolean dispenseArmor(BlockPointer pointer, ItemStack armor) {
|
||||||
|
|
Loading…
Reference in a new issue