Class AbstractImmersive<I extends AbstractImmersiveInfo,S extends NetworkStorage>
java.lang.Object
com.hammy275.immersivemc.client.immersive.AbstractImmersive<I,S>
- All Implemented Interfaces:
Immersive<I,
S>
- Direct Known Subclasses:
ImmersiveBeacon
,ImmersiveChest
public abstract class AbstractImmersive<I extends AbstractImmersiveInfo,S extends NetworkStorage>
extends Object
implements Immersive<I,S>
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGet the collection of ImmersiveInfos currently active for this Immersive.void
This method is called once per game tick.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.hammy275.immersivemc.api.client.immersive.Immersive
buildInfo, configScreenInfo, getHandler, globalTick, handleHitboxInteract, isVROnly, processStorageFromNetwork, render, shouldDisableRightClicksWhenVanillaInteractionsDisabled, shouldRender
-
Field Details
-
infos
-
-
Constructor Details
-
AbstractImmersive
public AbstractImmersive()
-
-
Method Details
-
getTrackedObjects
Description copied from interface:Immersive
Get the collection of ImmersiveInfos currently active for this Immersive. The contents of the list may be modified by ImmersiveMC with the intention of updating the actual set of active ImmersiveInfos.
For example, if this Immersive represented a furnace, and the furnace was broken, ImmersiveMC would remove the ImmersiveInfo from the collection returned by this function to indicate that this Immersive should no longer handle the block, as it is no longer a furnace. As another example, if this Immersive represented a furnace, and a player placed a furnace, ImmersiveMC would add the result ofImmersive.buildInfo(BlockPos, Level)
to the collection returned by this function.
In short, you should the actual collection of ImmersiveInfos used by this Immersive instead of a copy of it, unless you want to deal with a lot of extra work.- Specified by:
getTrackedObjects
in interfaceImmersive<I extends AbstractImmersiveInfo,
S extends NetworkStorage> - Returns:
- The collection of all ImmersiveInfos tied to this Immersive.
-
tick
Description copied from interface:Immersive
This method is called once per game tick. This is where you should, for example, recalculate hitboxes if needed.- Specified by:
tick
in interfaceImmersive<I extends AbstractImmersiveInfo,
S extends NetworkStorage> - Parameters:
info
- The info being ticked.
-