public class WorldTimeResource implements Resource
Class WorldTimeResource. Provides worldtimeresource functionality for the Hytale server.
java.lang.Object > WorldTimeResource
Field Summary
gameTime
Field gameTime.
_gameTimeLocalDateTime
Field _gameTimeLocalDateTime.
currentHour
Field currentHour.
sunlightFactor
Field sunlightFactor.
scaledTime
Field scaledTime.
moonPhase
Field moonPhase.
daytimeDurationSeconds
Field daytimeDurationSeconds.
nighttimeDurationSeconds
Field nighttimeDurationSeconds.
totalDurationSeconds
Field totalDurationSeconds.
world
Field world.
wasTimePausedChanged
Field wasTimePausedChanged.
secondsOfDay
Field secondsOfDay.
daytimeRate
Field daytimeRate.
nighttimeRate
Field nighttimeRate.
x2
Field x2.
whole
Field whole.
m0
Field m0.
m2
Field m2.
f0
Field f0.
f2
Field f2.
advance
Field advance.
event
Field event.
worldGameplayConfig
Field worldGameplayConfig.
totalMoonPhases
Field totalMoonPhases.
dayProgress
Field dayProgress.
currentDay
Field currentDay.
weekDay
Field weekDay.
dayDuration
Field dayDuration.
nightDuration
Field nightDuration.
halfNight
Field halfNight.
dawnRelativeProgress
Field dawnRelativeProgress.
oldGameTime
Field oldGameTime.
dayStart
Field dayStart.
newGameTime
Field newGameTime.
dayTime
Field dayTime.
daylightDuration
Field daylightDuration.
halfNightDuration
Field halfNightDuration.
inverseAllNightDay
Field inverseAllNightDay.
halfDaylightDuration
Field halfDaylightDuration.
inverseAllDaylightDay
Field inverseAllDaylightDay.
sunPosition
Field sunPosition.
tweakedSunHeight
Field tweakedSunHeight.
worldTimeComponent
Field worldTimeComponent.
Method Detail
WorldTimeResource
public
WorldTimeResource
()
Method WorldTimeResource.
getResourceType
WorldTimeResource>
getResourceType
()
Method getResourceType.
getSecondsPerTick
double
getSecondsPerTick
(final World world)
Method getSecondsPerTick.
- Parameters:
final Worldworld
getMoonPhase
int
getMoonPhase
()
Method getMoonPhase.
setMoonPhase
Method setMoonPhase.
- Parameters:
final intmoonPhase@Nonnull final ComponentAccessorcomponentAccessor
updateMoonPhase
void
updateMoonPhase
(@Nonnull final World world, @Nonnull final ComponentAccessor componentAccessor)
Method updateMoonPhase.
- Parameters:
@Nonnull final Worldworld@Nonnull final ComponentAccessorcomponentAccessor
isMoonPhaseWithinRange
boolean
isMoonPhaseWithinRange
(@Nonnull final World world, final int minMoonPhase, final int maxMoonPhase)
Method isMoonPhaseWithinRange.
- Parameters:
@Nonnull final Worldworldfinal intminMoonPhasefinal intmaxMoonPhase
setGameTime0
void
setGameTime0
(@Nonnull final Instant gameTime)
Method setGameTime0.
- Parameters:
@Nonnull final InstantgameTime
updateSunlightFactor
void
updateSunlightFactor
(final int dayProgress, final float halfNight)
Method updateSunlightFactor.
- Parameters:
final intdayProgressfinal floathalfNight
updateScaledTime
void
updateScaledTime
(float dayProgress, final float dayDuration, final float halfNight)
Method updateScaledTime.
- Parameters:
floatdayProgressfinal floatdayDurationfinal floathalfNight
getGameTime
Instant
getGameTime
()
Method getGameTime.
getGameDateTime
LocalDateTime
getGameDateTime
()
Method getGameDateTime.
getSunlightFactor
double
getSunlightFactor
()
Method getSunlightFactor.
setGameTime
void
setGameTime
(@Nonnull final Instant gameTime, @Nonnull final World world, @Nonnull final Store store)
Method setGameTime.
- Parameters:
@Nonnull final InstantgameTime@Nonnull final Worldworld@Nonnull final Storestore
setDayTime
void
setDayTime
(final double dayTime, @Nonnull final World world, @Nonnull final Store store)
Method setDayTime.
- Parameters:
final doubledayTime@Nonnull final Worldworld@Nonnull final Storestore
isDayTimeWithinRange
boolean
isDayTimeWithinRange
(final double minTime, final double maxTime)
Method isDayTimeWithinRange.
- Parameters:
final doubleminTimefinal doublemaxTime
updateTimeSettingsPacket
UpdateTimeSettings
updateTimeSettingsPacket
(@Nonnull final UpdateTimeSettings settings, @Nonnull final World world)
Method updateTimeSettingsPacket.
- Parameters:
@Nonnull final UpdateTimeSettingssettings@Nonnull final Worldworld
isScaledDayTimeWithinRange
boolean
isScaledDayTimeWithinRange
(final double minTime, final double maxTime)
Method isScaledDayTimeWithinRange.
- Parameters:
final doubleminTimefinal doublemaxTime
isYearWithinRange
boolean
isYearWithinRange
(final double minTime, final double maxTime)
Method isYearWithinRange.
- Parameters:
final doubleminTimefinal doublemaxTime
getCurrentHour
int
getCurrentHour
()
Method getCurrentHour.
getDayProgress
float
getDayProgress
()
Method getDayProgress.
if
else
if
(dayTime > WorldTimeResource.HOURS_PER_DAY - halfNightDuration)
Method if.
- Parameters:
dayTime > WorldTimeResource.HOURS_PER_DAY -halfNightDuration
Vector3f
new
Vector3f
(TrigMathUtil.cos(sunAngle)
Method Vector3f.
- Parameters:
TrigMathUtil.cos(sunAngleTrigMathUtil.cos(sunAngle
instantToInstantData
Method instantToInstantData.
- Parameters:
@Nonnull final Instantinstant
instantDataToInstant
Method instantDataToInstant.
- Parameters:
@Nonnull final InstantDatainstantData
toString
String
toString
()
Method toString.