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