167 lines
8.3 KiB
Java
167 lines
8.3 KiB
Java
/*
|
|
* Decompiled with CFR 0.152.
|
|
*
|
|
* Could not load the following classes:
|
|
* it.unimi.dsi.fastutil.ints.Int2ObjectAVLTreeMap
|
|
* org.joml.Matrix4f
|
|
* org.joml.Quaternionf
|
|
* org.joml.Vector3f
|
|
* org.jspecify.annotations.Nullable
|
|
*/
|
|
package net.minecraft.client.renderer;
|
|
|
|
import com.mojang.blaze3d.vertex.PoseStack;
|
|
import it.unimi.dsi.fastutil.ints.Int2ObjectAVLTreeMap;
|
|
import java.util.List;
|
|
import net.minecraft.client.gui.Font;
|
|
import net.minecraft.client.model.Model;
|
|
import net.minecraft.client.model.geom.ModelPart;
|
|
import net.minecraft.client.renderer.SubmitNodeCollection;
|
|
import net.minecraft.client.renderer.SubmitNodeCollector;
|
|
import net.minecraft.client.renderer.block.MovingBlockRenderState;
|
|
import net.minecraft.client.renderer.block.model.BakedQuad;
|
|
import net.minecraft.client.renderer.block.model.BlockStateModel;
|
|
import net.minecraft.client.renderer.entity.state.EntityRenderState;
|
|
import net.minecraft.client.renderer.feature.ModelFeatureRenderer;
|
|
import net.minecraft.client.renderer.item.ItemStackRenderState;
|
|
import net.minecraft.client.renderer.rendertype.RenderType;
|
|
import net.minecraft.client.renderer.state.CameraRenderState;
|
|
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
|
import net.minecraft.network.chat.Component;
|
|
import net.minecraft.util.FormattedCharSequence;
|
|
import net.minecraft.world.item.ItemDisplayContext;
|
|
import net.minecraft.world.level.block.state.BlockState;
|
|
import net.minecraft.world.phys.Vec3;
|
|
import org.joml.Matrix4f;
|
|
import org.joml.Quaternionf;
|
|
import org.joml.Vector3f;
|
|
import org.jspecify.annotations.Nullable;
|
|
|
|
public class SubmitNodeStorage
|
|
implements SubmitNodeCollector {
|
|
private final Int2ObjectAVLTreeMap<SubmitNodeCollection> submitsPerOrder = new Int2ObjectAVLTreeMap();
|
|
|
|
@Override
|
|
public SubmitNodeCollection order(int order) {
|
|
return (SubmitNodeCollection)this.submitsPerOrder.computeIfAbsent(order, ignored -> new SubmitNodeCollection(this));
|
|
}
|
|
|
|
@Override
|
|
public void submitShadow(PoseStack poseStack, float radius, List<EntityRenderState.ShadowPiece> pieces) {
|
|
this.order(0).submitShadow(poseStack, radius, pieces);
|
|
}
|
|
|
|
@Override
|
|
public void submitNameTag(PoseStack poseStack, @Nullable Vec3 nameTagAttachment, int offset, Component name, boolean seeThrough, int lightCoords, double distanceToCameraSq, CameraRenderState camera) {
|
|
this.order(0).submitNameTag(poseStack, nameTagAttachment, offset, name, seeThrough, lightCoords, distanceToCameraSq, camera);
|
|
}
|
|
|
|
@Override
|
|
public void submitText(PoseStack poseStack, float x, float y, FormattedCharSequence string, boolean dropShadow, Font.DisplayMode displayMode, int lightCoords, int color, int backgroundColor, int outlineColor) {
|
|
this.order(0).submitText(poseStack, x, y, string, dropShadow, displayMode, lightCoords, color, backgroundColor, outlineColor);
|
|
}
|
|
|
|
@Override
|
|
public void submitFlame(PoseStack poseStack, EntityRenderState renderState, Quaternionf rotation) {
|
|
this.order(0).submitFlame(poseStack, renderState, rotation);
|
|
}
|
|
|
|
@Override
|
|
public void submitLeash(PoseStack poseStack, EntityRenderState.LeashState leashState) {
|
|
this.order(0).submitLeash(poseStack, leashState);
|
|
}
|
|
|
|
@Override
|
|
public <S> void submitModel(Model<? super S> model, S state, PoseStack poseStack, RenderType renderType, int lightCoords, int overlayCoords, int tintedColor, @Nullable TextureAtlasSprite sprite, int outlineColor, @Nullable ModelFeatureRenderer.CrumblingOverlay crumblingOverlay) {
|
|
this.order(0).submitModel(model, state, poseStack, renderType, lightCoords, overlayCoords, tintedColor, sprite, outlineColor, crumblingOverlay);
|
|
}
|
|
|
|
@Override
|
|
public void submitModelPart(ModelPart modelPart, PoseStack poseStack, RenderType renderType, int lightCoords, int overlayCoords, @Nullable TextureAtlasSprite sprite, boolean sheeted, boolean hasFoil, int tintedColor, @Nullable ModelFeatureRenderer.CrumblingOverlay crumblingOverlay, int outlineColor) {
|
|
this.order(0).submitModelPart(modelPart, poseStack, renderType, lightCoords, overlayCoords, sprite, sheeted, hasFoil, tintedColor, crumblingOverlay, outlineColor);
|
|
}
|
|
|
|
@Override
|
|
public void submitBlock(PoseStack poseStack, BlockState state, int lightCoords, int overlayCoords, int outlineColor) {
|
|
this.order(0).submitBlock(poseStack, state, lightCoords, overlayCoords, outlineColor);
|
|
}
|
|
|
|
@Override
|
|
public void submitMovingBlock(PoseStack poseStack, MovingBlockRenderState movingBlockRenderState) {
|
|
this.order(0).submitMovingBlock(poseStack, movingBlockRenderState);
|
|
}
|
|
|
|
@Override
|
|
public void submitBlockModel(PoseStack poseStack, RenderType renderType, BlockStateModel model, float r, float g, float b, int lightCoords, int overlayCoords, int outlineColor) {
|
|
this.order(0).submitBlockModel(poseStack, renderType, model, r, g, b, lightCoords, overlayCoords, outlineColor);
|
|
}
|
|
|
|
@Override
|
|
public void submitItem(PoseStack poseStack, ItemDisplayContext displayContext, int lightCoords, int overlayCoords, int outlineColor, int[] tintLayers, List<BakedQuad> quads, RenderType renderType, ItemStackRenderState.FoilType foilType) {
|
|
this.order(0).submitItem(poseStack, displayContext, lightCoords, overlayCoords, outlineColor, tintLayers, quads, renderType, foilType);
|
|
}
|
|
|
|
@Override
|
|
public void submitCustomGeometry(PoseStack poseStack, RenderType renderType, SubmitNodeCollector.CustomGeometryRenderer customGeometryRenderer) {
|
|
this.order(0).submitCustomGeometry(poseStack, renderType, customGeometryRenderer);
|
|
}
|
|
|
|
@Override
|
|
public void submitParticleGroup(SubmitNodeCollector.ParticleGroupRenderer particleGroupRenderer) {
|
|
this.order(0).submitParticleGroup(particleGroupRenderer);
|
|
}
|
|
|
|
public void clear() {
|
|
this.submitsPerOrder.values().forEach(SubmitNodeCollection::clear);
|
|
}
|
|
|
|
public void endFrame() {
|
|
this.submitsPerOrder.values().removeIf(collection -> !collection.wasUsed());
|
|
this.submitsPerOrder.values().forEach(SubmitNodeCollection::endFrame);
|
|
}
|
|
|
|
public Int2ObjectAVLTreeMap<SubmitNodeCollection> getSubmitsPerOrder() {
|
|
return this.submitsPerOrder;
|
|
}
|
|
|
|
public record CustomGeometrySubmit(PoseStack.Pose pose, SubmitNodeCollector.CustomGeometryRenderer customGeometryRenderer) {
|
|
}
|
|
|
|
public record ItemSubmit(PoseStack.Pose pose, ItemDisplayContext displayContext, int lightCoords, int overlayCoords, int outlineColor, int[] tintLayers, List<BakedQuad> quads, RenderType renderType, ItemStackRenderState.FoilType foilType) {
|
|
}
|
|
|
|
public record BlockModelSubmit(PoseStack.Pose pose, RenderType renderType, BlockStateModel model, float r, float g, float b, int lightCoords, int overlayCoords, int outlineColor) {
|
|
}
|
|
|
|
public record MovingBlockSubmit(Matrix4f pose, MovingBlockRenderState movingBlockRenderState) {
|
|
}
|
|
|
|
public record BlockSubmit(PoseStack.Pose pose, BlockState state, int lightCoords, int overlayCoords, int outlineColor) {
|
|
}
|
|
|
|
public record TranslucentModelSubmit<S>(ModelSubmit<S> modelSubmit, RenderType renderType, Vector3f position) {
|
|
}
|
|
|
|
public record ModelPartSubmit(PoseStack.Pose pose, ModelPart modelPart, int lightCoords, int overlayCoords, @Nullable TextureAtlasSprite sprite, boolean sheeted, boolean hasFoil, int tintedColor, @Nullable ModelFeatureRenderer.CrumblingOverlay crumblingOverlay, int outlineColor) {
|
|
}
|
|
|
|
public record ModelSubmit<S>(PoseStack.Pose pose, Model<? super S> model, S state, int lightCoords, int overlayCoords, int tintedColor, @Nullable TextureAtlasSprite sprite, int outlineColor, @Nullable ModelFeatureRenderer.CrumblingOverlay crumblingOverlay) {
|
|
}
|
|
|
|
public record LeashSubmit(Matrix4f pose, EntityRenderState.LeashState leashState) {
|
|
}
|
|
|
|
public record TextSubmit(Matrix4f pose, float x, float y, FormattedCharSequence string, boolean dropShadow, Font.DisplayMode displayMode, int lightCoords, int color, int backgroundColor, int outlineColor) {
|
|
}
|
|
|
|
public record NameTagSubmit(Matrix4f pose, float x, float y, Component text, int lightCoords, int color, int backgroundColor, double distanceToCameraSq) {
|
|
}
|
|
|
|
public record FlameSubmit(PoseStack.Pose pose, EntityRenderState entityRenderState, Quaternionf rotation) {
|
|
}
|
|
|
|
public record ShadowSubmit(Matrix4f pose, float radius, List<EntityRenderState.ShadowPiece> pieces) {
|
|
}
|
|
}
|
|
|