Skip to content

Commit

Permalink
Forgot about this part :skully:
Browse files Browse the repository at this point in the history
  • Loading branch information
enjarai committed Jun 20, 2023
1 parent 7b0db08 commit 3469f23
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package nl.enjarai.showmeyourskin.client;

import net.minecraft.client.render.RenderLayer;
import net.minecraft.client.render.RenderPhase;
import net.minecraft.client.render.VertexFormat;
import net.minecraft.client.render.VertexFormats;
import net.minecraft.util.Identifier;
import net.minecraft.util.Util;

import java.util.function.Function;

import static net.minecraft.client.render.RenderPhase.*;

public class ModRenderLayers {
public static final Function<Identifier, RenderLayer> ARMOR_TRANSLUCENT_NO_CULL = Util.memoize(texture -> {
var params = RenderLayer.MultiPhaseParameters.builder()
.program(ARMOR_CUTOUT_NO_CULL_PROGRAM)
.texture(new RenderPhase.Texture(texture, false, false))
.transparency(TRANSLUCENT_TRANSPARENCY)
.cull(DISABLE_CULLING)
.lightmap(ENABLE_LIGHTMAP)
.overlay(ENABLE_OVERLAY_COLOR)
.layering(VIEW_OFFSET_Z_LAYERING)
.build(true);
return RenderLayer.of(
"armor_translucent_no_cull", VertexFormats.POSITION_COLOR_TEXTURE_OVERLAY_LIGHT_NORMAL,
VertexFormat.DrawMode.QUADS, 256, true, true, params
);
});
}
5 changes: 4 additions & 1 deletion src/main/resources/showmeyourskin.accesswidener
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@ extendable class net/minecraft/item/ItemStack
accessible field net/minecraft/client/gui/widget/TexturedButtonWidget u I
mutable field net/minecraft/client/gui/widget/TexturedButtonWidget u I
accessible field net/minecraft/client/gui/widget/TexturedButtonWidget v I
mutable field net/minecraft/client/gui/widget/TexturedButtonWidget v I
mutable field net/minecraft/client/gui/widget/TexturedButtonWidget v I

accessible class net/minecraft/client/render/RenderLayer$MultiPhaseParameters
accessible class net/minecraft/client/render/RenderPhase$Texture

0 comments on commit 3469f23

Please sign in to comment.