77import org .jetbrains .annotations .Nullable ;
88
99//? if >=1.21.6 {
10- /* import com.mojang.blaze3d.pipeline.RenderPipeline;
10+ import com .mojang .blaze3d .pipeline .RenderPipeline ;
1111import net .minecraft .client .Minecraft ;
1212import net .minecraft .client .gui .render .TextureSetup ;
1313import net .minecraft .client .gui .navigation .ScreenRectangle ;
1414import net .minecraft .client .renderer .RenderPipelines ;
1515import org .joml .Matrix3x2f ;
16- */ //?} else {
17- import net .minecraft .client .renderer .RenderType ;
16+ //?} else {
17+ /* import net.minecraft.client.renderer.RenderType;
1818import org.joml.Matrix4f;
19- //?}
19+ */ //?}
2020
2121public record BaseRenderState (
2222 //? if >=1.21.6 {
23- /* RenderPipeline pipeline,
23+ RenderPipeline pipeline ,
2424 TextureSetup textureSetup ,
2525 Matrix3x2f pose ,
2626 @ Nullable ScreenRectangle bounds ,
2727 @ Nullable ScreenRectangle scissorArea
28- */ //?} else {
29- net .minecraft .client .renderer .RenderType renderType ,
28+ //?} else {
29+ /* net.minecraft.client.renderer.RenderType renderType,
3030 Matrix4f pose
31- //?}
31+ */ //?}
3232) {
3333 public static BaseRenderState create (GuiGraphics graphics , @ Nullable ResourceLocation texture , int x0 , int y0 , int x1 , int y1 ) {
3434 //? if >=1.21.6 {
35- /* @Nullable ScreenRectangle scissorArea = GuiRenderStateSink.peekScissorStack(graphics);
35+ @ Nullable ScreenRectangle scissorArea = GuiRenderStateSink .peekScissorStack (graphics );
3636 ScreenRectangle bounds = boundsFromMaxPoints (x0 , y0 , x1 , y1 , graphics .pose (), scissorArea );
3737
3838 return new BaseRenderState (
@@ -41,29 +41,29 @@ public static BaseRenderState create(GuiGraphics graphics, @Nullable ResourceLoc
4141 new Matrix3x2f (graphics .pose ()),
4242 bounds , scissorArea
4343 );
44- */ //?} else {
45- return create (graphics , texture );
46- //?}
44+ //?} else {
45+ /* return create(graphics, texture);
46+ */ //?}
4747 }
4848
4949 public static BaseRenderState create (GuiGraphics graphics , @ Nullable ResourceLocation texture ) {
5050 //? if >=1.21.6 {
51- /* return new BaseRenderState(
51+ return new BaseRenderState (
5252 texture != null ? RenderPipelines .GUI_TEXTURED : RenderPipelines .GUI ,
5353 textureSetup (texture ),
5454 new Matrix3x2f (graphics .pose ()),
5555 null , GuiRenderStateSink .peekScissorStack (graphics )
5656 );
57- */ //?} else {
58- return new BaseRenderState (
57+ //?} else {
58+ /* return new BaseRenderState(
5959 texture != null ? GuiUtils.guiTextured(false).apply(texture) : RenderType.gui(),
6060 graphics.pose().last().pose()
6161 );
62- //?}
62+ */ //?}
6363 }
6464
6565 //? if >=1.21.6 {
66- /* private static TextureSetup textureSetup(@Nullable ResourceLocation texture) {
66+ private static TextureSetup textureSetup (@ Nullable ResourceLocation texture ) {
6767 return texture == null
6868 ? TextureSetup .noTexture ()
6969 : TextureSetup .singleTexture (Minecraft .getInstance ().getTextureManager ().getTexture (texture ).getTextureView ());
@@ -73,5 +73,5 @@ private static ScreenRectangle boundsFromMaxPoints(int x0, int y0, int x1, int y
7373 ScreenRectangle bounds = new ScreenRectangle (x0 , y0 , x1 - x0 , y1 - y0 ).transformMaxBounds (pose );
7474 return scissorArea != null ? scissorArea .intersection (bounds ) : bounds ;
7575 }
76- */ //?}
76+ //?}
7777}
0 commit comments