aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnthony Hilyard <anthony.hilyard@gmail.com>2022-12-23 17:18:10 -0800
committerAnthony Hilyard <anthony.hilyard@gmail.com>2022-12-23 17:18:10 -0800
commit94e0927f324032c49a610f41c6055e56a0823321 (patch)
tree18f352a3c2cc496d487b843773620d3eee6bec40 /src
parentce46c0feb25b6127a1ce4e5624a05acf5ce16a71 (diff)
downloadIceberg-94e0927f324032c49a610f41c6055e56a0823321.tar.gz
Iceberg-94e0927f324032c49a610f41c6055e56a0823321.tar.bz2
Iceberg-94e0927f324032c49a610f41c6055e56a0823321.zip
Fixed items rendered with alpha being upside down.
Diffstat (limited to 'src')
-rw-r--r--src/main/java/com/anthonyhilyard/iceberg/renderer/CustomItemRenderer.java19
-rw-r--r--src/main/resources/META-INF/mods.toml6
2 files changed, 15 insertions, 10 deletions
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"