HyCodeYourTale
classpublicPriority 1

WorldTimeResource

com.hypixel.hytale.server.core.modules.time.WorldTimeResource

implements Resource

27

Methods

27

Public Methods

6

Fields

1

Constructors

Constants

intDAYS_PER_YEAR= (int)ChronoUnit.YEARS.getDuration().toDays()
floatDAYTIME_PORTION_PERCENTAGE= 0.6F
intDAYTIME_SECONDS= (int)((float)SECONDS_PER_DAY * 0.6F)
intHOURS_PER_DAY= (int)ChronoUnit.DAYS.getDuration().toHours()
InstantMAX_TIME= Instant.ofEpochSecond(31553789759L, 99999999L)
longNANOS_PER_DAY= ChronoUnit.DAYS.getDuration().toNanos()
intNIGHTTIME_SECONDS= (int)((float)SECONDS_PER_DAY * 0.39999998F)
intSECONDS_PER_DAY= (int)ChronoUnit.DAYS.getDuration().getSeconds()
floatSHADOW_MAPPING_SAFE_ANGLE_LERP= 0.35F
intSUNRISE_SECONDS= NIGHTTIME_SECONDS / 2
floatSUN_HEIGHT= 2.0F
booleanUSE_SHADOW_MAPPING_SAFE_ANGLE= true
InstantZERO_YEAR= Instant.parse("0001-01-01T00:00:00.00Z")
ZoneOffsetZONE_OFFSET= ZoneOffset.UTC

Constructors

public
WorldTimeResource()

Methods

Public Methods (27)

public
void broadcastTimePacket(Store<EntityStore> store)
public
Resource<EntityStore> clone()
@Nonnull@Override
public
int getCurrentHour()
public
float getDayProgress()
public
LocalDateTime getGameDateTime()
public
Instant getGameTime()
public
int getMoonPhase()
publicstatic
ResourceType<EntityStore, WorldTimeResource> getResourceType()
@Nonnull
publicstatic
double getSecondsPerTick(World world)
public
Vector3f getSunDirection()
@Nonnull
public
double getSunlightFactor()
publicstatic
Instant instantDataToInstant(InstantData instantData)
@Nonnull
publicstatic
InstantData instantToInstantData(Instant instant)
@Nonnull
public
boolean isDayTimeWithinRange(double minTime, double maxTime)
public
boolean isMoonPhaseWithinRange(World world, int minMoonPhase, int maxMoonPhase)
public
boolean isScaledDayTimeWithinRange(double minTime, double maxTime)
public
boolean isYearWithinRange(double minTime, double maxTime)
public
void sendTimePackets(PlayerRef playerRef)
public
void setDayTime(double dayTime, World world, Store<EntityStore> store)
public
void setGameTime(Instant gameTime, World world, Store<EntityStore> store)
public
void setGameTime0(Instant gameTime)
public
void setMoonPhase(int moonPhase, ComponentAccessor<EntityStore> componentAccessor)
public
void tick(float dt, Store<EntityStore> store)
public
String toString()
@Nonnull@Override
public
void updateMoonPhase(World world, ComponentAccessor<EntityStore> componentAccessor)
public
void updateTimePacket(UpdateTime currentTimePacket)
publicstatic
UpdateTimeSettings updateTimeSettingsPacket(UpdateTimeSettings settings, World world)
@Nonnull

Fields

Private/Package Fields (6)

privateLocalDateTime _gameTimeLocalDateTime
privateint currentHour
privateInstant gameTime
privateint moonPhase
privatedouble scaledTime
privatedouble sunlightFactor

Related Classes