- * An "invoker" is an object which hides multiple registered + * + *
An "invoker" is an object which hides multiple registered * listeners of type T under one instance of type T, executing * them and leaving early as necessary. * diff --git a/fabric-api-base/src/main/java/net/fabricmc/fabric/api/event/EventFactory.java b/fabric-api-base/src/main/java/net/fabricmc/fabric/api/event/EventFactory.java index 826e62780..aab0cbbdd 100644 --- a/fabric-api-base/src/main/java/net/fabricmc/fabric/api/event/EventFactory.java +++ b/fabric-api-base/src/main/java/net/fabricmc/fabric/api/event/EventFactory.java @@ -16,19 +16,17 @@ package net.fabricmc.fabric.api.event; -import net.fabricmc.fabric.impl.event.EventFactoryImpl; - import java.util.function.Function; +import net.fabricmc.fabric.impl.event.EventFactoryImpl; + /** * Helper for creating {@link Event} classes. */ public final class EventFactory { private static boolean profilingEnabled = true; - private EventFactory() { - - } + private EventFactory() { } /** * @return True if events are supposed to be profiled. @@ -61,8 +59,8 @@ public final class EventFactory { /** * Create an "array-backed" Event instance with a custom empty invoker. - *
- * Having a custom empty invoker (of type (...) -> {}) increases performance + * + *
Having a custom empty invoker (of type (...) -> {}) increases performance * relative to iterating over an empty array; however, it only really matters * if the event is executed thousands of times a second. * diff --git a/fabric-api-base/src/main/java/net/fabricmc/fabric/api/util/NbtType.java b/fabric-api-base/src/main/java/net/fabricmc/fabric/api/util/NbtType.java index 931124495..1329371c2 100644 --- a/fabric-api-base/src/main/java/net/fabricmc/fabric/api/util/NbtType.java +++ b/fabric-api-base/src/main/java/net/fabricmc/fabric/api/util/NbtType.java @@ -22,10 +22,10 @@ import net.minecraft.nbt.Tag; /** * NBT type ID constants. Useful for filtering by value type in a few cases. * + *
For the current list of types, check with {@link Tag#TYPES}. + * * @see CompoundTag#containsKey(String, int) * @see Tag#idToString(int) - *
- * For the current list of types, check with {@link Tag#TYPES}.
*/
public final class NbtType {
public static final int END = 0;
@@ -49,7 +49,5 @@ public final class NbtType {
*/
public static final int NUMBER = 99;
- private NbtType() {
-
- }
+ private NbtType() { }
}
diff --git a/fabric-api-base/src/main/java/net/fabricmc/fabric/impl/event/ArrayBackedEvent.java b/fabric-api-base/src/main/java/net/fabricmc/fabric/impl/event/ArrayBackedEvent.java
index 8a86c8a62..8f6b376e3 100644
--- a/fabric-api-base/src/main/java/net/fabricmc/fabric/impl/event/ArrayBackedEvent.java
+++ b/fabric-api-base/src/main/java/net/fabricmc/fabric/impl/event/ArrayBackedEvent.java
@@ -16,12 +16,12 @@
package net.fabricmc.fabric.impl.event;
-import net.fabricmc.fabric.api.event.Event;
-
import java.lang.reflect.Array;
import java.util.Arrays;
import java.util.function.Function;
+import net.fabricmc.fabric.api.event.Event;
+
class ArrayBackedEvent For example, addBiomeVariant(Biomes.JUNGLE, Biomes.DESERT, 0.2) will replace 20% of jungles with deserts.
* This method is rather useful for replacing biomes not generated through standard methods, such as oceans,
* deep oceans, jungles, mushroom islands, etc. When replacing ocean and deep ocean biomes, one must specify
* the biome without temperature (Biomes.OCEAN / Biomes.DEEP_OCEAN) only, as ocean temperatures have not been
@@ -107,5 +107,4 @@ public final class OverworldBiomes {
public static void setRiverBiome(Biome parent, Biome river) {
InternalBiomeData.setOverworldRiverBiome(parent, river);
}
-
}
diff --git a/fabric-biomes-v1/src/main/java/net/fabricmc/fabric/api/biomes/v1/OverworldClimate.java b/fabric-biomes-v1/src/main/java/net/fabricmc/fabric/api/biomes/v1/OverworldClimate.java
index d40a428b6..7637dea3e 100644
--- a/fabric-biomes-v1/src/main/java/net/fabricmc/fabric/api/biomes/v1/OverworldClimate.java
+++ b/fabric-biomes-v1/src/main/java/net/fabricmc/fabric/api/biomes/v1/OverworldClimate.java
@@ -17,27 +17,26 @@
package net.fabricmc.fabric.api.biomes.v1;
/**
- * Represents the climates of biomes on the overworld continents
+ * Represents the climates of biomes on the overworld continents.
*/
public enum OverworldClimate {
-
/**
- * Includes Snowy Tundra (with a weight of 3) and Snowy Taiga (with a weight of 1)
+ * Includes Snowy Tundra (with a weight of 3) and Snowy Taiga (with a weight of 1).
*/
SNOWY,
/**
- * Includes Forest, Taiga, Mountains, and Plains (all with weights of 1)
+ * Includes Forest, Taiga, Mountains, and Plains (all with weights of 1).
*/
COOL,
/**
- * Includes Forest, Dark Forest, Mountains, Plains, Birch Forest, and Swamp (all with weights of 1)
+ * Includes Forest, Dark Forest, Mountains, Plains, Birch Forest, and Swamp (all with weights of 1).
*/
TEMPERATE,
/**
- * Includes Desert (with a weight of 3), Savanna (with a weight of 2), and Plains (with a weight of 1)
+ * Includes Desert (with a weight of 3), Savanna (with a weight of 2), and Plains (with a weight of 1).
*/
DRY
}
diff --git a/fabric-biomes-v1/src/main/java/net/fabricmc/fabric/impl/biomes/BiomeVariant.java b/fabric-biomes-v1/src/main/java/net/fabricmc/fabric/impl/biomes/BiomeVariant.java
index 854823f2c..cf95f581e 100644
--- a/fabric-biomes-v1/src/main/java/net/fabricmc/fabric/impl/biomes/BiomeVariant.java
+++ b/fabric-biomes-v1/src/main/java/net/fabricmc/fabric/impl/biomes/BiomeVariant.java
@@ -19,10 +19,9 @@ package net.fabricmc.fabric.impl.biomes;
import net.minecraft.world.biome.Biome;
/**
- * Represents a biome variant and its corresponding chance
+ * Represents a biome variant and its corresponding chance.
*/
final class BiomeVariant {
-
private final Biome variant;
private final double chance;
@@ -48,5 +47,4 @@ final class BiomeVariant {
double getChance() {
return chance;
}
-
}
diff --git a/fabric-biomes-v1/src/main/java/net/fabricmc/fabric/impl/biomes/ContinentalBiomeEntry.java b/fabric-biomes-v1/src/main/java/net/fabricmc/fabric/impl/biomes/ContinentalBiomeEntry.java
index 17e41caa9..dbefa3836 100644
--- a/fabric-biomes-v1/src/main/java/net/fabricmc/fabric/impl/biomes/ContinentalBiomeEntry.java
+++ b/fabric-biomes-v1/src/main/java/net/fabricmc/fabric/impl/biomes/ContinentalBiomeEntry.java
@@ -19,7 +19,7 @@ package net.fabricmc.fabric.impl.biomes;
import net.minecraft.world.biome.Biome;
/**
- * Represents a biome and its corresponding weight
+ * Represents a biome and its corresponding weight.
*/
final class ContinentalBiomeEntry {
private final Biome biome;
diff --git a/fabric-biomes-v1/src/main/java/net/fabricmc/fabric/impl/biomes/InternalBiomeData.java b/fabric-biomes-v1/src/main/java/net/fabricmc/fabric/impl/biomes/InternalBiomeData.java
index c6b557850..268de271c 100644
--- a/fabric-biomes-v1/src/main/java/net/fabricmc/fabric/impl/biomes/InternalBiomeData.java
+++ b/fabric-biomes-v1/src/main/java/net/fabricmc/fabric/impl/biomes/InternalBiomeData.java
@@ -16,26 +16,30 @@
package net.fabricmc.fabric.impl.biomes;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.EnumMap;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableMap;
-import net.fabricmc.fabric.api.biomes.v1.OverworldClimate;
+
import net.minecraft.util.registry.Registry;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.biome.Biomes;
import net.minecraft.world.biome.layer.BiomeLayers;
import net.minecraft.world.biome.source.VanillaLayeredBiomeSource;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.*;
+import net.fabricmc.fabric.api.biomes.v1.OverworldClimate;
/**
* Lists and maps for internal use only! Stores data that is used by the various mixins into the world generation
*/
public final class InternalBiomeData {
-
- private InternalBiomeData() {
- }
+ private InternalBiomeData() { }
private static final EnumMap
- *
- * {@code BlockRenderLayer} controls how sprite pixels for fluids and blocks are blended
- * with the scene. Consult the vanilla {@code BlockRenderLayer} implementation for examples.
- *
- * The Fabric Renderer API can be used to control this at a per-quad level at the code
- * via {@code BlendMode}.
- *
- * Client-side only.
+ * Use to associate blocks or fluids with block render layer other than default.
+ * Replaces the {@code renderLayer} property previously on {@code Block}.
+ *
+ * {@code BlockRenderLayer} controls how sprite pixels for fluids and blocks are blended
+ * with the scene. Consult the vanilla {@code BlockRenderLayer} implementation for examples.
+ *
+ * The Fabric Renderer API can be used to control this at a per-quad level at the code
+ * via {@code BlendMode}.
+ *
+ * Client-side only.
*/
public interface BlockRenderLayerMap {
BlockRenderLayerMap INSTANCE = BlockRenderLayerMapImpl.INSTANCE;
-
+
/**
* Map (or re-map) a block state with a render layer. Re-mapping is not recommended but if done, last one in wins.
* Must be called from client thread prior to world load/rendering. Best practice will be to call from mod's client initializer.
- *
+ *
* @param block Identifies block to be mapped.
* @param renderLayer Render layer. Should be one of the layers used for terrain rendering.
*/
@@ -58,7 +59,7 @@ public interface BlockRenderLayerMap {
/**
* Map (or re-map) a fluid state with a render layer. Re-mapping is not recommended but if done, last one in wins.
* Must be called from client thread prior to world load/rendering. Best practice will be to call from mod's client initializer.
- *
+ *
* @param fluid Identifies fluid to be mapped.
* @param renderLayer Render layer. Should be one of the layers used for terrain rendering.
*/
diff --git a/fabric-blockrenderlayer-v1/src/main/java/net/fabricmc/fabric/impl/blockrenderlayer/BlockRenderLayerMapImpl.java b/fabric-blockrenderlayer-v1/src/main/java/net/fabricmc/fabric/impl/blockrenderlayer/BlockRenderLayerMapImpl.java
index da0d4bf16..65da1d043 100644
--- a/fabric-blockrenderlayer-v1/src/main/java/net/fabricmc/fabric/impl/blockrenderlayer/BlockRenderLayerMapImpl.java
+++ b/fabric-blockrenderlayer-v1/src/main/java/net/fabricmc/fabric/impl/blockrenderlayer/BlockRenderLayerMapImpl.java
@@ -20,16 +20,16 @@ import java.util.HashMap;
import java.util.Map;
import java.util.function.BiConsumer;
+import net.minecraft.block.Block;
import net.minecraft.client.render.RenderLayer;
+import net.minecraft.fluid.Fluid;
import net.minecraft.item.Item;
import net.fabricmc.fabric.api.blockrenderlayer.v1.BlockRenderLayerMap;
-import net.minecraft.block.Block;
-import net.minecraft.fluid.Fluid;
public class BlockRenderLayerMapImpl implements BlockRenderLayerMap {
- private BlockRenderLayerMapImpl() {}
-
+ private BlockRenderLayerMapImpl() { }
+
@Override
public void putBlock(Block block, RenderLayer renderLayer) {
if (block == null) throw new IllegalArgumentException("Request to map null block to BlockRenderLayer");
@@ -53,7 +53,7 @@ public class BlockRenderLayerMapImpl implements BlockRenderLayerMap {
fluidHandler.accept(fluid, renderLayer);
}
-
+
public static final BlockRenderLayerMap INSTANCE = new BlockRenderLayerMapImpl();
private static Map> info) {
Set