EntityStatMap

public class EntityStatMap implements Component

Class EntityStatMap. Provides entitystatmap functionality for the Hytale server.

java.lang.Object > EntityStatMap

Field Summary

values

private EntityStatValue[] values

Field values.

isSelfNetworkOutdated

protected boolean isSelfNetworkOutdated

Field isSelfNetworkOutdated.

isNetworkOutdated

protected boolean isNetworkOutdated

Field isNetworkOutdated.

asset

final EntityStatType asset

Field asset.

value

final EntityStatValue value

Field value.

assetCount

final int assetCount

Field assetCount.

oldLength

final int oldLength

Field oldLength.

asset2

final EntityStatType asset2

Field asset2.

n

final int n

Field n.

entityStatValue

final EntityStatValue entityStatValue

Field entityStatValue.

value2

final EntityStatValue value2

Field value2.

values2

final EntityStatValue[] values2

Field values2.

n2

final int n2

Field n2.

entityStatValue2

final EntityStatValue entityStatValue2

Field entityStatValue2.

previousValue

final float previousValue

Field previousValue.

previous

final Modifier previous

Field previous.

currentValue

final float currentValue

Field currentValue.

ret

final float ret

Field ret.

entityStatType

final EntityStatType entityStatType

Field entityStatType.

updates

final Int2ObjectOpenHashMap updates

Field updates.

iterator

final ObjectIterator>> iterator

Field iterator.

e

final Int2ObjectMap.Entry> e

Field e.

stat

final EntityStatValue stat

Field stat.

temp

final boolean temp

Field temp.

statType

final EntityStatType statType

Field statType.

isPredictable

final boolean isPredictable

Field isPredictable.

other

final List other

Field other.

self

final List self

Field self.

modifierPacket

final com.hypixel.hytale.protocol.Modifier modifierPacket

Field modifierPacket.

last

final EntityStatUpdate last

Field last.

entityStatUpdate

final EntityStatUpdate entityStatUpdate

Field entityStatUpdate.

statIndex

final int statIndex

Field statIndex.

map

final EntityStatMap map

Field map.

packet

final Int2ObjectOpenHashMap packet

Field packet.

out

final com.hypixel.hytale.protocol.Modifier[] out

Field out.

Method Detail

getComponentType

public EntityStatMap> getComponentType ()

Method getComponentType.

EntityStatMap

public public EntityStatMap ()

Method EntityStatMap.

size

public int size ()

Method size.

get

public EntityStatValue get (final int index)

Method get.

Parameters:
final int index

update

public void update ()

Method update.

if

public else if (value.synchronizeAsset(index, asset)

Method if.

Parameters:
value.synchronizeAsset(index value.synchronizeAsset(index
asset asset

getModifier

public Modifier getModifier (final int index, final String key)

Method getModifier.

Parameters:
final int index
final String key

putModifier

public Modifier putModifier (final int index, final String key, final Modifier modifier)

Method putModifier.

Parameters:
final int index
final String key
final Modifier modifier

removeModifier

public Modifier removeModifier (final int index, final String key)

Method removeModifier.

Parameters:
final int index
final String key

setStatValue

public float setStatValue (final int index, final float newValue)

Method setStatValue.

Parameters:
final int index
final float newValue

addStatValue

public float addStatValue (final int index, final float amount)

Method addStatValue.

Parameters:
final int index
final float amount

subtractStatValue

public float subtractStatValue (final int index, final float amount)

Method subtractStatValue.

Parameters:
final int index
final float amount

minimizeStatValue

public float minimizeStatValue (final int index)

Method minimizeStatValue.

Parameters:
final int index

maximizeStatValue

public float maximizeStatValue (final int index)

Method maximizeStatValue.

Parameters:
final int index

resetStatValue

public float resetStatValue (final int index)

Method resetStatValue.

Parameters:
final int index

getSelfUpdates

public Int2ObjectMap> getSelfUpdates ()

Method getSelfUpdates.

getSelfStatValues

public Int2ObjectMap getSelfStatValues ()

Method getSelfStatValues.

consumeSelfUpdates

public Int2ObjectMap consumeSelfUpdates ()

Method consumeSelfUpdates.

clearUpdates

public void clearUpdates ()

Method clearUpdates.

consumeOtherUpdates

public Int2ObjectMap consumeOtherUpdates ()

Method consumeOtherUpdates.

updatesToProtocol

private Int2ObjectOpenHashMap updatesToProtocol (@Nonnull final Int2ObjectMap> localUpdates)

Method updatesToProtocol.

Parameters:
@Nonnull final Int2ObjectMap> localUpdates

createInitUpdate

public Int2ObjectMap createInitUpdate (final boolean all)

Method createInitUpdate.

Parameters:
final boolean all

consumeSelfNetworkOutdated

public boolean consumeSelfNetworkOutdated ()

Method consumeSelfNetworkOutdated.

consumeNetworkOutdated

public boolean consumeNetworkOutdated ()

Method consumeNetworkOutdated.

addInitChange

private void addInitChange (final int index, @Nonnull final EntityStatValue value)

Method addInitChange.

Parameters:
final int index
@Nonnull final EntityStatValue value

addChange

private void addChange (final Predictable predictable, final int index, @Nonnull final EntityStatOp op, final float previousValue, final float value)

Method addChange.

Parameters:
final Predictable predictable
final int index
@Nonnull final EntityStatOp op
final float previousValue
final float value

ObjectArrayList

public new ObjectArrayList ()

Method ObjectArrayList.

FloatArrayList

public new FloatArrayList ()

Method FloatArrayList.

EntityStatUpdate

public new EntityStatUpdate (op, isPredictable, 0.0f, null, key, modifierPacket)

Method EntityStatUpdate.

Parameters:
op op
isPredictable isPredictable
0.0f 0.0f
null null
key key
modifierPacket modifierPacket

tryMergeUpdate

private boolean tryMergeUpdate (@Nonnull final List updates, @Nonnull final EntityStatOp op, final float value, @Nullable final Map modifierMap, final boolean isPredictable)

Method tryMergeUpdate.

Parameters:
@Nonnull final List updates
@Nonnull final EntityStatOp op
final float value
@Nullable final Map modifierMap
final boolean isPredictable

processStatChanges

public void processStatChanges (final Predictable predictable, @Nonnull final Int2FloatMap entityStats, final ValueType valueType, @Nonnull final ChangeStatBehaviour changeStatBehaviour)

Method processStatChanges.

Parameters:
final Predictable predictable
@Nonnull final Int2FloatMap entityStats
final ValueType valueType
@Nonnull final ChangeStatBehaviour changeStatBehaviour

toString

public String toString ()

Method toString.

clone

public EntityStatMap clone ()

Method clone.

makeInitChange

static EntityStatUpdate makeInitChange (@Nonnull final EntityStatValue value)

Method makeInitChange.

Parameters:
@Nonnull final EntityStatValue value

toPacket

static Int2ObjectMap toPacket (@Nullable final Int2ObjectMap modifiers)

Method toPacket.

Parameters:
@Nullable final Int2ObjectMap modifiers