59 lines
2.1 KiB
Java
59 lines
2.1 KiB
Java
/*
|
|
* Decompiled with CFR 0.152.
|
|
*
|
|
* Could not load the following classes:
|
|
* com.mojang.serialization.MapCodec
|
|
* org.joml.Vector3f
|
|
*/
|
|
package net.minecraft.client.renderer.special;
|
|
|
|
import com.mojang.blaze3d.vertex.PoseStack;
|
|
import com.mojang.serialization.MapCodec;
|
|
import java.util.Set;
|
|
import net.minecraft.client.model.TridentModel;
|
|
import net.minecraft.client.model.geom.ModelLayers;
|
|
import net.minecraft.client.renderer.SubmitNodeCollector;
|
|
import net.minecraft.client.renderer.special.NoDataSpecialModelRenderer;
|
|
import net.minecraft.client.renderer.special.SpecialModelRenderer;
|
|
import net.minecraft.world.item.ItemDisplayContext;
|
|
import org.joml.Vector3f;
|
|
|
|
public class TridentSpecialRenderer
|
|
implements NoDataSpecialModelRenderer {
|
|
private final TridentModel model;
|
|
|
|
public TridentSpecialRenderer(TridentModel model) {
|
|
this.model = model;
|
|
}
|
|
|
|
@Override
|
|
public void submit(ItemDisplayContext type, PoseStack poseStack, SubmitNodeCollector submitNodeCollector, int lightCoords, int overlayCoords, boolean hasFoil, int outlineColor) {
|
|
poseStack.pushPose();
|
|
poseStack.scale(1.0f, -1.0f, -1.0f);
|
|
submitNodeCollector.submitModelPart(this.model.root(), poseStack, this.model.renderType(TridentModel.TEXTURE), lightCoords, overlayCoords, null, false, hasFoil, -1, null, outlineColor);
|
|
poseStack.popPose();
|
|
}
|
|
|
|
@Override
|
|
public void getExtents(Set<Vector3f> result) {
|
|
PoseStack poseStack = new PoseStack();
|
|
poseStack.scale(1.0f, -1.0f, -1.0f);
|
|
this.model.root().getExtentsForGui(poseStack, result);
|
|
}
|
|
|
|
public record Unbaked() implements SpecialModelRenderer.Unbaked
|
|
{
|
|
public static final MapCodec<Unbaked> MAP_CODEC = MapCodec.unit((Object)new Unbaked());
|
|
|
|
public MapCodec<Unbaked> type() {
|
|
return MAP_CODEC;
|
|
}
|
|
|
|
@Override
|
|
public SpecialModelRenderer<?> bake(SpecialModelRenderer.BakingContext context) {
|
|
return new TridentSpecialRenderer(new TridentModel(context.entityModelSet().bakeLayer(ModelLayers.TRIDENT)));
|
|
}
|
|
}
|
|
}
|
|
|