Interface BlockBasedImmersive<I extends BlockBasedImmersiveInfo, R extends ImmersiveRenderState, S extends NetworkStorage>
- Type Parameters:
I- TheBlockBasedImmersiveInfoimplementation this Immersive uses.R- The render state implementation this Immersive uses. SeeImmersive.extractRenderState(I, R, float).S- The type of storage to use for sending Immersive data over the network.
- All Superinterfaces:
Immersive<I,R, S>
- All Known Subinterfaces:
BuiltBlockBasedImmersive<E,ER, S>
- All Known Implementing Classes:
AbstractBlockBasedImmersive, AbstractDragImmersive, BuiltBlockBasedImmersiveImpl, ImmersiveBeacon, ImmersiveChest, ImmersiveDoor, ImmersiveLectern, ImmersiveLever, ImmersiveRepeater, ImmersiveTrapdoor
public non-sealed interface BlockBasedImmersive<I extends BlockBasedImmersiveInfo, R extends ImmersiveRenderState, S extends NetworkStorage>
extends Immersive<I,R,S>
Represents the client-side implementation of a block-based Immersive implementation. One should implement this
interface to create the client-side implementation of a block-based Immersive (or, alternatively, build one using an
BlockBasedImmersiveBuilder).
When combined with a BlockBasedImmersiveHandler, you have a fully-functioning block-based Immersive!
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbuildInfo(net.minecraft.core.BlockPos pos, net.minecraft.world.level.Level level) Constructs a new BlockBasedImmersiveInfo based on the provided block position.booleanisVROnly()booleanWhether normal right-click behavior for this block should be disabled when the option to disable interactions is enabled in ImmersiveMC.Methods inherited from interface Immersive
configScreenInfo, createRenderState, extractRenderState, getDragHitbox, getTrackedObjects, globalTick, handleHitboxInteract, isInputHitbox, processStorageFromNetwork, render, shouldRender, tick
-
Method Details
-
buildInfo
Constructs a new BlockBasedImmersiveInfo based on the provided block position. It's best to calculate initial hitboxes, etc. in this method to make the Immersive is available for interaction as soon as possible.- Parameters:
pos- The position of a block that matches this Immersive.level- The level in which this info is being built.- Returns:
- An instance of a BlockBasedImmersiveInfo implementation with the same position as provided.
-
shouldDisableRightClicksWhenVanillaInteractionsDisabled
Whether normal right-click behavior for this block should be disabled when the option to disable interactions is enabled in ImmersiveMC. This should usually return true if the block opens a GUI on right-click.For example, ImmersiveMC's furnace Immersive returns true here, since those not wanting to interact with vanilla UIs do not have any need to access the furnace UI. On the other hand, ImmersiveMC's door Immersive returns false here, as players should still be able to open/close doors with the right-click/use action.
- Parameters:
info- The info for the block that may want to disable right-clicks.- Returns:
- Whether to skip right-click behavior for this block when the option to disable click interactions is enabled in ImmersiveMC.
-
getHandler
BlockBasedImmersiveHandler<S> getHandler()- Specified by:
getHandlerin interfaceImmersive<I extends BlockBasedImmersiveInfo, R extends ImmersiveRenderState, S extends NetworkStorage>- Returns:
- The
BlockBasedImmersiveHandlerthis Immersive uses.
-
isVROnly
boolean isVROnly()- Returns:
- Whether this Immersive should only exist for VR users. The same value should always be returned by this method.
-