diff options
| author | Danielshe <shekwancheung0528@gmail.com> | 2019-08-25 20:58:00 +0800 |
|---|---|---|
| committer | Danielshe <shekwancheung0528@gmail.com> | 2019-08-25 20:58:00 +0800 |
| commit | b960e33306056c126c3816ec471c58c3b5a7be7f (patch) | |
| tree | b0ac4730b813a6a0004250cd50e0cabd1eb3f18e /src/main/java | |
| parent | c980df4f05485ef2a1adb768087bb95eeeadcfca (diff) | |
| download | RoughlyEnoughItems-b960e33306056c126c3816ec471c58c3b5a7be7f.tar.gz RoughlyEnoughItems-b960e33306056c126c3816ec471c58c3b5a7be7f.tar.bz2 RoughlyEnoughItems-b960e33306056c126c3816ec471c58c3b5a7be7f.zip | |
Updated on Cloth, support for 1.15
Diffstat (limited to 'src/main/java')
28 files changed, 112 insertions, 111 deletions
diff --git a/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsCore.java b/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsCore.java index 76ecf571d..52ee1031e 100644 --- a/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsCore.java +++ b/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsCore.java @@ -7,7 +7,6 @@ package me.shedaniel.rei; import com.google.common.collect.Lists; import com.google.common.collect.Maps; -import me.shedaniel.cloth.api.ClientUtils; import me.shedaniel.cloth.hooks.ClothClientHooks; import me.shedaniel.math.impl.PointHelper; import me.shedaniel.rei.api.*; diff --git a/src/main/java/me/shedaniel/rei/api/ConfigObject.java b/src/main/java/me/shedaniel/rei/api/ConfigObject.java index 187e3b76e..f60d6bc35 100644 --- a/src/main/java/me/shedaniel/rei/api/ConfigObject.java +++ b/src/main/java/me/shedaniel/rei/api/ConfigObject.java @@ -10,7 +10,6 @@ import me.shedaniel.rei.gui.config.ItemListOrdering; import me.shedaniel.rei.gui.config.RecipeScreenType; import me.shedaniel.rei.gui.config.SearchFieldLocation; import me.zeroeightsix.fiber.tree.ConfigNode; -import me.zeroeightsix.fiber.tree.ConfigValue; public interface ConfigObject { diff --git a/src/main/java/me/shedaniel/rei/gui/ContainerScreenOverlay.java b/src/main/java/me/shedaniel/rei/gui/ContainerScreenOverlay.java index e2f282762..ae6bf5089 100644 --- a/src/main/java/me/shedaniel/rei/gui/ContainerScreenOverlay.java +++ b/src/main/java/me/shedaniel/rei/gui/ContainerScreenOverlay.java @@ -6,9 +6,9 @@ package me.shedaniel.rei.gui; import com.google.common.collect.Lists; -import com.mojang.blaze3d.platform.GlStateManager; import me.shedaniel.math.api.Point; import me.shedaniel.math.api.Rectangle; +import me.shedaniel.math.compat.RenderHelper; import me.shedaniel.math.impl.PointHelper; import me.shedaniel.rei.RoughlyEnoughItemsCore; import me.shedaniel.rei.api.ClientHelper; @@ -144,7 +144,7 @@ public class ContainerScreenOverlay extends Widget { fill(getBounds().x, getBounds().y, getBounds().x + 20, getBounds().y + 20, 1476440063); } MinecraftClient.getInstance().getTextureManager().bindTexture(CHEST_GUI_TEXTURE); - GlStateManager.color4f(1.0F, 1.0F, 1.0F, 1.0F); + RenderHelper.color4f(1.0F, 1.0F, 1.0F, 1.0F); blit(getBounds().x + 3, getBounds().y + 3, 0, 0, 14, 14); } @@ -204,7 +204,7 @@ public class ContainerScreenOverlay extends Widget { super.render(mouseX, mouseY, delta); GuiLighting.disable(); MinecraftClient.getInstance().getTextureManager().bindTexture(CHEST_GUI_TEXTURE); - GlStateManager.color4f(1.0F, 1.0F, 1.0F, 1.0F); + RenderHelper.color4f(1.0F, 1.0F, 1.0F, 1.0F); blit(getBounds().x + 3, getBounds().y + 3, weather.getId() * 14, 14, 14, 14); } @@ -383,7 +383,7 @@ public class ContainerScreenOverlay extends Widget { } blitOffset = 0; } - GlStateManager.color4f(1.0F, 1.0F, 1.0F, 1.0F); + RenderHelper.color4f(1.0F, 1.0F, 1.0F, 1.0F); GuiLighting.disable(); this.renderWidgets(mouseX, mouseY, delta); if (MinecraftClient.getInstance().currentScreen instanceof AbstractContainerScreen && RoughlyEnoughItemsCore.getConfigManager().getConfig().areClickableRecipeArrowsEnabled()) { @@ -425,9 +425,9 @@ public class ContainerScreenOverlay extends Widget { int width = lines.stream().map(font::getStringWidth).max(Integer::compareTo).get(); int height = lines.size() <= 1 ? 8 : lines.size() * 10; ScreenHelper.drawHoveringWidget(mouseX, mouseY, (x, y, aFloat) -> { - GlStateManager.disableRescaleNormal(); + RenderHelper.disableRescaleNormal(); GuiLighting.disable(); - GlStateManager.disableLighting(); + RenderHelper.disableLighting(); this.blitOffset = 1000; this.fillGradient(x - 3, y - 4, x + width + 3, y - 3, -267386864, -267386864); this.fillGradient(x - 3, y + height + 3, x + width + 3, y + height + 4, -267386864, -267386864); @@ -440,15 +440,15 @@ public class ContainerScreenOverlay extends Widget { this.fillGradient(x - 3, y + height + 2, x + width + 3, y + height + 3, 1344798847, 1344798847); int currentY = y; for (int lineIndex = 0; lineIndex < lines.size(); lineIndex++) { - GlStateManager.disableDepthTest(); + RenderHelper.disableDepthTest(); font.drawWithShadow(lines.get(lineIndex), x, currentY, -1); - GlStateManager.enableDepthTest(); + RenderHelper.enableDepthTest(); currentY += lineIndex == 0 ? 12 : 10; } this.blitOffset = 0; - GlStateManager.enableLighting(); + RenderHelper.enableLighting(); GuiLighting.enable(); - GlStateManager.enableRescaleNormal(); + RenderHelper.enableRescaleNormal(); }, width, height, 0); } diff --git a/src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java b/src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java index f2fb9755f..30d285e32 100644 --- a/src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java +++ b/src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java @@ -6,8 +6,8 @@ package me.shedaniel.rei.gui; import com.google.common.collect.Lists; -import com.mojang.blaze3d.platform.GlStateManager; import me.shedaniel.math.api.Rectangle; +import me.shedaniel.math.compat.RenderHelper; import me.shedaniel.math.impl.PointHelper; import me.shedaniel.rei.RoughlyEnoughItemsCore; import me.shedaniel.rei.api.*; @@ -391,7 +391,7 @@ public class RecipeViewingScreen extends Screen { GuiLighting.disable(); widget.render(mouseX, mouseY, delta); }); - GlStateManager.color4f(1.0F, 1.0F, 1.0F, 1.0F); + RenderHelper.color4f(1.0F, 1.0F, 1.0F, 1.0F); GuiLighting.disable(); tabs.stream().filter(TabWidget::isSelected).forEach(tabWidget -> tabWidget.render(mouseX, mouseY, delta)); GuiLighting.disable(); diff --git a/src/main/java/me/shedaniel/rei/gui/VillagerRecipeViewingScreen.java b/src/main/java/me/shedaniel/rei/gui/VillagerRecipeViewingScreen.java index c7e85edb5..1bed855c8 100644 --- a/src/main/java/me/shedaniel/rei/gui/VillagerRecipeViewingScreen.java +++ b/src/main/java/me/shedaniel/rei/gui/VillagerRecipeViewingScreen.java @@ -7,10 +7,10 @@ package me.shedaniel.rei.gui; import com.google.common.collect.Lists; import com.google.common.collect.Maps; -import com.mojang.blaze3d.platform.GlStateManager; import com.zeitheron.hammercore.client.utils.Scissors; import me.shedaniel.math.api.Point; import me.shedaniel.math.api.Rectangle; +import me.shedaniel.math.compat.RenderHelper; import me.shedaniel.math.impl.PointHelper; import me.shedaniel.rei.RoughlyEnoughItemsCore; import me.shedaniel.rei.api.*; @@ -33,7 +33,10 @@ import net.minecraft.text.TranslatableText; import net.minecraft.util.Formatting; import net.minecraft.util.math.MathHelper; -import java.util.*; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Optional; import java.util.stream.Collectors; public class VillagerRecipeViewingScreen extends Screen { @@ -143,18 +146,18 @@ public class VillagerRecipeViewingScreen extends Screen { selectedRecipeIndex = finalIndex; VillagerRecipeViewingScreen.this.init(); } - + @Override public boolean isHovered(int mouseX, int mouseY) { return (isMouseOver(mouseX, mouseY) && scrollListBounds.contains(mouseX, mouseY)) || focused; } - + @Override protected int getTextureId(boolean boolean_1) { enabled = selectedRecipeIndex != finalIndex; return super.getTextureId(boolean_1); } - + @Override public boolean mouseClicked(double mouseX, double mouseY, int button) { if ((isMouseOver(mouseX, mouseY) && scrollListBounds.contains(mouseX, mouseY)) && enabled && button == 0) { @@ -225,7 +228,7 @@ public class VillagerRecipeViewingScreen extends Screen { @Override public void render(int mouseX, int mouseY, float delta) { - GlStateManager.color4f(1.0F, 1.0F, 1.0F, 1.0F); + RenderHelper.color4f(1.0F, 1.0F, 1.0F, 1.0F); font.draw((isHovered(mouseX, mouseY) ? Formatting.UNDERLINE.toString() : "") + text, x - font.getStringWidth(text) / 2, y, getDefaultColor()); if (clickable && getTooltips().isPresent()) if (!focused && containsMouse(mouseX, mouseY)) @@ -338,7 +341,7 @@ public class VillagerRecipeViewingScreen extends Screen { }); GuiLighting.disable(); ScreenHelper.getLastOverlay().render(mouseX, mouseY, delta); - GlStateManager.pushMatrix(); + RenderHelper.pushMatrix(); Scissors.begin(); Scissors.scissor(0, scrollListBounds.y + 1, width, scrollListBounds.height - 2); for (int i = 0; i < buttonWidgets.size(); i++) { @@ -369,11 +372,11 @@ public class VillagerRecipeViewingScreen extends Screen { minY = this.scrollListBounds.y + 1; double scrollbarPositionMinX = scrollListBounds.getMaxX() - 6, scrollbarPositionMaxX = scrollListBounds.getMaxX() - 2; GuiLighting.disable(); - GlStateManager.disableTexture(); - GlStateManager.enableBlend(); - GlStateManager.disableAlphaTest(); - GlStateManager.blendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO); - GlStateManager.shadeModel(7425); + RenderHelper.disableTexture(); + RenderHelper.enableBlend(); + RenderHelper.disableAlphaTest(); + RenderHelper.blendFuncSeparate(770, 771, 1, 0); + RenderHelper.shadeModel(7425); buffer.begin(7, VertexFormats.POSITION_COLOR); float b = ScreenHelper.isDarkModeEnabled() ? 0.37f : 1f; buffer.vertex(scrollbarPositionMinX, minY + scrollBarHeight, 1000D).color(b, b, b, scrollBarAlpha).next(); @@ -381,13 +384,13 @@ public class VillagerRecipeViewingScreen extends Screen { buffer.vertex(scrollbarPositionMaxX, minY, 1000D).color(b, b, b, scrollBarAlpha).next(); buffer.vertex(scrollbarPositionMinX, minY, 1000D).color(b, b, b, scrollBarAlpha).next(); tessellator.draw(); - GlStateManager.shadeModel(7424); - GlStateManager.disableBlend(); - GlStateManager.enableAlphaTest(); - GlStateManager.enableTexture(); + RenderHelper.shadeModel(7424); + RenderHelper.disableBlend(); + RenderHelper.enableAlphaTest(); + RenderHelper.enableTexture(); } Scissors.end(); - GlStateManager.popMatrix(); + RenderHelper.popMatrix(); ScreenHelper.getLastOverlay().lateRender(mouseX, mouseY, delta); } diff --git a/src/main/java/me/shedaniel/rei/gui/renderers/ItemStackRenderer.java b/src/main/java/me/shedaniel/rei/gui/renderers/ItemStackRenderer.java index 0387b79a6..609c74f97 100644 --- a/src/main/java/me/shedaniel/rei/gui/renderers/ItemStackRenderer.java +++ b/src/main/java/me/shedaniel/rei/gui/renderers/ItemStackRenderer.java @@ -6,7 +6,7 @@ package me.shedaniel.rei.gui.renderers; import com.google.common.collect.Lists; -import com.mojang.blaze3d.platform.GlStateManager; +import me.shedaniel.math.compat.RenderHelper; import me.shedaniel.rei.RoughlyEnoughItemsCore; import me.shedaniel.rei.api.ClientHelper; import me.shedaniel.rei.api.Renderer; @@ -30,14 +30,14 @@ public abstract class ItemStackRenderer extends Renderer { @Override public void render(int x, int y, double mouseX, double mouseY, float delta) { int l = x - 8, i1 = y - 6; - GlStateManager.color4f(1.0F, 1.0F, 1.0F, 1.0F); + RenderHelper.color4f(1.0F, 1.0F, 1.0F, 1.0F); ItemRenderer itemRenderer = MinecraftClient.getInstance().getItemRenderer(); itemRenderer.zOffset = blitOffset; GuiLighting.enableForItems(); - GlStateManager.colorMask(true, true, true, true); - GlStateManager.enableLighting(); - GlStateManager.enableRescaleNormal(); - GlStateManager.enableDepthTest(); + RenderHelper.colorMask(true, true, true, true); + RenderHelper.enableLighting(); + RenderHelper.enableRescaleNormal(); + RenderHelper.enableDepthTest(); itemRenderer.renderGuiItem(getItemStack(), l, i1); itemRenderer.renderGuiItemOverlay(MinecraftClient.getInstance().textRenderer, getItemStack(), l, i1, renderCounts() ? null : ""); itemRenderer.zOffset = 0.0F; diff --git a/src/main/java/me/shedaniel/rei/gui/widget/AutoCraftingButtonWidget.java b/src/main/java/me/shedaniel/rei/gui/widget/AutoCraftingButtonWidget.java index 6430708cb..9c080455a 100644 --- a/src/main/java/me/shedaniel/rei/gui/widget/AutoCraftingButtonWidget.java +++ b/src/main/java/me/shedaniel/rei/gui/widget/AutoCraftingButtonWidget.java @@ -5,10 +5,10 @@ package me.shedaniel.rei.gui.widget; -import com.mojang.blaze3d.platform.GlStateManager; import it.unimi.dsi.fastutil.ints.IntList; import me.shedaniel.math.api.Point; import me.shedaniel.math.api.Rectangle; +import me.shedaniel.math.compat.RenderHelper; import me.shedaniel.rei.api.*; import me.shedaniel.rei.impl.ScreenHelper; import net.minecraft.client.gui.screen.ingame.AbstractContainerScreen; @@ -94,11 +94,11 @@ public class AutoCraftingButtonWidget extends ButtonWidget { errorTooltip = error; int x = getBounds().x, y = getBounds().y, width = getBounds().width, height = getBounds().height; minecraft.getTextureManager().bindTexture(ScreenHelper.isDarkModeEnabled() ? BUTTON_LOCATION_DARK : BUTTON_LOCATION); - GlStateManager.color4f(1.0F, 1.0F, 1.0F, 1.0F); + RenderHelper.color4f(1.0F, 1.0F, 1.0F, 1.0F); int textureOffset = this.getTextureId(isHovered(mouseX, mouseY)); - GlStateManager.enableBlend(); - GlStateManager.blendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO); - GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA); + RenderHelper.enableBlend(); + RenderHelper.blendFuncSeparate(770, 771, 1, 0); + RenderHelper.blendFunc(770, 771); //Four Corners blit(x, y, 0, textureOffset * 80, 4, 4); blit(x + width - 4, y, 252, textureOffset * 80, 4, 4); diff --git a/src/main/java/me/shedaniel/rei/gui/widget/ButtonWidget.java b/src/main/java/me/shedaniel/rei/gui/widget/ButtonWidget.java index 7c15b67cd..f694180eb 100644 --- a/src/main/java/me/shedaniel/rei/gui/widget/ButtonWidget.java +++ b/src/main/java/me/shedaniel/rei/gui/widget/ButtonWidget.java @@ -5,9 +5,9 @@ package me.shedaniel.rei.gui.widget; -import com.mojang.blaze3d.platform.GlStateManager; import me.shedaniel.math.api.Point; import me.shedaniel.math.api.Rectangle; +import me.shedaniel.math.compat.RenderHelper; import me.shedaniel.rei.impl.ScreenHelper; import net.minecraft.client.gui.Element; import net.minecraft.client.sound.PositionedSoundInstance; @@ -66,11 +66,11 @@ public abstract class ButtonWidget extends WidgetWithBounds { public void render(int mouseX, int mouseY, float delta) { int x = bounds.x, y = bounds.y, width = bounds.width, height = bounds.height; minecraft.getTextureManager().bindTexture(ScreenHelper.isDarkModeEnabled() ? BUTTON_LOCATION_DARK : BUTTON_LOCATION); - GlStateManager.color4f(1.0F, 1.0F, 1.0F, 1.0F); + RenderHelper.color4f(1.0F, 1.0F, 1.0F, 1.0F); int textureOffset = this.getTextureId(isHovered(mouseX, mouseY)); - GlStateManager.enableBlend(); - GlStateManager.blendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO); - GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA); + RenderHelper.enableBlend(); + RenderHelper.blendFuncSeparate(770, 771, 1, 0); + RenderHelper.blendFunc(770, 771); //Four Corners blit(x, y, 0, textureOffset * 80, 4, 4); blit(x + width - 4, y, 252, textureOffset * 80, 4, 4); diff --git a/src/main/java/me/shedaniel/rei/gui/widget/CraftableToggleButtonWidget.java b/src/main/java/me/shedaniel/rei/gui/widget/CraftableToggleButtonWidget.java index 172b7e8e7..b11b9c600 100644 --- a/src/main/java/me/shedaniel/rei/gui/widget/CraftableToggleButtonWidget.java +++ b/src/main/java/me/shedaniel/rei/gui/widget/CraftableToggleButtonWidget.java @@ -5,8 +5,8 @@ package me.shedaniel.rei.gui.widget; -import com.mojang.blaze3d.platform.GlStateManager; import me.shedaniel.math.api.Rectangle; +import me.shedaniel.math.compat.RenderHelper; import me.shedaniel.rei.RoughlyEnoughItemsCore; import net.minecraft.block.Blocks; import net.minecraft.client.MinecraftClient; @@ -42,7 +42,7 @@ public abstract class CraftableToggleButtonWidget extends ButtonWidget { this.itemRenderer.zOffset = 0.0F; GuiLighting.disable(); MinecraftClient.getInstance().getTextureManager().bindTexture(CHEST_GUI_TEXTURE); - GlStateManager.color4f(1.0F, 1.0F, 1.0F, 1.0F); + RenderHelper.color4f(1.0F, 1.0F, 1.0F, 1.0F); int color = RoughlyEnoughItemsCore.getConfigManager().isCraftableOnlyEnabled() ? 939579655 : 956235776; this.blitOffset += 10f; this.fillGradient(getBounds().x, getBounds().y, getBounds().x + getBounds().width, getBounds().y + getBounds().height, color, color); diff --git a/src/main/java/me/shedaniel/rei/gui/widget/EntryListWidget.java b/src/main/java/me/shedaniel/rei/gui/widget/EntryListWidget.java index 95c922f2a..0f2e57361 100644 --- a/src/main/java/me/shedaniel/rei/gui/widget/EntryListWidget.java +++ b/src/main/java/me/shedaniel/rei/gui/widget/EntryListWidget.java @@ -6,10 +6,10 @@ package me.shedaniel.rei.gui.widget; import com.google.common.collect.Lists; -import com.mojang.blaze3d.platform.GlStateManager; import com.zeitheron.hammercore.client.utils.Scissors; import me.shedaniel.clothconfig2.api.RunSixtyTimesEverySec; import me.shedaniel.math.api.Rectangle; +import me.shedaniel.math.compat.RenderHelper; import me.shedaniel.math.impl.PointHelper; import me.shedaniel.rei.RoughlyEnoughItemsCore; import me.shedaniel.rei.api.*; @@ -242,7 +242,7 @@ public class EntryListWidget extends Widget { @Override public void render(int int_1, int int_2, float float_1) { GuiLighting.disable(); - GlStateManager.pushMatrix(); + RenderHelper.pushMatrix(); boolean widgetScrolled = RoughlyEnoughItemsCore.getConfigManager().getConfig().isEntryListWidgetScrolled(); if (!widgetScrolled) scroll = 0; @@ -263,7 +263,7 @@ public class EntryListWidget extends Widget { }); if (widgetScrolled) Scissors.end(); - GlStateManager.popMatrix(); + RenderHelper.popMatrix(); ClientPlayerEntity player = minecraft.player; if (rectangle.contains(PointHelper.fromMouse()) && ClientHelper.getInstance().isCheating() && !player.inventory.getCursorStack().isEmpty() && RoughlyEnoughItemsCore.hasPermissionToUsePackets()) ScreenHelper.getLastOverlay().addTooltip(QueuedTooltip.create(I18n.translate("text.rei.delete_items"))); diff --git a/src/main/java/me/shedaniel/rei/gui/widget/RecipeArrowWidget.java b/src/main/java/me/shedaniel/rei/gui/widget/RecipeArrowWidget.java index e3b6a748a..07d0b770b 100644 --- a/src/main/java/me/shedaniel/rei/gui/widget/RecipeArrowWidget.java +++ b/src/main/java/me/shedaniel/rei/gui/widget/RecipeArrowWidget.java @@ -5,8 +5,8 @@ package me.shedaniel.rei.gui.widget; -import com.mojang.blaze3d.platform.GlStateManager; import me.shedaniel.math.api.Rectangle; +import me.shedaniel.math.compat.RenderHelper; import me.shedaniel.rei.plugin.DefaultPlugin; import net.minecraft.client.MinecraftClient; import net.minecraft.client.gui.Element; @@ -34,7 +34,7 @@ public class RecipeArrowWidget extends WidgetWithBounds { @Override public void render(int mouseX, int mouseY, float delta) { - GlStateManager.color4f(1.0F, 1.0F, 1.0F, 1.0F); + RenderHelper.color4f(1.0F, 1.0F, 1.0F, 1.0F); GuiLighting.disable(); MinecraftClient.getInstance().getTextureManager().bindTexture(DefaultPlugin.getDisplayTexture()); blit(x, y, 106, 91, 24, 17); diff --git a/src/main/java/me/shedaniel/rei/gui/widget/RecipeBaseWidget.java b/src/main/java/me/shedaniel/rei/gui/widget/RecipeBaseWidget.java index 821e6ffbe..4b5d7423b 100644 --- a/src/main/java/me/shedaniel/rei/gui/widget/RecipeBaseWidget.java +++ b/src/main/java/me/shedaniel/rei/gui/widget/RecipeBaseWidget.java @@ -5,8 +5,8 @@ package me.shedaniel.rei.gui.widget; -import com.mojang.blaze3d.platform.GlStateManager; import me.shedaniel.math.api.Rectangle; +import me.shedaniel.math.compat.RenderHelper; import me.shedaniel.rei.RoughlyEnoughItemsCore; import me.shedaniel.rei.gui.config.RecipeScreenType; import me.shedaniel.rei.impl.ScreenHelper; @@ -53,7 +53,7 @@ public class RecipeBaseWidget extends WidgetWithBounds { public void render(int mouseX, int mouseY, float delta) { if (!isRendering()) return; - GlStateManager.color4f(1.0F, 1.0F, 1.0F, 1.0F); + RenderHelper.color4f(1.0F, 1.0F, 1.0F, 1.0F); GuiLighting.disable(); minecraft.getTextureManager().bindTexture(ScreenHelper.isDarkModeEnabled() ? CHEST_GUI_TEXTURE_DARK : CHEST_GUI_TEXTURE); int x = bounds.x, y = bounds.y, width = bounds.width, height = bounds.height; diff --git a/src/main/java/me/shedaniel/rei/gui/widget/RecipeChoosePageWidget.java b/src/main/java/me/shedaniel/rei/gui/widget/RecipeChoosePageWidget.java index b24837287..70f978d1a 100644 --- a/src/main/java/me/shedaniel/rei/gui/widget/RecipeChoosePageWidget.java +++ b/src/main/java/me/shedaniel/rei/gui/widget/RecipeChoosePageWidget.java @@ -6,9 +6,9 @@ package me.shedaniel.rei.gui.widget; import com.google.common.collect.Lists; -import com.mojang.blaze3d.platform.GlStateManager; import me.shedaniel.math.api.Point; import me.shedaniel.math.api.Rectangle; +import me.shedaniel.math.compat.RenderHelper; import me.shedaniel.rei.RoughlyEnoughItemsCore; import me.shedaniel.rei.api.ConfigManager; import me.shedaniel.rei.gui.RecipeViewingScreen; @@ -147,9 +147,9 @@ public class RecipeChoosePageWidget extends DraggableWidget { public void render(int i, int i1, float v) { widgets.forEach(widget -> { GuiLighting.disable(); - GlStateManager.translatef(0, 0, 800); + RenderHelper.translatef(0, 0, 800); widget.render(i, i1, v); - GlStateManager.translatef(0, 0, -800); + RenderHelper.translatef(0, 0, -800); }); } diff --git a/src/main/java/me/shedaniel/rei/gui/widget/SearchFieldWidget.java b/src/main/java/me/shedaniel/rei/gui/widget/SearchFieldWidget.java index 74f7a884d..bc2c569e5 100644 --- a/src/main/java/me/shedaniel/rei/gui/widget/SearchFieldWidget.java +++ b/src/main/java/me/shedaniel/rei/gui/widget/SearchFieldWidget.java @@ -5,7 +5,7 @@ package me.shedaniel.rei.gui.widget; -import com.mojang.blaze3d.platform.GlStateManager; +import me.shedaniel.math.compat.RenderHelper; import me.shedaniel.rei.gui.ContainerScreenOverlay; import net.minecraft.client.MinecraftClient; import net.minecraft.client.render.GuiLighting; @@ -28,11 +28,11 @@ public class SearchFieldWidget extends TextFieldWidget { public void laterRender(int int_1, int int_2, float float_1) { GuiLighting.disable(); - GlStateManager.disableDepthTest(); + RenderHelper.disableDepthTest(); setEditableColor(ContainerScreenOverlay.getEntryListWidget().children().isEmpty() && !getText().isEmpty() ? 16733525 : isSearching ? -1313241 : 14737632); setSuggestion(!isFocused() && getText().isEmpty() ? I18n.translate("text.rei.search.field.suggestion") : null); super.render(int_1, int_2, float_1); - GlStateManager.enableDepthTest(); + RenderHelper.enableDepthTest(); } @Override diff --git a/src/main/java/me/shedaniel/rei/gui/widget/SlotWidget.java b/src/main/java/me/shedaniel/rei/gui/widget/SlotWidget.java index b01cefd89..187c3a99b 100644 --- a/src/main/java/me/shedaniel/rei/gui/widget/SlotWidget.java +++ b/src/main/java/me/shedaniel/rei/gui/widget/SlotWidget.java @@ -6,8 +6,8 @@ package me.shedaniel.rei.gui.widget; import com.google.common.collect.Lists; -import com.mojang.blaze3d.platform.GlStateManager; import me.shedaniel.math.api.Rectangle; +import me.shedaniel.math.compat.RenderHelper; import me.shedaniel.math.impl.PointHelper; import me.shedaniel.rei.RoughlyEnoughItemsCore; import me.shedaniel.rei.api.ClientHelper; @@ -137,16 +137,16 @@ public class SlotWidget extends WidgetWithBounds { renderer.render(x + 8, y + 6, mouseX, mouseY, delta); } if (drawHighlightedBackground && highlighted) { - GlStateManager.disableLighting(); - GlStateManager.disableDepthTest(); - GlStateManager.colorMask(true, true, true, false); + RenderHelper.disableLighting(); + RenderHelper.disableDepthTest(); + RenderHelper.colorMask(true, true, true, false); int color = darkTheme ? -1877929711 : -2130706433; blitOffset = 300; fillGradient(x, y, x + 16, y + 16, color, color); blitOffset = 0; - GlStateManager.colorMask(true, true, true, true); - GlStateManager.enableLighting(); - GlStateManager.enableDepthTest(); + RenderHelper.colorMask(true, true, true, true); + RenderHelper.enableLighting(); + RenderHelper.enableDepthTest(); } } diff --git a/src |
