From 7037ad5416665b32c27977af97e5e8fd9572b85d Mon Sep 17 00:00:00 2001 From: Kilip1000 <206253641+Kilip1000@users.noreply.github.com> Date: Wed, 31 Dec 2025 22:02:43 +0100 Subject: [PATCH 01/22] Some @reurns and {@code true} --- .../resource/ResourcePackActivationType.java | 2 +- .../net/fabricmc/fabric/api/event/Event.java | 7 ++----- .../fabricmc/fabric/api/util/TriState.java | 6 ++++-- .../biome/v1/BiomeModificationContext.java | 16 +++++++-------- .../api/biome/v1/BiomeSelectionContext.java | 10 +++++----- .../fabric/api/biome/v1/BiomeSelectors.java | 18 ++++++++--------- .../fabric/api/biome/v1/NetherBiomes.java | 2 +- .../fabric/api/block/v1/FabricBlockState.java | 2 +- .../ChunkSectionBlockStateCounterMixin.java | 2 +- .../client/ClientCommandInternals.java | 4 ++-- .../v1/provider/FabricTagProvider.java | 2 +- .../fabric/api/item/v1/EnchantmentSource.java | 2 +- .../item/v1/FabricComponentMapBuilder.java | 2 +- .../fabric/api/item/v1/FabricItem.java | 12 +++++------ .../api/particle/v1/FabricParticleTypes.java | 6 +++--- .../CustomIngredientSerializer.java | 8 ++++---- .../api/renderer/v1/mesh/QuadAtlas.java | 4 ++-- .../fabric/impl/client/indigo/Indigo.java | 4 ++-- .../renderer/helper/GeometryHelper.java | 8 ++++---- .../indigo/renderer/mesh/QuadViewImpl.java | 2 +- .../rendering/v1/FabricRenderPipeline.java | 8 ++++---- .../rendering/hud/HudElementRegistryImpl.java | 4 ++-- .../fluid/FluidVariantAttributeHandler.java | 20 +++++++++---------- .../api/transfer/v1/item/ItemVariant.java | 4 ++-- .../transfer/v1/storage/TransferVariant.java | 2 +- 25 files changed, 78 insertions(+), 79 deletions(-) diff --git a/deprecated/fabric-resource-loader-v0/src/main/java/net/fabricmc/fabric/api/resource/ResourcePackActivationType.java b/deprecated/fabric-resource-loader-v0/src/main/java/net/fabricmc/fabric/api/resource/ResourcePackActivationType.java index 5c7117d11e6..3c175714ecc 100644 --- a/deprecated/fabric-resource-loader-v0/src/main/java/net/fabricmc/fabric/api/resource/ResourcePackActivationType.java +++ b/deprecated/fabric-resource-loader-v0/src/main/java/net/fabricmc/fabric/api/resource/ResourcePackActivationType.java @@ -43,7 +43,7 @@ public enum ResourcePackActivationType { } /** - * Returns whether this resource pack will be enabled by default or not. + * {@return whether this resource pack will be enabled by default or not} * * @return {@code true} if enabled by default, else {@code false} */ diff --git a/fabric-api-base/src/main/java/net/fabricmc/fabric/api/event/Event.java b/fabric-api-base/src/main/java/net/fabricmc/fabric/api/event/Event.java index 9e4e5f68f7e..3832de896c9 100644 --- a/fabric-api-base/src/main/java/net/fabricmc/fabric/api/event/Event.java +++ b/fabric-api-base/src/main/java/net/fabricmc/fabric/api/event/Event.java @@ -36,13 +36,10 @@ public abstract class Event { protected volatile T invoker; /** - * Returns the invoker instance. - * + * @return the invoker instance. *

An "invoker" is an object which hides multiple registered - * listeners of type T under one instance of type T, executing + * listeners of type {@code T} under one instance of type {@code T}, executing * them and leaving early as necessary. - * - * @return The invoker instance. */ public final T invoker() { return invoker; diff --git a/fabric-api-base/src/main/java/net/fabricmc/fabric/api/util/TriState.java b/fabric-api-base/src/main/java/net/fabricmc/fabric/api/util/TriState.java index c39ba488824..13adf521910 100644 --- a/fabric-api-base/src/main/java/net/fabricmc/fabric/api/util/TriState.java +++ b/fabric-api-base/src/main/java/net/fabricmc/fabric/api/util/TriState.java @@ -27,7 +27,7 @@ import net.minecraft.util.StringRepresentable; /** - * Represents a boolean value which can be true, false or refer to a default value. + * Represents a boolean value which can be {@code true}, {@code false} or refer to a default value. */ public enum TriState implements StringRepresentable { /** @@ -62,6 +62,7 @@ public static TriState of(boolean bool) { * * @param bool the boolean value * @return {@link TriState#DEFAULT} if {@code null}. + *
* Otherwise {@link TriState#TRUE} or {@link TriState#FALSE} depending on the value of the boolean. */ public static TriState of(@Nullable Boolean bool) { @@ -71,7 +72,7 @@ public static TriState of(@Nullable Boolean bool) { /** * Gets the value of the tri-state. * - * @return true if the tri-state is {@link TriState#TRUE}, + * @return {@code true} if the tri-state is {@link TriState#TRUE}, * otherwise false. */ public boolean get() { @@ -82,6 +83,7 @@ public boolean get() { * Gets the value of the tri-state as a boxed, nullable boolean. * * @return {@code null} if {@link TriState#DEFAULT}. + *
* Otherwise {@code true} if {@link TriState#TRUE} or {@code false} if {@link TriState#FALSE}. */ @Nullable diff --git a/fabric-biome-api-v1/src/main/java/net/fabricmc/fabric/api/biome/v1/BiomeModificationContext.java b/fabric-biome-api-v1/src/main/java/net/fabricmc/fabric/api/biome/v1/BiomeModificationContext.java index a646f643785..eff44f06cc7 100644 --- a/fabric-biome-api-v1/src/main/java/net/fabricmc/fabric/api/biome/v1/BiomeModificationContext.java +++ b/fabric-biome-api-v1/src/main/java/net/fabricmc/fabric/api/biome/v1/BiomeModificationContext.java @@ -43,27 +43,27 @@ */ public interface BiomeModificationContext { /** - * Returns the modification context for the biomes weather properties. + * @return the modification context for the biomes weather properties. */ WeatherContext getWeather(); /** - * Returns the modification context for the biomes environment attributes. + * @return the modification context for the biomes environment attributes. */ AttributesContext getAttributes(); /** - * Returns the modification context for the biomes effects. + * @return the modification context for the biomes effects. */ EffectsContext getEffects(); /** - * Returns the modification context for the biomes generation settings. + * @return the modification context for the biomes generation settings. */ GenerationSettingsContext getGenerationSettings(); /** - * Returns the modification context for the biomes spawn settings. + * @return the modification context for the biomes spawn settings. */ SpawnSettingsContext getSpawnSettings(); @@ -286,7 +286,7 @@ default boolean removeFeature(ResourceKey placedFeatureKey) { /** * Removes all carvers with the given key from this biome. * - * @return True if any carvers were removed. + * @return {@code true} if any carvers were removed. */ boolean removeCarver(ResourceKey> configuredCarverKey); } @@ -318,7 +318,7 @@ interface SpawnSettingsContext { void addSpawn(MobCategory spawnGroup, MobSpawnSettings.SpawnerData spawnEntry, int weight); /** - * Removes any spawns matching the given predicate from this biome, and returns true if any matched. + * Removes any spawns matching the given predicate from this biome, and returns {@code true} if any matched. * *

Associated JSON property: spawners. */ @@ -329,7 +329,7 @@ interface SpawnSettingsContext { * *

Associated JSON property: spawners. * - * @return True if any spawns were removed. + * @return {@code true} if any spawns were removed. */ default boolean removeSpawnsOfEntityType(EntityType entityType) { return removeSpawns((spawnGroup, spawnEntry) -> spawnEntry.type() == entityType); diff --git a/fabric-biome-api-v1/src/main/java/net/fabricmc/fabric/api/biome/v1/BiomeSelectionContext.java b/fabric-biome-api-v1/src/main/java/net/fabricmc/fabric/api/biome/v1/BiomeSelectionContext.java index 1538c43ddab..7279ed255a7 100644 --- a/fabric-biome-api-v1/src/main/java/net/fabricmc/fabric/api/biome/v1/BiomeSelectionContext.java +++ b/fabric-biome-api-v1/src/main/java/net/fabricmc/fabric/api/biome/v1/BiomeSelectionContext.java @@ -36,14 +36,14 @@ public interface BiomeSelectionContext { ResourceKey getBiomeKey(); /** - * Returns the biome with modifications by biome modifiers of higher priority already applied. + * @return the biome with modifications by biome modifiers of higher priority already applied. */ Biome getBiome(); Holder getBiomeRegistryEntry(); /** - * Returns true if this biome contains a placed feature referencing a configured feature with the given key. + * @return {@code true} if this biome contains a placed feature referencing a configured feature with the given key. */ default boolean hasFeature(ResourceKey> key) { List> featureSteps = getBiome().getGenerationSettings().features(); @@ -60,7 +60,7 @@ default boolean hasFeature(ResourceKey> key) { } /** - * Returns true if this biome contains a placed feature with the given key. + * @return {@code true} if this biome contains a placed feature with the given {@link TagKey}. */ default boolean hasPlacedFeature(ResourceKey key) { List> featureSteps = getBiome().getGenerationSettings().features(); @@ -91,7 +91,7 @@ default boolean hasPlacedFeature(ResourceKey key) { Optional> getPlacedFeatureKey(PlacedFeature placedFeature); /** - * Returns true if the configured structure with the given key can start in this biome in any chunk generator + * @return {@code true} if the configured structure with the given key can start in this biome in any chunk generator * used by the current world-save. */ boolean validForStructure(ResourceKey key); @@ -112,7 +112,7 @@ default boolean hasPlacedFeature(ResourceKey key) { boolean canGenerateIn(ResourceKey dimensionKey); /** - * {@return true if this biome is in the given {@link TagKey }}. + * @return {@code true} if this biome is in the given {@link TagKey}. */ boolean hasTag(TagKey tag); } diff --git a/fabric-biome-api-v1/src/main/java/net/fabricmc/fabric/api/biome/v1/BiomeSelectors.java b/fabric-biome-api-v1/src/main/java/net/fabricmc/fabric/api/biome/v1/BiomeSelectors.java index edc7c41bffa..796849cb7ea 100644 --- a/fabric-biome-api-v1/src/main/java/net/fabricmc/fabric/api/biome/v1/BiomeSelectors.java +++ b/fabric-biome-api-v1/src/main/java/net/fabricmc/fabric/api/biome/v1/BiomeSelectors.java @@ -48,7 +48,7 @@ public static Predicate all() { } /** - * Returns a biome selector that will match all biomes from the minecraft namespace. + * @return a biome selector that will match all biomes from the minecraft namespace. */ public static Predicate vanilla() { return context -> { @@ -59,7 +59,7 @@ public static Predicate vanilla() { } /** - * Returns a biome selector that will match all biomes that would normally spawn in the Overworld, + * @return a biome selector that will match all biomes that would normally spawn in the Overworld, * assuming Vanilla's default biome source is used. */ public static Predicate foundInOverworld() { @@ -67,7 +67,7 @@ public static Predicate foundInOverworld() { } /** - * Returns a biome selector that will match all biomes that would normally spawn in the Nether, + * @return a biome selector that will match all biomes that would normally spawn in the Nether, * assuming Vanilla's default multi noise biome source with the nether preset is used. * *

This selector will also match modded biomes that have been added to the nether using {@link NetherBiomes}. @@ -77,7 +77,7 @@ public static Predicate foundInTheNether() { } /** - * Returns a biome selector that will match all biomes that would normally spawn in the End, + * @return a biome selector that will match all biomes that would normally spawn in the End, * assuming Vanilla's default End biome source is used. */ public static Predicate foundInTheEnd() { @@ -85,7 +85,7 @@ public static Predicate foundInTheEnd() { } /** - * Returns a biome selector that will match all biomes in the given tag. + * @return a biome selector that will match all biomes in the given tag. * * @see net.minecraft.tags.BiomeTags */ @@ -102,7 +102,7 @@ public static Predicate excludeByKey(ResourceKey.. } /** - * Returns a selector that will reject any biome whose key is in the given collection of keys. + * @return a selector that will reject any biome whose key is in the given collection of keys. * *

This is useful for allowing a list of biomes to be defined in the config file, where * a certain feature should not spawn. @@ -120,7 +120,7 @@ public static Predicate includeByKey(ResourceKey.. } /** - * Returns a selector that will accept only biomes whose keys are in the given collection of keys. + * @return a selector that will accept only biomes whose keys are in the given collection of keys. * *

This is useful for allowing a list of biomes to be defined in the config file, where * a certain feature should spawn exclusively. @@ -130,7 +130,7 @@ public static Predicate includeByKey(CollectionMatches spawns in all {@link MobCategory spawn groups}. */ @@ -139,7 +139,7 @@ public static Predicate spawnsOneOf(EntityType... enti } /** - * Returns a biome selector that will match biomes in which one of the given entity types can spawn. + * @return a biome selector that will match biomes in which one of the given entity types can spawn. * *

Matches spawns in all {@link MobCategory spawn groups}. */ diff --git a/fabric-biome-api-v1/src/main/java/net/fabricmc/fabric/api/biome/v1/NetherBiomes.java b/fabric-biome-api-v1/src/main/java/net/fabricmc/fabric/api/biome/v1/NetherBiomes.java index 312fd78e31a..4c368ba425a 100644 --- a/fabric-biome-api-v1/src/main/java/net/fabricmc/fabric/api/biome/v1/NetherBiomes.java +++ b/fabric-biome-api-v1/src/main/java/net/fabricmc/fabric/api/biome/v1/NetherBiomes.java @@ -60,7 +60,7 @@ public static void addNetherBiome(ResourceKey biome, Climate.ParameterPoi } /** - * Returns true if the given biome can generate in the nether, considering the Vanilla nether biomes, + * @return {@code true} if the given biome can generate in the nether, considering the Vanilla nether biomes, * and any biomes added to the Nether by mods. */ public static boolean canGenerateInNether(ResourceKey biome) { diff --git a/fabric-block-api-v1/src/main/java/net/fabricmc/fabric/api/block/v1/FabricBlockState.java b/fabric-block-api-v1/src/main/java/net/fabricmc/fabric/api/block/v1/FabricBlockState.java index 06f4cffecbf..7ce36712630 100644 --- a/fabric-block-api-v1/src/main/java/net/fabricmc/fabric/api/block/v1/FabricBlockState.java +++ b/fabric-block-api-v1/src/main/java/net/fabricmc/fabric/api/block/v1/FabricBlockState.java @@ -30,7 +30,7 @@ */ public interface FabricBlockState { /** - * Return the current appearance of the block, i.e. which block state this block reports to look like on a given side. + * {@return the current appearance of the block, i.e. which block state this block reports to look like on a given side} * * @param renderView the world this block is in * @param pos position of this block, whose appearance is being queried diff --git a/fabric-block-api-v1/src/main/java/net/fabricmc/fabric/mixin/block/ChunkSectionBlockStateCounterMixin.java b/fabric-block-api-v1/src/main/java/net/fabricmc/fabric/mixin/block/ChunkSectionBlockStateCounterMixin.java index 0d5537abaaa..2539e15a496 100644 --- a/fabric-block-api-v1/src/main/java/net/fabricmc/fabric/mixin/block/ChunkSectionBlockStateCounterMixin.java +++ b/fabric-block-api-v1/src/main/java/net/fabricmc/fabric/mixin/block/ChunkSectionBlockStateCounterMixin.java @@ -27,7 +27,7 @@ public class ChunkSectionBlockStateCounterMixin { /** * Makes Chunk Sections not have isAir = true modded blocks be replaced with AIR against their will. - * Mojang report: https://bugs.mojang.com/browse/MC-232360 + * Mojang report: https://bugs.mojang.com/browse/MC-232360 */ @Redirect(method = "accept(Lnet/minecraft/world/level/block/state/BlockState;I)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/block/state/BlockState;isAir()Z")) diff --git a/fabric-command-api-v2/src/client/java/net/fabricmc/fabric/impl/command/client/ClientCommandInternals.java b/fabric-command-api-v2/src/client/java/net/fabricmc/fabric/impl/command/client/ClientCommandInternals.java index 63f3337867e..a3c2f378dfe 100644 --- a/fabric-command-api-v2/src/client/java/net/fabricmc/fabric/impl/command/client/ClientCommandInternals.java +++ b/fabric-command-api-v2/src/client/java/net/fabricmc/fabric/impl/command/client/ClientCommandInternals.java @@ -69,7 +69,7 @@ public static void setActiveDispatcher(@Nullable CommandDispatcher getAliasGroupBuilders() { return Collections.unmodifiableMap(aliasGroupBuilders); diff --git a/fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/EnchantmentSource.java b/fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/EnchantmentSource.java index 81db2eb691d..44332bf15a6 100644 --- a/fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/EnchantmentSource.java +++ b/fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/EnchantmentSource.java @@ -43,7 +43,7 @@ public enum EnchantmentSource { } /** - * Returns whether this enchantment source is builtin and bundled in the vanilla or mod resources. + * {@return whether this enchantment source is builtin and bundled in the vanilla or mod resources.} * *

{@link #VANILLA} and {@link #MOD} are builtin. * diff --git a/fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/FabricComponentMapBuilder.java b/fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/FabricComponentMapBuilder.java index c673962aa77..070430134aa 100644 --- a/fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/FabricComponentMapBuilder.java +++ b/fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/FabricComponentMapBuilder.java @@ -75,7 +75,7 @@ default List getOrEmpty(DataComponentType> type) { * Checks if a component type has been registered to this builder. * * @param type The component type to check - * @return Returns true if the type has been registered to this builder, false otherwise + * @return Returns {@code true} if the type has been registered to this builder, {@code false} otherwise */ default boolean contains(DataComponentType type) { throw new AssertionError("Implemented in Mixin"); diff --git a/fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/FabricItem.java b/fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/FabricItem.java index 08d8c8596c6..397a8357354 100644 --- a/fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/FabricItem.java +++ b/fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/FabricItem.java @@ -44,15 +44,15 @@ */ public interface FabricItem { /** - * When the components of an item stack in the main hand or off hand changes, vanilla runs an "update animation". + * When the components of an item stack in the main hand or offhand changes, vanilla runs an "update animation". * This function is called on the client side when the components or count of the stack has changed, but not the item, * and returning false cancels this animation. * * @param player the current player; this may be safely cast to {@link net.minecraft.client.player.LocalPlayer} in client-only code - * @param hand the hand; this function applies both to the main hand and the off hand + * @param hand the hand; this function applies both to the main hand and the offhand * @param oldStack the previous stack, of this item * @param newStack the new stack, also of this item - * @return true to run the vanilla animation, false to cancel it. + * @return {@code true} to run the vanilla animation, {@code false} to cancel it. */ default boolean allowComponentsUpdateAnimation(Player player, InteractionHand hand, ItemStack oldStack, ItemStack newStack) { return true; @@ -61,12 +61,12 @@ default boolean allowComponentsUpdateAnimation(Player player, InteractionHand ha /** * When the components of the selected stack changes, block breaking progress is reset. * This function is called when the components of the selected stack has changed, - * and returning true allows the block breaking progress to continue. + * and returning {@code true} allows the block breaking progress to continue. * * @param player the player breaking the block * @param oldStack the previous stack, of this item * @param newStack the new stack, also of this item - * @return true to allow continuing block breaking, false to reset the progress. + * @return {@code true} to allow continuing block breaking, false to reset the progress. */ default boolean allowContinuingBlockBreaking(Player player, ItemStack oldStack, ItemStack newStack) { return false; @@ -177,7 +177,7 @@ default Item.Properties equipmentSlot(EquipmentSlotProvider equipmentSlotProvide /** * Sets the custom damage handler of the item. - * Note that this is only called on an ItemStack if {@link ItemStack#isDamageableItem()} returns true. + * Note that this is only called on an ItemStack if {@link ItemStack#isDamageableItem()} returns {@code true}. * * @see CustomDamageHandler */ diff --git a/fabric-particles-v1/src/main/java/net/fabricmc/fabric/api/particle/v1/FabricParticleTypes.java b/fabric-particles-v1/src/main/java/net/fabricmc/fabric/api/particle/v1/FabricParticleTypes.java index ee53e1e39e6..c8c6b6e950f 100644 --- a/fabric-particles-v1/src/main/java/net/fabricmc/fabric/api/particle/v1/FabricParticleTypes.java +++ b/fabric-particles-v1/src/main/java/net/fabricmc/fabric/api/particle/v1/FabricParticleTypes.java @@ -56,7 +56,7 @@ public static SimpleParticleType simple() { /** * Creates a new, default particle type for the given id. * - * @param alwaysSpawn True to always spawn the particle regardless of distance. + * @param alwaysSpawn {@code true} to always spawn the particle regardless of distance. */ public static SimpleParticleType simple(boolean alwaysSpawn) { return new SimpleParticleType(alwaysSpawn) { }; @@ -75,7 +75,7 @@ public static ParticleType complex(final MapCodec /** * Creates a new particle type with a custom factory and codecs for packet/data serialization. * - * @param alwaysSpawn True to always spawn the particle regardless of distance. + * @param alwaysSpawn {@code true} to always spawn the particle regardless of distance. * @param codec The codec for serialization. * @param packetCodec The packet codec for network serialization. */ @@ -108,7 +108,7 @@ public static ParticleType complex(final Function * Creates a new particle type with a custom factory and codecs for packet/data serialization. * This method is useful when two different {@link ParticleType}s share the same {@link ParticleOptions} implementation. * - * @param alwaysSpawn True to always spawn the particle regardless of distance. + * @param alwaysSpawn {@code true} to always spawn the particle regardless of distance. * @param codecGetter A function that, given the newly created type, returns the codec for serialization. * @param packetCodecGetter A function that, given the newly created type, returns the packet codec for network serialization. */ diff --git a/fabric-recipe-api-v1/src/main/java/net/fabricmc/fabric/api/recipe/v1/ingredient/CustomIngredientSerializer.java b/fabric-recipe-api-v1/src/main/java/net/fabricmc/fabric/api/recipe/v1/ingredient/CustomIngredientSerializer.java index 5703d0342fe..37bae20956b 100644 --- a/fabric-recipe-api-v1/src/main/java/net/fabricmc/fabric/api/recipe/v1/ingredient/CustomIngredientSerializer.java +++ b/fabric-recipe-api-v1/src/main/java/net/fabricmc/fabric/api/recipe/v1/ingredient/CustomIngredientSerializer.java @@ -44,7 +44,7 @@ static void register(CustomIngredientSerializer serializer) { } /** - * {@return the custom ingredient serializer registered with the given identifier, or {@code null} if there is no such serializer}. + * @return the custom ingredient serializer registered with the given identifier, or {@code null} if there is no such serializer. */ @Nullable static CustomIngredientSerializer get(Identifier identifier) { @@ -52,12 +52,12 @@ static CustomIngredientSerializer get(Identifier identifier) { } /** - * {@return the identifier of this serializer}. + * @return the identifier of this serializer. */ Identifier getIdentifier(); /** - * {@return the codec}. + * {@return the codec} * *

Codecs are used to read the ingredient from the recipe JSON files. * @@ -66,7 +66,7 @@ static CustomIngredientSerializer get(Identifier identifier) { MapCodec getCodec(); /** - * {@return the packet codec for serializing this ingredient}. + * @return the packet codec for serializing this ingredient. * * @see Ingredient#CONTENTS_STREAM_CODEC */ diff --git a/fabric-renderer-api-v1/src/client/java/net/fabricmc/fabric/api/renderer/v1/mesh/QuadAtlas.java b/fabric-renderer-api-v1/src/client/java/net/fabricmc/fabric/api/renderer/v1/mesh/QuadAtlas.java index 2050b0ba746..1fcb36b2130 100644 --- a/fabric-renderer-api-v1/src/client/java/net/fabricmc/fabric/api/renderer/v1/mesh/QuadAtlas.java +++ b/fabric-renderer-api-v1/src/client/java/net/fabricmc/fabric/api/renderer/v1/mesh/QuadAtlas.java @@ -35,7 +35,7 @@ public enum QuadAtlas { } /** - * {@return the quad atlas for the given atlas texture ID or null if no corresponding quad atlas exists} + * @return the quad atlas for the given atlas texture ID or null if no corresponding quad atlas exists. */ @Nullable public static QuadAtlas of(Identifier atlasTextureId) { @@ -49,7 +49,7 @@ public static QuadAtlas of(Identifier atlasTextureId) { } /** - * {@return the atlas texture ID} + * @return the atlas texture ID. */ public Identifier getTextureId() { return textureId; diff --git a/fabric-renderer-indigo/src/client/java/net/fabricmc/fabric/impl/client/indigo/Indigo.java b/fabric-renderer-indigo/src/client/java/net/fabricmc/fabric/impl/client/indigo/Indigo.java index 031f6b03ddd..a6377583bfc 100644 --- a/fabric-renderer-indigo/src/client/java/net/fabricmc/fabric/impl/client/indigo/Indigo.java +++ b/fabric-renderer-indigo/src/client/java/net/fabricmc/fabric/impl/client/indigo/Indigo.java @@ -35,10 +35,10 @@ public class Indigo implements ClientModInitializer { public static final AoConfig AMBIENT_OCCLUSION_MODE; - /** Set true in dev env to confirm results match vanilla when they should. */ + /** Set {@code true} in dev env to confirm results match vanilla when they should. */ public static final boolean DEBUG_COMPARE_LIGHTING; public static final boolean FIX_SMOOTH_LIGHTING_OFFSET; - /** When true, requires {@link #FIX_SMOOTH_LIGHTING_OFFSET} to be true. */ + /** When {@code true}, requires {@link #FIX_SMOOTH_LIGHTING_OFFSET} to be {@code true}. */ public static final boolean FIX_MEAN_LIGHT_CALCULATION; public static final boolean FIX_EXTERIOR_VERTEX_LIGHTING; public static final boolean FIX_LUMINOUS_AO_SHADE; diff --git a/fabric-renderer-indigo/src/client/java/net/fabricmc/fabric/impl/client/indigo/renderer/helper/GeometryHelper.java b/fabric-renderer-indigo/src/client/java/net/fabricmc/fabric/impl/client/indigo/renderer/helper/GeometryHelper.java index b86dd493263..9e9e996986e 100644 --- a/fabric-renderer-indigo/src/client/java/net/fabricmc/fabric/impl/client/indigo/renderer/helper/GeometryHelper.java +++ b/fabric-renderer-indigo/src/client/java/net/fabricmc/fabric/impl/client/indigo/renderer/helper/GeometryHelper.java @@ -77,7 +77,7 @@ public static int computeShapeFlags(QuadView quad) { } /** - * Returns true if quad is parallel to the given face. + * @return {@code true} if quad is parallel to the given face. * Does not validate quad winding order. * Expects convex quads with all points co-planar. */ @@ -88,7 +88,7 @@ public static boolean isQuadParallelToFace(Direction face, QuadView quad) { } /** - * True if quad - already known to be parallel to a face - is actually coplanar with it. + * Returns: {@code true} if quad - already known to be parallel to a face - is actually coplanar with it. * For compatibility with vanilla resource packs, also true if quad is outside the face. * *

Test will be unreliable if not already parallel, use {@link #isQuadParallelToFace(Direction, QuadView)} @@ -100,7 +100,7 @@ public static boolean isParallelQuadOnFace(Direction lightFace, QuadView quad) { } /** - * Returns true if quad is truly a quad (not a triangle) and fills a full block cross-section. + * Returns: {@code true} if quad is truly a quad (not a triangle) and fills a full block cross-section. * If known to be true, allows use of a simpler/faster AO lighting algorithm. * *

Does not check if quad is actually coplanar with the light face, nor does it check that all @@ -223,7 +223,7 @@ public static Axis longestAxis(float normalX, float normalY, float normalZ) { } /** - * Returns the index of the vertex which is in the first cubic corner for the given quad's light face, according to + * @return the index of the vertex which is in the first cubic corner for the given quad's light face, according to * the directions specified in {@link FaceInfo}. Assumes that the given quad is * {@linkplain #isQuadCubic(Direction, QuadView) cubic}. Used to make smooth lighting for cubic quads work correctly * regardless of vertex order. diff --git a/fabric-renderer-indigo/src/client/java/net/fabricmc/fabric/impl/client/indigo/renderer/mesh/QuadViewImpl.java b/fabric-renderer-indigo/src/client/java/net/fabricmc/fabric/impl/client/indigo/renderer/mesh/QuadViewImpl.java index 19a48faf71b..0af85eaf4ac 100644 --- a/fabric-renderer-indigo/src/client/java/net/fabricmc/fabric/impl/client/indigo/renderer/mesh/QuadViewImpl.java +++ b/fabric-renderer-indigo/src/client/java/net/fabricmc/fabric/impl/client/indigo/renderer/mesh/QuadViewImpl.java @@ -53,7 +53,7 @@ public class QuadViewImpl implements QuadView { @Nullable protected Direction nominalFace; - /** True when face normal, light face, or geometry flags may not match geometry. */ + /** {@code true} when face normal, light face, or geometry flags may not match geometry. */ protected boolean isGeometryInvalid = true; protected final Vector3f faceNormal = new Vector3f(); diff --git a/fabric-rendering-v1/src/client/java/net/fabricmc/fabric/api/client/rendering/v1/FabricRenderPipeline.java b/fabric-rendering-v1/src/client/java/net/fabricmc/fabric/api/client/rendering/v1/FabricRenderPipeline.java index 689b4bed21b..11b11005e74 100644 --- a/fabric-rendering-v1/src/client/java/net/fabricmc/fabric/api/client/rendering/v1/FabricRenderPipeline.java +++ b/fabric-rendering-v1/src/client/java/net/fabricmc/fabric/api/client/rendering/v1/FabricRenderPipeline.java @@ -29,7 +29,7 @@ public interface FabricRenderPipeline { /** * Returns whether the pipeline draw mode should be used for GUI rendering. * - * @return true if the pipeline draw mode should be used for GUI rendering, false otherwise. + * @return {@code true} if the pipeline draw mode should be used for GUI rendering, false otherwise. */ default boolean usePipelineDrawModeForGui() { throw new AssertionError("Implemented in Mixin"); @@ -44,7 +44,7 @@ interface Builder { /** * Sets whether the pipeline draw mode should be used for GUI rendering. * - * @param usePipelineDrawMode true if the pipeline draw mode should be used for GUI rendering, false otherwise. + * @param usePipelineDrawMode {@code true} if the pipeline draw mode should be used for GUI rendering, {@code false} otherwise. * @return this builder instance for chaining. */ default RenderPipeline.Builder withUsePipelineDrawModeForGui(boolean usePipelineDrawMode) { @@ -70,7 +70,7 @@ interface Snippet { /** * Returns whether the pipeline draw mode should be used for GUI rendering. * - * @return an Optional containing true if the pipeline draw mode should be used for GUI rendering, false otherwise. + * @return an Optional containing {@code true} if the pipeline draw mode should be used for GUI rendering, {@code false} otherwise. */ default Optional usePipelineDrawModeForGui() { throw new AssertionError("Implemented in Mixin"); @@ -79,7 +79,7 @@ default Optional usePipelineDrawModeForGui() { /** * Creates a new snippet with the specified pipeline draw mode for GUI rendering. * - * @param usePipelineDrawMode true if the pipeline draw mode should be used for GUI rendering, false otherwise. + * @param usePipelineDrawMode {@code true} if the pipeline draw mode should be used for GUI rendering, {@code false} otherwise. * @return a new RenderPipeline.Snippet instance with the specified pipeline draw mode. */ static RenderPipeline.Snippet withPipelineDrawModeForGui(RenderPipeline.Snippet base, boolean usePipelineDrawMode) { diff --git a/fabric-rendering-v1/src/client/java/net/fabricmc/fabric/impl/client/rendering/hud/HudElementRegistryImpl.java b/fabric-rendering-v1/src/client/java/net/fabricmc/fabric/impl/client/rendering/hud/HudElementRegistryImpl.java index 293dbe88045..8197d060b25 100644 --- a/fabric-rendering-v1/src/client/java/net/fabricmc/fabric/impl/client/rendering/hud/HudElementRegistryImpl.java +++ b/fabric-rendering-v1/src/client/java/net/fabricmc/fabric/impl/client/rendering/hud/HudElementRegistryImpl.java @@ -148,7 +148,7 @@ static void validateUnique(Identifier id) { } /** - * @return true if an element with the given identifier was found + * @return {@code true} if an element with the given identifier was found */ @VisibleForTesting static boolean findLayer(Identifier identifier, LayerVisitor visitor) { @@ -196,7 +196,7 @@ private static boolean visitLayers(List layers, LayerVisitor visitor) @VisibleForTesting interface LayerVisitor { /** - * @return true if the list has been modified, false if not modified + * @return {@code true} if the list has been modified, {@code false} if not modified */ boolean visit(HudLayer layer, ListIterator iterator); } diff --git a/fabric-transfer-api-v1/src/main/java/net/fabricmc/fabric/api/transfer/v1/fluid/FluidVariantAttributeHandler.java b/fabric-transfer-api-v1/src/main/java/net/fabricmc/fabric/api/transfer/v1/fluid/FluidVariantAttributeHandler.java index ffff56ce9d1..9860bb8f866 100644 --- a/fabric-transfer-api-v1/src/main/java/net/fabricmc/fabric/api/transfer/v1/fluid/FluidVariantAttributeHandler.java +++ b/fabric-transfer-api-v1/src/main/java/net/fabricmc/fabric/api/transfer/v1/fluid/FluidVariantAttributeHandler.java @@ -37,7 +37,7 @@ */ public interface FluidVariantAttributeHandler { /** - * Return the name that should be used for the passed fluid variant. + * @return the name that should be used for the passed fluid variant. */ default Component getName(FluidVariant fluidVariant) { Block fluidBlock = fluidVariant.getFluid().defaultFluidState().createLegacyBlock().getBlock(); @@ -51,7 +51,7 @@ default Component getName(FluidVariant fluidVariant) { } /** - * Return the sound corresponding to this fluid being filled, or none if no sound is available. + * @return the sound corresponding to this fluid being filled, or none if no sound is available. * *

If a non-empty sound event is returned, {@link Fluid#getPickupSound} will return that sound. */ @@ -60,7 +60,7 @@ default Optional getFillSound(FluidVariant variant) { } /** - * Return the sound corresponding to this fluid being emptied, or none if no sound is available. + * @return the sound corresponding to this fluid being emptied, or none if no sound is available. * *

If a non-empty sound event is returned, {@link BucketItem#playEmptySound} will play that sound. */ @@ -69,14 +69,14 @@ default Optional getEmptySound(FluidVariant variant) { } /** - * Return an integer in [0, 15]: the light level emitted by this fluid, or 0 if it doesn't naturally emit light. + * @return an integer in the range of 0 to 15: the light level emitted by this fluid, or 0 if it doesn't naturally emit light. */ default int getLuminance(FluidVariant variant) { return variant.getFluid().defaultFluidState().createLegacyBlock().getLightEmission(); } /** - * Return a non-negative integer, representing the temperature of this fluid in Kelvin. + * {@return a non-negative integer, representing the temperature of this fluid in Kelvin.} * The reference values are {@value FluidConstants#WATER_TEMPERATURE} for water, and {@value FluidConstants#LAVA_TEMPERATURE} for lava. */ default int getTemperature(FluidVariant variant) { @@ -84,22 +84,22 @@ default int getTemperature(FluidVariant variant) { } /** - * Return a positive integer, representing the viscosity of this fluid. - * Fluids with lower viscosity generally flow faster than fluids with higher viscosity. - * + * {@return a positive integer, representing the viscosity of this fluid. + * Fluids with lower viscosity generally flow faster than fluids with higher viscosity} + *

*

More precisely, viscosity should be {@value FluidConstants#VISCOSITY_RATIO} * {@link FlowingFluid#getTickDelay} for flowable fluids. * The reference values are {@value FluidConstants#WATER_VISCOSITY} for water, * {@value FluidConstants#LAVA_VISCOSITY_NETHER} for lava in ultrawarm dimensions (such as the nether), * and {@value FluidConstants#LAVA_VISCOSITY} for lava in other dimensions. * - * @param world World if available, otherwise null. + * @param world World if available, otherwise {@code null}. */ default int getViscosity(FluidVariant variant, @Nullable Level world) { return FluidConstants.WATER_VISCOSITY; } /** - * Return true if this fluid is lighter than air. + * @return {@code true} if this fluid is lighter than air. * Fluids that are lighter than air generally flow upwards. */ default boolean isLighterThanAir(FluidVariant variant) { diff --git a/fabric-transfer-api-v1/src/main/java/net/fabricmc/fabric/api/transfer/v1/item/ItemVariant.java b/fabric-transfer-api-v1/src/main/java/net/fabricmc/fabric/api/transfer/v1/item/ItemVariant.java index 803cef16ccd..da2dfcbdb58 100644 --- a/fabric-transfer-api-v1/src/main/java/net/fabricmc/fabric/api/transfer/v1/item/ItemVariant.java +++ b/fabric-transfer-api-v1/src/main/java/net/fabricmc/fabric/api/transfer/v1/item/ItemVariant.java @@ -73,14 +73,14 @@ static ItemVariant of(ItemLike item, DataComponentPatch components) { } /** - * Return true if the item and tag of this variant match those of the passed stack, and false otherwise. + * @return {@code true} if the item and tag of this variant match those of the passed stack, and {@code false} otherwise. */ default boolean matches(ItemStack stack) { return isOf(stack.getItem()) && Objects.equals(stack.getComponentsPatch(), getComponents()); } /** - * Return the item of this variant. + * @return the item of this variant. */ default Item getItem() { return getObject(); diff --git a/fabric-transfer-api-v1/src/main/java/net/fabricmc/fabric/api/transfer/v1/storage/TransferVariant.java b/fabric-transfer-api-v1/src/main/java/net/fabricmc/fabric/api/transfer/v1/storage/TransferVariant.java index 2d8cdc89d86..f93333c6e24 100644 --- a/fabric-transfer-api-v1/src/main/java/net/fabricmc/fabric/api/transfer/v1/storage/TransferVariant.java +++ b/fabric-transfer-api-v1/src/main/java/net/fabricmc/fabric/api/transfer/v1/storage/TransferVariant.java @@ -34,7 +34,7 @@ */ public interface TransferVariant { /** - * Return true if this variant is blank, and false otherwise. + * Return {@code true} if this variant is blank, and {@code false} otherwise. */ boolean isBlank(); From 534df530726a4d758b250924fac11ec866121a0b Mon Sep 17 00:00:00 2001 From: Kilip1000 <206253641+Kilip1000@users.noreply.github.com> Date: Wed, 31 Dec 2025 22:15:18 +0100 Subject: [PATCH 02/22] fix --- .../fabric/impl/client/indigo/renderer/mesh/QuadViewImpl.java | 4 ++-- .../api/transfer/v1/fluid/FluidVariantAttributeHandler.java | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/fabric-renderer-indigo/src/client/java/net/fabricmc/fabric/impl/client/indigo/renderer/mesh/QuadViewImpl.java b/fabric-renderer-indigo/src/client/java/net/fabricmc/fabric/impl/client/indigo/renderer/mesh/QuadViewImpl.java index 0af85eaf4ac..98f23631443 100644 --- a/fabric-renderer-indigo/src/client/java/net/fabricmc/fabric/impl/client/indigo/renderer/mesh/QuadViewImpl.java +++ b/fabric-renderer-indigo/src/client/java/net/fabricmc/fabric/impl/client/indigo/renderer/mesh/QuadViewImpl.java @@ -165,12 +165,12 @@ public final boolean hasNormal(int vertexIndex) { return (normalFlags() & (1 << vertexIndex)) != 0; } - /** True if any vertex normal has been set. */ + /** @return {@code true} if any vertex normal has been set. */ public final boolean hasVertexNormals() { return normalFlags() != 0; } - /** True if all vertex normals have been set. */ + /** @return {@code true if all vertex normals have been set. */ public final boolean hasAllVertexNormals() { return (normalFlags() & 0b1111) == 0b1111; } diff --git a/fabric-transfer-api-v1/src/main/java/net/fabricmc/fabric/api/transfer/v1/fluid/FluidVariantAttributeHandler.java b/fabric-transfer-api-v1/src/main/java/net/fabricmc/fabric/api/transfer/v1/fluid/FluidVariantAttributeHandler.java index 9860bb8f866..ff8ab0551d7 100644 --- a/fabric-transfer-api-v1/src/main/java/net/fabricmc/fabric/api/transfer/v1/fluid/FluidVariantAttributeHandler.java +++ b/fabric-transfer-api-v1/src/main/java/net/fabricmc/fabric/api/transfer/v1/fluid/FluidVariantAttributeHandler.java @@ -87,6 +87,7 @@ default int getTemperature(FluidVariant variant) { * {@return a positive integer, representing the viscosity of this fluid. * Fluids with lower viscosity generally flow faster than fluids with higher viscosity} *

+ * *

More precisely, viscosity should be {@value FluidConstants#VISCOSITY_RATIO} * {@link FlowingFluid#getTickDelay} for flowable fluids. * The reference values are {@value FluidConstants#WATER_VISCOSITY} for water, * {@value FluidConstants#LAVA_VISCOSITY_NETHER} for lava in ultrawarm dimensions (such as the nether), From 15c3379a511a72fff04d5406c81dab3ff45b5730 Mon Sep 17 00:00:00 2001 From: Kilip1000 <206253641+Kilip1000@users.noreply.github.com> Date: Wed, 31 Dec 2025 22:23:32 +0100 Subject: [PATCH 03/22] Fix some returns --- .../net/fabricmc/fabric/api/item/v1/EnchantmentSource.java | 2 +- .../main/java/net/fabricmc/fabric/api/item/v1/FabricItem.java | 4 +++- .../fabric/api/recipe/v1/ingredient/CustomIngredient.java | 2 +- .../net/fabricmc/fabric/api/renderer/v1/mesh/MutableMesh.java | 2 +- .../fabric/api/client/rendering/v1/FabricRenderPipeline.java | 2 +- .../api/transfer/v1/fluid/FluidVariantAttributeHandler.java | 4 ++-- 6 files changed, 9 insertions(+), 7 deletions(-) diff --git a/fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/EnchantmentSource.java b/fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/EnchantmentSource.java index 44332bf15a6..3937e220cbf 100644 --- a/fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/EnchantmentSource.java +++ b/fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/EnchantmentSource.java @@ -43,7 +43,7 @@ public enum EnchantmentSource { } /** - * {@return whether this enchantment source is builtin and bundled in the vanilla or mod resources.} + * {@return whether this enchantment source is builtin and bundled in the vanilla or mod resources}. * *

{@link #VANILLA} and {@link #MOD} are builtin. * diff --git a/fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/FabricItem.java b/fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/FabricItem.java index 397a8357354..8ba3f56aa0c 100644 --- a/fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/FabricItem.java +++ b/fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/FabricItem.java @@ -75,8 +75,10 @@ default boolean allowContinuingBlockBreaking(Player player, ItemStack oldStack, /** * Returns a leftover item stack after {@code stack} is consumed in a recipe. * (This is also known as "recipe remainder".) - * For example, using a lava bucket in a furnace as fuel will leave an empty bucket. + *
+ *
* + *

For example, using a lava bucket in a furnace as fuel will leave an empty bucket. *

Here is an example for a recipe remainder that increments the item's damage. * *

{@code
diff --git a/fabric-recipe-api-v1/src/main/java/net/fabricmc/fabric/api/recipe/v1/ingredient/CustomIngredient.java b/fabric-recipe-api-v1/src/main/java/net/fabricmc/fabric/api/recipe/v1/ingredient/CustomIngredient.java
index f390c02b547..b7cbdf15be9 100644
--- a/fabric-recipe-api-v1/src/main/java/net/fabricmc/fabric/api/recipe/v1/ingredient/CustomIngredient.java
+++ b/fabric-recipe-api-v1/src/main/java/net/fabricmc/fabric/api/recipe/v1/ingredient/CustomIngredient.java
@@ -62,7 +62,7 @@ public interface CustomIngredient {
 	boolean test(ItemStack stack);
 
 	/**
-	 * {@return the list of stacks that match this ingredient.}
+	 * {@return the list of stacks that match this ingredient}
 	 *
 	 * 

The following guidelines should be followed for good compatibility: *

* * @param entity the entity - * @param tickElytra false if this is just to check if the custom elytra can be used, true if the custom elytra should also be ticked, i.e. perform side-effects of flying such as using resources. - * @return true to use a custom elytra, enabling elytra flight for the entity and cancelling subsequent handlers + * @param tickElytra {@code false} if this is just to check if the custom elytra can be used, {@code true} if the custom elytra should also be ticked, i.e. perform side-effects of flying such as using resources. + * @return {@code true} to use a custom elytra, enabling elytra flight for the entity and cancelling subsequent handlers */ boolean useCustomElytra(LivingEntity entity, boolean tickElytra); } diff --git a/fabric-entity-events-v1/src/main/java/net/fabricmc/fabric/api/entity/event/v1/ServerLivingEntityEvents.java b/fabric-entity-events-v1/src/main/java/net/fabricmc/fabric/api/entity/event/v1/ServerLivingEntityEvents.java index 658b12a6cec..b30d16c9920 100644 --- a/fabric-entity-events-v1/src/main/java/net/fabricmc/fabric/api/entity/event/v1/ServerLivingEntityEvents.java +++ b/fabric-entity-events-v1/src/main/java/net/fabricmc/fabric/api/entity/event/v1/ServerLivingEntityEvents.java @@ -64,7 +64,7 @@ public final class ServerLivingEntityEvents { * *

Mods can cancel this to keep the entity alive. * - *

Vanilla checks for entity health {@code <= 0} each tick (with {@link LivingEntity#isDeadOrDying()}), and kills if true - + *

Vanilla checks for entity health {@code <= 0} each tick (with {@link LivingEntity#isDeadOrDying()}), and kills if {@code true} - * so the entity will still die next tick if this event is cancelled. * It's assumed that the listener will do something to prevent this, for example, if the entity is a player: *