22
33import com .mojang .blaze3d .systems .RenderSystem ;
44import eu .midnightdust .picturesign .PictureDownloader ;
5+ import net .coderbot .iris .Iris ;
6+ import net .fabricmc .loader .api .FabricLoader ;
57import net .minecraft .block .entity .SignBlockEntity ;
68import net .minecraft .client .render .*;
79import net .minecraft .client .util .math .MatrixStack ;
@@ -87,7 +89,15 @@ else if (signBlockEntity.getCachedState().contains(Properties.ROTATION)) {
8789
8890 matrixStack .push ();
8991
90- RenderSystem .setShader (GameRenderer ::getPositionTexShader );
92+ int l ;
93+ if (FabricLoader .getInstance ().isModLoaded ("iris" ) && Iris .getIrisConfig ().areShadersEnabled () && Iris .getCurrentPack ().isPresent ()) {
94+ RenderSystem .setShader (GameRenderer ::getRenderTypeCutoutShader );
95+ l = 230 ;
96+ }
97+ else {
98+ RenderSystem .setShader (GameRenderer ::getPositionColorTexLightmapShader );
99+ l = light ;
100+ }
91101 RenderSystem .setShaderTexture (0 , data .identifier );
92102
93103 RenderSystem .disableBlend ();
@@ -98,19 +108,19 @@ else if (signBlockEntity.getCachedState().contains(Properties.ROTATION)) {
98108 matrixStack .multiply (yRotation );
99109
100110 Matrix4f matrix4f = matrixStack .peek ().getModel ();
101- buffer .begin (VertexFormat .DrawMode .QUADS , VertexFormats .POSITION_TEXTURE_COLOR );
111+ buffer .begin (VertexFormat .DrawMode .QUADS , VertexFormats .POSITION_COLOR_TEXTURE_LIGHT );
102112
103- buffer .vertex (matrix4f , width , 0.0F , 1.0F ).texture (1.0F , 1.0F ).color ( 255 , 255 , 255 , 255 )
104- .light ( light ). overlay ( overlay ). next ();
113+ buffer .vertex (matrix4f , width , 0.0F , 1.0F ).color ( 255 , 255 , 255 , 255 ). texture (1.0F , 1.0F ).light ( l ). overlay ( overlay )
114+ .next ();
105115
106- buffer .vertex (matrix4f , width , height , 1.0F ).texture (1.0F , 0.0F ).color ( 255 , 255 , 255 , 255 )
107- .light ( light ). overlay ( overlay ). next ();
116+ buffer .vertex (matrix4f , width , height , 1.0F ).color ( 255 , 255 , 255 , 255 ). texture (1.0F , 0.0F ).light ( l ). overlay ( overlay )
117+ .next ();
108118
109- buffer .vertex (matrix4f , 0.0F , height , 1.0F ).texture (0.0F , 0.0F ).color ( 255 , 255 , 255 , 255 )
110- .light ( light ). overlay ( overlay ). next ();
119+ buffer .vertex (matrix4f , 0.0F , height , 1.0F ).color ( 255 , 255 , 255 , 255 ). texture (0.0F , 0.0F ).light ( l ). overlay ( overlay )
120+ .next ();
111121
112- buffer .vertex (matrix4f , 0.0F , 0.0F , 1.0F ).texture (0.0F , 1.0F ).color ( 255 , 255 , 255 , 255 )
113- .light ( light ). overlay ( overlay ). next ();
122+ buffer .vertex (matrix4f , 0.0F , 0.0F , 1.0F ).color ( 255 , 255 , 255 , 255 ). texture (0.0F , 1.0F ).light ( l ). overlay ( overlay )
123+ .next ();
114124
115125 tessellator .draw ();
116126 matrixStack .pop ();
0 commit comments