Skip to content
Open
Show file tree
Hide file tree
Changes from 11 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 @@ -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}
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,11 @@ public abstract class Event<T> {
protected volatile T invoker;

/**
* 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
* @return the invoker instance.
* <br>
* An "invoker" is an object which hides multiple registered
* 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;
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 @@ -62,6 +62,7 @@ public static TriState of(boolean bool) {
*
* @param bool the boolean value
* @return {@link TriState#DEFAULT} if {@code null}.
* <br>
* Otherwise {@link TriState#TRUE} or {@link TriState#FALSE} depending on the value of the boolean.
*/
public static TriState of(@Nullable Boolean bool) {
Expand All @@ -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() {
Expand All @@ -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}.
* <br>
* Otherwise {@code true} if {@link TriState#TRUE} or {@code false} if {@link TriState#FALSE}.
*/
@Nullable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down 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 @@ -36,14 +36,14 @@ public interface BiomeSelectionContext {
ResourceKey<Biome> 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<Biome> 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<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.
* @return {@code true} if this biome contains a placed feature with the given {@link TagKey}.
*/
default boolean hasPlacedFeature(ResourceKey<PlacedFeature> key) {
List<HolderSet<PlacedFeature>> featureSteps = getBiome().getGenerationSettings().features();
Expand Down Expand Up @@ -91,7 +91,7 @@ default boolean hasPlacedFeature(ResourceKey<PlacedFeature> key) {
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
* @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 All @@ -112,7 +112,7 @@ default boolean hasPlacedFeature(ResourceKey<PlacedFeature> key) {
boolean canGenerateIn(ResourceKey<LevelStem> 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<Biome> tag);
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public static Predicate<BiomeSelectionContext> 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<BiomeSelectionContext> vanilla() {
return context -> {
Expand All @@ -59,33 +59,33 @@ public static Predicate<BiomeSelectionContext> 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<BiomeSelectionContext> foundInOverworld() {
return context -> context.canGenerateIn(LevelStem.OVERWORLD);
}

/**
* 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.
*
* <p>This selector will also match modded biomes that have been added to the nether using {@link NetherBiomes}.
* <br>
* This selector will also match modded biomes that have been added to the nether using {@link NetherBiomes}.
*/
public static Predicate<BiomeSelectionContext> foundInTheNether() {
return context -> context.canGenerateIn(LevelStem.NETHER);
}

/**
* 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<BiomeSelectionContext> foundInTheEnd() {
return context -> context.canGenerateIn(LevelStem.END);
}

/**
* 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
*/
Expand All @@ -102,9 +102,9 @@ public static Predicate<BiomeSelectionContext> excludeByKey(ResourceKey<Biome>..
}

/**
* Returns a selector that will reject any biome whose key is in the given collection of keys.
*
* <p>This is useful for allowing a list of biomes to be defined in the config file, where
* @return a selector that will reject any biome whose key is in the given collection of keys.
* <br>
* This is useful for allowing a list of biomes to be defined in the config file, where
* a certain feature should not spawn.
*/
public static Predicate<BiomeSelectionContext> excludeByKey(Collection<ResourceKey<Biome>> keys) {
Expand All @@ -120,28 +120,28 @@ public static Predicate<BiomeSelectionContext> includeByKey(ResourceKey<Biome>..
}

/**
* Returns a selector that will accept only biomes whose keys are in the given collection of keys.
*
* <p>This is useful for allowing a list of biomes to be defined in the config file, where
* @return a selector that will accept only biomes whose keys are in the given collection of keys.
* <br>
* This is useful for allowing a list of biomes to be defined in the config file, where
* a certain feature should spawn exclusively.
*/
public static Predicate<BiomeSelectionContext> includeByKey(Collection<ResourceKey<Biome>> keys) {
return context -> keys.contains(context.getBiomeKey());
}

/**
* Returns a biome selector that will match biomes in which one of the given entity types can spawn.
*
* <p>Matches spawns in all {@link MobCategory spawn groups}.
* @return a biome selector that will match biomes in which one of the given entity types can spawn.
* <br>
* Matches spawns in all {@link MobCategory spawn groups}.
*/
public static Predicate<BiomeSelectionContext> spawnsOneOf(EntityType<?>... entityTypes) {
return spawnsOneOf(ImmutableSet.copyOf(entityTypes));
}

/**
* Returns a biome selector that will match biomes in which one of the given entity types can spawn.
*
* <p>Matches spawns in all {@link MobCategory spawn groups}.
* @return a biome selector that will match biomes in which one of the given entity types can spawn.
* <br>
* Matches spawns in all {@link MobCategory spawn groups}.
*/
public static Predicate<BiomeSelectionContext> spawnsOneOf(Set<EntityType<?>> entityTypes) {
return context -> {
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,
* @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 @@ -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
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 @@ -112,7 +112,7 @@ protected AliasGroupBuilder aliasGroup(String group) {
}

/**
* {@return a read-only map of alias group builders by the alias group ID}.
* @return a read-only map of alias group builders by the alias group ID
*/
public Map<Identifier, AliasGroupBuilder> getAliasGroupBuilders() {
return Collections.unmodifiableMap(aliasGroupBuilders);
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
Loading
Loading