diff --git a/SpongeAPI b/SpongeAPI index 26492d4356d..e2d8085fa82 160000 --- a/SpongeAPI +++ b/SpongeAPI @@ -1 +1 @@ -Subproject commit 26492d4356d264efa4d8c95ca84854f95606fbf2 +Subproject commit e2d8085fa823b19c8de7e58d46e1a1efae2799c7 diff --git a/src/main/java/org/spongepowered/common/event/tracking/phase/packet/PacketPhaseUtil.java b/src/main/java/org/spongepowered/common/event/tracking/phase/packet/PacketPhaseUtil.java index aea3d5d144c..db98191c158 100644 --- a/src/main/java/org/spongepowered/common/event/tracking/phase/packet/PacketPhaseUtil.java +++ b/src/main/java/org/spongepowered/common/event/tracking/phase/packet/PacketPhaseUtil.java @@ -92,7 +92,7 @@ public static void handleSlotRestore(@Nullable final Player player, final @Nulla final org.spongepowered.api.item.inventory.Slot slot = slotTransaction.slot(); final ItemStackSnapshot snapshot = eventCancelled || !slotTransaction.isValid() ? slotTransaction.original() : slotTransaction.custom().get(); if (containerMenu == null || slot.viewedSlot() instanceof Slot) { - slot.set(snapshot.asMutable()); + slot.set(snapshot); } else if (player instanceof ServerPlayer serverPlayer && containerMenu != player.inventoryMenu && serverPlayer.inventory().containsInventory(slot)) { final org.spongepowered.api.item.inventory.ItemStack stack = snapshot.asMutable(); diff --git a/src/main/java/org/spongepowered/common/inventory/InventoryTransactionResultImpl.java b/src/main/java/org/spongepowered/common/inventory/InventoryTransactionResultImpl.java index 1cf39ad0bb4..38317b9c96f 100644 --- a/src/main/java/org/spongepowered/common/inventory/InventoryTransactionResultImpl.java +++ b/src/main/java/org/spongepowered/common/inventory/InventoryTransactionResultImpl.java @@ -28,7 +28,6 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; import org.checkerframework.checker.nullness.qual.Nullable; -import org.spongepowered.api.item.inventory.ItemStack; import org.spongepowered.api.item.inventory.ItemStackLike; import org.spongepowered.api.item.inventory.ItemStackSnapshot; import org.spongepowered.api.item.inventory.transaction.InventoryTransactionResult; diff --git a/src/main/java/org/spongepowered/common/inventory/adapter/impl/AdapterLogic.java b/src/main/java/org/spongepowered/common/inventory/adapter/impl/AdapterLogic.java index 6ab2d5548f4..dedae4cc143 100644 --- a/src/main/java/org/spongepowered/common/inventory/adapter/impl/AdapterLogic.java +++ b/src/main/java/org/spongepowered/common/inventory/adapter/impl/AdapterLogic.java @@ -109,7 +109,7 @@ public static InventoryTransactionResult.Poll pollSequential(Fabric fabric, @Nul removedType.setQuantity(totalPolled); } - return result.poll(removedType.asImmutable()).build(); + return result.poll(removedType).build(); } public static Optional peekSequential(Fabric fabric, @Nullable Lens lens) { diff --git a/src/main/java/org/spongepowered/common/inventory/adapter/impl/slots/FilteringSlotAdapter.java b/src/main/java/org/spongepowered/common/inventory/adapter/impl/slots/FilteringSlotAdapter.java index 4bb84163a6d..55bc5c8e004 100644 --- a/src/main/java/org/spongepowered/common/inventory/adapter/impl/slots/FilteringSlotAdapter.java +++ b/src/main/java/org/spongepowered/common/inventory/adapter/impl/slots/FilteringSlotAdapter.java @@ -32,7 +32,6 @@ import org.spongepowered.api.item.inventory.transaction.InventoryTransactionResult; import org.spongepowered.common.inventory.fabric.Fabric; import org.spongepowered.common.inventory.lens.impl.slot.FilteringSlotLens; -import org.spongepowered.common.item.util.ItemStackUtil; public class FilteringSlotAdapter extends SlotAdapter implements FilteringSlot { diff --git a/src/main/java/org/spongepowered/common/inventory/adapter/impl/slots/HeldSlotAdapter.java b/src/main/java/org/spongepowered/common/inventory/adapter/impl/slots/HeldSlotAdapter.java index fdbcf3632bd..03cb0814e44 100644 --- a/src/main/java/org/spongepowered/common/inventory/adapter/impl/slots/HeldSlotAdapter.java +++ b/src/main/java/org/spongepowered/common/inventory/adapter/impl/slots/HeldSlotAdapter.java @@ -26,14 +26,12 @@ import org.spongepowered.api.item.ItemType; import org.spongepowered.api.item.inventory.Inventory; -import org.spongepowered.api.item.inventory.ItemStack; import org.spongepowered.api.item.inventory.ItemStackLike; import org.spongepowered.api.item.inventory.equipment.EquipmentType; import org.spongepowered.api.item.inventory.slot.EquipmentSlot; import org.spongepowered.api.item.inventory.transaction.InventoryTransactionResult; import org.spongepowered.common.inventory.fabric.Fabric; import org.spongepowered.common.inventory.lens.impl.slot.HeldHandSlotLens; -import org.spongepowered.common.item.util.ItemStackUtil; import java.util.function.Predicate; diff --git a/src/main/java/org/spongepowered/common/inventory/lens/impl/slot/EquipmentSlotLens.java b/src/main/java/org/spongepowered/common/inventory/lens/impl/slot/EquipmentSlotLens.java index 0af32460cec..e63fe04826a 100644 --- a/src/main/java/org/spongepowered/common/inventory/lens/impl/slot/EquipmentSlotLens.java +++ b/src/main/java/org/spongepowered/common/inventory/lens/impl/slot/EquipmentSlotLens.java @@ -52,7 +52,7 @@ private static FilteringSlotLens.ItemStackFilter equipmentTypeFilter(EquipmentTy if (item.isEmpty()) { return true; } - final var equipable = Equipable.get(ItemStackUtil.toNative(item)); + final var equipable = Equipable.get(ItemStackUtil.fromLikeToNative(item)); final var itemSlotType = equipable != null ? equipable.getEquipmentSlot() : EquipmentSlot.MAINHAND; return itemSlotType == (Object) type; }; diff --git a/src/main/java/org/spongepowered/common/inventory/lens/impl/slot/FilteringSlotLens.java b/src/main/java/org/spongepowered/common/inventory/lens/impl/slot/FilteringSlotLens.java index 54c9a27e42d..cb1e0731a35 100644 --- a/src/main/java/org/spongepowered/common/inventory/lens/impl/slot/FilteringSlotLens.java +++ b/src/main/java/org/spongepowered/common/inventory/lens/impl/slot/FilteringSlotLens.java @@ -26,7 +26,6 @@ import net.minecraft.world.Container; import org.spongepowered.api.item.inventory.Inventory; -import org.spongepowered.api.item.inventory.ItemStack; import org.spongepowered.api.item.inventory.ItemStackLike; import org.spongepowered.api.item.inventory.Slot; import org.spongepowered.common.bridge.world.inventory.InventoryBridge; diff --git a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/item/enchantment/EnchantmentMixin_API.java b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/item/enchantment/EnchantmentMixin_API.java index 8ed9fe87cf3..3b20df6735d 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/item/enchantment/EnchantmentMixin_API.java +++ b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/item/enchantment/EnchantmentMixin_API.java @@ -28,7 +28,6 @@ import net.minecraft.core.Holder; import net.minecraft.world.item.enchantment.Enchantment; import org.spongepowered.api.item.enchantment.EnchantmentType; -import org.spongepowered.api.item.inventory.ItemStack; import org.spongepowered.api.item.inventory.ItemStackLike; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; diff --git a/src/mixins/java/org/spongepowered/common/mixin/inventory/api/world/inventory/SlotMixin_Inventory_API.java b/src/mixins/java/org/spongepowered/common/mixin/inventory/api/world/inventory/SlotMixin_Inventory_API.java index 1b9a0ef5ae4..16790079ee4 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/inventory/api/world/inventory/SlotMixin_Inventory_API.java +++ b/src/mixins/java/org/spongepowered/common/mixin/inventory/api/world/inventory/SlotMixin_Inventory_API.java @@ -27,7 +27,6 @@ import net.minecraft.world.Container; import net.minecraft.world.inventory.Slot; import org.spongepowered.api.item.inventory.Inventory; -import org.spongepowered.api.item.inventory.ItemStack; import org.spongepowered.api.item.inventory.ItemStackLike; import org.spongepowered.api.item.inventory.ItemStackSnapshot; import org.spongepowered.api.item.inventory.transaction.InventoryTransactionResult;