diff options
| author | shedaniel <daniel@shedaniel.me> | 2025-07-23 20:50:25 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-23 20:50:25 +0200 |
| commit | bbf4c43a1ed431c94c2a95e67ea8494a8007cdee (patch) | |
| tree | 3dedaf08cf00a710b54698b20299e614a281cafa /default-plugin | |
| parent | 3224ded226541e1dbd7809cba218e3c0c8c4144b (diff) | |
| download | RoughlyEnoughItems-bbf4c43a1ed431c94c2a95e67ea8494a8007cdee.tar.gz RoughlyEnoughItems-bbf4c43a1ed431c94c2a95e67ea8494a8007cdee.tar.bz2 RoughlyEnoughItems-bbf4c43a1ed431c94c2a95e67ea8494a8007cdee.zip | |
Port to 1.21.6 (#1907)
* Port to 1.21.6
* Fix tooltip Z-rendering
* Fix config screen
* Add workflow
Diffstat (limited to 'default-plugin')
11 files changed, 46 insertions, 67 deletions
diff --git a/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/DefaultBrewingCategory.java b/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/DefaultBrewingCategory.java index a770553c4..65c16054d 100644 --- a/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/DefaultBrewingCategory.java +++ b/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/DefaultBrewingCategory.java @@ -37,7 +37,7 @@ import me.shedaniel.rei.plugin.common.BuiltinPlugin; import me.shedaniel.rei.plugin.common.displays.brewing.DefaultBrewingDisplay; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; -import net.minecraft.client.renderer.RenderType; +import net.minecraft.client.renderer.RenderPipelines; import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; import net.minecraft.util.Mth; @@ -70,9 +70,9 @@ public class DefaultBrewingCategory implements DisplayCategory<DefaultBrewingDis widgets.add(Widgets.createRecipeBase(bounds)); widgets.add(Widgets.createDrawableWidget((graphics, mouseX, mouseY, delta) -> { ResourceLocation texture = REIRuntime.getInstance().getDefaultDisplayTexture(); - graphics.blit(RenderType::guiTextured, texture, startPoint.x, startPoint.y, 0, 108, 103, 59, 256, 256); + graphics.blit(RenderPipelines.GUI_TEXTURED, texture, startPoint.x, startPoint.y, 0, 108, 103, 59, 256, 256); int width = Mth.ceil(System.currentTimeMillis() / 250d % 18d); - graphics.blit(RenderType::guiTextured, texture, startPoint.x + 44, startPoint.y + 28, 103, 163, width, 4, 256, 256); + graphics.blit(RenderPipelines.GUI_TEXTURED, texture, startPoint.x + 44, startPoint.y + 28, 103, 163, width, 4, 256, 256); })); widgets.add(Widgets.createSlot(new Point(startPoint.x + 1, startPoint.y + 1)).entry(EntryStacks.of(Items.BLAZE_POWDER)).disableBackground().markInput()); widgets.add(Widgets.createSlot(new Point(startPoint.x + 40, startPoint.y + 1)).entries(display.getInputEntries().get(0)).disableBackground().markInput()); diff --git a/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/DefaultFuelCategory.java b/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/DefaultFuelCategory.java index 2f1157a13..a542d873c 100644 --- a/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/DefaultFuelCategory.java +++ b/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/DefaultFuelCategory.java @@ -104,11 +104,8 @@ public class DefaultFuelCategory implements DisplayCategory<DefaultFuelDisplay> @Override public void render(GuiGraphics graphics, Rectangle bounds, int mouseX, int mouseY, float delta) { - graphics.pose().pushPose(); - graphics.pose().translate(0, 0, 50); slot.getBounds().setLocation(bounds.x + 4, bounds.y + 2); slot.render(graphics, mouseX, mouseY, delta); - graphics.pose().popPose(); graphics.drawString(Minecraft.getInstance().font, text.getVisualOrderText(), bounds.x + 25, bounds.y + 8, -1); } }; diff --git a/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/DefaultInformationCategory.java b/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/DefaultInformationCategory.java index 9ef500b6f..78bc3e856 100644 --- a/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/DefaultInformationCategory.java +++ b/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/DefaultInformationCategory.java @@ -24,7 +24,6 @@ package me.shedaniel.rei.plugin.client.categories; import com.google.common.collect.Lists; -import com.mojang.blaze3d.vertex.VertexConsumer; import me.shedaniel.clothconfig2.ClothConfigInitializer; import me.shedaniel.clothconfig2.api.scroll.ScrollingContainer; import me.shedaniel.math.Point; @@ -45,11 +44,10 @@ import net.fabricmc.api.Environment; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.gui.components.events.GuiEventListener; -import net.minecraft.client.renderer.RenderType; +import net.minecraft.client.renderer.RenderPipelines; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.FormattedText; import net.minecraft.util.FormattedCharSequence; -import org.joml.Matrix4f; import java.util.Collections; import java.util.List; @@ -57,16 +55,6 @@ import java.util.Objects; @Environment(EnvType.CLIENT) public class DefaultInformationCategory implements DisplayCategory<DefaultInformationDisplay> { - protected static void innerBlit(GuiGraphics graphics, Matrix4f matrix4f, int xStart, int xEnd, int yStart, int yEnd, int z, float uStart, float uEnd, float vStart, float vEnd) { - graphics.drawSpecial(source -> { - VertexConsumer buffer = source.getBuffer(RenderType.guiTextured(REIRuntime.getInstance().getDefaultDisplayTexture())); - buffer.addVertex(matrix4f, xStart, yEnd, z).setUv(uStart, vEnd).setColor(0xFFFFFFFF); - buffer.addVertex(matrix4f, xEnd, yEnd, z).setUv(uEnd, vEnd).setColor(0xFFFFFFFF); - buffer.addVertex(matrix4f, xEnd, yStart, z).setUv(uEnd, vStart).setColor(0xFFFFFFFF); - buffer.addVertex(matrix4f, xStart, yStart, z).setUv(uStart, vStart).setColor(0xFFFFFFFF); - }); - } - @Override public CategoryIdentifier<? extends DefaultInformationDisplay> getCategoryIdentifier() { return BuiltinPlugin.INFO; @@ -98,11 +86,10 @@ public class DefaultInformationCategory implements DisplayCategory<DefaultInform return new Renderer() { @Override public void render(GuiGraphics graphics, Rectangle bounds, int mouseX, int mouseY, float delta) { - graphics.pose().pushPose(); - graphics.pose().translate(-1.2f, -1, 0); - Matrix4f matrix = graphics.pose().last().pose(); - DefaultInformationCategory.innerBlit(graphics, matrix, bounds.getCenterX() - 8, bounds.getCenterX() + 8, bounds.getCenterY() - 8, bounds.getCenterY() + 8, 0, 116f / 256f, (116f + 16f) / 256f, 0f, 16f / 256f); - graphics.pose().popPose(); + graphics.pose().pushMatrix(); + graphics.pose().translate(-1.2f, -1); + graphics.innerBlit(RenderPipelines.GUI_TEXTURED, REIRuntime.getInstance().getDefaultDisplayTexture(), bounds.getCenterX() - 8, bounds.getCenterX() + 8, bounds.getCenterY() - 8, bounds.getCenterY() + 8, 116f / 256f, (116f + 16f) / 256f, 0f, 16f / 256f, -1); + graphics.pose().popMatrix(); } }; } diff --git a/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/anvil/DefaultAnvilCategory.java b/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/anvil/DefaultAnvilCategory.java index c1f292e96..9f09eddeb 100644 --- a/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/anvil/DefaultAnvilCategory.java +++ b/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/anvil/DefaultAnvilCategory.java @@ -73,7 +73,7 @@ public class DefaultAnvilCategory implements DisplayCategory<DefaultAnvilDisplay Component component = Component.translatable("container.repair.cost", display.getCost().getAsInt()); int x = startPoint.x + 102 - font.width(component) - 2; graphics.fill(x - 2, startPoint.y + 28, startPoint.x + 102, startPoint.y + 28 + 12, 0x4f000000); - graphics.drawString(font, component, x, startPoint.y + 28 + 2, 0x80ff20); + graphics.drawString(font, component, x, startPoint.y + 28 + 2, 0xff80ff20); })); } return widgets; diff --git a/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/tag/DefaultTagCategory.java b/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/tag/DefaultTagCategory.java index 420a96dbb..e0a3711d3 100644 --- a/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/tag/DefaultTagCategory.java +++ b/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/tag/DefaultTagCategory.java @@ -35,7 +35,6 @@ import me.shedaniel.rei.api.client.registry.display.DisplayCategory; import me.shedaniel.rei.api.client.util.ClientEntryStacks; import me.shedaniel.rei.api.common.category.CategoryIdentifier; import me.shedaniel.rei.api.common.entry.EntryStack; -import me.shedaniel.rei.api.common.util.CollectionUtils; import me.shedaniel.rei.api.common.util.EntryStacks; import me.shedaniel.rei.plugin.common.BuiltinPlugin; import me.shedaniel.rei.plugin.common.displays.tag.DefaultTagDisplay; @@ -49,7 +48,6 @@ import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.Items; import org.jetbrains.annotations.Nullable; -import org.joml.Matrix4f; import java.util.ArrayList; import java.util.List; @@ -118,7 +116,7 @@ public class DefaultTagCategory implements DisplayCategory<DefaultTagDisplay<?, WidgetWithBounds[] delegate = new WidgetWithBounds[]{Widgets.noOp()}; TagNode<?>[] tagNode = new TagNode[]{null}; - widgets.add(Widgets.withTranslate(Widgets.delegateWithBounds(() -> delegate[0]), 0, 0, 20)); + widgets.add(Widgets.delegateWithBounds(() -> delegate[0])); TagNodes.create(display.getKey(), dataResult -> { if (dataResult.error().isPresent()) { @@ -140,10 +138,10 @@ public class DefaultTagCategory implements DisplayCategory<DefaultTagDisplay<?, Font font = instance.font; String text = "?"; int width = font.width(text); - graphics.pose().pushPose(); - graphics.pose().translate(bounds.getCenterX() - width / 2f + 0.2f, bounds.getCenterY() - font.lineHeight / 2f + 1f, 0); + graphics.pose().pushMatrix(); + graphics.pose().translate(bounds.getCenterX() - width / 2f + 0.2f, bounds.getCenterY() - font.lineHeight / 2f + 1f); graphics.drawString(font, text, 0, 0, REIRuntime.getInstance().isDarkThemeEnabled() ? -4473925 : -12566464, false); - graphics.pose().popPose(); + graphics.pose().popMatrix(); } @Override @@ -179,7 +177,7 @@ public class DefaultTagCategory implements DisplayCategory<DefaultTagDisplay<?, } }) .tooltipLine(Component.translatable("text.rei.tag.copy.clipboard"))); - widgets.add(Widgets.withTranslate(new DelegateWidget(Widgets.noOp()) { + widgets.add(new DelegateWidget(Widgets.noOp()) { @Override protected Widget delegate() { ResourceLocation expandTexture = !expanded[0] ? ResourceLocation.fromNamespaceAndPath("roughlyenoughitems", "textures/gui/expand.png") @@ -191,12 +189,8 @@ public class DefaultTagCategory implements DisplayCategory<DefaultTagDisplay<?, new Rectangle(recipeBounds.x + 5 + 2, recipeBounds.getMaxY() - 6 - 13 + 2, 13 - 4, 13 - 4), 0, 0, 9, 9) ); } - }, 0, 0, 10)); + }); - Matrix4f translateMatrix = new Matrix4f().translate(0, 0, 200); - Matrix4f identity = new Matrix4f(); - identity.identity(); - return CollectionUtils.map(widgets, widget -> Widgets.withTranslate(widget, () -> - expanded[0] || !boundsAnimator.value().equals(boundsAnimator.target()) ? translateMatrix : identity)); + return widgets; } } diff --git a/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/tag/ReferenceTagNodeWidget.java b/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/tag/ReferenceTagNodeWidget.java index b00e6b993..7e17c6986 100644 --- a/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/tag/ReferenceTagNodeWidget.java +++ b/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/tag/ReferenceTagNodeWidget.java @@ -34,6 +34,7 @@ import me.shedaniel.rei.api.common.util.EntryIngredients; import me.shedaniel.rei.plugin.common.displays.tag.TagNode; import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.gui.components.events.GuiEventListener; +import net.minecraft.client.renderer.RenderPipelines; import net.minecraft.client.renderer.RenderType; import net.minecraft.core.Holder; import net.minecraft.network.chat.Component; @@ -69,8 +70,8 @@ public class ReferenceTagNodeWidget<S, T> extends TagNodeWidget<S, T> { @Override public void render(GuiGraphics graphics, int mouseX, int mouseY, float delta) { - if (this.overflowBounds.intersects(MatrixUtils.transform(graphics.pose().last().pose(), getBounds()))) { - graphics.innerBlit(RenderType::guiTextured, ResourceLocation.withDefaultNamespace("textures/gui/sprites/advancements/task_frame_unobtained.png"), + if (this.overflowBounds.intersects(MatrixUtils.transform(graphics.pose(), getBounds()))) { + graphics.innerBlit(RenderPipelines.GUI_TEXTURED, ResourceLocation.withDefaultNamespace("textures/gui/sprites/advancements/task_frame_unobtained.png"), bounds.x - 1, bounds.x - 1 + 26, bounds.y - 1, bounds.y - 1 + 26, 0, 1, 0, 1, -1); this.slot.getBounds().setLocation(bounds.getCenterX() - this.slot.getBounds().getWidth() / 2, bounds.y + (bounds.height - this.slot.getBounds().getHeight()) / 2 + 1); diff --git a/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/tag/TagTreeWidget.java b/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/tag/TagTreeWidget.java index 9b5c2747e..6a3c25514 100644 --- a/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/tag/TagTreeWidget.java +++ b/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/tag/TagTreeWidget.java @@ -91,7 +91,7 @@ public class TagTreeWidget<S, T> extends WidgetWithBounds { rootWidget.getBounds().getMaxY() + 6, rootWidget.getBounds().getMaxY() + 16, 0xFFFFFFFF); childWidget.getBounds().setLocation(getBounds().getCenterX() - childrenTotalWidth / 2 + x, this.rootWidget.getBounds().getMaxY() + 16); - if (this.overflowBounds.intersects(MatrixUtils.transform(graphics.pose().last().pose(), childWidget.getBounds()))) { + if (this.overflowBounds.intersects(MatrixUtils.transform(graphics.pose(), childWidget.getBounds()))) { childWidget.render(graphics, mouseX, mouseY, delta); } x += childWidget.getBounds().width + 6; diff --git a/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/tag/ValueTagNodeWidget.java b/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/tag/ValueTagNodeWidget.java index a108bdaa6..d5537063c 100644 --- a/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/tag/ValueTagNodeWidget.java +++ b/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/tag/ValueTagNodeWidget.java @@ -34,7 +34,7 @@ import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.gui.components.events.GuiEventListener; import net.minecraft.core.Holder; import net.minecraft.core.HolderSet; -import org.joml.Matrix4f; +import org.joml.Matrix3x2f; import java.util.ArrayList; import java.util.Collections; @@ -71,7 +71,7 @@ public class ValueTagNodeWidget<S, T> extends TagNodeWidget<S, T> { i++; } this.widget = Widgets.withTranslate(Widgets.concat(this.widgets), - $ -> new Matrix4f().translate(getBounds().x, getBounds().y, 0)); + $ -> new Matrix3x2f().translate(getBounds().x, getBounds().y)); this.children = Collections.singletonList(this.widget); } @@ -83,17 +83,17 @@ public class ValueTagNodeWidget<S, T> extends TagNodeWidget<S, T> { @Override public void render(GuiGraphics graphics, int mouseX, int mouseY, float delta) { Rectangle bounds = getBounds(); - if (this.overflowBounds.intersects(MatrixUtils.transform(graphics.pose().last().pose(), bounds))) { - graphics.pose().pushPose(); - graphics.pose().translate(bounds.x, bounds.y, 0); + if (this.overflowBounds.intersects(MatrixUtils.transform(graphics.pose(), bounds))) { + graphics.pose().pushMatrix(); + graphics.pose().translate(bounds.x, bounds.y); Point mouse = new Point(mouseX - bounds.x, mouseY - bounds.y); for (Widget widget : this.widgets) { if (!(widget instanceof WidgetWithBounds withBounds) || - this.overflowBounds.intersects(MatrixUtils.transform(graphics.pose().last().pose(), withBounds.getBounds()))) { + this.overflowBounds.intersects(MatrixUtils.transform(graphics.pose(), withBounds.getBounds()))) { widget.render(graphics, mouse.x, mouse.y, delta); } } - graphics.pose().popPose(); + graphics.pose().popMatrix(); } } diff --git a/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/favorites/GameModeFavoriteEntry.java b/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/favorites/GameModeFavoriteEntry.java index e78e10cc3..161b3deda 100644 --- a/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/favorites/GameModeFavoriteEntry.java +++ b/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/favorites/GameModeFavoriteEntry.java @@ -105,21 +105,21 @@ public class GameModeFavoriteEntry extends FavoriteEntry { public void render(GuiGraphics graphics, Rectangle bounds, int mouseX, int mouseY, float delta) { int color = bounds.contains(mouseX, mouseY) ? 0xFFEEEEEE : 0xFFAAAAAA; if (bounds.width > 4 && bounds.height > 4) { - graphics.pose().pushPose(); - graphics.pose().translate(bounds.getCenterX(), bounds.getCenterY(), 0); - graphics.pose().scale(bounds.getWidth() / 18f, bounds.getHeight() / 18f, 1); + graphics.pose().pushMatrix(); + graphics.pose().translate(bounds.getCenterX(), bounds.getCenterY()); + graphics.pose().scale(bounds.getWidth() / 18f, bounds.getHeight() / 18f); renderGameModeText(graphics, type, 0, 0, color); - graphics.pose().popPose(); + graphics.pose().popMatrix(); } } private void renderGameModeText(GuiGraphics graphics, GameType type, int centerX, int centerY, int color) { Component s = Component.translatable("text.rei.short_gamemode." + type.getName()); Font font = Minecraft.getInstance().font; - graphics.pose().pushPose(); - graphics.pose().translate(centerX - font.width(s) / 2f + 0.5f, centerY - 3.5f, 0); + graphics.pose().pushMatrix(); + graphics.pose().translate(centerX - font.width(s) / 2f + 0.5f, centerY - 3.5f); graphics.drawString(font, s, 0, 0, color, false); - graphics.pose().popPose(); + graphics.pose().popMatrix(); } @Override diff --git a/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/favorites/TimeFavoriteEntry.java b/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/favorites/TimeFavoriteEntry.java index dec965a60..ef2fcdec6 100644 --- a/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/favorites/TimeFavoriteEntry.java +++ b/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/favorites/TimeFavoriteEntry.java @@ -40,7 +40,7 @@ import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.gui.components.events.GuiEventListener; import net.minecraft.client.multiplayer.ClientLevel; -import net.minecraft.client.renderer.RenderType; +import net.minecraft.client.renderer.RenderPipelines; import net.minecraft.client.resources.language.I18n; import net.minecraft.client.resources.sounds.SimpleSoundInstance; import net.minecraft.nbt.CompoundTag; @@ -140,16 +140,16 @@ public class TimeFavoriteEntry extends FavoriteEntry { public void render(GuiGraphics graphics, Rectangle bounds, int mouseX, int mouseY, float delta) { int color = bounds.contains(mouseX, mouseY) ? 0xFFEEEEEE : 0xFFAAAAAA; if (bounds.width > 4 && bounds.height > 4) { - graphics.pose().pushPose(); - graphics.pose().translate(bounds.getCenterX(), bounds.getCenterY(), 0); - graphics.pose().scale(bounds.getWidth() / 18f, bounds.getHeight() / 18f, 1); + graphics.pose().pushMatrix(); + graphics.pose().translate(bounds.getCenterX(), bounds.getCenterY()); + graphics.pose().scale(bounds.getWidth() / 18f, bounds.getHeight() / 18f); renderTimeIcon(graphics, time, 0, 0, color); - graphics.pose().popPose(); + graphics.pose().popMatrix(); } } private void renderTimeIcon(GuiGraphics graphics, Time time, int centerX, int centerY, int color) { - graphics.blit(RenderType::guiTextured, CHEST_GUI_TEXTURE, centerX - 7, centerY - 7, time.ordinal() * 14 + 42, 14, 14, 14, 256, 256); + graphics.blit(RenderPipelines.GUI_TEXTURED, CHEST_GUI_TEXTURE, centerX - 7, centerY - 7, time.ordinal() * 14 + 42, 14, 14, 14, 256, 256); } @Override diff --git a/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/favorites/WeatherFavoriteEntry.java b/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/favorites/WeatherFavoriteEntry.java index fde840d21..d20ea2939 100644 --- a/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/favorites/WeatherFavoriteEntry.java +++ b/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/favorites/WeatherFavoriteEntry.java @@ -40,7 +40,7 @@ import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.gui.components.events.GuiEventListener; import net.minecraft.client.multiplayer.ClientLevel; -import net.minecraft.client.renderer.RenderType; +import net.minecraft.client.renderer.RenderPipelines; import net.minecraft.client.resources.language.I18n; import net.minecraft.client.resources.sounds.SimpleSoundInstance; import net.minecraft.nbt.CompoundTag; @@ -116,16 +116,16 @@ public class WeatherFavoriteEntry extends FavoriteEntry { public void render(GuiGraphics graphics, Rectangle bounds, int mouseX, int mouseY, float delta) { int color = bounds.contains(mouseX, mouseY) ? 0xFFEEEEEE : 0xFFAAAAAA; if (bounds.width > 4 && bounds.height > 4) { - graphics.pose().pushPose(); - graphics.pose().translate(bounds.getCenterX(), bounds.getCenterY(), 0); - graphics.pose().scale(bounds.getWidth() / 18f, bounds.getHeight() / 18f, 1); + graphics.pose().pushMatrix(); + graphics.pose().translate(bounds.getCenterX(), bounds.getCenterY()); + graphics.pose().scale(bounds.getWidth() / 18f, bounds.getHeight() / 18f); renderWeatherIcon(graphics, weather, 0, 0, color); - graphics.pose().popPose(); + graphics.pose().popMatrix(); } } private void renderWeatherIcon(GuiGraphics graphics, Weather type, int centerX, int centerY, int color) { - graphics.blit(RenderType::guiTextured, CHEST_GUI_TEXTURE, centerX - 7, centerY - 7, type.getId() * 14, 14, 14, 14, 256, 256); + graphics.blit(RenderPipelines.GUI_TEXTURED, CHEST_GUI_TEXTURE, centerX - 7, centerY - 7, type.getId() * 14, 14, 14, 14, 256, 256); } @Override |
