Class SwapTracker
java.lang.Object
com.hammy275.immersivemc.client.immersive.SwapTracker
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static final recordSwapTracker.LastImmersive<I extends ImmersiveInfo>protected static enum -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final SwapTrackerstatic final SwapTrackerprotected final net.minecraft.world.InteractionHandprotected SwapTracker.LastImmersive<?> protected booleanprotected booleanprotected intprotected intprotected SwapTracker.SwapStateprotected int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintprotected intprotected booleanhasSlotHovered(ImmersiveInfo info, int slot) protected voidvoidWorkaround so non-VR play can do a NONE tickvoidsetCooldown(int newCooldown) protected voidsetState(SwapTracker.SwapState newState, int newHitbox) static booleanslotHovered(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()
-