Class WrenchHelpers

java.lang.Object
org.cyclops.integrateddynamics.core.helper.WrenchHelpers

public final class WrenchHelpers extends Object
Helper methods related to items.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static interface 
    An action that can serve as wrenching.
    static class 
    An action that can serve as wrenching.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final net.minecraft.tags.TagKey<net.minecraft.world.item.Item>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    isWrench(net.minecraft.world.entity.player.Player player, net.minecraft.world.item.ItemStack heldItem, net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, net.minecraft.core.Direction side)
    Checks if the given player can wrench something.
    static void
    wrench(net.minecraft.world.entity.player.Player player, net.minecraft.world.item.ItemStack heldItem, net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, net.minecraft.core.Direction side, WrenchHelpers.IWrenchAction<Void> action)
    Wrench a given position.
    static <P> void
    wrench(net.minecraft.world.entity.player.Player player, net.minecraft.world.item.ItemStack heldItem, net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, net.minecraft.core.Direction side, WrenchHelpers.IWrenchAction<P> action, P parameter)
    Wrench a given position.

    Methods inherited from class java.lang.Object

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

    • TAG_WRENCH

      public static final net.minecraft.tags.TagKey<net.minecraft.world.item.Item> TAG_WRENCH
  • Constructor Details

    • WrenchHelpers

      public WrenchHelpers()
  • Method Details

    • isWrench

      public static boolean isWrench(net.minecraft.world.entity.player.Player player, net.minecraft.world.item.ItemStack heldItem, net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, @Nullable net.minecraft.core.Direction side)
      Checks if the given player can wrench something.
      Parameters:
      player - The player.
      heldItem - The item the player is holding.
      world - The world in which the wrenching is happening.
      pos - The position that is being wrenched.
      side - The side that is being wrenched.
      Returns:
      If the wrenching can continue with the held item.
    • wrench

      public static <P> void wrench(net.minecraft.world.entity.player.Player player, net.minecraft.world.item.ItemStack heldItem, net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, net.minecraft.core.Direction side, WrenchHelpers.IWrenchAction<P> action, P parameter)
      Wrench a given position. Requires the isWrench(Player, ItemStack, Level, BlockPos, Direction) to be passed. Takes an extra parameter of any type that is forwarded to the wrench action.
      Type Parameters:
      P - The type of parameter to pass.
      Parameters:
      player - The player.
      heldItem - The item the player is holding.
      world - The world in which the wrenching is happening.
      pos - The position that is being wrenched.
      side - The side that is being wrenched.
      action - The actual wrench action.
      parameter - An extra parameter that is forwarded to the action.
    • wrench

      public static void wrench(net.minecraft.world.entity.player.Player player, net.minecraft.world.item.ItemStack heldItem, net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, net.minecraft.core.Direction side, WrenchHelpers.IWrenchAction<Void> action)
      Wrench a given position. Requires the isWrench(Player, ItemStack, Level, BlockPos, Direction) to be passed.
      Parameters:
      player - The player.
      heldItem - The item the player is holding.
      world - The world in which the wrenching is happening.
      pos - The position that is being wrenched.
      side - The side that is being wrenched.
      action - The actual wrench action.