mirror of https://github.com/FabricMC/yarn.git
Map the new SleepManager (#2087)
* zzz Signed-off-by: liach <liach@users.noreply.github.com> * Fixed some bad stuff and more docs Signed-off-by: liach <liach@users.noreply.github.com> Co-authored-by: liach <liach@users.noreply.github.com>
This commit is contained in:
parent
e26f8a2dfb
commit
ec3597979c
|
@ -21,6 +21,7 @@ CLASS net/minecraft/class_3218 net/minecraft/server/world/ServerWorld
|
|||
FIELD field_26933 dragonParts Lit/unimi/dsi/fastutil/ints/Int2ObjectMap;
|
||||
FIELD field_26934 entityList Lnet/minecraft/class_5574;
|
||||
FIELD field_26935 entityManager Lnet/minecraft/class_5579;
|
||||
FIELD field_28859 sleepManager Lnet/minecraft/class_5838;
|
||||
METHOD <init> (Lnet/minecraft/server/MinecraftServer;Ljava/util/concurrent/Executor;Lnet/minecraft/class_32$class_5143;Lnet/minecraft/class_5268;Lnet/minecraft/class_5321;Lnet/minecraft/class_2874;Lnet/minecraft/class_3949;Lnet/minecraft/class_2794;ZJLjava/util/List;Z)V
|
||||
ARG 1 server
|
||||
ARG 2 workerExecutor
|
||||
|
|
|
@ -0,0 +1,41 @@
|
|||
CLASS net/minecraft/class_5838 net/minecraft/server/world/SleepManager
|
||||
COMMENT A sleep manager allows easy tracking of whether nights should be skipped
|
||||
COMMENT on a {@linkplain ServerWorld server world}.
|
||||
FIELD field_28866 total I
|
||||
COMMENT The total number of players in a server world.
|
||||
FIELD field_28867 sleeping I
|
||||
COMMENT The number of players sleeping in a server world.
|
||||
METHOD method_33811 clearSleeping ()V
|
||||
COMMENT Resets the number of sleeping players to 0.
|
||||
METHOD method_33812 canSkipNight (I)Z
|
||||
COMMENT Returns if the number of sleeping players has reached a {@code percentage}
|
||||
COMMENT out of all players.
|
||||
COMMENT
|
||||
COMMENT <p>This allows initiating the night sleeping process,
|
||||
COMMENT but still needs players to have slept long enough (checked in {@linkplain
|
||||
COMMENT #canResetTime(int, List) canResetTime}) to actually skip the night.
|
||||
ARG 1 percentage
|
||||
COMMENT the percentage of players required, as obtained from the game rule
|
||||
METHOD method_33813 canResetTime (ILjava/util/List;)Z
|
||||
COMMENT Returns if the night can actually be skipped at the tick this is called.
|
||||
COMMENT
|
||||
COMMENT <p>This is usually tested after {@linkplain #canSkipNight(int} canSkipNight},
|
||||
COMMENT which is less performance intensive to check.
|
||||
ARG 1 percentage
|
||||
COMMENT the percentage of players required, as obtained from the game rule
|
||||
ARG 2 players
|
||||
COMMENT the list of all players in a world where the night would be skipped
|
||||
METHOD method_33814 update (Ljava/util/List;)Z
|
||||
COMMENT Updates the sleeping player and total player counts.
|
||||
COMMENT
|
||||
COMMENT @return {@code true} if the sleeping players or total players have
|
||||
COMMENT changed
|
||||
ARG 1 players
|
||||
COMMENT the list of all players in a server world
|
||||
METHOD method_33815 getSleeping ()I
|
||||
COMMENT Returns the number of sleeping players.
|
||||
METHOD method_33816 getNightSkippingRequirement (I)I
|
||||
COMMENT Returns {@linkplain #sleeping the number of sleepers} needed to skip
|
||||
COMMENT a night with the given {@code percentage}.
|
||||
ARG 1 percentage
|
||||
COMMENT the percentage of players required, as obtained from the game rule
|
Loading…
Reference in New Issue