java.lang.Object
me.desht.pneumaticcraft.common.thirdparty.curios.CuriosUtils

public class CuriosUtils extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    chargeItems(net.minecraft.world.entity.player.Player player, PneumaticEnergyStorage energyStorage, int maxTransfer)
    Supply Forge Energy from the given energy storage to all Curio items the player has.
    static org.apache.commons.lang3.tuple.Pair<String,Integer>
    findStack(net.minecraft.world.entity.player.Player player, Predicate<net.minecraft.world.item.ItemStack> predicate)
    Try to find a curio item on the player matching the given predicate
    static net.minecraft.world.item.ItemStack
    getStack(net.minecraft.world.entity.player.Player player, String invId, int slot)
    Get the curio item in the given curios inventory at the given slot
    static net.minecraftforge.items.IItemHandler
    makeCombinedInvWrapper(net.minecraft.world.entity.player.Player player)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CuriosUtils

      public CuriosUtils()
  • Method Details

    • chargeItems

      public static void chargeItems(net.minecraft.world.entity.player.Player player, PneumaticEnergyStorage energyStorage, int maxTransfer)
      Supply Forge Energy from the given energy storage to all Curio items the player has.
      Parameters:
      player - the player
      energyStorage - source energy storage
      maxTransfer - max amount to transfer per item
    • getStack

      public static net.minecraft.world.item.ItemStack getStack(net.minecraft.world.entity.player.Player player, String invId, int slot)
      Get the curio item in the given curios inventory at the given slot
      Parameters:
      player - the player
      invId - id of the curios inventory in question
      slot - slot in the given curios inventory
      Returns:
      stack in that slot
    • findStack

      public static org.apache.commons.lang3.tuple.Pair<String,Integer> findStack(net.minecraft.world.entity.player.Player player, Predicate<net.minecraft.world.item.ItemStack> predicate)
      Try to find a curio item on the player matching the given predicate
      Parameters:
      player - the player
      predicate - an itemstack matching predicate
      Returns:
      a pair of (inventory id and slot), or null if no match
    • makeCombinedInvWrapper

      public static net.minecraftforge.items.IItemHandler makeCombinedInvWrapper(@Nonnull net.minecraft.world.entity.player.Player player)