Class SwapTracker

java.lang.Object
com.hammy275.immersivemc.client.immersive.SwapTracker

public class SwapTracker extends Object
  • Field Details

    • c0

      public static final SwapTracker c0
    • c1

      public static final SwapTracker c1
    • hand

      protected final net.minecraft.world.InteractionHand hand
    • state

      protected SwapTracker.SwapState state
    • mostRecentHitbox

      protected int mostRecentHitbox
    • ticksInMostRecent

      protected int ticksInMostRecent
    • lastImmersive

      protected SwapTracker.LastImmersive<?> lastImmersive
    • queuedPlacements

      protected final Set<Integer> queuedPlacements
    • leftClickWasDown

      protected boolean leftClickWasDown
    • lastTickWasIdle

      protected boolean lastTickWasIdle
    • rightClickCooldown

      protected int rightClickCooldown
  • Constructor Details

    • SwapTracker

      public SwapTracker(net.minecraft.world.InteractionHand hand)
  • Method Details

    • slotHovered

      public static boolean slotHovered(ImmersiveInfo info, int slot)
    • maybeIdleTick

      public void maybeIdleTick()
      Workaround so non-VR play can do a NONE tick
    • tick

      public <I extends ImmersiveInfo> void tick(@Nullable @Nullable Immersive<I,?> immersive, @Nullable I info, int inputHitbox, boolean inDragHitbox)
      Tick the swap tracker with data.
      Parameters:
      immersive - Immersive being interacted with, or null if there is none.
      info - Info being interacted with, or null if no info.
      inputHitbox - Input hitbox being interacted with. Should be negative if not interacting with one.
      inDragHitbox - Whether we're currently in the drag hitbox. Should be false if dragging is disabled.
    • setCooldown

      public void setCooldown(int newCooldown)
    • getCooldown

      public int getCooldown()
    • hasSlotHovered

      protected boolean hasSlotHovered(ImmersiveInfo info, int slot)
    • setState

      protected void setState(SwapTracker.SwapState newState, int newHitbox)
    • maybeDoDragPlace

      protected void maybeDoDragPlace()
    • getCooldownToPass

      protected int getCooldownToPass()