diff options
author | Anthony Hilyard <anthony.hilyard@gmail.com> | 2022-12-23 17:18:10 -0800 |
---|---|---|
committer | Anthony Hilyard <anthony.hilyard@gmail.com> | 2022-12-23 17:18:10 -0800 |
commit | 94e0927f324032c49a610f41c6055e56a0823321 (patch) | |
tree | 18f352a3c2cc496d487b843773620d3eee6bec40 | |
parent | ce46c0feb25b6127a1ce4e5624a05acf5ce16a71 (diff) | |
download | Iceberg-94e0927f324032c49a610f41c6055e56a0823321.tar.gz Iceberg-94e0927f324032c49a610f41c6055e56a0823321.tar.bz2 Iceberg-94e0927f324032c49a610f41c6055e56a0823321.zip |
Fixed items rendered with alpha being upside down.
-rw-r--r-- | gradle.properties | 4 | ||||
-rw-r--r-- | src/main/java/com/anthonyhilyard/iceberg/renderer/CustomItemRenderer.java | 19 | ||||
-rw-r--r-- | src/main/resources/META-INF/mods.toml | 6 |
3 files changed, 17 insertions, 12 deletions
diff --git a/gradle.properties b/gradle.properties index a97801c..19285dd 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,6 +6,6 @@ org.gradle.daemon=false name=${rootProject.name} group=com.anthonyhilyard.${name.toLowerCase()} author=anthonyhilyard -version=1.1.1 +version=1.1.2 mcVersion=1.19.3 -forgeVersion=44.0.18
\ No newline at end of file +forgeVersion=44.0.37
\ No newline at end of file diff --git a/src/main/java/com/anthonyhilyard/iceberg/renderer/CustomItemRenderer.java b/src/main/java/com/anthonyhilyard/iceberg/renderer/CustomItemRenderer.java index 301b4c4..77e814a 100644 --- a/src/main/java/com/anthonyhilyard/iceberg/renderer/CustomItemRenderer.java +++ b/src/main/java/com/anthonyhilyard/iceberg/renderer/CustomItemRenderer.java @@ -640,10 +640,9 @@ public class CustomItemRenderer extends ItemRenderer RenderSystem.backupProjectionMatrix(); RenderSystem.setProjectionMatrix(matrix); - Lighting.setupFor3DItems(); - mc.getTextureManager().getTexture(InventoryMenu.BLOCK_ATLAS).setFilter(false, false); RenderSystem.setShaderTexture(0, InventoryMenu.BLOCK_ATLAS); + RenderSystem.disableCull(); RenderSystem.enableBlend(); RenderSystem.blendFuncSeparate(SourceFactor.SRC_ALPHA, DestFactor.ONE_MINUS_SRC_ALPHA, SourceFactor.ONE, DestFactor.ONE_MINUS_SRC_ALPHA); RenderSystem.setShaderColor(1.0f, 1.0f, 1.0f, 1.0f); @@ -655,14 +654,21 @@ public class CustomItemRenderer extends ItemRenderer modelViewStack.scale(96.0f, 96.0f, 96.0f); RenderSystem.applyModelViewMatrix(); PoseStack poseStack = new PoseStack(); - BufferSource bufferSource = Minecraft.getInstance().renderBuffers().bufferSource(); + BufferSource bufferSource = mc.renderBuffers().bufferSource(); + boolean flatLighting = !bakedModel.usesBlockLight(); - if (flatLighting) { Lighting.setupForFlatItems(); } + if (flatLighting) + { + Lighting.setupForFlatItems(); + } render(stack, ItemTransforms.TransformType.GUI, false, poseStack, bufferSource, LightTexture.FULL_BRIGHT, OverlayTexture.NO_OVERLAY, bakedModel); bufferSource.endBatch(); RenderSystem.enableDepthTest(); - if (flatLighting) { Lighting.setupFor3DItems(); } + if (flatLighting) + { + Lighting.setupFor3DItems(); + } modelViewStack.popPose(); RenderSystem.applyModelViewMatrix(); @@ -679,13 +685,12 @@ public class CustomItemRenderer extends ItemRenderer RenderSystem.disableCull(); RenderSystem.setShaderColor(1.0f, 1.0f, 1.0f, alpha); modelViewStack.pushPose(); - modelViewStack.scale(1.0f, -1.0f, 1.0f); modelViewStack.translate(0.0f, 0.0f, 50.0f + this.blitOffset); RenderSystem.applyModelViewMatrix(); RenderSystem.setShaderTexture(0, iconFrameBuffer.getColorTextureId()); - GuiComponent.blit(new PoseStack(), x, y - 18, 16, 16, 0, 0, iconFrameBuffer.width, iconFrameBuffer.height, iconFrameBuffer.width, iconFrameBuffer.height); + GuiComponent.blit(new PoseStack(), x, y, 16, 16, 0, 0, iconFrameBuffer.width, iconFrameBuffer.height, iconFrameBuffer.width, iconFrameBuffer.height); modelViewStack.popPose(); RenderSystem.applyModelViewMatrix(); iconFrameBuffer.unbindRead(); diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/mods.toml index 9a2bd13..e1ba5f0 100644 --- a/src/main/resources/META-INF/mods.toml +++ b/src/main/resources/META-INF/mods.toml @@ -1,5 +1,5 @@ modLoader="javafml" -loaderVersion="[41,)" +loaderVersion="[44,)" license="CC BY-NC-ND 4.0" [[mods]] @@ -15,14 +15,14 @@ description="A library containing events, helpers, and utilities to make modding [[dependencies.iceberg]] modId="forge" mandatory=true - versionRange="[41,)" + versionRange="[44,)" ordering="NONE" side="BOTH" [[dependencies.iceberg]] modId="minecraft" mandatory=true - versionRange="[1.19,)" + versionRange="[1.19.3,)" ordering="NONE" side="BOTH" |