Class World
java.lang.Object
com.hypixel.hytale.server.core.util.thread.TickingThread
com.hypixel.hytale.server.core.universe.world.World
- All Implemented Interfaces:
com.hypixel.hytale.metrics.ExecutorMetricsRegistry.ExecutorMetric,IMessageReceiver,ChunkAccessor<WorldChunk>,IChunkAccessorSync<WorldChunk>,IWorldChunks,IWorldChunksAsync,Runnable,Executor
public class World
extends TickingThread
implements Executor, com.hypixel.hytale.metrics.ExecutorMetricsRegistry.ExecutorMetric, ChunkAccessor<WorldChunk>, IWorldChunks, IMessageReceiver
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface com.hypixel.hytale.server.core.universe.world.accessor.IChunkAccessorSync
IChunkAccessorSync.TestBlockFunction -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final AtomicBooleanprivate final AtomicBooleanprivate final ChunkLightingManagerprivate final ChunkStorestatic final Stringprivate final AtomicIntegerprivate final EntityStoreprivate final EventRegistryprivate final Map<ClientFeature, Boolean> private booleanprivate booleanprivate booleanprivate final com.hypixel.hytale.logger.HytaleLoggerstatic final com.hypixel.hytale.metrics.ExecutorMetricsRegistry<World> private final Stringprivate final com.hypixel.hytale.server.core.universe.world.WorldNotificationHandlerprivate final Collection<PlayerRef> private final Randomstatic final floatprivate final Pathprivate longprivate final WorldConfigprivate final WorldMapManagerprivate WorldPathConfigFields inherited from class com.hypixel.hytale.server.core.util.thread.TickingThread
NANOS_IN_ONE_MILLI, NANOS_IN_ONE_SECOND, SLEEP_OFFSET, TPS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T extends Entity>
TDeprecated.addPlayer(PlayerRef playerRef, Transform transform, Boolean clearWorldOverride, Boolean fadeInOutOverride) voidbooleanvoiddrainPlayersTo(World fallbackTargetWorld) booleanvoid<T> voidgetBlockBulkRelative(it.unimi.dsi.fastutil.longs.Long2ObjectMap<T> blocks, IntUnaryOperator xConvert, IntUnaryOperator yConvert, IntUnaryOperator zConvert, World.GenericBlockBulkUpdater<T> consumer) getChunkAsync(long index) getChunkIfInMemory(long index) getChunkIfLoaded(long index) getChunkIfNonTicking(long index) intDeprecated.getEntityRef(UUID uuid) com.hypixel.hytale.logger.HytaleLoggergetName()intgetNonTickingChunkAsync(long index) com.hypixel.hytale.server.core.universe.world.WorldNotificationHandlerintDeprecated, for removal: This API element is subject to removal in a future version.longgetTick()inthashCode()init()booleanisAlive()booleanbooleanisFeatureEnabled(ClientFeature feature) protected booleanisIdle()booleanisPaused()booleanloadChunkIfInMemory(long index) voidprivate PlayerRefonFinishPlayerJoining(Player playerComponent, PlayerRef playerRefComponent, PacketHandler packetHandler, boolean broadcastJoin) private voidonSetupPlayerJoining(Holder<EntityStore> holder, Player playerComponent, PlayerRef playerRefComponent, PacketHandler packetHandler, Transform transform, boolean clearWorld, boolean fadeInOut) protected voidprotected voidonStart()voidregisterFeature(ClientFeature feature, boolean enabled) voidsendMessage(Message message) voidsetCompassUpdating(boolean compassUpdating) voidsetPaused(boolean paused) voidsetTicking(boolean ticking) static voidsetTimeDilation(float timeDilationModifier, ComponentAccessor<EntityStore> componentAccessor) voidsetTps(int tps) <T extends Entity>
TspawnEntity(T entity, Vector3d position, Vector3f rotation) Deprecated.voidprotected voidtick(float dt) toString()voidtrackPlayerRef(PlayerRef playerRef) voiduntrackPlayerRef(PlayerRef playerRef) voidupdateEntitySeed(Store<EntityStore> store) voidvalidate(StringBuilder errors, IPrefabBuffer.RawBlockConsumer<Void> blockValidator, EnumSet<ValidationOption> options) voidMethods inherited from class com.hypixel.hytale.server.core.util.thread.TickingThread
clearMetrics, debugAssertInTickingThread, getBufferedTickLengthMetricSet, getThread, getTickStepNanos, getTps, interrupt, isInThread, isStarted, run, setThread, start, stopMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.hypixel.hytale.server.core.universe.world.accessor.ChunkAccessor
getFluidId, performBlockUpdate, performBlockUpdateMethods inherited from interface com.hypixel.hytale.metrics.ExecutorMetricsRegistry.ExecutorMetric
isInThreadMethods inherited from interface com.hypixel.hytale.server.core.universe.world.accessor.IChunkAccessorSync
breakBlock, getBaseBlock, getBlock, getBlock, getBlockComponentHolder, getBlockType, getBlockType, getState, setBlock, setBlock, setBlockInteractionState, testBlockTypes, testPlaceBlock, testPlaceBlockMethods inherited from interface com.hypixel.hytale.server.core.universe.world.IWorldChunks
getChunk, getNonTickingChunk, isInThread, waitForFutureWithoutLockMethods inherited from interface com.hypixel.hytale.server.core.universe.world.IWorldChunksAsync
getChunkAsync, getNonTickingChunkAsync
-
Field Details
-
SAVE_INTERVAL
public static final float SAVE_INTERVAL- See Also:
-
DEFAULT
- See Also:
-
METRICS_REGISTRY
@Nonnull public static final com.hypixel.hytale.metrics.ExecutorMetricsRegistry<World> METRICS_REGISTRY -
logger
@Nonnull private final com.hypixel.hytale.logger.HytaleLogger logger -
name
-
savePath
-
worldConfig
-
chunkStore
-
entityStore
-
chunkLighting
-
worldMapManager
-
worldPathConfig
-
acceptingTasks
-
taskQueue
-
alive
-
eventRegistry
-
notificationHandler
@Nonnull private final com.hypixel.hytale.server.core.universe.world.WorldNotificationHandler notificationHandler -
isTicking
private boolean isTicking -
isPaused
private boolean isPaused -
tick
private long tick -
random
-
entitySeed
-
players
-
playerRefs
-
features
-
gcHasRun
private volatile boolean gcHasRun
-
-
Constructor Details
-
World
public World(@Nonnull String name, @Nonnull Path savePath, @Nonnull WorldConfig worldConfig) throws IOException - Throws:
IOException
-
-
Method Details
-
init
-
onStart
protected void onStart()- Overrides:
onStartin classTickingThread
-
stopIndividualWorld
public void stopIndividualWorld() -
validateDeleteOnRemove
public void validateDeleteOnRemove() -
isIdle
protected boolean isIdle()- Overrides:
isIdlein classTickingThread
-
tick
protected void tick(float dt) - Specified by:
tickin classTickingThread
-
onShutdown
protected void onShutdown()- Specified by:
onShutdownin classTickingThread
-
setTps
public void setTps(int tps) - Overrides:
setTpsin classTickingThread
-
setTimeDilation
public static void setTimeDilation(float timeDilationModifier, @Nonnull ComponentAccessor<EntityStore> componentAccessor) -
getName
-
isAlive
public boolean isAlive() -
getWorldConfig
-
getDeathConfig
-
getDaytimeDurationSeconds
public int getDaytimeDurationSeconds() -
getNighttimeDurationSeconds
public int getNighttimeDurationSeconds() -
isTicking
public boolean isTicking() -
setTicking
public void setTicking(boolean ticking) -
isPaused
public boolean isPaused() -
setPaused
public void setPaused(boolean paused) -
getTick
public long getTick() -
getLogger
@Nonnull public com.hypixel.hytale.logger.HytaleLogger getLogger() -
isCompassUpdating
public boolean isCompassUpdating() -
setCompassUpdating
public void setCompassUpdating(boolean compassUpdating) -
getBlockBulkRelative
public <T> void getBlockBulkRelative(@Nonnull it.unimi.dsi.fastutil.longs.Long2ObjectMap<T> blocks, @Nonnull IntUnaryOperator xConvert, @Nonnull IntUnaryOperator yConvert, @Nonnull IntUnaryOperator zConvert, @Nonnull World.GenericBlockBulkUpdater<T> consumer) -
loadChunkIfInMemory
- Specified by:
loadChunkIfInMemoryin interfaceIChunkAccessorSync<WorldChunk>
-
getChunkIfInMemory
- Specified by:
getChunkIfInMemoryin interfaceIChunkAccessorSync<WorldChunk>
-
getChunkIfLoaded
- Specified by:
getChunkIfLoadedin interfaceIChunkAccessorSync<WorldChunk>
-
getChunkIfNonTicking
- Specified by:
getChunkIfNonTickingin interfaceIChunkAccessorSync<WorldChunk>
-
getChunkAsync
- Specified by:
getChunkAsyncin interfaceIWorldChunksAsync
-
getNonTickingChunkAsync
- Specified by:
getNonTickingChunkAsyncin interfaceIWorldChunksAsync
-
getPlayers
Deprecated, for removal: This API element is subject to removal in a future version. -
getEntity
Deprecated. -
getEntityRef
-
getPlayerCount
public int getPlayerCount() -
getPlayerRefs
-
trackPlayerRef
-
untrackPlayerRef
-
spawnEntity
@Deprecated @Nullable public <T extends Entity> T spawnEntity(T entity, @Nonnull Vector3d position, Vector3f rotation) Deprecated. -
addEntity
@Deprecated @Nullable public <T extends Entity> T addEntity(T entity, @Nonnull Vector3d position, @Nullable Vector3f rotation, @Nonnull AddReason reason) Deprecated. -
sendMessage
- Specified by:
sendMessagein interfaceIMessageReceiver
-
execute
-
consumeTaskQueue
public void consumeTaskQueue()- Specified by:
consumeTaskQueuein interfaceIWorldChunks
-
getChunkStore
-
getEntityStore
-
getChunkLighting
-
getWorldMapManager
-
getWorldPathConfig
-
getNotificationHandler
@Nonnull public com.hypixel.hytale.server.core.universe.world.WorldNotificationHandler getNotificationHandler() -
getEventRegistry
-
addPlayer
-
addPlayer
@Nullable public CompletableFuture<PlayerRef> addPlayer(@Nonnull PlayerRef playerRef, @Nullable Transform transform) -
addPlayer
@Nullable public CompletableFuture<PlayerRef> addPlayer(@Nonnull PlayerRef playerRef, @Deprecated(forRemoval=true) @Nullable Transform transform, @Nullable Boolean clearWorldOverride, @Nullable Boolean fadeInOutOverride) -
onFinishPlayerJoining
@Nonnull private PlayerRef onFinishPlayerJoining(@Nonnull Player playerComponent, @Nonnull PlayerRef playerRefComponent, @Nonnull PacketHandler packetHandler, boolean broadcastJoin) -
onSetupPlayerJoining
private void onSetupPlayerJoining(@Nonnull Holder<EntityStore> holder, @Nonnull Player playerComponent, @Nonnull PlayerRef playerRefComponent, @Nonnull PacketHandler packetHandler, @Nullable Transform transform, boolean clearWorld, boolean fadeInOut) -
drainPlayersTo
-
getGameplayConfig
-
getFeatures
-
isFeatureEnabled
-
registerFeature
-
broadcastFeatures
public void broadcastFeatures() -
getSavePath
-
updateEntitySeed
-
markGCHasRun
public void markGCHasRun() -
consumeGCHasRun
public boolean consumeGCHasRun() -
hashCode
public int hashCode() -
equals
-
toString
-
validate
public void validate(@Nonnull StringBuilder errors, @Nonnull IPrefabBuffer.RawBlockConsumer<Void> blockValidator, @Nonnull EnumSet<ValidationOption> options) throws IOException - Throws:
IOException
-