Class CogwheelBlockItem.IntegratedSmallCogHelper

java.lang.Object
com.simibubi.create.content.contraptions.relays.elementary.CogwheelBlockItem.IntegratedSmallCogHelper
All Implemented Interfaces:
IPlacementHelper
Enclosing class:
CogwheelBlockItem

public static class CogwheelBlockItem.IntegratedSmallCogHelper extends Object implements IPlacementHelper
  • Constructor Details

    • IntegratedSmallCogHelper

      public IntegratedSmallCogHelper()
  • Method Details

    • getItemPredicate

      public Predicate<net.minecraft.world.item.ItemStack> getItemPredicate()
      Specified by:
      getItemPredicate in interface IPlacementHelper
      Returns:
      a predicate that gets tested with the items held in the players hands
      should return true if this placement helper is active with the given item
    • getStatePredicate

      public Predicate<net.minecraft.world.level.block.state.BlockState> getStatePredicate()
      Specified by:
      getStatePredicate in interface IPlacementHelper
      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:
      getOffset in interface IPlacementHelper
      Parameters:
      player - the player that activated the placement helper
      world - the world that the placement helper got activated in
      state - the Blockstate of the Block that the player is looking at or clicked on
      pos - the position of the Block the player is looking at or clicked on
      ray - the exact raytrace result
      Returns:
      the PlacementOffset object describing where to place the new block.
      Use PlacementOffset.fail() when no new position could be found.
      Use PlacementOffset.success(Vec3i) 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