diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/client/render/FontRenderer.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/client/render/FontRenderer.kt index 818e3dc95..891815dad 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/client/render/FontRenderer.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/client/render/FontRenderer.kt @@ -1,9 +1,7 @@ package ru.dbotthepony.mc.otm.client.render import com.mojang.blaze3d.vertex.PoseStack -import com.mojang.blaze3d.vertex.VertexSorting import net.minecraft.client.gui.Font - import net.minecraft.client.renderer.MultiBufferSource import net.minecraft.network.chat.Component import net.minecraft.util.FormattedCharSequence diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/client/render/GlitchRenderer.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/client/render/GlitchRenderer.kt index 9a3fcf2cb..34c5747a1 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/client/render/GlitchRenderer.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/client/render/GlitchRenderer.kt @@ -148,7 +148,7 @@ object GlitchRenderer { val glitchBuffer = glitchBuffer val projection = RenderSystem.getProjectionMatrix() - RenderSystem.setProjectionMatrix(Matrix4f(), VertexSorting.ORTHOGRAPHIC_Z) + RenderSystem.setProjectionMatrix(Matrix4f()) RenderSystem.getModelViewStack().also { it.pushPose() @@ -244,7 +244,7 @@ object GlitchRenderer { RenderSystem.setShaderTexture(0, glitchBuffer.colorTextureId) draw(0.0, 0.0) - RenderSystem.setProjectionMatrix(projection, VertexSorting.DISTANCE_TO_ORIGIN) + RenderSystem.setProjectionMatrix(projection) RenderSystem.getModelViewStack().popPose() RenderSystem.applyModelViewMatrix() } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/MatteryScreen.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/MatteryScreen.kt index 5c43c66de..d3fbe4daa 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/MatteryScreen.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/MatteryScreen.kt @@ -12,6 +12,7 @@ import net.minecraft.network.chat.Component import net.minecraft.world.entity.player.Inventory import net.minecraft.world.inventory.Slot import net.minecraft.world.item.Item +import net.minecraft.world.item.ItemDisplayContext import net.minecraft.world.item.ItemStack import net.minecraftforge.client.event.ContainerScreenEvent.Render.Background import net.minecraftforge.client.event.ContainerScreenEvent.Render.Foreground @@ -91,19 +92,11 @@ abstract class MatteryScreen(menu: T, inventory: Inventory, tit fun renderItemStack(graphics: MGUIGraphics, itemstack: ItemStack, countOverride: String? = null) { if (!itemstack.isEmpty) { RenderSystem.enableDepthTest() - - val (x, y) = graphics.pose.translation() - - graphics.parent.renderItem( - requireNotNull(ru.dbotthepony.mc.otm.client.minecraft.player) { "yo, dude, what the fuck" }, - itemstack, - 1, - 1, - (x + y * ru.dbotthepony.mc.otm.client.minecraft.window.guiScaledWidth).toInt() - ) - + itemRenderer.renderGuiItem(graphics.pose, itemstack, 1, 1) RenderSystem.depthFunc(GL11.GL_ALWAYS) - graphics.parent.renderItemDecorations( + + itemRenderer.renderGuiItemDecorations( + graphics.pose, super.font, itemstack, 1, diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/panels/EntityRendererPanel.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/panels/EntityRendererPanel.kt index f5fbc7871..3dc6017e0 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/panels/EntityRendererPanel.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/panels/EntityRendererPanel.kt @@ -174,7 +174,7 @@ class EntityRendererPanel @JvmOverloads constructor( val renderY = (height * 0.9f).toInt() InventoryScreen.renderEntityInInventoryFollowsMouse( - graphics.parent, + graphics.pose, renderX, renderY, renderScale, diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/panels/Widget2Panel.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/panels/Widget2Panel.kt index ca49c74fb..d904817e7 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/panels/Widget2Panel.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/panels/Widget2Panel.kt @@ -91,7 +91,7 @@ abstract class Widget2Panel( override fun innerRender(graphics: MGUIGraphics, mouseX: Float, mouseY: Float, partialTick: Float) { RenderSystem.depthFunc(GL11.GL_ALWAYS) - getOrCreateWidget().render(graphics.parent, mouseX.toInt(), mouseY.toInt(), partialTick) + getOrCreateWidget().render(graphics.pose, mouseX.toInt(), mouseY.toInt(), partialTick) RenderSystem.depthFunc(GL11.GL_ALWAYS) }