Class ImmersiveRepeater

java.lang.Object
com.hammy275.immersivemc.client.immersive.AbstractDragImmersive
com.hammy275.immersivemc.client.immersive.ImmersiveRepeater
All Implemented Interfaces:
Immersive<DragImmersiveInfo,NullStorage>

public class ImmersiveRepeater extends AbstractDragImmersive
  • Constructor Details

    • ImmersiveRepeater

      public ImmersiveRepeater()
  • Method Details

    • hitboxDragged

      protected void hitboxDragged(DragImmersiveInfo info, int controller, int oldIndex, int newIndex)
      Description copied from class: AbstractDragImmersive
      Called whenever a drag occurs from some old hitbox index to a new one. This is an ideal spot to update DragImmersiveInfo.startingHitboxIndex if not auto-dragging.
      Specified by:
      hitboxDragged in class AbstractDragImmersive
      Parameters:
      info - Info with dragging happening.
      controller - Controller number that is dragging.
      oldIndex - Old hitbox index. This will be -1 if starting a drag from "anywhere".
      newIndex - New hitbox index. This will never be -1.
    • autoDragSettings

      protected AbstractDragImmersive.AutoDragSettings autoDragSettings()
      Description copied from class: AbstractDragImmersive
      Configures auto-dragging.
      Specified by:
      autoDragSettings in class AbstractDragImmersive
      Returns:
      Whether to use auto-dragging.
    • tick

      public void tick(DragImmersiveInfo info)
      Description copied from interface: Immersive
      This method is called once per game tick. This is where you should, for example, recalculate hitboxes if needed.
      Specified by:
      tick in interface Immersive<DragImmersiveInfo,NullStorage>
      Overrides:
      tick in class AbstractDragImmersive
      Parameters:
      info - The info being ticked.
    • getHandler

      public ImmersiveHandler<NullStorage> getHandler()
      Returns:
      The ImmersiveHandler this Immersive uses.
    • makeHitboxes

      protected void makeHitboxes(DragImmersiveInfo info, net.minecraft.world.level.Level level)
      Description copied from class: AbstractDragImmersive
      Add/set hitboxes into the info instance. Called automatically on each tick if AbstractDragImmersive.AutoDragSettings.makeHitboxesEveryTick is true. Otherwise, it's not called.
      Overrides:
      makeHitboxes in class AbstractDragImmersive
      Parameters:
      info - Info to set hitboxes into.
      level - The current level.
    • buildInfo

      public DragImmersiveInfo buildInfo(net.minecraft.core.BlockPos pos, net.minecraft.world.level.Level level)
      Description copied from interface: Immersive
      Constructs a new ImmersiveInfo based on the provided block position. It's best to calculate initial hitboxes, etc. in this method to make the Immersive available for interaction as soon as possible.
      Parameters:
      pos - The position of a block that matches this Immersive.
      level - The level in which this info is being built.
      Returns:
      An instance of an ImmersiveInfo implementation with the same position as provided.
    • configScreenInfo

      @Nullable public @Nullable ImmersiveConfigScreenInfo configScreenInfo()
      Description copied from interface: Immersive
      The info needed to build a config screen button for this Immersive. If this method returns null, ImmersiveMC will not add a setting for this Immersive to its in-game configuration. Reasons to possibly return null from this method include, but are not limited to:
      • This Immersive cannot be controlled via a config.
      • Another mod already handles configuring this Immersive.
      Returns:
      An ImmersiveConfigScreenInfo instance used for ImmersiveMC to add this Immersive to its in-game configuration screens, or null if ImmersiveMC should not do so.