Class CuriosUtils
java.lang.Object
me.desht.pneumaticcraft.common.thirdparty.curios.CuriosUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidchargeItems(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.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 predicatestatic net.minecraft.world.item.ItemStackGet the curio item in the given curios inventory at the given slotstatic net.minecraftforge.items.IItemHandlermakeCombinedInvWrapper(net.minecraft.world.entity.player.Player player)
-
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 playerenergyStorage- source energy storagemaxTransfer- 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 playerinvId- id of the curios inventory in questionslot- 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 playerpredicate- 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)
-