| 1 | package net.minecraft.client.renderer;
|
| 2 |
|
| 3 | import com.mojang.blaze3d.vertex.PoseStack;
|
| 4 | import java.util.List;
|
| 5 | import net.fabricmc.api.EnvType;
|
| 6 | import net.fabricmc.api.Environment;
|
| 7 | import net.fabricmc.fabric.api.client.renderer.v1.render.FabricOrderedSubmitNodeCollector;
|
| 8 | import net.minecraft.client.gui.Font;
|
| 9 | import net.minecraft.client.model.Model;
|
| 10 | import net.minecraft.client.model.geom.ModelPart;
|
| 11 | import net.minecraft.client.renderer.block.MovingBlockRenderState;
|
| 12 | import net.minecraft.client.renderer.block.dispatch.BlockStateModelPart;
|
| 13 | import net.minecraft.client.renderer.entity.state.EntityRenderState;
|
| 14 | import net.minecraft.client.renderer.feature.ModelFeatureRenderer;
|
| 15 | import net.minecraft.client.renderer.gizmos.DrawableGizmoPrimitives;
|
| 16 | import net.minecraft.client.renderer.item.ItemStackRenderState;
|
| 17 | import net.minecraft.client.renderer.rendertype.RenderType;
|
| 18 | import net.minecraft.client.renderer.state.level.CameraRenderState;
|
| 19 | import net.minecraft.client.renderer.state.level.QuadParticleRenderState;
|
| 20 | import net.minecraft.client.renderer.texture.UvMapping;
|
| 21 | import net.minecraft.client.resources.model.geometry.ItemQuads;
|
| 22 | import net.minecraft.client.resources.model.sprite.SpriteGetter;
|
| 23 | import net.minecraft.client.resources.model.sprite.SpriteId;
|
| 24 | import net.minecraft.network.chat.Component;
|
| 25 | import net.minecraft.resources.Identifier;
|
| 26 | import net.minecraft.util.FormattedCharSequence;
|
| 27 | import net.minecraft.util.Unit;
|
| 28 | import net.minecraft.world.item.ItemDisplayContext;
|
| 29 | import net.minecraft.world.phys.Vec3;
|
| 30 | import net.minecraft.world.phys.shapes.VoxelShape;
|
| 31 | import org.joml.Quaternionf;
|
| 32 | import org.jspecify.annotations.Nullable;
|
| 33 |
|
| 34 | @Environment(EnvType.CLIENT)
|
| 35 | public interface OrderedSubmitNodeCollector
|
| 36 | extends FabricOrderedSubmitNodeCollector,
|
| 37 | net.fabricmc.fabric.api.client.rendering.v1.FabricOrderedSubmitNodeCollector {
|
| 38 | void submitShadow(PoseStack poseStack, float radius, List<EntityRenderState.ShadowPiece> pieces);
|
| 39 |
|
| 40 | void submitNameTag(
|
| 41 | PoseStack poseStack, @Nullable Vec3 nameTagAttachment, final int offset, Component name, boolean seeThrough, int lightCoords, final CameraRenderState camera
|
| 42 | );
|
| 43 |
|
| 44 | void submitText(
|
| 45 | PoseStack poseStack,
|
| 46 | float x,
|
| 47 | float y,
|
| 48 | FormattedCharSequence string,
|
| 49 | boolean dropShadow,
|
| 50 | Font.DisplayMode displayMode,
|
| 51 | int lightCoords,
|
| 52 | int color,
|
| 53 | int backgroundColor,
|
| 54 | int outlineColor
|
| 55 | );
|
| 56 |
|
| 57 | void submitTextBackground(PoseStack poseStack, float x0, float y0, float x1, float y1, int color, Font.DisplayMode displayMode, int lightCoords);
|
| 58 |
|
| 59 | void submitFlame(PoseStack poseStack, EntityRenderState renderState, Quaternionf rotation);
|
| 60 |
|
| 61 | void submitLeash(PoseStack poseStack, EntityRenderState.LeashState leashState);
|
| 62 |
|
| 63 | <S> void submitModel(
|
| 64 | Model<? super S> model,
|
| 65 | S state,
|
| 66 | PoseStack poseStack,
|
| 67 | RenderType renderType,
|
| 68 | int lightCoords,
|
| 69 | int overlayCoords,
|
| 70 | int tintedColor,
|
| 71 | @Nullable UvMapping uvMapping,
|
| 72 | int outlineColor
|
| 73 | );
|
| 74 |
|
| 75 | default <S> void submitModel(
|
| 76 | final Model<? super S> model,
|
| 77 | final S state,
|
| 78 | final PoseStack poseStack,
|
| 79 | final RenderType renderType,
|
| 80 | final int lightCoords,
|
| 81 | final int overlayCoords,
|
| 82 | final int outlineColor
|
| 83 | ) {
|
| 84 | this.submitModel(model, state, poseStack, renderType, lightCoords, overlayCoords, -1, null, outlineColor);
|
| 85 | }
|
| 86 |
|
| 87 | default <S> void submitModel(
|
| 88 | final Model<? super S> model,
|
| 89 | final S state,
|
| 90 | final PoseStack poseStack,
|
| 91 | final Identifier texture,
|
| 92 | final int lightCoords,
|
| 93 | final int overlayCoords,
|
| 94 | final int outlineColor
|
| 95 | ) {
|
| 96 | this.submitModel(model, state, poseStack, model.renderType(texture), lightCoords, overlayCoords, -1, null, outlineColor);
|
| 97 | }
|
| 98 |
|
| 99 | default <S> void submitModel(
|
| 100 | final Model<S> model,
|
| 101 | final S state,
|
| 102 | final PoseStack poseStack,
|
| 103 | final int lightCoords,
|
| 104 | final int overlayCoords,
|
| 105 | final int tintedColor,
|
| 106 | final SpriteId sprite,
|
| 107 | final SpriteGetter sprites,
|
| 108 | final int outlineColor
|
| 109 | ) {
|
| 110 | this.submitModel(model, state, poseStack, sprite.renderType(model.renderType()), lightCoords, overlayCoords, tintedColor, sprites.get(sprite), outlineColor);
|
| 111 | }
|
| 112 |
|
| 113 | <S> void submitCrumblingOverlay(
|
| 114 | Model<? super S> model,
|
| 115 | S state,
|
| 116 | PoseStack poseStack,
|
| 117 | RenderType renderType,
|
| 118 | int lightCoords,
|
| 119 | int overlayCoords,
|
| 120 | int tintedColor,
|
| 121 | ModelFeatureRenderer.CrumblingOverlay crumblingOverlay
|
| 122 | );
|
| 123 |
|
| 124 | default void submitCrumblingOverlay(
|
| 125 | final ModelPart modelPart,
|
| 126 | final PoseStack poseStack,
|
| 127 | final RenderType renderType,
|
| 128 | final int lightCoords,
|
| 129 | final int overlayCoords,
|
| 130 | final int tintedColor,
|
| 131 | final ModelFeatureRenderer.CrumblingOverlay crumblingOverlay
|
| 132 | ) {
|
| 133 | this.submitCrumblingOverlay(
|
| 134 | new Model.Simple(modelPart, var1 -> renderType), Unit.INSTANCE, poseStack, renderType, lightCoords, overlayCoords, tintedColor, crumblingOverlay
|
| 135 | );
|
| 136 | }
|
| 137 |
|
| 138 | default void submitModelPart(
|
| 139 | final ModelPart modelPart,
|
| 140 | final PoseStack poseStack,
|
| 141 | final RenderType renderType,
|
| 142 | final int lightCoords,
|
| 143 | final int overlayCoords,
|
| 144 | final @Nullable UvMapping uvMapping
|
| 145 | ) {
|
| 146 | this.submitModelPart(modelPart, poseStack, renderType, lightCoords, overlayCoords, uvMapping, -1, 0);
|
| 147 | }
|
| 148 |
|
| 149 | default void submitModelPart(
|
| 150 | final ModelPart modelPart,
|
| 151 | final PoseStack poseStack,
|
| 152 | final RenderType renderType,
|
| 153 | final int lightCoords,
|
| 154 | final int overlayCoords,
|
| 155 | final @Nullable UvMapping uvMapping,
|
| 156 | final int tintedColor
|
| 157 | ) {
|
| 158 | this.submitModelPart(modelPart, poseStack, renderType, lightCoords, overlayCoords, uvMapping, tintedColor, 0);
|
| 159 | }
|
| 160 |
|
| 161 | default void submitModelPart(
|
| 162 | final ModelPart modelPart,
|
| 163 | final PoseStack poseStack,
|
| 164 | final RenderType renderType,
|
| 165 | final int lightCoords,
|
| 166 | final int overlayCoords,
|
| 167 | final @Nullable UvMapping uvMapping,
|
| 168 | final int tintedColor,
|
| 169 | final int outlineColor
|
| 170 | ) {
|
| 171 | Model.Simple model = new Model.Simple(modelPart, var1 -> renderType);
|
| 172 | this.submitModel(model, Unit.INSTANCE, poseStack, renderType, lightCoords, overlayCoords, tintedColor, uvMapping, outlineColor);
|
| 173 | }
|
| 174 |
|
| 175 | void submitMovingBlock(PoseStack poseStack, MovingBlockRenderState movingBlockRenderState, int outlineColor);
|
| 176 |
|
| 177 | void submitBlockModel(
|
| 178 | PoseStack poseStack, RenderType renderType, List<BlockStateModelPart> parts, int[] tintLayers, int lightCoords, int overlayCoords, int outlineColor
|
| 179 | );
|
| 180 |
|
| 181 | void submitBreakingBlockModel(PoseStack poseStack, List<BlockStateModelPart> parts, int progress, final boolean isBlockTranslucent);
|
| 182 |
|
| 183 | void submitShapeOutline(PoseStack poseStack, VoxelShape shape, RenderType renderType, int color, float width, boolean afterTerrain);
|
| 184 |
|
| 185 | void submitItem(
|
| 186 | PoseStack poseStack,
|
| 187 | ItemDisplayContext displayContext,
|
| 188 | int lightCoords,
|
| 189 | int overlayCoords,
|
| 190 | int outlineColor,
|
| 191 | int[] tintLayers,
|
| 192 | ItemQuads quads,
|
| 193 | ItemStackRenderState.FoilType foilType
|
| 194 | );
|
| 195 |
|
| 196 | void submitCustomGeometry(PoseStack poseStack, RenderType renderType, SubmitNodeCollector.CustomGeometryRenderer customGeometryRenderer);
|
| 197 |
|
| 198 | void submitQuadParticleGroup(QuadParticleRenderState particles);
|
| 199 |
|
| 200 | void submitGizmoPrimitives(DrawableGizmoPrimitives.Group group, CameraRenderState camera, boolean onTop);
|
| 201 | }
|
| 202 |
|