Class SwapTracker
java.lang.Object
com.hammy275.immersivemc.client.immersive.SwapTracker
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static final record
SwapTracker.LastImmersive<I extends ImmersiveInfo>
protected static enum
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final SwapTracker
static final SwapTracker
protected final net.minecraft.world.InteractionHand
protected SwapTracker.LastImmersive
<?> protected boolean
protected boolean
protected int
protected int
protected SwapTracker.SwapState
protected int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
protected int
protected boolean
hasSlotHovered
(ImmersiveInfo info, int slot) protected void
void
Workaround so non-VR play can do a NONE tickvoid
setCooldown
(int newCooldown) protected void
setState
(SwapTracker.SwapState newState, int newHitbox) static boolean
slotHovered
(ImmersiveInfo info, int slot) <I extends ImmersiveInfo>
voidTick the swap tracker with data.
-
Field Details
-
c0
-
c1
-
hand
protected final net.minecraft.world.InteractionHand hand -
state
-
mostRecentHitbox
protected int mostRecentHitbox -
ticksInMostRecent
protected int ticksInMostRecent -
lastImmersive
-
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
-
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
-
setState
-
maybeDoDragPlace
protected void maybeDoDragPlace() -
getCooldownToPass
protected int getCooldownToPass()
-