Contents
- Description
- Field Summary
- Constructor Summary
- Method Summary
- Constructor Details
- Method Details
- getComponentType()
- updateWeather(PlayerRef, WeatherResource, TransformComponent, float, ComponentAccessor)
- sendWeatherIndex(PlayerRef, int, float)
- consumeFirstSendForWorld()
- clear()
- setOverrideWeatherIndex(int)
- clearOverrideWeatherIndex()
- tryClaimOverride(Ref, int)
- releaseOverride(Ref)
- resolveUnoverriddenWeatherIndex(WeatherResource, TransformComponent, ComponentAccessor)
- updateEnvironment(TransformComponent, ComponentAccessor)
- getEnvironmentId()
- getWeatherIndex()
- setWeatherIndex(PlayerRef, int)
- clone()
Class WeatherTracker
java.lang.Object
com.hypixel.hytale.builtin.weather.components.WeatherTracker
- All Implemented Interfaces:
Component<EntityStore>, Cloneable
-
Field Summary
Fields inherited from interface Component
EMPTY_ARRAY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()voidclone()booleanstatic ComponentType<EntityStore, WeatherTracker> intintbooleanreleaseOverride(Ref<EntityStore> owner) Drops the override if the given entity still holds it.intresolveUnoverriddenWeatherIndex(WeatherResource weatherResource, TransformComponent transformComponent, ComponentAccessor<EntityStore> componentAccessor) Resolves what this player should see with no override active: the world's forced weather, otherwise the environment weather at their position.voidsendWeatherIndex(PlayerRef playerRef, int weatherIndex, float transitionSeconds) voidsetOverrideWeatherIndex(int weatherIndex) voidsetWeatherIndex(PlayerRef playerRef, int weatherIndex) booleantryClaimOverride(Ref<EntityStore> owner, int weatherIndex) Claims the override for the given entity, or refreshes it if that entity already holds it.voidupdateEnvironment(TransformComponent transformComponent, ComponentAccessor<EntityStore> componentAccessor) voidupdateWeather(PlayerRef playerRef, WeatherResource weatherComponent, TransformComponent transformComponent, float transitionSeconds, ComponentAccessor<EntityStore> componentAccessor) Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Component
cloneSerializable
-
Constructor Details
-
WeatherTracker
public WeatherTracker()
-
-
Method Details
-
getComponentType
-
updateWeather
public void updateWeather(@Nonnull PlayerRef playerRef, @Nonnull WeatherResource weatherComponent, @Nonnull TransformComponent transformComponent, float transitionSeconds, @Nonnull ComponentAccessor<EntityStore> componentAccessor) -
sendWeatherIndex
public void sendWeatherIndex(@Nonnull PlayerRef playerRef, int weatherIndex, float transitionSeconds) -
consumeFirstSendForWorld
public boolean consumeFirstSendForWorld() -
clear
public void clear() -
setOverrideWeatherIndex
public void setOverrideWeatherIndex(int weatherIndex) -
clearOverrideWeatherIndex
public void clearOverrideWeatherIndex() -
tryClaimOverride
Claims the override for the given entity, or refreshes it if that entity already holds it. The claim fails while another live entity holds the override.- Returns:
- true when the override now belongs to the given owner.
-
releaseOverride
Drops the override if the given entity still holds it.- Returns:
- true when the override was released, false when the caller had already lost it.
-
resolveUnoverriddenWeatherIndex
public int resolveUnoverriddenWeatherIndex(@Nonnull WeatherResource weatherResource, @Nullable TransformComponent transformComponent, @Nonnull ComponentAccessor<EntityStore> componentAccessor) Resolves what this player should see with no override active: the world's forced weather, otherwise the environment weather at their position. The environment is recomputed first because the override path skipsupdateEnvironment(TransformComponent, ComponentAccessor), so the cached environment can be stale.The result can be
AssetMapWithIndexes.NOT_FOUNDorWeather.UNKNOWN_ID, which callers must not send. -
updateEnvironment
public void updateEnvironment(@Nonnull TransformComponent transformComponent, @Nonnull ComponentAccessor<EntityStore> componentAccessor) -
getEnvironmentId
public int getEnvironmentId() -
getWeatherIndex
public int getWeatherIndex() -
setWeatherIndex
-
clone
- Specified by:
clonein interfaceComponent<EntityStore>- Returns:
- a clone instance of the original component instance.
-