Moved tree decorators into their own package (#1579)

* Moved tree decorators into their own package

* Apply suggestions from code review

Co-authored-by: liach <7806504+liach@users.noreply.github.com>

* trigger github?

* Update mappings/net/minecraft/world/gen/tree/TreeDecoratorType.mapping

Co-authored-by: Juuxel <6596629+Juuxel@users.noreply.github.com>

Co-authored-by: liach <7806504+liach@users.noreply.github.com>
Co-authored-by: Juuxel <6596629+Juuxel@users.noreply.github.com>
This commit is contained in:
Yanis48 2020-07-19 16:06:04 +02:00 committed by GitHub
parent e8dd3900c6
commit 8a5d3b4c45
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 38 additions and 22 deletions

View File

@ -2,7 +2,7 @@ CLASS net/minecraft/class_3542 net/minecraft/util/StringIdentifiable
METHOD method_15434 asString ()Ljava/lang/String;
METHOD method_28140 createCodec (Ljava/util/function/Supplier;Ljava/util/function/Function;)Lcom/mojang/serialization/Codec;
COMMENT Creates a codec that serializes an enum implementing this interface either
COMMENT using its ordinals (when compressed) or using it's {@link #asString()} method
COMMENT using its ordinals (when compressed) or using its {@link #asString()} method
COMMENT and a given decode function.
ARG 0 enumValues
ARG 1 fromString

View File

@ -41,7 +41,7 @@ CLASS net/minecraft/class_1959 net/minecraft/world/biome/Biome
METHOD method_30350 addFeature (ILjava/util/function/Supplier;)V
ARG 1 stepIndex
METHOD method_30357 getFeatures ()Ljava/util/List;
COMMENT @return The lists of features configured for each {@link net.minecraft.world.gen.GenerationStep.Feature feature generation step}, up to the highest step that has a configured feature.
COMMENT Returns the lists of features configured for each {@link net.minecraft.world.gen.GenerationStep.Feature feature generation step}, up to the highest step that has a configured feature.
COMMENT Entries are guaranteed to not be null, but may be empty lists if an earlier step has no features, but a later step does.
METHOD method_8684 hasStructureFeature (Lnet/minecraft/class_3195;)Z
ARG 1 structureFeature

View File

@ -23,14 +23,15 @@ CLASS net/minecraft/class_2794 net/minecraft/world/gen/chunk/ChunkGenerator
COMMENT <p>
COMMENT New chunks will only be generated up to the {@link net.minecraft.world.chunk.ChunkStatus#STRUCTURE_STARTS} phase by this method.
COMMENT
COMMENT @return null if no structure could be found within the given search radius.
COMMENT @return {@code null} if no structure could be found within the given search radius
ARG 1 world
ARG 2 feature
ARG 3 center
ARG 4 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.
COMMENT This is ignored for strongholds.
ARG 5 skipExistingChunks
COMMENT Don't return structures that are aleady referenced by generated chunks (chunks past the STRUCTURE_STARTS stage).
COMMENT This is ignored for strongholds.
COMMENT whether only structures that are not referenced by generated chunks (chunks past the STRUCTURE_STARTS stage) are returned, excluding strongholds
METHOD method_12104 getMaxY ()I
METHOD method_12106 populateBiomes (Lnet/minecraft/class_2378;Lnet/minecraft/class_2791;)V
METHOD method_12107 populateEntities (Lnet/minecraft/class_3233;)V

View File

@ -5,7 +5,7 @@ CLASS net/minecraft/class_5314 net/minecraft/world/gen/chunk/StructureConfig
FIELD field_24918 spacing I
COMMENT Defines the width and height of a cell in the structure placement grid in chunks.
COMMENT <p>
COMMENT For each cell in the grid, the chunk generator will attept to place the start of a structure.
COMMENT For each cell in the grid, the chunk generator will attempt to place the start of a structure.
COMMENT <p>
COMMENT Minimum is 1, which means the structure will potentially be placed in every chunk.
COMMENT 2 leads to one structure per 2x2 chunks, and so on.

View File

@ -8,7 +8,7 @@ CLASS net/minecraft/class_5311 net/minecraft/world/gen/chunk/StructuresConfig
COMMENT has been initialized, the check will already have been made and a
COMMENT bad default configuration will be used instead (see below).
FIELD field_24823 DEFAULT_STRONGHOLD Lnet/minecraft/class_5313;
COMMENT Default placement settings for the Stronghold.
COMMENT Default placement settings for the stronghold.
FIELD field_24824 structures Ljava/util/Map;
FIELD field_24825 stronghold Lnet/minecraft/class_5313;
COMMENT Placement settings for the stronghold for this particular combination of settings,
@ -19,7 +19,7 @@ CLASS net/minecraft/class_5311 net/minecraft/world/gen/chunk/StructuresConfig
METHOD <init> (Z)V
COMMENT Creates a new structure placement configuration with default values.
ARG 1 withStronghold
COMMENT Determines if the default stronghold configuration should be included.
COMMENT determines if the default stronghold configuration should be included
METHOD method_28598 getStructures ()Ljava/util/Map;
METHOD method_28599 (Lnet/minecraft/class_5311;)Ljava/util/Map;
ARG 0 config

View File

@ -1,2 +0,0 @@
CLASS net/minecraft/class_4658 net/minecraft/world/gen/decorator/AlterGroundTreeDecorator
FIELD field_24957 CODEC Lcom/mojang/serialization/Codec;

View File

@ -1,3 +0,0 @@
CLASS net/minecraft/class_4659 net/minecraft/world/gen/decorator/BeehiveTreeDecorator
FIELD field_21317 chance F
FIELD field_24958 CODEC Lcom/mojang/serialization/Codec;

View File

@ -1,2 +0,0 @@
CLASS net/minecraft/class_4660 net/minecraft/world/gen/decorator/CocoaBeansTreeDecorator
FIELD field_24959 CODEC Lcom/mojang/serialization/Codec;

View File

@ -3,6 +3,11 @@ CLASS net/minecraft/class_2975 net/minecraft/world/gen/feature/ConfiguredFeature
FIELD field_13376 feature Lnet/minecraft/class_3031;
FIELD field_21589 LOGGER Lorg/apache/logging/log4j/Logger;
FIELD field_24833 CODEC Lcom/mojang/serialization/Codec;
METHOD <init> (Lnet/minecraft/class_3031;Lnet/minecraft/class_3037;)V
ARG 1 feature
ARG 2 config
METHOD method_12862 generate (Lnet/minecraft/class_5281;Lnet/minecraft/class_2794;Ljava/util/Random;Lnet/minecraft/class_2338;)Z
METHOD method_23387 withChance (F)Lnet/minecraft/class_3226;
ARG 1 chance
METHOD method_30380 getFeature ()Lnet/minecraft/class_3031;
METHOD method_30381 getConfig ()Lnet/minecraft/class_3037;

View File

@ -13,7 +13,7 @@ CLASS net/minecraft/class_3195 net/minecraft/world/gen/feature/StructureFeature
COMMENT <p>
COMMENT New chunks will only be generated up to the {@link net.minecraft.world.chunk.ChunkStatus#STRUCTURE_STARTS} phase by this method.
COMMENT
COMMENT @return null if no structure could be found within the given search radius.
COMMENT @return {@code null} if no structure could be found within the given search radius
ARG 3 searchStartPos
ARG 4 searchRadius
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.
@ -24,7 +24,7 @@ CLASS net/minecraft/class_3195 net/minecraft/world/gen/feature/StructureFeature
METHOD method_14019 getName ()Ljava/lang/String;
METHOD method_14026 shouldStartAt (Lnet/minecraft/class_2794;Lnet/minecraft/class_1966;JLnet/minecraft/class_2919;IILnet/minecraft/class_1959;Lnet/minecraft/class_1923;Lnet/minecraft/class_3037;)Z
COMMENT Checks if this structure can <em>actually</em> be placed at a potential structure position determined via
COMMENT {@link #getStartChunk}. Specific structures override this method to reduce the spawn propability or
COMMENT {@link #getStartChunk}. Specific structures override this method to reduce the spawn probability or
COMMENT restrict the spawn in some other way.
ARG 3 worldSeed
ARG 6 chunkX

View File

@ -0,0 +1,5 @@
CLASS net/minecraft/class_4658 net/minecraft/world/gen/tree/AlterGroundTreeDecorator
FIELD field_21316 provider Lnet/minecraft/class_4651;
FIELD field_24957 CODEC Lcom/mojang/serialization/Codec;
METHOD <init> (Lnet/minecraft/class_4651;)V
ARG 1 provider

View File

@ -0,0 +1,5 @@
CLASS net/minecraft/class_4659 net/minecraft/world/gen/tree/BeehiveTreeDecorator
FIELD field_21317 probability F
FIELD field_24958 CODEC Lcom/mojang/serialization/Codec;
METHOD <init> (F)V
ARG 1 probability

View File

@ -0,0 +1,5 @@
CLASS net/minecraft/class_4660 net/minecraft/world/gen/tree/CocoaBeansTreeDecorator
FIELD field_21318 probability F
FIELD field_24959 CODEC Lcom/mojang/serialization/Codec;
METHOD <init> (F)V
ARG 1 probability

View File

@ -1,3 +1,3 @@
CLASS net/minecraft/class_4661 net/minecraft/world/gen/decorator/LeaveVineTreeDecorator
CLASS net/minecraft/class_4661 net/minecraft/world/gen/tree/LeaveVineTreeDecorator
FIELD field_24960 CODEC Lcom/mojang/serialization/Codec;
FIELD field_24961 INSTANCE Lnet/minecraft/class_4661;

View File

@ -1,7 +1,8 @@
CLASS net/minecraft/class_4662 net/minecraft/world/gen/decorator/TreeDecorator
CLASS net/minecraft/class_4662 net/minecraft/world/gen/tree/TreeDecorator
COMMENT Tree decorators can add additional blocks to trees, such as vines or beehives.
FIELD field_24962 TYPE_CODEC Lcom/mojang/serialization/Codec;
METHOD method_23469 generate (Lnet/minecraft/class_5281;Ljava/util/Random;Ljava/util/List;Ljava/util/List;Ljava/util/Set;Lnet/minecraft/class_3341;)V
ARG 1 world
ARG 2 random
ARG 3 logPositions
ARG 4 leavesPositions

View File

@ -1,5 +1,6 @@
CLASS net/minecraft/class_4663 net/minecraft/world/gen/decorator/TreeDecoratorType
CLASS net/minecraft/class_4663 net/minecraft/world/gen/tree/TreeDecoratorType
FIELD field_24963 codec Lcom/mojang/serialization/Codec;
METHOD method_28894 getCodec ()Lcom/mojang/serialization/Codec;
METHOD method_28895 register (Ljava/lang/String;Lcom/mojang/serialization/Codec;)Lnet/minecraft/class_4663;
ARG 0 type
ARG 0 id
ARG 1 codec

View File

@ -1,3 +1,3 @@
CLASS net/minecraft/class_4664 net/minecraft/world/gen/decorator/TrunkVineTreeDecorator
CLASS net/minecraft/class_4664 net/minecraft/world/gen/tree/TrunkVineTreeDecorator
FIELD field_24964 CODEC Lcom/mojang/serialization/Codec;
FIELD field_24965 INSTANCE Lnet/minecraft/class_4664;