Class WrenchHelpers
java.lang.Object
org.cyclops.integrateddynamics.core.helper.WrenchHelpers
Helper methods related to items.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceAn action that can serve as wrenching.static classAn action that can serve as wrenching. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final net.minecraft.tags.TagKey<net.minecraft.world.item.Item> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisWrench(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 voidwrench(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> voidwrench(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.
-
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 theisWrench(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 theisWrench(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.
-