Class ImmersiveBackpack
java.lang.Object
com.hammy275.immersivemc.client.immersive.AbstractPlayerAttachmentImmersive<BackpackInfo,NullStorage>
com.hammy275.immersivemc.client.immersive.ImmersiveBackpack
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final BackpackBundleModelstatic final BackpackCraftingModelstatic final BackpackModelstatic final BackpackLowDetailModelFields inherited from class com.hammy275.immersivemc.client.immersive.AbstractPlayerAttachmentImmersive
forceDisableItemGuide, forceTickEvenIfNoTrack, infos, maxImmersives, maxLight -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoTick(BackpackInfo info, boolean isInVR) voiddoTrack()booleanstatic intstatic net.minecraft.client.model.Modelstatic net.minecraft.resources.ResourceLocation@Nullable ImmersiveHandlernet.minecraft.core.BlockPosgetLightPos(BackpackInfo info) Gets the BlockPos used for lighting calculations.voidhandleRightClick(AbstractPlayerAttachmentInfo info, net.minecraft.world.entity.player.Player player, int closest, net.minecraft.world.InteractionHand hand) protected voidinitInfo(BackpackInfo info) Initializes an `info` instance after it's constructed.protected booleaninputSlotShouldRenderHelpHitbox(BackpackInfo info, int slotNum) protected booleaninRange(int num, int start, int end) booleanisVROnly()static voidonHitboxInteract(net.minecraft.world.entity.player.Player player, BackpackInfo info, int slot) voidprocessFromNetwork(List<net.minecraft.world.item.ItemStack> items) voidprocessStorageFromNetwork(AbstractPlayerAttachmentInfo info, NullStorage storage) refreshOrTrackObject(net.minecraft.core.BlockPos pos, net.minecraft.world.level.Level level) protected voidrender(BackpackInfo info, com.mojang.blaze3d.vertex.PoseStack stack, boolean isInVR) protected voidrenderTick(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.booleanbooleanshouldRender(BackpackInfo info, boolean isInVR) booleanshouldTrack(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:
isVROnlyin classAbstractPlayerAttachmentImmersive<BackpackInfo,NullStorage>
-
renderTick
Description copied from class:AbstractPlayerAttachmentImmersiveCalled 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:
renderTickin classAbstractPlayerAttachmentImmersive<BackpackInfo,NullStorage>
-
doTick
- Overrides:
doTickin classAbstractPlayerAttachmentImmersive<BackpackInfo,NullStorage>
-
getHandler
- Specified by:
getHandlerin 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:AbstractPlayerAttachmentImmersiveGets 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:
getLightPosin 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:
shouldRenderin classAbstractPlayerAttachmentImmersive<BackpackInfo,NullStorage>
-
render
- Specified by:
renderin classAbstractPlayerAttachmentImmersive<BackpackInfo,NullStorage>
-
enabledInConfig
public boolean enabledInConfig()- Specified by:
enabledInConfigin classAbstractPlayerAttachmentImmersive<BackpackInfo,NullStorage>
-
inputSlotShouldRenderHelpHitbox
- Specified by:
inputSlotShouldRenderHelpHitboxin classAbstractPlayerAttachmentImmersive<BackpackInfo,NullStorage>
-
shouldTrack
public boolean shouldTrack(net.minecraft.core.BlockPos pos, net.minecraft.world.level.Level level) - Specified by:
shouldTrackin classAbstractPlayerAttachmentImmersive<BackpackInfo,NullStorage>
-
refreshOrTrackObject
public BackpackInfo refreshOrTrackObject(net.minecraft.core.BlockPos pos, net.minecraft.world.level.Level level) - Specified by:
refreshOrTrackObjectin classAbstractPlayerAttachmentImmersive<BackpackInfo,NullStorage>
-
shouldBlockClickIfEnabled
- Specified by:
shouldBlockClickIfEnabledin classAbstractPlayerAttachmentImmersive<BackpackInfo,NullStorage>
-
initInfo
Description copied from class:AbstractPlayerAttachmentImmersiveInitializes an `info` instance after it's constructed. Useful for immersives that have non-changing hitboxes/positions.- Specified by:
initInfoin 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:
handleRightClickin classAbstractPlayerAttachmentImmersive<BackpackInfo,NullStorage>
-
processStorageFromNetwork
- Specified by:
processStorageFromNetworkin 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 int getBackpackColor()
-