Class ImmersiveBackpack
java.lang.Object
com.hammy275.immersivemc.client.immersive.AbstractPlayerAttachmentImmersive<BackpackInfo,NullStorage>
com.hammy275.immersivemc.client.immersive.ImmersiveBackpack
-
Field Summary
Modifier and TypeFieldDescriptionstatic final BackpackBundleModel
static final BackpackCraftingModel
static final BackpackModel
static final BackpackLowDetailModel
Fields inherited from class com.hammy275.immersivemc.client.immersive.AbstractPlayerAttachmentImmersive
forceDisableItemGuide, forceTickEvenIfNoTrack, infos, maxImmersives, maxLight
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
doTick
(BackpackInfo info, boolean isInVR) void
doTrack()
boolean
static org.joml.Vector3f
static net.minecraft.client.model.Model
static net.minecraft.resources.ResourceLocation
@Nullable ImmersiveHandler
net.minecraft.core.BlockPos
getLightPos
(BackpackInfo info) 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) protected void
initInfo
(BackpackInfo info) Initializes an `info` instance after it's constructed.protected boolean
inputSlotShouldRenderHelpHitbox
(BackpackInfo info, int slotNum) protected boolean
inRange
(int num, int start, int end) boolean
isVROnly()
static void
onHitboxInteract
(net.minecraft.world.entity.player.Player player, BackpackInfo info, int slot) void
processFromNetwork
(List<net.minecraft.world.item.ItemStack> items) void
processStorageFromNetwork
(AbstractPlayerAttachmentInfo info, NullStorage storage) refreshOrTrackObject
(net.minecraft.core.BlockPos pos, net.minecraft.world.level.Level level) protected void
render
(BackpackInfo info, com.mojang.blaze3d.vertex.PoseStack stack, boolean isInVR) protected void
renderTick
(BackpackInfo 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
(BackpackInfo 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, noInfosTick, onAnyRightClick, onRemove, playerPos, renderHitbox, renderHitbox, renderHitbox, renderHitbox, renderItem, renderItem, slotHelpBoxIsSelected, tick
-
Field Details
-
bundleModel
-
model
-
modelLowDetail
-
craftingModel
-
-
Constructor Details
-
ImmersiveBackpack
public ImmersiveBackpack()
-
-
Method Details
-
isVROnly
public boolean isVROnly()- Overrides:
isVROnly
in classAbstractPlayerAttachmentImmersive<BackpackInfo,
NullStorage>
-
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<BackpackInfo,
NullStorage>
-
doTick
- Overrides:
doTick
in classAbstractPlayerAttachmentImmersive<BackpackInfo,
NullStorage>
-
getHandler
- Specified by:
getHandler
in classAbstractPlayerAttachmentImmersive<BackpackInfo,
NullStorage> - Returns:
- ImmersiveHandler that this immersive uses. Can return null if this immersive doesn't receive item data from the server through FetchInventoryPacket.
-
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<BackpackInfo,
NullStorage> - Parameters:
info
- The immersive info instance.- Returns:
- The BlockPos for lighting.
-
onHitboxInteract
public static void onHitboxInteract(net.minecraft.world.entity.player.Player player, BackpackInfo info, int slot) -
inRange
protected boolean inRange(int num, int start, int end) -
shouldRender
- Specified by:
shouldRender
in classAbstractPlayerAttachmentImmersive<BackpackInfo,
NullStorage>
-
render
- Specified by:
render
in classAbstractPlayerAttachmentImmersive<BackpackInfo,
NullStorage>
-
enabledInConfig
public boolean enabledInConfig()- Specified by:
enabledInConfig
in classAbstractPlayerAttachmentImmersive<BackpackInfo,
NullStorage>
-
inputSlotShouldRenderHelpHitbox
- Specified by:
inputSlotShouldRenderHelpHitbox
in classAbstractPlayerAttachmentImmersive<BackpackInfo,
NullStorage>
-
shouldTrack
public boolean shouldTrack(net.minecraft.core.BlockPos pos, net.minecraft.world.level.Level level) - Specified by:
shouldTrack
in classAbstractPlayerAttachmentImmersive<BackpackInfo,
NullStorage>
-
refreshOrTrackObject
public BackpackInfo refreshOrTrackObject(net.minecraft.core.BlockPos pos, net.minecraft.world.level.Level level) - Specified by:
refreshOrTrackObject
in classAbstractPlayerAttachmentImmersive<BackpackInfo,
NullStorage>
-
shouldBlockClickIfEnabled
- Specified by:
shouldBlockClickIfEnabled
in classAbstractPlayerAttachmentImmersive<BackpackInfo,
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<BackpackInfo,
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<BackpackInfo,
NullStorage>
-
processStorageFromNetwork
- Specified by:
processStorageFromNetwork
in classAbstractPlayerAttachmentImmersive<BackpackInfo,
NullStorage>
-
processFromNetwork
-
doTrack
public void doTrack() -
getBackpackModel
public static net.minecraft.client.model.Model getBackpackModel() -
getBackpackTexture
public static net.minecraft.resources.ResourceLocation getBackpackTexture() -
getBackpackColor
public static org.joml.Vector3f getBackpackColor()
-