Class ImmersiveHitboxes
java.lang.Object
com.hammy275.immersivemc.client.immersive.AbstractPlayerAttachmentImmersive<ImmersiveHitboxesInfo,NullStorage>
com.hammy275.immersivemc.client.immersive.ImmersiveHitboxes
public class ImmersiveHitboxes
extends AbstractPlayerAttachmentImmersive<ImmersiveHitboxesInfo,NullStorage>
Used for hitboxes attached to the player
-
Field Summary
Fields inherited from class com.hammy275.immersivemc.client.immersive.AbstractPlayerAttachmentImmersive
forceDisableItemGuide, forceTickEvenIfNoTrack, infos, maxImmersives, maxLight
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
doTick
(ImmersiveHitboxesInfo info, boolean isInVR) boolean
@Nullable ImmersiveHandler
net.minecraft.core.BlockPos
Gets the BlockPos used for lighting calculations.void
handleRightClick
(AbstractPlayerAttachmentInfo info, net.minecraft.world.entity.player.Player player, int closest, net.minecraft.world.InteractionHand hand) void
protected void
Initializes an `info` instance after it's constructed.protected boolean
inputSlotShouldRenderHelpHitbox
(ImmersiveHitboxesInfo info, int slotNum) void
processStorageFromNetwork
(AbstractPlayerAttachmentInfo info, NullStorage storage) refreshOrTrackObject
(net.minecraft.core.BlockPos pos, net.minecraft.world.level.Level level) protected void
render
(ImmersiveHitboxesInfo info, com.mojang.blaze3d.vertex.PoseStack stack, boolean isInVR) protected void
renderTick
(ImmersiveHitboxesInfo info, boolean isInVR) Called just before render() for data that needs to be updated just before render time, rather than on a tick-based interval.boolean
boolean
shouldRender
(ImmersiveHitboxesInfo info, boolean isInVR) boolean
shouldTrack
(net.minecraft.core.BlockPos pos, net.minecraft.world.level.Level level) Methods inherited from class com.hammy275.immersivemc.client.immersive.AbstractPlayerAttachmentImmersive
clearImmersives, clientAuthoritative, doRender, enqueueItemGuideRender, get3x3HorizontalGrid, getCooldownDesktop, getCooldownVR, getForwardFromPlayer, getForwardFromPlayerUpAndDown, getForwardFromPlayerUpAndDownFilterBlockFacing, getLeftOfDirection, getLight, getLight, getLightPositions, getTopCenterOfBlock, getTrackedObjects, globalTick, handleTriggerHitboxRightClick, hasMultipleLightPositions, hitboxesAvailable, isVROnly, noInfosTick, onAnyRightClick, onRemove, playerPos, renderHitbox, renderHitbox, renderHitbox, renderHitbox, renderItem, renderItem, slotHelpBoxIsSelected, tick
-
Constructor Details
-
ImmersiveHitboxes
public ImmersiveHitboxes()
-
-
Method Details
-
renderTick
Description copied from class:AbstractPlayerAttachmentImmersive
Called just before render() for data that needs to be updated just before render time, rather than on a tick-based interval. WARNING: This is called per render-pass, and will completely mess with the player position!- Overrides:
renderTick
in classAbstractPlayerAttachmentImmersive<ImmersiveHitboxesInfo,
NullStorage>
-
getHandler
- Specified by:
getHandler
in classAbstractPlayerAttachmentImmersive<ImmersiveHitboxesInfo,
NullStorage> - Returns:
- ImmersiveHandler that this immersive uses. Can return null if this immersive doesn't receive item data from the server through FetchInventoryPacket.
-
doTick
- Overrides:
doTick
in classAbstractPlayerAttachmentImmersive<ImmersiveHitboxesInfo,
NullStorage>
-
shouldRender
- Specified by:
shouldRender
in classAbstractPlayerAttachmentImmersive<ImmersiveHitboxesInfo,
NullStorage>
-
render
protected void render(ImmersiveHitboxesInfo info, com.mojang.blaze3d.vertex.PoseStack stack, boolean isInVR) - Specified by:
render
in classAbstractPlayerAttachmentImmersive<ImmersiveHitboxesInfo,
NullStorage>
-
enabledInConfig
public boolean enabledInConfig()- Specified by:
enabledInConfig
in classAbstractPlayerAttachmentImmersive<ImmersiveHitboxesInfo,
NullStorage>
-
inputSlotShouldRenderHelpHitbox
- Specified by:
inputSlotShouldRenderHelpHitbox
in classAbstractPlayerAttachmentImmersive<ImmersiveHitboxesInfo,
NullStorage>
-
shouldTrack
public boolean shouldTrack(net.minecraft.core.BlockPos pos, net.minecraft.world.level.Level level) - Specified by:
shouldTrack
in classAbstractPlayerAttachmentImmersive<ImmersiveHitboxesInfo,
NullStorage>
-
refreshOrTrackObject
public ImmersiveHitboxesInfo refreshOrTrackObject(net.minecraft.core.BlockPos pos, net.minecraft.world.level.Level level) - Specified by:
refreshOrTrackObject
in classAbstractPlayerAttachmentImmersive<ImmersiveHitboxesInfo,
NullStorage>
-
shouldBlockClickIfEnabled
- Specified by:
shouldBlockClickIfEnabled
in classAbstractPlayerAttachmentImmersive<ImmersiveHitboxesInfo,
NullStorage>
-
initInfo
Description copied from class:AbstractPlayerAttachmentImmersive
Initializes an `info` instance after it's constructed. Useful for immersives that have non-changing hitboxes/positions.- Specified by:
initInfo
in classAbstractPlayerAttachmentImmersive<ImmersiveHitboxesInfo,
NullStorage> - Parameters:
info
- Info instance that should be initialized
-
handleRightClick
public void handleRightClick(AbstractPlayerAttachmentInfo info, net.minecraft.world.entity.player.Player player, int closest, net.minecraft.world.InteractionHand hand) - Specified by:
handleRightClick
in classAbstractPlayerAttachmentImmersive<ImmersiveHitboxesInfo,
NullStorage>
-
processStorageFromNetwork
- Specified by:
processStorageFromNetwork
in classAbstractPlayerAttachmentImmersive<ImmersiveHitboxesInfo,
NullStorage>
-
getLightPos
Description copied from class:AbstractPlayerAttachmentImmersive
Gets the BlockPos used for lighting calculations. Called immediately after doTick(), so anything set up then, it will be in info to use. Note that this should not be inside another block (even the immmersive!). The best option is to set this to be one of the blocks that must be unoccupied for the immersive to render (the block above the crafting table, for example).- Specified by:
getLightPos
in classAbstractPlayerAttachmentImmersive<ImmersiveHitboxesInfo,
NullStorage> - Parameters:
info
- The immersive info instance.- Returns:
- The BlockPos for lighting.
-
initImmersiveIfNeeded
public void initImmersiveIfNeeded()
-