-
Notifications
You must be signed in to change notification settings - Fork 104
Expand file tree
/
Copy pathBreastRenderCommand.java
More file actions
62 lines (55 loc) · 2.63 KB
/
BreastRenderCommand.java
File metadata and controls
62 lines (55 loc) · 2.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/*
* Wildfire's Female Gender Mod is a female gender mod created for Minecraft.
* Copyright (C) 2023-present WildfireRomeo
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.wildfire.render;
import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.client.renderer.SubmitNodeCollector;
import net.minecraft.client.renderer.entity.state.LivingEntityRenderState;
import net.minecraft.client.renderer.texture.OverlayTexture;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import org.jetbrains.annotations.Nullable;
import java.util.function.UnaryOperator;
@Environment(EnvType.CLIENT)
public record BreastRenderCommand(
WildfireModelRenderer.ModelBox model,
int light,
int overlay,
int color,
int outline,
@Nullable UnaryOperator<VertexConsumer> consumerOperator,
PhysicsDeformation physics
) implements SubmitNodeCollector.CustomGeometryRenderer {
public BreastRenderCommand(WildfireModelRenderer.ModelBox model, LivingEntityRenderState state, int overlay, int color) {
this(model, state.lightCoords, overlay, color, state.outlineColor, null, PhysicsDeformation.NONE);
}
public BreastRenderCommand(WildfireModelRenderer.ModelBox model, LivingEntityRenderState state, int overlay, int color, PhysicsDeformation physics) {
this(model, state.lightCoords, overlay, color, state.outlineColor, null, physics);
}
public static BreastRenderCommand trim(WildfireModelRenderer.ModelBox model, LivingEntityRenderState state, TextureAtlasSprite trimSprite, PhysicsDeformation physics) {
return new BreastRenderCommand(model, state.lightCoords, OverlayTexture.NO_OVERLAY, -1, 0, trimSprite::wrap, physics);
}
@Override
public void render(PoseStack.Pose matricesEntry, VertexConsumer vertexConsumer) {
if(consumerOperator != null) {
vertexConsumer = consumerOperator.apply(vertexConsumer);
}
GenderLayer.renderBox(model, matricesEntry, vertexConsumer, light, overlay, color, physics);
}
}