diff options
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/data/RenderGuiData.kt | 11 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt | 21 |
2 files changed, 6 insertions, 26 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/data/RenderGuiData.kt b/src/main/java/at/hannibal2/skyhanni/data/RenderGuiData.kt index 9130a3723..b342fb345 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/RenderGuiData.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/RenderGuiData.kt @@ -15,18 +15,7 @@ class RenderGuiData { fun onRenderOverlay(event: RenderGameOverlayEvent.Pre) { if (event.type != RenderGameOverlayEvent.ElementType.HOTBAR) return -// val currentScreen = Minecraft.getMinecraft().currentScreen -// if (currentScreen != null) { -// if (currentScreen is GuiInventory || currentScreen is GuiChest) return -// } - - GlStateManager.pushMatrix() - GlStateManager.translate(0f, 0f, -1f) - GlStateManager.enableDepth() - GuiRenderEvent.GameOverlayRenderEvent().postAndCatch() - - GlStateManager.popMatrix() } @SubscribeEvent diff --git a/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt b/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt index 388ea8a08..bd0ac8cb0 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt @@ -6,7 +6,6 @@ import io.github.moulberry.notenoughupdates.NotEnoughUpdates import io.github.moulberry.notenoughupdates.recipes.CraftingRecipe import io.github.moulberry.notenoughupdates.recipes.NeuRecipe import io.github.moulberry.notenoughupdates.util.ItemResolutionQuery -import io.github.moulberry.notenoughupdates.util.Utils import net.minecraft.client.Minecraft import net.minecraft.client.renderer.GlStateManager import net.minecraft.client.renderer.RenderHelper @@ -71,7 +70,6 @@ object NEUItems { fun isVanillaItem(item: ItemStack) = manager.auctionManager.isVanillaItem(item.getInternalName()) fun ItemStack.renderOnScreen(x: Float, y: Float, scaleMultiplier: Double = 1.0) { - GlStateManager.pushMatrix() val isSkull = item === Items.skull val baseScale = (if (isSkull) 0.8f else 0.6f) @@ -88,23 +86,16 @@ object NEUItems { translateY = y - diff } - GlStateManager.translate(translateX, translateY, 0f) - GlStateManager.scale(finalScale, finalScale, 0.0) - drawItemStack(this) - GlStateManager.popMatrix() - } + GlStateManager.pushMatrix(); - private fun drawItemStack(stack: ItemStack) { - val itemRender = Minecraft.getMinecraft().renderItem + GlStateManager.translate(translateX, translateY, 1F) + GlStateManager.scale(finalScale, finalScale, 1.0) - Utils.disableCustomDungColours = true RenderHelper.enableGUIStandardItemLighting() - Utils.hasEffectOverride = true - itemRender.renderItemAndEffectIntoGUI(stack, 0, 0) - itemRender.renderItemOverlayIntoGUI(Minecraft.getMinecraft().fontRendererObj, stack, 0, 0, null) - Utils.hasEffectOverride = false + Minecraft.getMinecraft().renderItem.renderItemIntoGUI(this, 0, 0) RenderHelper.disableStandardItemLighting() - Utils.disableCustomDungColours = false + + GlStateManager.popMatrix() } fun getMultiplier(rawId: String, tryCount: Int = 0): Pair<String, Int> { |