Merge pull request from svipthedrunk/javadoc

Javadoc fixes
This commit is contained in:
grondag 2019-07-28 06:04:11 -07:00 committed by GitHub
commit 9b03381f03
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
44 changed files with 60 additions and 93 deletions
build.gradle
fabric-api-base/src/main/java/net/fabricmc/fabric/api/event
fabric-commands-v0/src/main/java/net/fabricmc/fabric/mixin/registrycommands
fabric-containers-v0/src/main/java/net/fabricmc/fabric/api
fabric-content-registries-v0/src/main/java/net/fabricmc/fabric/api/registry
fabric-loot-tables-v1/src/main/java/net/fabricmc/fabric
fabric-networking-blockentity-v0/src/main/java/net/fabricmc/fabric/mixin/networkingblockentity
fabric-networking-v0/src/main/java/net/fabricmc/fabric
fabric-object-builders-v0/src/main/java/net/fabricmc/fabric/api/entity
fabric-registry-sync-v0/src/main/java/net/fabricmc/fabric
fabric-renderer-api-v1/src/main/java/net/fabricmc/fabric/api/renderer/v1
fabric-renderer-indigo/src/main/java/net/fabricmc/indigo/renderer
fabric-rendering-data-attachment-v1/src/main/java/net/fabricmc/fabric/api/rendering/data/v1
fabric-tag-extensions-v0/src/main/java/net/fabricmc/fabric/mixin/tag
fabric-textures-v0/src/main/java/net/fabricmc/fabric

View file

@ -41,6 +41,8 @@ allprojects {
group = "net.fabricmc.fabric-api" group = "net.fabricmc.fabric-api"
dependencies { dependencies {
minecraft "com.mojang:minecraft:$Globals.mcVersion" minecraft "com.mojang:minecraft:$Globals.mcVersion"
mappings "net.fabricmc:yarn:${Globals.mcVersion}${Globals.yarnVersion}" mappings "net.fabricmc:yarn:${Globals.mcVersion}${Globals.yarnVersion}"
@ -92,6 +94,14 @@ allprojects {
classifier = 'sources' classifier = 'sources'
from sourceSets.main.allSource from sourceSets.main.allSource
} }
}
javadoc{
options.memberLevel = "PACKAGE"
allprojects.each{
source( it.sourceSets.main.allJava.srcDirs)
}
classpath = sourceSets.main.compileClasspath
} }
subprojects { subprojects {
@ -128,6 +138,7 @@ subprojects {
} }
} }
javadoc.enabled = false
} }
task remapMavenJar(type: net.fabricmc.loom.task.RemapJarTask, dependsOn: jar) { task remapMavenJar(type: net.fabricmc.loom.task.RemapJarTask, dependsOn: jar) {

View file

@ -62,7 +62,7 @@ public final class EventFactory {
/** /**
* Create an "array-backed" Event instance with a custom empty invoker. * Create an "array-backed" Event instance with a custom empty invoker.
* <p> * <p>
* Having a custom empty invoker (of type (...) -> {}) increases performance * Having a custom empty invoker (of type (...) -&gt; {}) increases performance
* relative to iterating over an empty array; however, it only really matters * relative to iterating over an empty array; however, it only really matters
* if the event is executed thousands of times a second. * if the event is executed thousands of times a second.
* *

View file

@ -20,11 +20,8 @@ import com.mojang.brigadier.CommandDispatcher;
import net.fabricmc.fabric.impl.registry.CommandRegistryImpl; import net.fabricmc.fabric.impl.registry.CommandRegistryImpl;
import net.minecraft.server.command.CommandManager; import net.minecraft.server.command.CommandManager;
import net.minecraft.server.command.ServerCommandSource; import net.minecraft.server.command.ServerCommandSource;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

View file

@ -28,7 +28,7 @@ public interface ScreenProviderRegistry {
ScreenProviderRegistry INSTANCE = ScreenProviderRegistryImpl.INSTANCE; ScreenProviderRegistry INSTANCE = ScreenProviderRegistryImpl.INSTANCE;
/** /**
* Register a "Container -> ContainerScreen" factory. This is used only on the client side. * Register a "Container -&gt; ContainerScreen" factory. This is used only on the client side.
* *
* @param identifier a shared identifier, this identifier should also be used to register a container using {@link ContainerProviderRegistry} * @param identifier a shared identifier, this identifier should also be used to register a container using {@link ContainerProviderRegistry}
* @param containerScreenFactory the supplier that should be used to create the new gui * @param containerScreenFactory the supplier that should be used to create the new gui
@ -36,8 +36,8 @@ public interface ScreenProviderRegistry {
<C extends Container> void registerFactory(Identifier identifier, ContainerScreenFactory<C> containerScreenFactory); <C extends Container> void registerFactory(Identifier identifier, ContainerScreenFactory<C> containerScreenFactory);
/** /**
* Register a "packet -> ContainerScreen" factory. This is used only on the client side, and allows you * Register a "packet -&gt; ContainerScreen" factory. This is used only on the client side, and allows you
* to override the default behaviour of re-using the existing "packet -> Container" logic. * to override the default behaviour of re-using the existing "packet -&gt; Container" logic.
* *
* @param identifier a shared identifier, this identifier should also be used to register a container using {@link ContainerProviderRegistry} * @param identifier a shared identifier, this identifier should also be used to register a container using {@link ContainerProviderRegistry}
* @param factory the gui factory, this should return a new {@link AbstractContainerScreen} * @param factory the gui factory, this should return a new {@link AbstractContainerScreen}

View file

@ -29,7 +29,7 @@ public interface ContainerFactory<T> {
* @param syncId The container synchronization ID. * @param syncId The container synchronization ID.
* @param identifier the Identifier is the name that was used when registering the factory * @param identifier the Identifier is the name that was used when registering the factory
* @param player the player that is opening the gui/container * @param player the player that is opening the gui/container
* @param buf the buffer contains the same data that was provided with {@Link ContainerProviderRegistry.openContainer} * @param buf the buffer contains the same data that was provided with {@link net.fabricmc.fabric.api.container.ContainerProviderRegistry#openContainer}
* @return the new gui or container * @return the new gui or container
*/ */
T create(int syncId, Identifier identifier, PlayerEntity player, PacketByteBuf buf); T create(int syncId, Identifier identifier, PlayerEntity player, PacketByteBuf buf);

View file

@ -31,7 +31,7 @@ public interface ContainerProviderRegistry {
ContainerProviderRegistry INSTANCE = ContainerProviderImpl.INSTANCE; ContainerProviderRegistry INSTANCE = ContainerProviderImpl.INSTANCE;
/** /**
* Register a "packet buffer -> container" factory. This is used both on the client and server side. * Register a "packet buffer -&gt; container" factory. This is used both on the client and server side.
* *
* @param identifier a shared identifier, this identifier should also be used to register a container using {@link ScreenProviderRegistry} * @param identifier a shared identifier, this identifier should also be used to register a container using {@link ScreenProviderRegistry}
* @param factory the ContainerFactory that should return a new {@link Container} * @param factory the ContainerFactory that should return a new {@link Container}

View file

@ -17,8 +17,8 @@
package net.fabricmc.fabric.api.registry; package net.fabricmc.fabric.api.registry;
import net.fabricmc.fabric.impl.registry.LootEntryTypeRegistryImpl; import net.fabricmc.fabric.impl.registry.LootEntryTypeRegistryImpl;
import net.minecraft.world.loot.entry.LootEntry;
import net.minecraft.world.loot.entry.LootEntry;
/** /**
* @deprecated Use {@link net.fabricmc.fabric.api.loot.v1.LootEntryTypeRegistry} * @deprecated Use {@link net.fabricmc.fabric.api.loot.v1.LootEntryTypeRegistry}
*/ */

View file

@ -17,24 +17,11 @@
package net.fabricmc.fabric.api.loot.v1; package net.fabricmc.fabric.api.loot.v1;
import com.google.gson.Gson; import com.google.gson.Gson;
import net.minecraft.resource.Resource;
import net.minecraft.resource.ResourceManager;
import net.minecraft.util.Identifier;
import net.minecraft.util.JsonHelper; import net.minecraft.util.JsonHelper;
import net.minecraft.util.Lazy; import net.minecraft.util.Lazy;
import net.minecraft.world.loot.*; import net.minecraft.world.loot.*;
import net.minecraft.world.loot.condition.LootCondition;
import net.minecraft.world.loot.entry.LootEntry;
import net.minecraft.world.loot.function.LootFunction;
import org.apache.commons.io.IOUtils;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader; import java.io.Reader;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.nio.charset.StandardCharsets;
import java.util.Optional;
import java.util.stream.Stream; import java.util.stream.Stream;
public final class LootJsonParser { public final class LootJsonParser {

View file

@ -25,7 +25,6 @@ import net.minecraft.util.Identifier;
import net.minecraft.util.profiler.Profiler; import net.minecraft.util.profiler.Profiler;
import net.minecraft.world.loot.LootManager; import net.minecraft.world.loot.LootManager;
import net.minecraft.world.loot.LootSupplier; import net.minecraft.world.loot.LootSupplier;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.At;

View file

@ -26,7 +26,6 @@ import net.minecraft.util.Identifier;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.Unique; import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.Inject;

View file

@ -26,7 +26,7 @@ import java.util.Collection;
/** /**
* Event for listening to packet type registrations and unregistrations * Event for listening to packet type registrations and unregistrations
* (also known as "minecraft:register" and "minecraft:unregister") * (also known as "minecraft:register" and "minecraft:unregister")
* in the client -> server direction. * in the client -&gt; server direction.
*/ */
public interface C2SPacketTypeCallback { public interface C2SPacketTypeCallback {
static final Event<C2SPacketTypeCallback> REGISTERED = EventFactory.createArrayBacked( static final Event<C2SPacketTypeCallback> REGISTERED = EventFactory.createArrayBacked(

View file

@ -25,7 +25,7 @@ import java.util.Collection;
/** /**
* Event for listening to packet type registrations and unregistrations * Event for listening to packet type registrations and unregistrations
* (also known as "minecraft:register" and "minecraft:unregister") * (also known as "minecraft:register" and "minecraft:unregister")
* in the server -> client direction. * in the server -&gt; client direction.
*/ */
public interface S2CPacketTypeCallback { public interface S2CPacketTypeCallback {
static final Event<S2CPacketTypeCallback> REGISTERED = EventFactory.createArrayBacked( static final Event<S2CPacketTypeCallback> REGISTERED = EventFactory.createArrayBacked(

View file

@ -28,8 +28,8 @@ import net.minecraft.util.PacketByteBuf;
* <p> * <p>
* It is used for: * It is used for:
* <p> * <p>
* - registering client-side packet receivers (server -> client packets) * - registering client-side packet receivers (server -&gt; client packets)
* - sending packets to the server (client -> server packets). * - sending packets to the server (client -&gt; server packets).
*/ */
public interface ClientSidePacketRegistry extends PacketRegistry { public interface ClientSidePacketRegistry extends PacketRegistry {
static final ClientSidePacketRegistry INSTANCE = new ClientSidePacketRegistryImpl(); static final ClientSidePacketRegistry INSTANCE = new ClientSidePacketRegistryImpl();

View file

@ -30,8 +30,8 @@ import net.minecraft.util.PacketByteBuf;
* <p> * <p>
* It is used for: * It is used for:
* <p> * <p>
* - registering server-side packet receivers (client -> server packets) * - registering server-side packet receivers (client -&gt; server packets)
* - sending packets to clients (server -> client packets). * - sending packets to clients (server -&gt; client packets).
* <p> * <p>
* For iterating over clients in a server, see {@link PlayerStream}. * For iterating over clients in a server, see {@link PlayerStream}.
*/ */

View file

@ -23,7 +23,6 @@ import net.fabricmc.fabric.api.network.ClientSidePacketRegistry;
import net.fabricmc.fabric.api.network.PacketContext; import net.fabricmc.fabric.api.network.PacketContext;
import net.minecraft.client.MinecraftClient; import net.minecraft.client.MinecraftClient;
import net.minecraft.client.network.ClientPlayNetworkHandler; import net.minecraft.client.network.ClientPlayNetworkHandler;
import net.minecraft.client.network.packet.CustomPayloadS2CPacket;
import net.minecraft.network.Packet; import net.minecraft.network.Packet;
import net.minecraft.server.network.packet.CustomPayloadC2SPacket; import net.minecraft.server.network.packet.CustomPayloadC2SPacket;
import net.minecraft.util.Identifier; import net.minecraft.util.Identifier;

View file

@ -24,10 +24,8 @@ import net.fabricmc.fabric.api.network.ServerSidePacketRegistry;
import net.minecraft.client.network.packet.CustomPayloadS2CPacket; import net.minecraft.client.network.packet.CustomPayloadS2CPacket;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.network.Packet; import net.minecraft.network.Packet;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.network.ServerPlayNetworkHandler; import net.minecraft.server.network.ServerPlayNetworkHandler;
import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.server.network.packet.CustomPayloadC2SPacket;
import net.minecraft.server.network.packet.LoginQueryResponseC2SPacket; import net.minecraft.server.network.packet.LoginQueryResponseC2SPacket;
import net.minecraft.util.Identifier; import net.minecraft.util.Identifier;
import net.minecraft.util.PacketByteBuf; import net.minecraft.util.PacketByteBuf;

View file

@ -20,7 +20,6 @@ import net.fabricmc.api.EnvType;
import net.fabricmc.fabric.api.network.ClientSidePacketRegistry; import net.fabricmc.fabric.api.network.ClientSidePacketRegistry;
import net.fabricmc.fabric.api.network.PacketContext; import net.fabricmc.fabric.api.network.PacketContext;
import net.fabricmc.fabric.impl.network.ClientSidePacketRegistryImpl; import net.fabricmc.fabric.impl.network.ClientSidePacketRegistryImpl;
import net.fabricmc.fabric.impl.network.PacketDebugOptions;
import net.fabricmc.fabric.impl.network.PacketRegistryImpl; import net.fabricmc.fabric.impl.network.PacketRegistryImpl;
import net.fabricmc.fabric.impl.network.PacketTypes; import net.fabricmc.fabric.impl.network.PacketTypes;
import net.minecraft.client.MinecraftClient; import net.minecraft.client.MinecraftClient;

View file

@ -19,9 +19,7 @@ package net.fabricmc.fabric.mixin.network;
import net.fabricmc.fabric.impl.network.ClientSidePacketRegistryImpl; import net.fabricmc.fabric.impl.network.ClientSidePacketRegistryImpl;
import net.minecraft.client.MinecraftClient; import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.screen.Screen; import net.minecraft.client.gui.screen.Screen;
import org.apache.logging.log4j.Logger;
import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

View file

@ -16,7 +16,6 @@
package net.fabricmc.fabric.mixin.network; package net.fabricmc.fabric.mixin.network;
import net.fabricmc.fabric.api.network.PacketRegistry;
import net.fabricmc.fabric.api.network.ServerSidePacketRegistry; import net.fabricmc.fabric.api.network.ServerSidePacketRegistry;
import net.fabricmc.fabric.impl.network.PacketRegistryImpl; import net.fabricmc.fabric.impl.network.PacketRegistryImpl;
import net.fabricmc.fabric.impl.network.ServerSidePacketRegistryImpl; import net.fabricmc.fabric.impl.network.ServerSidePacketRegistryImpl;

View file

@ -20,7 +20,6 @@ import net.fabricmc.api.EnvType;
import net.fabricmc.fabric.api.network.PacketContext; import net.fabricmc.fabric.api.network.PacketContext;
import net.fabricmc.fabric.api.network.ServerSidePacketRegistry; import net.fabricmc.fabric.api.network.ServerSidePacketRegistry;
import net.fabricmc.fabric.impl.network.CustomPayloadC2SPacketAccessor; import net.fabricmc.fabric.impl.network.CustomPayloadC2SPacketAccessor;
import net.fabricmc.fabric.impl.network.PacketDebugOptions;
import net.fabricmc.fabric.impl.network.ServerSidePacketRegistryImpl; import net.fabricmc.fabric.impl.network.ServerSidePacketRegistryImpl;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.server.MinecraftServer; import net.minecraft.server.MinecraftServer;
@ -28,7 +27,6 @@ import net.minecraft.server.network.ServerPlayNetworkHandler;
import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.server.network.packet.CustomPayloadC2SPacket; import net.minecraft.server.network.packet.CustomPayloadC2SPacket;
import net.minecraft.util.Identifier; import net.minecraft.util.Identifier;
import net.minecraft.util.PacketByteBuf;
import net.minecraft.util.ThreadExecutor; import net.minecraft.util.ThreadExecutor;
import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.Shadow;

View file

@ -25,7 +25,7 @@ import java.util.HashMap;
import java.util.Map; import java.util.Map;
/** /**
* Registry for server->client entity tracking values. * Registry for server-&gt;client entity tracking values.
* *
* @deprecated Use FabricEntityTypeBuilder methods * @deprecated Use FabricEntityTypeBuilder methods
*/ */

View file

@ -29,7 +29,7 @@ import java.util.function.Function;
/** /**
* Extended version of {@link EntityType.Builder} with added registration for * Extended version of {@link EntityType.Builder} with added registration for
* server->client entity tracking values. * server-&gt;client entity tracking values.
* *
* @param <T> Entity class. * @param <T> Entity class.
*/ */

View file

@ -32,7 +32,6 @@ import net.minecraft.util.Identifier;
import net.minecraft.util.PacketByteBuf; import net.minecraft.util.PacketByteBuf;
import net.minecraft.util.registry.MutableRegistry; import net.minecraft.util.registry.MutableRegistry;
import net.minecraft.util.registry.Registry; import net.minecraft.util.registry.Registry;
import net.minecraft.util.registry.SimpleRegistry;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;

View file

@ -25,7 +25,7 @@ public interface RemappableRegistry {
*/ */
enum RemapMode { enum RemapMode {
/** /**
* Any differences (local->remote, remote->local) are allowed. This should * Any differences (local-&gt;remote, remote-&gt;local) are allowed. This should
* be used when a side is authoritative (f.e. loading a world on the server). * be used when a side is authoritative (f.e. loading a world on the server).
*/ */
AUTHORITATIVE, AUTHORITATIVE,

View file

@ -16,14 +16,12 @@
package net.fabricmc.fabric.mixin.registry; package net.fabricmc.fabric.mixin.registry;
import net.fabricmc.fabric.impl.registry.ListenableRegistry;
import net.fabricmc.fabric.impl.registry.trackers.*; import net.fabricmc.fabric.impl.registry.trackers.*;
import net.fabricmc.fabric.impl.registry.trackers.vanilla.BiomeParentTracker; import net.fabricmc.fabric.impl.registry.trackers.vanilla.BiomeParentTracker;
import net.fabricmc.fabric.impl.registry.trackers.vanilla.BlockInitTracker; import net.fabricmc.fabric.impl.registry.trackers.vanilla.BlockInitTracker;
import net.fabricmc.fabric.impl.registry.trackers.vanilla.BlockItemTracker; import net.fabricmc.fabric.impl.registry.trackers.vanilla.BlockItemTracker;
import net.minecraft.Bootstrap; import net.minecraft.Bootstrap;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks; import net.minecraft.block.Blocks;
import net.minecraft.fluid.Fluid; import net.minecraft.fluid.Fluid;
import net.minecraft.fluid.Fluids; import net.minecraft.fluid.Fluids;

View file

@ -25,10 +25,8 @@ import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.Unique; import org.spongepowered.asm.mixin.Unique;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashSet;
import java.util.IdentityHashMap; import java.util.IdentityHashMap;
import java.util.List; import java.util.List;
import java.util.Set;
@Mixin(IdList.class) @Mixin(IdList.class)
public class MixinIdList implements RemovableIdList<Object> { public class MixinIdList implements RemovableIdList<Object> {

View file

@ -16,8 +16,6 @@
package net.fabricmc.fabric.mixin.registry; package net.fabricmc.fabric.mixin.registry;
import net.fabricmc.fabric.api.network.ServerSidePacketRegistry;
import net.fabricmc.fabric.impl.network.PacketRegistryImpl;
import net.fabricmc.fabric.impl.registry.RegistrySyncManager; import net.fabricmc.fabric.impl.registry.RegistrySyncManager;
import net.minecraft.network.ClientConnection; import net.minecraft.network.ClientConnection;
import net.minecraft.server.PlayerManager; import net.minecraft.server.PlayerManager;

View file

@ -48,7 +48,7 @@ public interface MaterialFinder {
/** /**
* *
* Reserved for future use. Behavior for values > 1 is currently undefined. * Reserved for future use. Behavior for values &gt; 1 is currently undefined.
*/ */
MaterialFinder spriteDepth(int depth); MaterialFinder spriteDepth(int depth);

View file

@ -75,7 +75,7 @@ public interface RenderMaterial {
/** /**
* How many sprite color/uv coordinates are in the material. * How many sprite color/uv coordinates are in the material.
* Behavior for values > 1 is currently undefined. * Behavior for values &gt; 1 is currently undefined.
* See {@link MaterialFinder#spriteDepth(int)} * See {@link MaterialFinder#spriteDepth(int)}
*/ */
int spriteDepth(); int spriteDepth();

View file

@ -24,7 +24,7 @@ import net.fabricmc.fabric.api.renderer.v1.Renderer;
* A bundle of one or more {@link QuadView} instances encoded by the renderer, * A bundle of one or more {@link QuadView} instances encoded by the renderer,
* typically via {@link Renderer#meshBuilder()}.<p> * typically via {@link Renderer#meshBuilder()}.<p>
* *
* Similar in purpose to the List<BakedQuad> instances returned by BakedModel, but * Similar in purpose to the {@code List<BakedQuad>} instances returned by BakedModel, but
* affords the renderer the ability to optimize the format for performance * affords the renderer the ability to optimize the format for performance
* and memory allocation.<p> * and memory allocation.<p>
* *

View file

@ -162,7 +162,7 @@ public interface MutableQuadView extends QuadView {
MutableQuadView pos(int vertexIndex, float x, float y, float z); MutableQuadView pos(int vertexIndex, float x, float y, float z);
/** /**
* Same as {@link #pos(float, float, float)} but accepts vector type. * Same as {@link #pos(int, float, float, float)} but accepts vector type.
*/ */
default MutableQuadView pos(int vertexIndex, Vector3f vec) { default MutableQuadView pos(int vertexIndex, Vector3f vec) {
return pos(vertexIndex, vec.getX(), vec.getY(), vec.getZ()); return pos(vertexIndex, vec.getX(), vec.getY(), vec.getZ());
@ -180,7 +180,7 @@ public interface MutableQuadView extends QuadView {
MutableQuadView normal(int vertexIndex, float x, float y, float z); MutableQuadView normal(int vertexIndex, float x, float y, float z);
/** /**
* Same as {@link #normal(float, float, float, extra)} but accepts vector type. * Same as {@link #normal(int, float, float, float)} but accepts vector type.
*/ */
default MutableQuadView normal(int vertexIndex, Vector3f vec) { default MutableQuadView normal(int vertexIndex, Vector3f vec) {
return normal(vertexIndex, vec.getX(), vec.getY(), vec.getZ()); return normal(vertexIndex, vec.getX(), vec.getY(), vec.getZ());
@ -210,12 +210,12 @@ public interface MutableQuadView extends QuadView {
} }
/** /**
* Set sprite color. Behavior for spriteIndex values > 0 is currently undefined. * Set sprite color. Behavior for {@code spriteIndex > 0} is currently undefined.
*/ */
MutableQuadView spriteColor(int vertexIndex, int spriteIndex, int color); MutableQuadView spriteColor(int vertexIndex, int spriteIndex, int color);
/** /**
* Convenience: set sprite color for all vertices at once. Behavior for spriteIndex values > 0 is currently undefined. * Convenience: set sprite color for all vertices at once. Behavior for {@code spriteIndex > 0} is currently undefined.
*/ */
default MutableQuadView spriteColor(int spriteIndex, int c0, int c1, int c2, int c3) { default MutableQuadView spriteColor(int spriteIndex, int c0, int c1, int c2, int c3) {
spriteColor(0, spriteIndex, c0); spriteColor(0, spriteIndex, c0);
@ -226,7 +226,7 @@ public interface MutableQuadView extends QuadView {
} }
/** /**
* Set sprite atlas coordinates. Behavior for spriteIndex values > 0 is currently undefined. * Set sprite atlas coordinates. Behavior for {@code spriteIndex > 0} is currently undefined.
*/ */
MutableQuadView sprite(int vertexIndex, int spriteIndex, float u, float v); MutableQuadView sprite(int vertexIndex, int spriteIndex, float u, float v);
@ -234,7 +234,7 @@ public interface MutableQuadView extends QuadView {
* Assigns sprite atlas u,v coordinates to this quad for the given sprite. * Assigns sprite atlas u,v coordinates to this quad for the given sprite.
* Can handle UV locking, rotation, interpolation, etc. Control this behavior * Can handle UV locking, rotation, interpolation, etc. Control this behavior
* by passing additive combinations of the BAKE_ flags defined in this interface. * by passing additive combinations of the BAKE_ flags defined in this interface.
* Behavior for spriteIndex values > 0 is currently undefined. * Behavior for {@code spriteIndex > 0} is currently undefined.
*/ */
MutableQuadView spriteBake(int spriteIndex, Sprite sprite, int bakeFlags); MutableQuadView spriteBake(int spriteIndex, Sprite sprite, int bakeFlags);
} }

View file

@ -27,7 +27,7 @@ import net.minecraft.util.math.MathHelper;
* Specialized {@link MutableQuadView} obtained via {@link MeshBuilder#getEmitter()} * Specialized {@link MutableQuadView} obtained via {@link MeshBuilder#getEmitter()}
* to append quads during mesh building.<p> * to append quads during mesh building.<p>
* *
* Also obtained from {@link RenderContext#getEmitter(RenderMaterial)} to submit * Also obtained from {@link RenderContext#getEmitter()} to submit
* dynamic quads one-by-one at render time.<p> * dynamic quads one-by-one at render time.<p>
* *
* Instances of {@link QuadEmitter} will practically always be * Instances of {@link QuadEmitter} will practically always be

View file

@ -35,7 +35,7 @@ public interface QuadView {
* vertex data in the given array and location.<p> * vertex data in the given array and location.<p>
* *
* @param spriteIndex The sprite to be used for the quad. * @param spriteIndex The sprite to be used for the quad.
* Behavior for values > 0 is currently undefined. * Behavior for values &gt; 0 is currently undefined.
* *
* @param target Target array for the baked quad data. * @param target Target array for the baked quad data.
* *
@ -49,9 +49,9 @@ public interface QuadView {
/** /**
* Extracts all quad properties except material to the given {@link MutableQuadView} instance. * Extracts all quad properties except material to the given {@link MutableQuadView} instance.
* Must be used before calling {@link MutableQuadView#emit()} on the target instance. * Must be used before calling {link QuadEmitter#emit()} on the target instance.
* Meant for re-texturing, analysis and static transformation use cases. * Meant for re-texturing, analysis and static transformation use cases.
*/ */
void copyTo(MutableQuadView target); void copyTo(MutableQuadView target);
/** /**
@ -98,12 +98,12 @@ public interface QuadView {
* Generates a new BakedQuad instance with texture * Generates a new BakedQuad instance with texture
* coordinates and colors from the given sprite.<p> * coordinates and colors from the given sprite.<p>
* *
* @param source Data previously packed by {@link MeshBuilder}. * param source Data previously packed by {@link MeshBuilder}.
* *
* @param sourceIndex Index where packed data starts. * param sourceIndex Index where packed data starts.
* *
* @param spriteIndex The sprite to be used for the quad. * @param spriteIndex The sprite to be used for the quad.
* Behavior for values > 0 is currently undefined. * Behavior for {@code spriteIndex > 0} is currently undefined.
* *
* @param sprite {@link MutableQuadView} does not serialize sprites * @param sprite {@link MutableQuadView} does not serialize sprites
* so the sprite must be provided by the caller. * so the sprite must be provided by the caller.
@ -130,7 +130,6 @@ public interface QuadView {
/** /**
* Pass a non-null target to avoid allocation - will be returned with values. * Pass a non-null target to avoid allocation - will be returned with values.
* Otherwise returns a new instance. * Otherwise returns a new instance.
* See {@link VertexEditor#pos(float, float, float)}
*/ */
Vector3f copyPos(int vertexIndex, Vector3f target); Vector3f copyPos(int vertexIndex, Vector3f target);
@ -157,7 +156,6 @@ public interface QuadView {
/** /**
* If false, no vertex normal was provided. * If false, no vertex normal was provided.
* Lighting should use face normal in that case. * Lighting should use face normal in that case.
* See {@link VertexEditor#normal(float, float, float, float)}
*/ */
boolean hasNormal(int vertexIndex); boolean hasNormal(int vertexIndex);

View file

@ -45,7 +45,7 @@ public interface FabricBakedModel {
* Fabric overrides to true for vanilla baked models. * Fabric overrides to true for vanilla baked models.
* Enhanced models that use this API should return false, * Enhanced models that use this API should return false,
* otherwise the API will not recognize the model.<p> * otherwise the API will not recognize the model. <p>
*/ */
boolean isVanillaAdapter(); boolean isVanillaAdapter();
@ -79,12 +79,12 @@ public interface FabricBakedModel {
* parameter is normally initialized with the same seed prior to each face layer. * parameter is normally initialized with the same seed prior to each face layer.
* Model authors should note this method is called only once per block, and call the provided * Model authors should note this method is called only once per block, and call the provided
* Random supplier multiple times if re-seeding is necessary. For wrapped vanilla baked models, * Random supplier multiple times if re-seeding is necessary. For wrapped vanilla baked models,
* it will probably be easier to use {@link RenderContext#fallbackModelConsumer()} which handles * it will probably be easier to use {@link RenderContext#fallbackConsumer} which handles
* re-seeding per face automatically.<p> * re-seeding per face automatically.<p>
* *
* @param Access to world state. Using {@link TerrainBlockView#getCachedRenderData(BlockPos)} to * @param blockView Access to world state. Using {@link net.fabricmc.fabric.api.rendering.data.v1.RenderAttachedBlockView#getBlockEntityRenderAttachment(BlockPos)} to
* retrieve block entity state unless thread safety can be guaranteed. * retrieve block entity state unless thread safety can be guaranteed.
* @param safeBlockEntityAccessor Thread-safe access to block entity data * param safeBlockEntityAccessor Thread-safe access to block entity data
* @param state Block state for model being rendered. * @param state Block state for model being rendered.
* @param pos Position of block for model being rendered. * @param pos Position of block for model being rendered.
* @param randomSupplier Random object seeded per vanilla conventions. Call multiple times to re-seed. * @param randomSupplier Random object seeded per vanilla conventions. Call multiple times to re-seed.
@ -92,7 +92,7 @@ public interface FabricBakedModel {
* @param context Accepts model output. * @param context Accepts model output.
*/ */
void emitBlockQuads(ExtendedBlockView blockView, BlockState state, BlockPos pos, Supplier<Random> randomSupplier, RenderContext context); void emitBlockQuads(ExtendedBlockView blockView, BlockState state, BlockPos pos, Supplier<Random> randomSupplier, RenderContext context);
/** /**
* This method will be called during item rendering to generate both the static and * This method will be called during item rendering to generate both the static and
* dynamic portions of an item model when the model implements this interface and * dynamic portions of an item model when the model implements this interface and
@ -111,13 +111,13 @@ public interface FabricBakedModel {
* *
* Implementing this method does NOT mitigate the need to implement a functional * Implementing this method does NOT mitigate the need to implement a functional
* {@link BakedModel#getItemPropertyOverrides()} method, because this method will be called * {@link BakedModel#getItemPropertyOverrides()} method, because this method will be called
* on the <em>result</em> of {@link #getItemPropertyOverrides()}. However, that * on the <em>result</em> of {@link BakedModel#getItemPropertyOverrides}. However, that
* method can simply return the base model because the output from this method will * method can simply return the base model because the output from this method will
* be used for rendering.<p> * be used for rendering.<p>
* *
* Renderer implementations should also use this method to obtain the quads used * Renderer implementations should also use this method to obtain the quads used
* for item enchantment glint rendering. This means models can put geometric variation * for item enchantment glint rendering. This means models can put geometric variation
* logic here, instead of returning every possible shape from {@link #getItemPropertyOverrides()} * logic here, instead of returning every possible shape from {@link BakedModel#getItemPropertyOverrides}
* as vanilla baked models. * as vanilla baked models.
*/ */
void emitItemQuads(ItemStack stack, Supplier<Random> randomSupplier, RenderContext context); void emitItemQuads(ItemStack stack, Supplier<Random> randomSupplier, RenderContext context);

View file

@ -51,7 +51,7 @@ public abstract class ModelHelper {
* Use to decode a result from {@link #toFaceIndex(Direction)}. * Use to decode a result from {@link #toFaceIndex(Direction)}.
* Return value will be null if encoded value was null. * Return value will be null if encoded value was null.
* Can also be used for no-allocation iteration of {@link Direction#values()}, * Can also be used for no-allocation iteration of {@link Direction#values()},
* optionally including the null face. (Use < or <= {@link #NULL_FACE_ID} * optionally including the null face. (Use &lt; or &lt;= {@link #NULL_FACE_ID}
* to exclude or include the null value, respectively.) * to exclude or include the null value, respectively.)
*/ */
public static Direction faceFromIndex(int faceIndex) { public static Direction faceFromIndex(int faceIndex) {

View file

@ -75,7 +75,7 @@ public interface RenderContext {
void pushTransform(QuadTransform transform); void pushTransform(QuadTransform transform);
/** /**
* Removes the transformation added by the last call to {@link #pushTransform(Consumer)}. * Removes the transformation added by the last call to {@link #pushTransform(QuadTransform)}.
* MUST be called before exiting from {@link FabricBakedModel} .emit... methods. * MUST be called before exiting from {@link FabricBakedModel} .emit... methods.
*/ */
void popTransform(); void popTransform();

View file

@ -82,7 +82,7 @@ public abstract class ColorHelper {
} }
/** /**
* Same results as {@link BakedQuadFactory#method_3456()} * Same results as {@link BakedQuadFactory#method_3456(Direction)}
*/ */
public static float diffuseShade(Direction direction) { public static float diffuseShade(Direction direction) {
return FACE_SHADE_FACTORS[direction.getId()]; return FACE_SHADE_FACTORS[direction.getId()];
@ -110,7 +110,7 @@ public abstract class ColorHelper {
/** /**
* Returns {@link #diffuseShade(Direction)} if quad is aligned to light face, * Returns {@link #diffuseShade(Direction)} if quad is aligned to light face,
* otherwise uses face normal and {@link #normalShade()} * otherwise uses face normal and {@link #normalShade}
*/ */
public static float faceShade(ShadeableQuad quad) { public static float faceShade(ShadeableQuad quad) {
return quad.isFaceAligned() ? diffuseShade(quad.lightFace()) : normalShade(quad.faceNormal()); return quad.isFaceAligned() ? diffuseShade(quad.lightFace()) : normalShade(quad.faceNormal());

View file

@ -42,7 +42,7 @@ public abstract class EncodingFormat {
public static final int NORMALS_OFFSET_VANILLA = VANILLA_STRIDE; public static final int NORMALS_OFFSET_VANILLA = VANILLA_STRIDE;
// normals are followed by 0-2 sets of color/uv coordinates // normals are followed by 0-2 sets of color/uv coordinates
static final int TEXTURE_STRIDE = 12; static final int TEXTURE_STRIDE = 12;
/** is one tex stride less than the actual base, because when used tex index is >= 1 */ /** is one tex stride less than the actual base, because when used tex index is &gt;= 1 */
static final int TEXTURE_OFFSET_MINUS = NORMALS_OFFSET + NORMALS_STRIDE - TEXTURE_STRIDE; static final int TEXTURE_OFFSET_MINUS = NORMALS_OFFSET + NORMALS_STRIDE - TEXTURE_STRIDE;
static final int SECOND_TEXTURE_OFFSET = NORMALS_OFFSET + NORMALS_STRIDE; static final int SECOND_TEXTURE_OFFSET = NORMALS_OFFSET + NORMALS_STRIDE;
static final int THIRD_TEXTURE_OFFSET = SECOND_TEXTURE_OFFSET + TEXTURE_STRIDE; static final int THIRD_TEXTURE_OFFSET = SECOND_TEXTURE_OFFSET + TEXTURE_STRIDE;

View file

@ -25,7 +25,7 @@ import net.fabricmc.indigo.renderer.helper.GeometryHelper;
/** /**
* Our implementation of {@link MeshBuilder}, used for static mesh creation and baking. * Our implementation of {@link MeshBuilder}, used for static mesh creation and baking.
* Not much to it - mainly it just needs to grow the int[] array as quads are appended * Not much to it - mainly it just needs to grow the int[] array as quads are appended
* and maintain/provide a properly-configured {@link MutableQuadView} instance. * and maintain/provide a properly-configured {@link net.fabricmc.fabric.api.renderer.v1.mesh.MutableQuadView} instance.
* All the encoding and other work is handled in the quad base classes. * All the encoding and other work is handled in the quad base classes.
* The one interesting bit is in {@link Maker#emit()}. * The one interesting bit is in {@link Maker#emit()}.
*/ */

View file

@ -21,7 +21,7 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.world.ExtendedBlockView; import net.minecraft.world.ExtendedBlockView;
/** /**
* BlockView-extending interface to be used by {@link FabricBakedModel} for dynamic model * BlockView-extending interface to be used by {@link net.fabricmc.fabric.api.renderer.v1.model.FabricBakedModel} for dynamic model
* customization. It ensures thread safety and exploits data cached in render * customization. It ensures thread safety and exploits data cached in render
* chunks for performance and data consistency.<p> * chunks for performance and data consistency.<p>
* *
@ -29,7 +29,7 @@ import net.minecraft.world.ExtendedBlockView;
* *
* BlockEntity implementations that provide data for model customization should implement * BlockEntity implementations that provide data for model customization should implement
* {@link RenderAttachmentBlockEntity} which will be queried on the main thread when a render * {@link RenderAttachmentBlockEntity} which will be queried on the main thread when a render
* chunk is enqueued for rebuild. The model should retrieve the results via {@link #getCachedRenderData()}. * chunk is enqueued for rebuild. The model should retrieve the results via {@link #getBlockEntityRenderAttachment(BlockPos)}.
* While {@link #getBlockEntity(net.minecraft.util.math.BlockPos)} is not disabled, it * While {@link #getBlockEntity(net.minecraft.util.math.BlockPos)} is not disabled, it
* is not thread-safe for use on render threads. Models that violate this guidance are * is not thread-safe for use on render threads. Models that violate this guidance are
* responsible for any necessary synchronization or collision detection.<p> * responsible for any necessary synchronization or collision detection.<p>
@ -37,7 +37,7 @@ import net.minecraft.world.ExtendedBlockView;
* {@link #getBlockState(net.minecraft.util.math.BlockPos)} and {@link #getFluidState(net.minecraft.util.math.BlockPos)} * {@link #getBlockState(net.minecraft.util.math.BlockPos)} and {@link #getFluidState(net.minecraft.util.math.BlockPos)}
* will always reflect the state cached with the render chunk. Block and fluid states * will always reflect the state cached with the render chunk. Block and fluid states
* can thus be different from main-thread world state due to lag between block update * can thus be different from main-thread world state due to lag between block update
* application from network packets and render chunk rebuilds. Use of {@link #getCachedRenderData()} * application from network packets and render chunk rebuilds. Use of {link #getCachedRenderData()}
* will ensure consistency of model state with the rest of the chunk being rendered.<p> * will ensure consistency of model state with the rest of the chunk being rendered.<p>
* *
* Models should avoid using {@link ExtendedBlockView#getBlockEntity(BlockPos)} * Models should avoid using {@link ExtendedBlockView#getBlockEntity(BlockPos)}
@ -48,6 +48,7 @@ import net.minecraft.world.ExtendedBlockView;
* *
* This interface is only guaranteed to be present in the client environment. * This interface is only guaranteed to be present in the client environment.
*/ */
// XXX can not link net.fabricmc.fabric.api.renderer.v1.model.FabricBakedModel
public interface RenderAttachedBlockView extends ExtendedBlockView { public interface RenderAttachedBlockView extends ExtendedBlockView {
/** /**
* For models associated with Block Entities that implement {@link RenderAttachmentBlockEntity} * For models associated with Block Entities that implement {@link RenderAttachmentBlockEntity}

View file

@ -16,7 +16,6 @@
package net.fabricmc.fabric.mixin.tag; package net.fabricmc.fabric.mixin.tag;
import com.google.common.collect.Sets;
import com.google.gson.JsonObject; import com.google.gson.JsonObject;
import net.fabricmc.fabric.api.tag.FabricTagBuilder; import net.fabricmc.fabric.api.tag.FabricTagBuilder;
import net.fabricmc.fabric.impl.tag.FabricTagHooks; import net.fabricmc.fabric.impl.tag.FabricTagHooks;
@ -27,12 +26,10 @@ import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.Unique; import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import java.util.Set; import java.util.Set;
import java.util.function.Function; import java.util.function.Function;
import java.util.function.Predicate;
@Mixin(Tag.Builder.class) @Mixin(Tag.Builder.class)
public class MixinTagBuilder<T> implements FabricTagBuilder<T> { public class MixinTagBuilder<T> implements FabricTagBuilder<T> {

View file

@ -22,7 +22,6 @@ import net.minecraft.client.texture.Sprite;
import net.minecraft.client.texture.SpriteAtlasTexture; import net.minecraft.client.texture.SpriteAtlasTexture;
import net.minecraft.util.Identifier; import net.minecraft.util.Identifier;
import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.function.Consumer; import java.util.function.Consumer;

View file

@ -21,7 +21,6 @@ import net.fabricmc.fabric.api.event.EventFactory;
import net.fabricmc.fabric.api.event.client.ClientSpriteRegistryCallback; import net.fabricmc.fabric.api.event.client.ClientSpriteRegistryCallback;
import net.minecraft.util.Identifier; import net.minecraft.util.Identifier;
import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.Lock;

View file

@ -19,13 +19,10 @@ package net.fabricmc.fabric.mixin.client.texture;
import com.google.common.base.Joiner; import com.google.common.base.Joiner;
import net.fabricmc.fabric.api.client.texture.*; import net.fabricmc.fabric.api.client.texture.*;
import net.fabricmc.fabric.api.event.client.ClientSpriteRegistryCallback; import net.fabricmc.fabric.api.event.client.ClientSpriteRegistryCallback;
import net.fabricmc.fabric.impl.client.texture.FabricSprite;
import net.fabricmc.fabric.impl.client.texture.SpriteAtlasTextureHooks; import net.fabricmc.fabric.impl.client.texture.SpriteAtlasTextureHooks;
import net.fabricmc.fabric.impl.client.texture.SpriteRegistryCallbackHolder; import net.fabricmc.fabric.impl.client.texture.SpriteRegistryCallbackHolder;
import net.minecraft.client.resource.metadata.AnimationResourceMetadata;
import net.minecraft.client.texture.Sprite; import net.minecraft.client.texture.Sprite;
import net.minecraft.client.texture.SpriteAtlasTexture; import net.minecraft.client.texture.SpriteAtlasTexture;
import net.minecraft.client.util.PngFile;
import net.minecraft.resource.ResourceManager; import net.minecraft.resource.ResourceManager;
import net.minecraft.util.Identifier; import net.minecraft.util.Identifier;
import net.minecraft.util.crash.CrashException; import net.minecraft.util.crash.CrashException;
@ -39,7 +36,6 @@ import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.ModifyVariable; import org.spongepowered.asm.mixin.injection.ModifyVariable;
import org.spongepowered.asm.mixin.injection.Redirect;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import java.io.IOException; import java.io.IOException;