Class InteractionChain

java.lang.Object
com.hypixel.hytale.server.core.entity.InteractionChain
All Implemented Interfaces:
ChainSyncStorage

public class InteractionChain extends Object implements ChainSyncStorage
Represents a chain of interactions for an instigating entity.
  • Constructor Details

  • Method Details

    • getType

      public InteractionType getType()
    • getChainId

      public int getChainId()
    • getForkedChainId

      public ForkedChainId getForkedChainId()
    • getBaseForkedChainId

      public ForkedChainId getBaseForkedChainId()
    • getInitialRootInteraction

      @Nonnull public RootInteraction getInitialRootInteraction()
    • isPredicted

      public boolean isPredicted()
    • getContext

      public InteractionContext getContext()
    • getChainData

      public InteractionChainData getChainData()
    • getServerState

      public InteractionState getServerState()
    • requiresClient

      public boolean requiresClient()
    • getRootInteraction

      public RootInteraction getRootInteraction()
    • getSimulatedRootInteraction

      public RootInteraction getSimulatedRootInteraction()
    • getOperationCounter

      public int getOperationCounter()
    • setOperationCounter

      public void setOperationCounter(int operationCounter)
    • getSimulatedOperationCounter

      public int getSimulatedOperationCounter()
    • setSimulatedOperationCounter

      public void setSimulatedOperationCounter(int simulatedOperationCounter)
    • wasPreTicked

      public boolean wasPreTicked()
    • setPreTicked

      public void setPreTicked(boolean preTicked)
    • getOperationIndex

      public int getOperationIndex()
    • nextOperationIndex

      public void nextOperationIndex()
    • getClientOperationIndex

      public int getClientOperationIndex()
    • findForkedChain

      @Nullable public InteractionChain findForkedChain(@Nonnull ForkedChainId chainId, @Nullable InteractionChainData data)
    • getForkedChain

      public InteractionChain getForkedChain(@Nonnull ForkedChainId chainId)
      Returns the interaction chain for the given fork id.
      Parameters:
      chainId - The ID of the forked chain.
      Returns:
      the interaction chain, or null if it doesn't exist.
    • putForkedChain

      public void putForkedChain(@Nonnull ForkedChainId chainId, @Nonnull InteractionChain chain)
    • getTempForkedChain

      @Nullable public com.hypixel.hytale.server.core.entity.InteractionChain.TempChain getTempForkedChain(@Nonnull ForkedChainId chainId)
    • hasSentInitial

      public boolean hasSentInitial()
    • setSentInitial

      public void setSentInitial(boolean sentInitial)
    • getTimeShift

      public float getTimeShift()
    • setTimeShift

      public void setTimeShift(float timeShift)
    • consumeFirstRun

      public boolean consumeFirstRun()
    • isFirstRun

      public boolean isFirstRun()
    • setFirstRun

      public void setFirstRun(boolean firstRun)
    • getCallDepth

      public int getCallDepth()
    • getSimulatedCallDepth

      public int getSimulatedCallDepth()
    • pushRoot

      public void pushRoot(RootInteraction nextInteraction, boolean simulate)
    • popRoot

      public void popRoot()
    • getTimeInSeconds

      public float getTimeInSeconds()
    • setOnCompletion

      public void setOnCompletion(Runnable onCompletion)
    • getClientState

      public InteractionState getClientState()
      Specified by:
      getClientState in interface ChainSyncStorage
    • setClientState

      public void setClientState(InteractionState state)
      Specified by:
      setClientState in interface ChainSyncStorage
    • getOrCreateInteractionEntry

      @Nonnull public InteractionEntry getOrCreateInteractionEntry(int index)
    • getInteraction

      @Nullable public InteractionEntry getInteraction(int index)
      Specified by:
      getInteraction in interface ChainSyncStorage
    • removeInteractionEntry

      public void removeInteractionEntry(@Nonnull InteractionManager interactionManager, int index)
    • putInteractionSyncData

      public void putInteractionSyncData(int index, InteractionSyncData data)
      Specified by:
      putInteractionSyncData in interface ChainSyncStorage
    • clearInteractionSyncData

      public void clearInteractionSyncData(int operationIndex)
      Removes all invalid sync data from the chain and any active interactions
      Specified by:
      clearInteractionSyncData in interface ChainSyncStorage
      Parameters:
      operationIndex -
    • removeInteractionSyncData

      @Nullable public InteractionSyncData removeInteractionSyncData(int index)
    • updateSyncPosition

      public void updateSyncPosition(int index)
      Specified by:
      updateSyncPosition in interface ChainSyncStorage
    • isSyncDataOutOfOrder

      public boolean isSyncDataOutOfOrder(int index)
      Specified by:
      isSyncDataOutOfOrder in interface ChainSyncStorage
    • syncFork

      public void syncFork(@Nonnull Ref<EntityStore> ref, @Nonnull InteractionManager manager, @Nonnull SyncInteractionChain packet)
      Specified by:
      syncFork in interface ChainSyncStorage
    • copyTempFrom

      public void copyTempFrom(@Nonnull com.hypixel.hytale.server.core.entity.InteractionChain.TempChain temp)
    • setChainId

      public void setChainId(int chainId)
    • getBaseType

      public InteractionType getBaseType()
    • setBaseType

      public void setBaseType(InteractionType baseType)
    • getForkedChains

      @Nonnull public it.unimi.dsi.fastutil.longs.Long2ObjectMap<InteractionChain> getForkedChains()
    • getTempForkedChainData

      @Nonnull public it.unimi.dsi.fastutil.longs.Long2ObjectMap<com.hypixel.hytale.server.core.entity.InteractionChain.TempChain> getTempForkedChainData()
    • getTimestamp

      public long getTimestamp()
    • setTimestamp

      public void setTimestamp(long timestamp)
    • getWaitingForServerFinished

      public long getWaitingForServerFinished()
    • setWaitingForServerFinished

      public void setWaitingForServerFinished(long waitingForServerFinished)
    • getWaitingForClientFinished

      public long getWaitingForClientFinished()
    • setWaitingForClientFinished

      public void setWaitingForClientFinished(long waitingForClientFinished)
    • setServerState

      public void setServerState(InteractionState serverState)
    • getFinalState

      public InteractionState getFinalState()
    • setFinalState

      public void setFinalState(InteractionState finalState)
    • flagDesync

      public void flagDesync()
    • isDesynced

      public boolean isDesynced()
    • getNewForks

      @Nonnull public List<InteractionChain> getNewForks()
    • toString

      @Nonnull public String toString()
      Overrides:
      toString in class Object