From 88ca0afebd69f8da1c9dd58c6f4f7e238b71b17d Mon Sep 17 00:00:00 2001 From: apple502j <33279053+apple502j@users.noreply.github.com> Date: Wed, 9 Feb 2022 20:36:29 +0900 Subject: [PATCH] Document ServerWorld stuff (#2891) * Document ServerWorld stuff * Apply suggestions from code review Co-authored-by: haykam821 <24855774+haykam821@users.noreply.github.com> * Update mappings/net/minecraft/server/world/ServerWorld.mapping * More stuff * Fix and change some stuff * Temporary commit * Fix some stuff * Fixes * Should fix all javadoc issues * Apply suggestions from code review Co-authored-by: Juuxel <6596629+Juuxel@users.noreply.github.com> * Clarify world spawn pos Co-authored-by: haykam821 <24855774+haykam821@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Juuxel <6596629+Juuxel@users.noreply.github.com> --- .../server/world/ServerWorld.mapping | 103 ++++++++++++++++++ .../minecraft/world/BlockRenderView.mapping | 6 + .../net/minecraft/world/BlockView.mapping | 9 ++ .../net/minecraft/world/CollisionView.mapping | 4 + .../net/minecraft/world/EntityView.mapping | 4 + .../minecraft/world/ModifiableWorld.mapping | 43 ++++++++ mappings/net/minecraft/world/World.mapping | 99 +++++++++++++++++ .../net/minecraft/world/WorldAccess.mapping | 5 + .../net/minecraft/world/WorldView.mapping | 14 +++ 9 files changed, 287 insertions(+) diff --git a/mappings/net/minecraft/server/world/ServerWorld.mapping b/mappings/net/minecraft/server/world/ServerWorld.mapping index 0b05cc3268..8144c67424 100644 --- a/mappings/net/minecraft/server/world/ServerWorld.mapping +++ b/mappings/net/minecraft/server/world/ServerWorld.mapping @@ -43,6 +43,12 @@ CLASS net/minecraft/class_3218 net/minecraft/server/world/ServerWorld ARG 12 spawners ARG 13 shouldTickTime METHOD method_14166 spawnParticles (Lnet/minecraft/class_3222;Lnet/minecraft/class_2394;ZDDDIDDDD)Z + COMMENT Spawns a particle visible to {@code viewer}, if the viewer is near the provided + COMMENT coordinates. + COMMENT + COMMENT @return whether the particle packet was sent + COMMENT + COMMENT @see #spawnParticles(ParticleEffect, double, double, double, int, double, double, double, double) ARG 1 viewer ARG 2 particle ARG 3 force @@ -63,9 +69,13 @@ CLASS net/minecraft/class_3218 net/minecraft/server/world/ServerWorld METHOD method_14175 addEntity (Lnet/minecraft/class_1297;)Z ARG 1 entity METHOD method_14176 save (Lnet/minecraft/class_3536;ZZ)V + COMMENT Saves the world. ARG 1 progressListener + COMMENT the listener for the saving process, or {@code null} to specify none ARG 2 flush + COMMENT if it should immediately write all data to storage device ARG 3 savingDisabled + COMMENT whether to return early without doing anything METHOD method_14177 isInBlockTick ()Z METHOD method_14183 getStructureManager ()Lnet/minecraft/class_3485; METHOD method_14188 saveLevel ()V @@ -73,8 +83,18 @@ CLASS net/minecraft/class_3218 net/minecraft/server/world/ServerWorld ARG 1 pos ARG 2 block METHOD method_14190 getEntity (Ljava/util/UUID;)Lnet/minecraft/class_1297; + COMMENT {@return the entity using the UUID, or {@code null} if none was found} + COMMENT + COMMENT @see World#getEntityById ARG 1 uuid METHOD method_14191 sendToPlayerIfNearby (Lnet/minecraft/class_3222;ZDDDLnet/minecraft/class_2596;)Z + COMMENT Sends the {@code packet} to {@code player} if the player + COMMENT is near the provided coordinates. + COMMENT + COMMENT @return whether the packet was sent + COMMENT + COMMENT @implNote The threshold is 32 blocks if {@code force} is {@code false}, and + COMMENT 512 blocks if {@code force} is {@code true}. ARG 1 player ARG 2 force ARG 3 x @@ -85,6 +105,11 @@ CLASS net/minecraft/class_3218 net/minecraft/server/world/ServerWorld METHOD method_14195 resetWeather ()V METHOD method_14197 resetIdleTimeout ()V METHOD method_14199 spawnParticles (Lnet/minecraft/class_2394;DDDIDDDD)I + COMMENT Spawns a particle visible to nearby players. + COMMENT + COMMENT @return the number of players the particle packet was sent to + COMMENT + COMMENT @see #spawnParticles(ServerPlayerEntity, ParticleEffect, boolean, double, double, double, int, double, double, double, double) ARG 1 particle ARG 2 x ARG 4 y @@ -96,10 +121,18 @@ CLASS net/minecraft/class_3218 net/minecraft/server/world/ServerWorld ARG 15 speed METHOD method_17983 getPersistentStateManager ()Lnet/minecraft/class_26; METHOD method_17984 getForcedChunks ()Lit/unimi/dsi/fastutil/longs/LongSet; + COMMENT {@return the set that contains {@link ChunkPos} of forced chunks serialized as a long} METHOD method_17988 setChunkForced (IIZ)Z + COMMENT Sets the forced status of the chunk. + COMMENT + COMMENT

Forced chunks are created in-game using the + COMMENT {@linkplain net.minecraft.server.command.ForceLoadCommand {@code /forceload} command}. ARG 1 x + COMMENT the chunk's X coordinate ARG 2 z + COMMENT the chunk's Z coordinate ARG 3 forced + COMMENT whether to mark the chunk as forced METHOD method_18198 getEntitiesByType (Lnet/minecraft/class_5575;Ljava/util/function/Predicate;)Ljava/util/List; COMMENT Computes a list of entities of the given type. COMMENT @@ -117,14 +150,27 @@ CLASS net/minecraft/class_3218 net/minecraft/server/world/ServerWorld ARG 1 chunk ARG 2 randomTickSpeed METHOD method_18207 onPlayerTeleport (Lnet/minecraft/class_3222;)V + COMMENT Called on the destination world when a player changed the dimension + COMMENT by teleportation. + COMMENT + COMMENT @see ServerPlayerEntity#moveToWorld + COMMENT @see #onDimensionChanged + COMMENT @see #onPlayerChangeDimension ARG 1 player METHOD method_18210 getLightningPos (Lnet/minecraft/class_2338;)Lnet/minecraft/class_2338; ARG 1 pos METHOD method_18211 onPlayerChangeDimension (Lnet/minecraft/class_3222;)V + COMMENT Called on the destination world when a player changed the dimension using portals. + COMMENT + COMMENT @see ServerPlayerEntity#moveToWorld + COMMENT @see #onDimensionChanged + COMMENT @see #onPlayerTeleport ARG 1 player METHOD method_18213 onPlayerConnected (Lnet/minecraft/class_3222;)V + COMMENT Called on the player's world when the player connected to the server and spawned. ARG 1 player METHOD method_18215 onPlayerRespawned (Lnet/minecraft/class_3222;)V + COMMENT Called on the world that has the player's respawn point when the player respawned. ARG 1 player METHOD method_18762 tickEntity (Lnet/minecraft/class_1297;)V ARG 1 entity @@ -136,10 +182,20 @@ CLASS net/minecraft/class_3218 net/minecraft/server/world/ServerWorld METHOD method_18765 tick (Ljava/util/function/BooleanSupplier;)V ARG 1 shouldKeepTicking METHOD method_18766 getPlayers (Ljava/util/function/Predicate;)Ljava/util/List; + COMMENT {@return the list of players filtered using {@code predicate}} ARG 1 predicate METHOD method_18768 tryLoadEntity (Lnet/minecraft/class_1297;)Z ARG 1 entity METHOD method_18769 onDimensionChanged (Lnet/minecraft/class_1297;)V + COMMENT Called on the destination world when an entity changed the dimension. + COMMENT + COMMENT

This does not get called for players changing dimensions. + COMMENT Use {@link #onPlayerChangeDimension} (for portals) or + COMMENT {@link #onPlayerTeleport} (for teleportation) instead. + COMMENT + COMMENT @see Entity#moveToWorld + COMMENT @see #onPlayerTeleport + COMMENT @see #onPlayerChangeDimension ARG 1 entity METHOD method_18770 removePlayer (Lnet/minecraft/class_3222;Lnet/minecraft/class_1297$class_5529;)V ARG 1 player @@ -149,7 +205,9 @@ CLASS net/minecraft/class_3218 net/minecraft/server/world/ServerWorld METHOD method_18773 (Lnet/minecraft/class_3222;)V ARG 0 player METHOD method_18776 getAliveEnderDragons ()Ljava/util/List; + COMMENT {@return the list of alive ender dragons in the world} METHOD method_18779 getRandomAlivePlayer ()Lnet/minecraft/class_3222; + COMMENT {@return a randomly selected alive player, or {@code null} if there is none} METHOD method_19494 getPointOfInterestStorage ()Lnet/minecraft/class_4153; METHOD method_19495 getRaidManager ()Lnet/minecraft/class_3767; METHOD method_19496 handleInteraction (Lnet/minecraft/class_4151;Lnet/minecraft/class_1297;Lnet/minecraft/class_4094;)V @@ -164,8 +222,10 @@ CLASS net/minecraft/class_3218 net/minecraft/server/world/ServerWorld METHOD method_19500 isNearOccupiedPointOfInterest (Lnet/minecraft/class_2338;)Z ARG 1 pos METHOD method_19502 getRaidAt (Lnet/minecraft/class_2338;)Lnet/minecraft/class_3765; + COMMENT {@return the raid occurring within 96 block radius, or {@code null} if there is none} ARG 1 pos METHOD method_19503 hasRaidAt (Lnet/minecraft/class_2338;)Z + COMMENT {@return {@code true} if a raid exists within 96 block radius of {@code pos}} ARG 1 pos METHOD method_19535 (Lnet/minecraft/class_2338;Lnet/minecraft/class_4158;)V ARG 2 poiType @@ -193,14 +253,38 @@ CLASS net/minecraft/class_3218 net/minecraft/server/world/ServerWorld METHOD method_27056 getStructureAccessor ()Lnet/minecraft/class_5138; METHOD method_27909 iterateEntities ()Ljava/lang/Iterable; METHOD method_27910 setWeather (IIZZ)V + COMMENT Sets the current weather, as well as how long it should last. + COMMENT + COMMENT @see ServerWorldProperties#setClearWeatherTime + COMMENT @see ServerWorldProperties#setRainTime + COMMENT @see ServerWorldProperties#setThunderTime + COMMENT @see ServerWorldProperties#setRaining + COMMENT @see ServerWorldProperties#setThundering ARG 1 clearDuration + COMMENT how long the clear weather should last, in seconds ARG 2 rainDuration + COMMENT how long the rain or the thunderstorm should last, in seconds ARG 3 raining + COMMENT whether a rain is ongoing ARG 4 thundering + COMMENT whether a thunderstorm is ongoing METHOD method_27911 getSpawnPos ()Lnet/minecraft/class_2338; + COMMENT {@return the world spawn point} + COMMENT + COMMENT @implNote If it is outside the world border, this returns the position of the + COMMENT highest {@linkplain Heightmap.Type#MOTION_BLOCKING motion-blocking} block at the center of the world border. METHOD method_28125 isFlat ()Z METHOD method_29198 getEnderDragonFight ()Lnet/minecraft/class_2881; METHOD method_29199 setTimeOfDay (J)V + COMMENT Sets the time of day. + COMMENT + COMMENT

Time of day is different to "time", which is incremented on every tick and + COMMENT cannot be modified; Time of day affects the day-night cycle, can be changed using + COMMENT {@link net.minecraft.server.command.TimeCommand /time command}, and can be frozen + COMMENT if {@link net.minecraft.world.GameRules#DO_DAYLIGHT_CYCLE doDaylightCycle} gamerule is turned off. + COMMENT Time is used to track scheduled ticks and cannot be modified or frozen. + COMMENT + COMMENT @see net.minecraft.world.level.ServerWorldProperties#setTimeOfDay ARG 1 timeOfDay METHOD method_29200 createEndSpawnPlatform (Lnet/minecraft/class_3218;)V ARG 0 world @@ -255,15 +339,18 @@ CLASS net/minecraft/class_3218 net/minecraft/server/world/ServerWorld METHOD method_33143 sendSleepingStatus ()V COMMENT Sends sleeping status action bar messages to players in this world. METHOD method_33144 isSleepingEnabled ()Z + COMMENT {@return whether sleeping can cause the night to skip} METHOD method_34679 (Lnet/minecraft/class_2338;)Lnet/minecraft/class_2338; ARG 0 pos METHOD method_34680 (Lnet/minecraft/class_2338;)Z ARG 1 pos METHOD method_37116 isChunkLoaded (J)Z + COMMENT {@return {@code true} if the chunk {@code chunkPos} is loaded} ARG 1 chunkPos METHOD method_37117 isTickingFutureReady (J)Z ARG 1 chunkPos METHOD method_37118 shouldTickEntity (Lnet/minecraft/class_2338;)Z + COMMENT {@return whether to tick entities at {@code pos}} ARG 1 pos METHOD method_39223 disableTickSchedulers (Lnet/minecraft/class_2818;)V ARG 1 chunk @@ -276,11 +363,27 @@ CLASS net/minecraft/class_3218 net/minecraft/server/world/ServerWorld ARG 1 pos METHOD method_8448 updateSleepingPlayers ()V METHOD method_8487 locateStructure (Lnet/minecraft/class_3195;Lnet/minecraft/class_2338;IZ)Lnet/minecraft/class_2338; + COMMENT Tries to find the closest structure of a given type near a given block. + COMMENT

+ COMMENT New chunks will only be generated up to the {@link net.minecraft.world.chunk.ChunkStatus#STRUCTURE_STARTS} phase by this method. + COMMENT

+ COMMENT The radius is ignored for strongholds. + COMMENT + COMMENT @return the position of the structure, or {@code null} if no structure could be found within the given search radius + COMMENT + COMMENT @see ChunkGenerator#locateStructure ARG 1 feature + COMMENT the structure feature to search for ARG 2 pos + COMMENT the position to start the searching at ARG 3 radius + COMMENT the search radius in chunks around the chunk the given block position is in; a radius of 0 will only search in the given chunk ARG 4 skipExistingChunks + COMMENT whether only structures that are not referenced by generated chunks (chunks past the {@code STRUCTURE_STARTS} stage) are returned, excluding strongholds METHOD method_8554 setSpawnPos (Lnet/minecraft/class_2338;F)V + COMMENT Sets the world spawn point. ARG 1 pos + COMMENT the position of the spawn point ARG 2 angle + COMMENT the angle of the spawned entity CLASS class_5526 ServerEntityHandler diff --git a/mappings/net/minecraft/world/BlockRenderView.mapping b/mappings/net/minecraft/world/BlockRenderView.mapping index 14aae7001d..80c572f8b9 100644 --- a/mappings/net/minecraft/world/BlockRenderView.mapping +++ b/mappings/net/minecraft/world/BlockRenderView.mapping @@ -10,6 +10,12 @@ CLASS net/minecraft/class_1920 net/minecraft/world/BlockRenderView ARG 1 direction ARG 2 shaded METHOD method_8311 isSkyVisible (Lnet/minecraft/class_2338;)Z + COMMENT {@return if the sky is visible at {@code pos}} + COMMENT + COMMENT @implNote This returns {@code true} if the sky light level + COMMENT at {@code pos} is the maximum, {@code 15}. + COMMENT + COMMENT @see WorldView#isSkyVisibleAllowingSea ARG 1 pos METHOD method_8314 getLightLevel (Lnet/minecraft/class_1944;Lnet/minecraft/class_2338;)I ARG 1 type diff --git a/mappings/net/minecraft/world/BlockView.mapping b/mappings/net/minecraft/world/BlockView.mapping index 9b78adf62a..f71151874d 100644 --- a/mappings/net/minecraft/world/BlockView.mapping +++ b/mappings/net/minecraft/world/BlockView.mapping @@ -38,10 +38,19 @@ CLASS net/minecraft/class_1922 net/minecraft/world/BlockView ARG 2 type METHOD method_8315 getMaxLightLevel ()I METHOD method_8316 getFluidState (Lnet/minecraft/class_2338;)Lnet/minecraft/class_3610; + COMMENT {@return the fluid state at {@code pos}} + COMMENT + COMMENT @implNote This returns the fluid state for {@link net.minecraft.fluid.Fluids#EMPTY} + COMMENT if the Y coordinate is outside the height limit. ARG 1 pos METHOD method_8317 getLuminance (Lnet/minecraft/class_2338;)I ARG 1 pos METHOD method_8320 getBlockState (Lnet/minecraft/class_2338;)Lnet/minecraft/class_2680; + COMMENT {@return the block state at {@code pos}} + COMMENT + COMMENT @implNote This returns the block state for {@link net.minecraft.block.Blocks#VOID_AIR} + COMMENT if the Y coordinate is outside the height limit. ARG 1 pos METHOD method_8321 getBlockEntity (Lnet/minecraft/class_2338;)Lnet/minecraft/class_2586; + COMMENT {@return the block entity at {@code pos}, or {@code null} if there is none} ARG 1 pos diff --git a/mappings/net/minecraft/world/CollisionView.mapping b/mappings/net/minecraft/world/CollisionView.mapping index 9bfa2ff10e..cc26a9a9b1 100644 --- a/mappings/net/minecraft/world/CollisionView.mapping +++ b/mappings/net/minecraft/world/CollisionView.mapping @@ -34,6 +34,10 @@ CLASS net/minecraft/class_1941 net/minecraft/world/CollisionView METHOD method_8606 doesNotIntersectEntities (Lnet/minecraft/class_1297;)Z ARG 1 entity METHOD method_8611 doesNotIntersectEntities (Lnet/minecraft/class_1297;Lnet/minecraft/class_265;)Z + COMMENT {@return {@code true} if {@code shape} does not intersect + COMMENT with non-spectator entities except {@code except}} + COMMENT + COMMENT @implNote This always returns {@code true} if {@code shape} is {@linkplain VoxelShape#isEmpty empty}. ARG 1 except ARG 2 shape METHOD method_8621 getWorldBorder ()Lnet/minecraft/class_2784; diff --git a/mappings/net/minecraft/world/EntityView.mapping b/mappings/net/minecraft/world/EntityView.mapping index 5a48ddbbb5..616bb3a502 100644 --- a/mappings/net/minecraft/world/EntityView.mapping +++ b/mappings/net/minecraft/world/EntityView.mapping @@ -102,5 +102,9 @@ CLASS net/minecraft/class_1924 net/minecraft/world/EntityView ARG 7 maxDistance ARG 9 targetPredicate METHOD method_8611 doesNotIntersectEntities (Lnet/minecraft/class_1297;Lnet/minecraft/class_265;)Z + COMMENT {@return {@code true} if {@code shape} does not intersect + COMMENT with non-spectator entities except {@code except}} + COMMENT + COMMENT @implNote This always returns {@code true} if {@code shape} is {@linkplain VoxelShape#isEmpty empty}. ARG 1 except ARG 2 shape diff --git a/mappings/net/minecraft/world/ModifiableWorld.mapping b/mappings/net/minecraft/world/ModifiableWorld.mapping index 7ee5ef123e..bed8117b3a 100644 --- a/mappings/net/minecraft/world/ModifiableWorld.mapping +++ b/mappings/net/minecraft/world/ModifiableWorld.mapping @@ -1,6 +1,15 @@ CLASS net/minecraft/class_1945 net/minecraft/world/ModifiableWorld COMMENT Represents a modifiable world where block states can be changed and entities spawned. METHOD method_22352 breakBlock (Lnet/minecraft/class_2338;Z)Z + COMMENT Removes the block and replaces it with the fluid occupying the block + COMMENT (such as water inside kelp), or air if it does not exist. Additionally, + COMMENT this emits the {@linkplain WorldEvents#BLOCK_BROKEN world event} + COMMENT and the {@linkplain net.minecraft.world.event.GameEvent#BLOCK_DESTROY game event}. + COMMENT + COMMENT @return whether the block was removed successfully + COMMENT + COMMENT @see #removeBlock(BlockPos, boolean) + COMMENT @see #breakBlock(BlockPos, boolean, Entity) ARG 1 pos ARG 2 drop METHOD method_30092 setBlockState (Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;II)Z @@ -21,16 +30,50 @@ CLASS net/minecraft/class_1945 net/minecraft/world/ModifiableWorld ARG 4 maxUpdateDepth COMMENT the limit for the cascading block updates METHOD method_30093 breakBlock (Lnet/minecraft/class_2338;ZLnet/minecraft/class_1297;I)Z + COMMENT Removes the block and replaces it with the fluid occupying the block + COMMENT (such as water inside kelp), or air if it does not exist. Additionally, + COMMENT this emits the {@linkplain WorldEvents#BLOCK_BROKEN world event} + COMMENT and the {@linkplain net.minecraft.world.event.GameEvent#BLOCK_DESTROY game event}. + COMMENT + COMMENT @return whether the block was removed successfully + COMMENT + COMMENT @see #breakBlock(BlockPos, boolean) + COMMENT @see #breakBlock(BlockPos, boolean, Entity) ARG 1 pos ARG 2 drop ARG 3 breakingEntity ARG 4 maxUpdateDepth METHOD method_8649 spawnEntity (Lnet/minecraft/class_1297;)Z + COMMENT Spawns an entity. + COMMENT + COMMENT @apiNote To spawn an entity with passengers, use + COMMENT {@link ServerWorldAccess#spawnEntityAndPassengers}. + COMMENT + COMMENT @see ServerWorldAccess#spawnEntityAndPassengers ARG 1 entity METHOD method_8650 removeBlock (Lnet/minecraft/class_2338;Z)Z + COMMENT Removes the block and replaces it with the fluid occupying the block + COMMENT (such as water inside kelp), or air if it does not exist. + COMMENT + COMMENT @implNote This does not emit the {@linkplain WorldEvents#BLOCK_BROKEN world event} + COMMENT or the {@linkplain net.minecraft.world.event.GameEvent#BLOCK_DESTROY game event}. + COMMENT + COMMENT @return whether the block was removed successfully + COMMENT + COMMENT @see #breakBlock(BlockPos, boolean) ARG 1 pos ARG 2 move + COMMENT whether the block was removed as part of piston moving blocks METHOD method_8651 breakBlock (Lnet/minecraft/class_2338;ZLnet/minecraft/class_1297;)Z + COMMENT Removes the block and replaces it with the fluid occupying the block + COMMENT (such as water inside kelp), or air if it does not exist. Additionally, + COMMENT this emits the {@linkplain WorldEvents#BLOCK_BROKEN world event} + COMMENT and the {@linkplain net.minecraft.world.event.GameEvent#BLOCK_DESTROY game event}. + COMMENT + COMMENT @return whether the block was removed successfully + COMMENT + COMMENT @see #breakBlock(BlockPos, boolean) + COMMENT @see #breakBlock(BlockPos, boolean, Entity, int) ARG 1 pos ARG 2 drop ARG 3 breakingEntity diff --git a/mappings/net/minecraft/world/World.mapping b/mappings/net/minecraft/world/World.mapping index 5800570162..b703bd8ca2 100644 --- a/mappings/net/minecraft/world/World.mapping +++ b/mappings/net/minecraft/world/World.mapping @@ -63,6 +63,10 @@ CLASS net/minecraft/class_1937 net/minecraft/world/World ARG 1 tickConsumer ARG 2 entity METHOD method_19282 onBlockChanged (Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;Lnet/minecraft/class_2680;)V + COMMENT Called when a block state changed. + COMMENT + COMMENT @apiNote To implement logic for specific type of blocks, override + COMMENT {@link net.minecraft.block.AbstractBlock#onStateReplaced} instead. ARG 1 pos ARG 2 oldBlock ARG 3 newBlock @@ -73,10 +77,36 @@ CLASS net/minecraft/class_1937 net/minecraft/world/World ARG 2 entity ARG 3 direction METHOD method_24794 isInBuildLimit (Lnet/minecraft/class_2338;)Z + COMMENT {@return whether the position is inside the build limit} + COMMENT + COMMENT @implNote In addition to the height limit, the position's X and Z + COMMENT coordinates must be greater than or equal to {@code -30_000_000} + COMMENT and less than {@code 30_000_000}. + COMMENT + COMMENT @apiNote This method should be used for block placement. If the + COMMENT action involves a player interaction, additionally check for + COMMENT {@link #canPlayerModifyAt} (which checks the spawn protection and world border). + COMMENT + COMMENT @see #isValid + COMMENT @see #canPlayerModifyAt ARG 1 pos METHOD method_25952 isInvalidVertically (I)Z ARG 0 y METHOD method_25953 isValid (Lnet/minecraft/class_2338;)Z + COMMENT {@return whether the position is valid} + COMMENT + COMMENT @implNote The position is considered valid if the X and Z + COMMENT coordinates are greater than or equal to {@code -30_000_000} and less than + COMMENT {@code 30_000_000}, and the Y coordinate is greater or equal to + COMMENT {@code -20_000_000} and less than {@code 20_000_000}. + COMMENT + COMMENT @apiNote This method should be used for teleportation. To test for + COMMENT block positions, use {@link #isInBuildLimit} (which checks the height + COMMENT limit), and if the action involves a player interaction, additionally + COMMENT check for {@link #canPlayerModifyAt} (which checks the spawn protection and world border). + COMMENT + COMMENT @see #isInBuildLimit + COMMENT @see #canPlayerModifyAt ARG 0 pos METHOD method_27982 isDebugWorld ()Z COMMENT Checks if this world is a debug world. @@ -106,6 +136,7 @@ CLASS net/minecraft/class_1937 net/minecraft/world/World METHOD method_38989 shouldUpdatePostDeath (Lnet/minecraft/class_1297;)Z ARG 1 entity METHOD method_39425 shouldTickBlocksInChunk (J)Z + COMMENT {@return whether the blocks in the specified chunk should get ticked} ARG 1 chunkPos METHOD method_39522 shouldRemoveEntityLater (Lnet/minecraft/class_1297$class_5529;)Z ARG 1 reason @@ -115,10 +146,17 @@ CLASS net/minecraft/class_1937 net/minecraft/world/World ARG 3 newState ARG 4 flags METHOD method_8419 isRaining ()Z + COMMENT {@return whether it is raining} + COMMENT + COMMENT @see #hasRain METHOD method_8421 sendEntityStatus (Lnet/minecraft/class_1297;B)V + COMMENT Sends the entity status to nearby players. + COMMENT + COMMENT @see net.minecraft.entity.EntityStatuses ARG 1 entity ARG 2 status METHOD method_8424 setMobSpawnOptions (ZZ)V + COMMENT Sets whether monsters or animals can spawn. ARG 1 spawnMonsters ARG 2 spawnAnimals METHOD method_8427 addSyncedBlockEvent (Lnet/minecraft/class_2338;Lnet/minecraft/class_2248;II)V @@ -131,6 +169,9 @@ CLASS net/minecraft/class_1937 net/minecraft/world/World ARG 1 delta METHOD method_8433 getRecipeManager ()Lnet/minecraft/class_1863; METHOD method_8437 createExplosion (Lnet/minecraft/class_1297;DDDFLnet/minecraft/class_1927$class_4179;)Lnet/minecraft/class_1927; + COMMENT Creates an explosion without creating fire. + COMMENT + COMMENT @see #createExplosion(Entity, DamageSource, ExplosionBehavior, double, double, double, float, boolean, Explosion.DestructionType) ARG 1 entity ARG 2 x ARG 4 y @@ -151,18 +192,28 @@ CLASS net/minecraft/class_1937 net/minecraft/world/World ARG 6 pitch METHOD method_8450 getGameRules ()Lnet/minecraft/class_1928; METHOD method_8452 updateNeighborsAlways (Lnet/minecraft/class_2338;Lnet/minecraft/class_2248;)V + COMMENT Emits a neighbor update to all 6 neighboring blocks of {@code pos}. + COMMENT + COMMENT @see #updateNeighborsExcept(BlockPos, Block, Direction) ARG 1 pos ARG 2 block METHOD method_8454 createExplosion (Lnet/minecraft/class_1297;Lnet/minecraft/class_1282;Lnet/minecraft/class_5362;DDDFZLnet/minecraft/class_1927$class_4179;)Lnet/minecraft/class_1927; + COMMENT Creates an explosion. ARG 1 entity + COMMENT the entity that exploded (like TNT) or {@code null} to indicate no entity exploded ARG 2 damageSource + COMMENT the custom damage source, or {@code null} to use the default + COMMENT ({@link DamageSource#explosion(Explosion)}) ARG 3 behavior + COMMENT the explosion behavior, or {@code null} to use the default ARG 4 x ARG 6 y ARG 8 z ARG 10 power ARG 11 createFire + COMMENT whether the explosion should create fire ARG 12 destructionType + COMMENT the destruction type of the explosion METHOD method_8455 updateComparators (Lnet/minecraft/class_2338;Lnet/minecraft/class_2248;)V ARG 1 pos ARG 2 block @@ -190,6 +241,12 @@ CLASS net/minecraft/class_1937 net/minecraft/world/World ARG 11 velocityY ARG 13 velocityZ METHOD method_8469 getEntityById (I)Lnet/minecraft/class_1297; + COMMENT {@return the entity using the entity ID, or {@code null} if none was found} + COMMENT + COMMENT

Entity ID is ephemeral and changes after server restart. Use the UUID + COMMENT for persistent storage instead. + COMMENT + COMMENT @see net.minecraft.server.world.ServerWorld#getEntity ARG 1 id METHOD method_8474 syncGlobalEvent (ILnet/minecraft/class_2338;I)V ARG 1 eventId @@ -202,6 +259,9 @@ CLASS net/minecraft/class_1937 net/minecraft/world/World METHOD method_8479 isReceivingRedstonePower (Lnet/minecraft/class_2338;)Z ARG 1 pos METHOD method_8480 hasHighHumidity (Lnet/minecraft/class_2338;)Z + COMMENT {@return whether the biome at {@code pos} has high humidity} + COMMENT + COMMENT

Humidity affects the chance of fire spreading. ARG 1 pos METHOD method_8482 getReceivedRedstonePower (Lnet/minecraft/class_2338;)I ARG 1 pos @@ -217,6 +277,10 @@ CLASS net/minecraft/class_1937 net/minecraft/world/World METHOD method_8488 getReceivedStrongRedstonePower (Lnet/minecraft/class_2338;)I ARG 1 pos METHOD method_8492 updateNeighbor (Lnet/minecraft/class_2338;Lnet/minecraft/class_2248;Lnet/minecraft/class_2338;)V + COMMENT Triggers a neighbor update originating from {@code pos} at + COMMENT {@code neighborPos}. + COMMENT + COMMENT @see #updateNeighborsAlways(BlockPos, Block) ARG 1 pos ARG 2 sourceBlock ARG 3 neighborPos @@ -234,20 +298,36 @@ CLASS net/minecraft/class_1937 net/minecraft/world/World ARG 1 pos ARG 2 direction METHOD method_8500 getWorldChunk (Lnet/minecraft/class_2338;)Lnet/minecraft/class_2818; + COMMENT {@return the chunk that contains {@code pos}} ARG 1 pos METHOD method_8501 setBlockState (Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)Z ARG 1 pos ARG 2 state METHOD method_8505 canPlayerModifyAt (Lnet/minecraft/class_1657;Lnet/minecraft/class_2338;)Z + COMMENT {@return whether {@code player} can modify blocks at {@code pos}} + COMMENT + COMMENT @implNote This checks the spawn protection and the world border. + COMMENT + COMMENT @see #isInBuildLimit + COMMENT @see #isValid ARG 1 player ARG 2 pos METHOD method_8508 updateNeighborsExcept (Lnet/minecraft/class_2338;Lnet/minecraft/class_2248;Lnet/minecraft/class_2350;)V + COMMENT Emits a neighbor update to neighboring blocks of {@code pos}, except + COMMENT for the one in {@code direction} direction. + COMMENT + COMMENT @see #updateNeighborsAlways(BlockPos, Block) ARG 1 pos ARG 2 sourceBlock ARG 3 direction METHOD method_8509 setLightningTicksLeft (I)V ARG 1 lightningTicksLeft METHOD method_8510 getTime ()J + COMMENT {@return the time} + COMMENT + COMMENT

Time is used to track scheduled ticks and cannot be modified or frozen. + COMMENT + COMMENT @see WorldProperties#getTime METHOD method_8514 getTagManager ()Lnet/minecraft/class_5415; METHOD method_8515 isTopSolid (Lnet/minecraft/class_2338;Lnet/minecraft/class_1297;)Z ARG 1 pos @@ -259,6 +339,12 @@ CLASS net/minecraft/class_1937 net/minecraft/world/World METHOD method_8519 setRainGradient (F)V ARG 1 rainGradient METHOD method_8520 hasRain (Lnet/minecraft/class_2338;)Z + COMMENT {@return whether it can rain at {@code pos}} + COMMENT + COMMENT @implNote This returns {@code true} if a rain is ongoing, the biome + COMMENT and the position allows it to rain, and there are no blocks above the position. + COMMENT + COMMENT @see #isRaining ARG 1 pos METHOD method_8522 sendPacket (Lnet/minecraft/class_2596;)V ARG 1 packet @@ -267,12 +353,25 @@ CLASS net/minecraft/class_1937 net/minecraft/world/World METHOD method_8525 disconnect ()V METHOD method_8530 isDay ()Z METHOD method_8532 getTimeOfDay ()J + COMMENT {@return the time of day} + COMMENT + COMMENT

Time of day is different to "time", which is incremented on every tick and + COMMENT cannot be modified; Time of day affects the day-night cycle, can be changed using + COMMENT {@link net.minecraft.server.command.TimeCommand /time command}, and can be frozen + COMMENT if {@link GameRules#DO_DAYLIGHT_CYCLE doDaylightCycle} gamerule is turned off. + COMMENT Time is used to track scheduled ticks and cannot be modified or frozen. + COMMENT + COMMENT @see WorldProperties#getTimeOfDay + COMMENT @see net.minecraft.server.world.ServerWorld#setTimeOfDay METHOD method_8533 calculateAmbientDarkness ()V METHOD method_8536 getRandomPosInChunk (IIII)Lnet/minecraft/class_2338; ARG 1 x ARG 2 y ARG 3 z METHOD method_8537 createExplosion (Lnet/minecraft/class_1297;DDDFZLnet/minecraft/class_1927$class_4179;)Lnet/minecraft/class_1927; + COMMENT Creates an explosion. + COMMENT + COMMENT @see #createExplosion(Entity, DamageSource, ExplosionBehavior, double, double, double, float, boolean, Explosion.DestructionType) ARG 1 entity ARG 2 x ARG 4 y diff --git a/mappings/net/minecraft/world/WorldAccess.mapping b/mappings/net/minecraft/world/WorldAccess.mapping index 943e20c417..3cb1b0b85c 100644 --- a/mappings/net/minecraft/world/WorldAccess.mapping +++ b/mappings/net/minecraft/world/WorldAccess.mapping @@ -8,9 +8,14 @@ CLASS net/minecraft/class_1936 net/minecraft/world/WorldAccess ARG 2 event ARG 3 emitter METHOD method_32888 emitGameEvent (Lnet/minecraft/class_1297;Lnet/minecraft/class_5712;Lnet/minecraft/class_2338;)V + COMMENT Emits an game event. ARG 1 entity + COMMENT the entity that triggered the game event, or {@code null} for events + COMMENT not triggered by entities (such as dispensers) ARG 2 event + COMMENT the game event ARG 3 pos + COMMENT the position where the event occurred METHOD method_32889 emitGameEvent (Lnet/minecraft/class_5712;Lnet/minecraft/class_2338;)V ARG 1 event ARG 2 pos diff --git a/mappings/net/minecraft/world/WorldView.mapping b/mappings/net/minecraft/world/WorldView.mapping index 7df8cd0303..308fc7ec9e 100644 --- a/mappings/net/minecraft/world/WorldView.mapping +++ b/mappings/net/minecraft/world/WorldView.mapping @@ -22,6 +22,7 @@ CLASS net/minecraft/class_4538 net/minecraft/world/WorldView ARG 1 pos ARG 2 direction METHOD method_22345 containsFluid (Lnet/minecraft/class_238;)Z + COMMENT {@return {@code true} if any of the blocks inside {@code box} contain fluid} ARG 1 box METHOD method_22346 getLightLevel (Lnet/minecraft/class_2338;I)I ARG 1 pos @@ -29,10 +30,18 @@ CLASS net/minecraft/class_4538 net/minecraft/world/WorldView METHOD method_22347 isAir (Lnet/minecraft/class_2338;)Z ARG 1 pos METHOD method_22348 isSkyVisibleAllowingSea (Lnet/minecraft/class_2338;)Z + COMMENT {@return whether the sky is visible at {@code pos}} + COMMENT + COMMENT

In addition to the normal logic that checks the sky light level, this method + COMMENT also returns {@code true} if {@code pos} is below the sea level, and every block + COMMENT between the sea level and {@code pos} is either transparent or liquid. + COMMENT + COMMENT @see BlockRenderView#isSkyVisible ARG 1 pos METHOD method_22349 getBrightness (Lnet/minecraft/class_2338;)F ARG 1 pos METHOD method_22350 getChunk (Lnet/minecraft/class_2338;)Lnet/minecraft/class_2791; + COMMENT {@return the chunk that contains {@code pos}} ARG 1 pos METHOD method_22351 isWater (Lnet/minecraft/class_2338;)Z ARG 1 pos @@ -54,6 +63,7 @@ CLASS net/minecraft/class_4538 net/minecraft/world/WorldView ARG 1 x ARG 2 z METHOD method_8392 getChunk (II)Lnet/minecraft/class_2791; + COMMENT {@return the chunk with position {@code chunkX} and {@code chunkZ}} ARG 1 chunkX ARG 2 chunkZ METHOD method_8393 isChunkLoaded (II)Z @@ -67,6 +77,8 @@ CLASS net/minecraft/class_4538 net/minecraft/world/WorldView METHOD method_8594 getAmbientDarkness ()I METHOD method_8597 getDimension ()Lnet/minecraft/class_2874; METHOD method_8598 getTopPosition (Lnet/minecraft/class_2902$class_2903;Lnet/minecraft/class_2338;)Lnet/minecraft/class_2338; + COMMENT {@return the position of the topmost block in the column + COMMENT containing {@code pos} using {@code heightmap} heightmap} ARG 1 heightmap ARG 2 pos METHOD method_8608 isClient ()Z @@ -75,6 +87,8 @@ CLASS net/minecraft/class_4538 net/minecraft/world/WorldView COMMENT

If the value returned is false, it is expected that this world is present on a logical server. METHOD method_8615 getSeaLevel ()I METHOD method_8624 getTopY (Lnet/minecraft/class_2902$class_2903;II)I + COMMENT {@return the Y coordinate of the topmost block at the coordinates + COMMENT {@code x} and {@code z} using {@code heightmap}} ARG 1 heightmap ARG 2 x ARG 3 z