@MethodsReturnNonnullByDefault public abstract class PoleHelper<T extends java.lang.Comparable<T>> extends java.lang.Object implements IPlacementHelper
| Modifier and Type | Field and Description |
|---|---|
protected java.util.function.Function<net.minecraft.block.BlockState,net.minecraft.util.Direction.Axis> |
axisFunction |
protected net.minecraft.state.Property<T> |
property |
protected java.util.function.Predicate<net.minecraft.block.BlockState> |
statePredicate |
ID| Constructor and Description |
|---|
PoleHelper(java.util.function.Predicate<net.minecraft.block.BlockState> statePredicate,
java.util.function.Function<net.minecraft.block.BlockState,net.minecraft.util.Direction.Axis> axisFunction,
net.minecraft.state.Property<T> property) |
| Modifier and Type | Method and Description |
|---|---|
int |
attachedPoles(net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos,
net.minecraft.util.Direction direction) |
PlacementOffset |
getOffset(net.minecraft.entity.player.PlayerEntity player,
net.minecraft.world.World world,
net.minecraft.block.BlockState state,
net.minecraft.util.math.BlockPos pos,
net.minecraft.util.math.BlockRayTraceResult ray) |
java.util.function.Predicate<net.minecraft.block.BlockState> |
getStatePredicate() |
boolean |
matchesAxis(net.minecraft.block.BlockState state,
net.minecraft.util.Direction.Axis axis) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdisplayGhost, getItemPredicate, getOffset, matchesItem, matchesState, orderedByDistance, orderedByDistance, orderedByDistanceExceptAxis, orderedByDistanceExceptAxis, orderedByDistanceExceptAxis, orderedByDistanceExceptAxis, orderedByDistanceOnlyAxis, orderedByDistanceOnlyAxis, renderArrow, renderArrow, renderAtprotected final java.util.function.Predicate<net.minecraft.block.BlockState> statePredicate
protected final java.util.function.Function<net.minecraft.block.BlockState,net.minecraft.util.Direction.Axis> axisFunction
public PoleHelper(java.util.function.Predicate<net.minecraft.block.BlockState> statePredicate,
java.util.function.Function<net.minecraft.block.BlockState,net.minecraft.util.Direction.Axis> axisFunction,
net.minecraft.state.Property<T> property)
public boolean matchesAxis(net.minecraft.block.BlockState state,
net.minecraft.util.Direction.Axis axis)
public int attachedPoles(net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos,
net.minecraft.util.Direction direction)
public java.util.function.Predicate<net.minecraft.block.BlockState> getStatePredicate()
getStatePredicate in interface IPlacementHelperpublic PlacementOffset getOffset(net.minecraft.entity.player.PlayerEntity player, net.minecraft.world.World world, net.minecraft.block.BlockState state, net.minecraft.util.math.BlockPos pos, net.minecraft.util.math.BlockRayTraceResult ray)
getOffset in interface IPlacementHelperplayer - 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 resultPlacementOffset.fail() when no new position could be found.PlacementOffset.success(Vector3i) with the new BlockPos to indicate a success
and call PlacementOffset.withTransform(Function) if the blocks default state has to be modified before it is placed