Class ContainerHelper
java.lang.Object
net.ixdarklord.coolcatcore.api.utils.ContainerHelper
Utility class providing convenience methods for working with
Container and Player inventories.
Includes item search, filtering, equality, and hashing utilities that simplify inventory-related logic.-
Method Summary
Modifier and TypeMethodDescriptionstatic booleancontainsItem(net.minecraft.world.Container container, net.minecraft.world.item.Item item) static booleancontainsItem(net.minecraft.world.entity.player.Player player, net.minecraft.world.item.Item item) static booleanequals(net.minecraft.world.Container a, net.minecraft.world.Container b) static booleanequals(net.minecraft.world.entity.player.Player a, net.minecraft.world.entity.player.Player b) static intfindFirstSlotWithItem(net.minecraft.world.Container container, net.minecraft.world.item.Item item) static intfindFirstSlotWithItem(net.minecraft.world.entity.player.Player player, net.minecraft.world.item.Item item) static List<SlotReference.Container> getAllMatchingSlots(net.minecraft.world.Container container, Predicate<net.minecraft.world.item.ItemStack> predicate) static List<SlotReference.Container> getAllMatchingSlots(net.minecraft.world.Container container, net.minecraft.world.item.Item item) static List<SlotReference.Player> getAllMatchingSlots(net.minecraft.world.entity.player.Player player, Predicate<net.minecraft.world.item.ItemStack> predicate) static List<SlotReference.Player> getAllMatchingSlots(net.minecraft.world.entity.player.Player player, net.minecraft.world.item.Item item) static List<net.minecraft.world.item.ItemStack> getAllMatchingStacks(net.minecraft.world.Container container, Predicate<net.minecraft.world.item.ItemStack> predicate) static List<net.minecraft.world.item.ItemStack> getAllMatchingStacks(net.minecraft.world.Container container, net.minecraft.world.item.Item item) static List<net.minecraft.world.item.ItemStack> getAllMatchingStacks(net.minecraft.world.entity.player.Player player, Predicate<net.minecraft.world.item.ItemStack> predicate) static List<net.minecraft.world.item.ItemStack> getAllMatchingStacks(net.minecraft.world.entity.player.Player player, net.minecraft.world.item.Item item) static net.minecraft.core.NonNullList<net.minecraft.world.item.ItemStack> getItems(net.minecraft.world.Container container) static net.minecraft.core.NonNullList<net.minecraft.world.item.ItemStack> getItems(net.minecraft.world.entity.player.Player player) static inthashCode(net.minecraft.world.Container container) static inthashCode(net.minecraft.world.entity.player.Player player)
-
Method Details
-
containsItem
public static boolean containsItem(net.minecraft.world.Container container, net.minecraft.world.item.Item item) -
findFirstSlotWithItem
public static int findFirstSlotWithItem(net.minecraft.world.Container container, net.minecraft.world.item.Item item) -
getAllMatchingStacks
public static List<net.minecraft.world.item.ItemStack> getAllMatchingStacks(net.minecraft.world.Container container, net.minecraft.world.item.Item item) -
getAllMatchingStacks
-
getAllMatchingSlots
public static List<SlotReference.Container> getAllMatchingSlots(net.minecraft.world.Container container, net.minecraft.world.item.Item item) -
getAllMatchingSlots
public static List<SlotReference.Container> getAllMatchingSlots(net.minecraft.world.Container container, Predicate<net.minecraft.world.item.ItemStack> predicate) -
getItems
public static net.minecraft.core.NonNullList<net.minecraft.world.item.ItemStack> getItems(net.minecraft.world.Container container) -
equals
public static boolean equals(net.minecraft.world.Container a, net.minecraft.world.Container b) -
hashCode
public static int hashCode(net.minecraft.world.Container container) -
containsItem
public static boolean containsItem(net.minecraft.world.entity.player.Player player, net.minecraft.world.item.Item item) -
findFirstSlotWithItem
public static int findFirstSlotWithItem(net.minecraft.world.entity.player.Player player, net.minecraft.world.item.Item item) -
getAllMatchingStacks
public static List<net.minecraft.world.item.ItemStack> getAllMatchingStacks(net.minecraft.world.entity.player.Player player, net.minecraft.world.item.Item item) -
getAllMatchingStacks
-
getAllMatchingSlots
public static List<SlotReference.Player> getAllMatchingSlots(net.minecraft.world.entity.player.Player player, net.minecraft.world.item.Item item) -
getAllMatchingSlots
public static List<SlotReference.Player> getAllMatchingSlots(net.minecraft.world.entity.player.Player player, Predicate<net.minecraft.world.item.ItemStack> predicate) -
getItems
public static net.minecraft.core.NonNullList<net.minecraft.world.item.ItemStack> getItems(net.minecraft.world.entity.player.Player player) -
equals
public static boolean equals(net.minecraft.world.entity.player.Player a, net.minecraft.world.entity.player.Player b) -
hashCode
public static int hashCode(net.minecraft.world.entity.player.Player player)
-