Class CogwheelBlockItem.DiagonalCogHelper
java.lang.Object
com.simibubi.create.content.contraptions.relays.elementary.CogwheelBlockItem.DiagonalCogHelper
- All Implemented Interfaces:
IPlacementHelper
- Enclosing class:
- CogwheelBlockItem
public abstract static class CogwheelBlockItem.DiagonalCogHelper
extends Object
implements IPlacementHelper
-
Field Summary
Fields inherited from interface com.simibubi.create.foundation.utility.placement.IPlacementHelper
ID -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetOffset(net.minecraft.world.entity.player.Player player, net.minecraft.world.level.Level world, net.minecraft.world.level.block.state.BlockState state, net.minecraft.core.BlockPos pos, net.minecraft.world.phys.BlockHitResult ray) Predicate<net.minecraft.world.level.block.state.BlockState>protected booleanhitOnShaft(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.phys.BlockHitResult ray) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.simibubi.create.foundation.utility.placement.IPlacementHelper
displayGhost, getItemPredicate, getOffset, matchesItem, matchesState, renderAt
-
Constructor Details
-
DiagonalCogHelper
public DiagonalCogHelper()
-
-
Method Details
-
getStatePredicate
- Specified by:
getStatePredicatein interfaceIPlacementHelper- Returns:
- a predicate that gets tested with the blockstate the player is looking at
should return true if this placement helper is active with the given blockstate
-
getOffset
public PlacementOffset getOffset(net.minecraft.world.entity.player.Player player, net.minecraft.world.level.Level world, net.minecraft.world.level.block.state.BlockState state, net.minecraft.core.BlockPos pos, net.minecraft.world.phys.BlockHitResult ray) - Specified by:
getOffsetin interfaceIPlacementHelper- Parameters:
player- the player that activated the placement helperworld- the world that the placement helper got activated instate- the Blockstate of the Block that the player is looking at or clicked onpos- the position of the Block the player is looking at or clicked onray- the exact raytrace result- Returns:
- the PlacementOffset object describing where to place the new block.
UsePlacementOffset.fail()when no new position could be found.
UsePlacementOffset.success(Vec3i)with the new BlockPos to indicate a success and callPlacementOffset.withTransform(Function)if the blocks default state has to be modified before it is placed
-
hitOnShaft
protected boolean hitOnShaft(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.phys.BlockHitResult ray)
-