Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,8 @@ public abstract class Event<T> {
* Returns the invoker instance.
*
* <p>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.
Comment on lines 39 to -45
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO keep the @return and remove the above statement that says "Returns the invoker instance."

*/
public final T invoker() {
return invoker;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
/**
Expand Down Expand Up @@ -71,7 +71,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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ default boolean removeFeature(ResourceKey<PlacedFeature> 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<ConfiguredWorldCarver<?>> configuredCarverKey);
}
Expand Down Expand Up @@ -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.
*
* <p>Associated JSON property: <code>spawners</code>.
*/
Expand All @@ -329,7 +329,7 @@ interface SpawnSettingsContext {
*
* <p>Associated JSON property: <code>spawners</code>.
*
* @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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public interface BiomeSelectionContext {
Holder<Biome> getBiomeRegistryEntry();

/**
* Returns true if this biome contains a placed feature referencing a configured feature with the given key.
* Returns {@code true} if this biome contains a placed feature referencing a configured feature with the given key.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Returns {@code 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<ConfiguredFeature<?, ?>> key) {
List<HolderSet<PlacedFeature>> featureSteps = getBiome().getGenerationSettings().features();
Expand All @@ -60,7 +60,7 @@ default boolean hasFeature(ResourceKey<ConfiguredFeature<?, ?>> key) {
}

/**
* Returns true if this biome contains a placed feature with the given key.
* Returns {@code true} if this biome contains a placed feature with the given {@linkplain ResourceKey key}.
*/
default boolean hasPlacedFeature(ResourceKey<PlacedFeature> key) {
List<HolderSet<PlacedFeature>> featureSteps = getBiome().getGenerationSettings().features();
Expand Down Expand Up @@ -89,9 +89,8 @@ default boolean hasPlacedFeature(ResourceKey<PlacedFeature> key) {
* from this biomes feature list.
*/
Optional<ResourceKey<PlacedFeature>> getPlacedFeatureKey(PlacedFeature placedFeature);

/**
* Returns true if the configured structure with the given key can start in this biome in any chunk generator
* Returns {@code true} if the configured structure with the given key can start in this biome in any chunk generator
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Returns {@code 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<Structure> key);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public static void addNetherBiome(ResourceKey<Biome> biome, Climate.ParameterPoi
}

/**
* Returns true if the given biome can generate in the nether, considering the Vanilla nether biomes,
* Returns {@code true} if the given biome can generate in the nether, considering the Vanilla nether biomes,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Returns {@code 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> biome) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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: <a href="https://bugs.mojang.com/browse/MC-232360">https://bugs.mojang.com/browse/MC-232360</a>
*/
@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"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public static void setActiveDispatcher(@Nullable CommandDispatcher<FabricClientC
* (This is the same requirement as {@code ClientPlayerEntity#sendCommand}.)
*
* @param command the command with slash removed
* @return true if the command should not be sent to the server, false otherwise
* @return {@code true} if the command should not be sent to the server, {@code false} otherwise
*/
public static boolean executeCommand(String command) {
Minecraft client = Minecraft.getInstance();
Expand Down Expand Up @@ -111,7 +111,7 @@ public static boolean executeCommand(String command) {
* should be ignored and the command sent to the server.
*
* @param type the exception type
* @return true if ignored, false otherwise
* @return {@code true} if ignored, {@code false} otherwise
*/
private static boolean isIgnoredException(CommandExceptionType type) {
BuiltInExceptionProvider builtins = CommandSyntaxException.BUILT_IN_EXCEPTIONS;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ default SoundTypeBuilder category(SoundSource category) {
}

/**
* Sets an optional replace boolean, which on true allows this sound type to override others.
* Sets an optional replace boolean, which on {@code true} allows this sound type to override others.
*
* <p>The default is false.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
public final class EntityElytraEvents {
/**
* An event to check if elytra flight (both through normal and custom elytras) is allowed.
* All listeners need to return true to allow the entity to fly, otherwise elytra flight will be blocked/stopped.
* All listeners need to return {@code true} to allow the entity to fly, otherwise elytra flight will be blocked/stopped.
*/
public static final Event<Allow> ALLOW = EventFactory.createArrayBacked(Allow.class, listeners -> entity -> {
for (Allow listener : listeners) {
Expand Down Expand Up @@ -59,7 +59,7 @@ public final class EntityElytraEvents {
@FunctionalInterface
public interface Allow {
/**
* @return false to block elytra flight, true to allow it (unless another listener returns false)
* @return {@code false} to block elytra flight, {@code true} to allow it (unless another listener returns {@code false})
*/
boolean allowElytraFlight(LivingEntity entity);
}
Expand All @@ -86,8 +86,8 @@ public interface Custom {
* }</pre>
*
* @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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public final class ServerLivingEntityEvents {
*
* <p>Mods can cancel this to keep the entity alive.
*
* <p>Vanilla checks for entity health {@code <= 0} each tick (with {@link LivingEntity#isDeadOrDying()}), and kills if true -
* <p>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:
* <ul>
Expand Down Expand Up @@ -116,7 +116,7 @@ public interface AllowDamage {
* @param entity the entity
* @param source the source of the damage
* @param amount the amount of damage that the entity will take (before mitigations)
* @return true if the damage should go ahead, false to cancel the damage.
* @return {@code true} if the damage should go ahead, {@code false} to cancel the damage.
*/
boolean allowDamage(LivingEntity entity, DamageSource source, float amount);
}
Expand Down Expand Up @@ -144,7 +144,7 @@ public interface AllowDeath {
* @param entity the entity
* @param damageSource the source of the fatal damage
* @param damageAmount the amount of damage that has killed the entity
* @return true if the death should go ahead, false to cancel the death.
* @return {@code true} if the death should go ahead, {@code false} to cancel the death.
*/
boolean allowDeath(LivingEntity entity, DamageSource damageSource, float damageAmount);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public interface AllowDeath {
* @param player the player
* @param damageSource the fatal damage damageSource
* @param damageAmount the damageAmount of damage that has killed the player
* @return true if the death should go ahead, false otherwise.
* @return {@code true} if the death should go ahead, {@code false} otherwise.
*/
boolean allowDeath(ServerPlayer player, DamageSource damageSource, float damageAmount);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
@Deprecated
public interface BlockAttackInteractionAware {
/**
* @return True if the block accepted the player and it should no longer be processed.
* @return {@code true} if the block accepted the player, and it should no longer be processed.
*/
boolean onAttackInteraction(BlockState state, Level world, BlockPos pos, Player player, InteractionHand hand, Direction direction);
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
import net.fabricmc.fabric.api.item.v1.FabricItem;

/**
* Allow canceling the held item update animation if {@link FabricItem#allowComponentsUpdateAnimation} returns false.
* Allow canceling the held item update animation if {@link FabricItem#allowComponentsUpdateAnimation} returns {@code false}.
*/
@Mixin(ItemInHandRenderer.class)
public class ItemInHandRendererMixin {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public interface FabricComponentMapBuilder {
* @param fallback The supplier for the default data value if the type is not in this map yet. The value given by this supplier
* may not be null.
* @param <T> The type of the component data
* @return Returns the current value in the map builder, or the default value provided by the fallback if not present
* @return the current value in the map builder, or the default value provided by the fallback if not present
* @see #getOrEmpty(DataComponentType)
*/
default <T> T getOrCreate(DataComponentType<T> type, Supplier<T> fallback) {
Expand All @@ -51,7 +51,7 @@ default <T> T getOrCreate(DataComponentType<T> type, Supplier<T> fallback) {
* @param type The component type
* @param defaultValue The default data value if the type is not in this map yet
* @param <T> The type of the component data
* @return Returns the current value in the map builder, or the default value if not present
* @return the current value in the map builder, or the default value if not present
*/
default <T> T getOrDefault(DataComponentType<T> type, T defaultValue) {
Objects.requireNonNull(defaultValue, "Cannot insert null values to component map builder");
Expand All @@ -65,7 +65,7 @@ default <T> T getOrDefault(DataComponentType<T> type, T defaultValue) {
*
* @param type The component type. The component must be a list-type.
* @param <T> The type of the component entry data
* @return Returns a mutable list of values for the type.
* @return a mutable list of values for the type.
*/
default <T> List<T> getOrEmpty(DataComponentType<List<T>> type) {
throw new AssertionError("Implemented in Mixin");
Expand All @@ -75,7 +75,7 @@ default <T> List<T> getOrEmpty(DataComponentType<List<T>> 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 {@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");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
* and returning {@code 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;
Expand All @@ -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, {@code false} to reset the progress.
*/
default boolean allowContinuingBlockBreaking(Player player, ItemStack oldStack, ItemStack newStack) {
return false;
Expand All @@ -75,9 +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.
*
* <p>Here is an example for a recipe remainder that increments the item's damage.
* <p>
* 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.
*
* <pre>{@code
* if (stack.getDamage() < stack.getMaxDamage() - 1) {
Expand Down Expand Up @@ -177,7 +178,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
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public interface FabricCreativeInventoryScreen {
* Switches to the page with the given index if it exists.
*
* @param page the index of the page to switch to
* @return Returns true when the page was changed
* @return {@code true} when the page was changed
*/
default boolean switchToPage(int page) {
throw new AssertionError("Implemented by mixin");
Expand All @@ -39,7 +39,7 @@ default boolean switchToPage(int page) {
/**
* Switches to the next page if it exists.
*
* @return Returns true when the page was changed
* @return {@code true} when the page was changed
*/
default boolean switchToNextPage() {
return switchToPage(getCurrentPage() + 1);
Expand All @@ -48,28 +48,28 @@ default boolean switchToNextPage() {
/**
* Switches to the previous page if it exists.
*
* @return Returns true when the page was changed
* @return {@code true} when the page was changed
*/
default boolean switchToPreviousPage() {
return switchToPage(getCurrentPage() - 1);
}

/**
* Returns the index of the current page.
* @return the index of the current page.
*/
default int getCurrentPage() {
throw new AssertionError("Implemented by mixin");
}

/**
* Returns the total number of pages.
* @return the total number of pages.
*/
default int getPageCount() {
throw new AssertionError("Implemented by mixin");
}

/**
* Returns an ordered list containing the item groups on the requested page.
* @return an ordered list containing the item groups on the requested page.
*/
default List<CreativeModeTab> getItemGroupsOnPage(int page) {
throw new AssertionError("Implemented by mixin");
Expand All @@ -90,7 +90,7 @@ default int getPage(CreativeModeTab itemGroup) {
/**
* Returns whether there are additional pages to show on top of the default vanilla pages.
*
* @return true if there are additional pages
* @return {@code true} if there are additional pages
*/
default boolean hasAdditionalPages() {
throw new AssertionError("Implemented by mixin");
Expand All @@ -109,7 +109,7 @@ default CreativeModeTab getSelectedItemGroup() {
* Sets the currently selected tab to the given {@link CreativeModeTab}.
*
* @param itemGroup the {@link CreativeModeTab} to select
* @return true if the tab was successfully selected
* @return {@code true} if the tab was successfully selected
*/
default boolean setSelectedItemGroup(CreativeModeTab itemGroup) {
throw new AssertionError("Implemented by mixin");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ public void addBefore(Predicate<ItemStack> beforeFirst, Collection<ItemStack> ne
}

/**
* @return True if the item of a given stack is enabled in the current {@link FeatureFlagSet}.
* @return {@code true} if the item of a given stack is enabled in the current {@link FeatureFlagSet}.
* @see Item#isEnabled
*/
private boolean isEnabled(ItemStack stack) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ private CommonLifecycleEvents() {
public interface TagsLoaded {
/**
* @param registries Up-to-date registries from which the tags can be retrieved.
* @param client True if the client just received a sync packet, false if the server just (re)loaded the tags.
* @param client {@code true} if the client just received a sync packet, {@code false} if the server just (re)loaded the tags.
*/
void onTagsLoaded(RegistryAccess registries, boolean client);
}
Expand Down
Loading
Loading