From cbe2766c0a58e6fb8f4d34cb855885775454a9e6 Mon Sep 17 00:00:00 2001 From: RainWarrior Date: Sun, 8 Nov 2015 09:37:33 +0300 Subject: [PATCH] Provide ItemCameraTransforms for vanilla models when possible. --- .../client/ForgeHooksClient.java | 33 ++++++++++--------- .../client/model/IPerspectiveAwareModel.java | 2 +- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/src/main/java/net/minecraftforge/client/ForgeHooksClient.java b/src/main/java/net/minecraftforge/client/ForgeHooksClient.java index 885ec49af..ed12e6f70 100644 --- a/src/main/java/net/minecraftforge/client/ForgeHooksClient.java +++ b/src/main/java/net/minecraftforge/client/ForgeHooksClient.java @@ -545,22 +545,25 @@ public class ForgeHooksClient if(pair.getRight() != null) multiplyCurrentGlMatrix(pair.getRight()); return pair.getLeft(); } - switch(cameraTransformType) + else { - case FIRST_PERSON: - RenderItem.applyVanillaTransform(model.getItemCameraTransforms().firstPerson); - break; - case GUI: - RenderItem.applyVanillaTransform(model.getItemCameraTransforms().gui); - break; - case HEAD: - RenderItem.applyVanillaTransform(model.getItemCameraTransforms().head); - break; - case THIRD_PERSON: - RenderItem.applyVanillaTransform(model.getItemCameraTransforms().thirdPerson); - break; - default: - break; + switch(cameraTransformType) + { + case FIRST_PERSON: + RenderItem.applyVanillaTransform(model.getItemCameraTransforms().firstPerson); + break; + case GUI: + RenderItem.applyVanillaTransform(model.getItemCameraTransforms().gui); + break; + case HEAD: + RenderItem.applyVanillaTransform(model.getItemCameraTransforms().head); + break; + case THIRD_PERSON: + RenderItem.applyVanillaTransform(model.getItemCameraTransforms().thirdPerson); + break; + default: + break; + } } return model; } diff --git a/src/main/java/net/minecraftforge/client/model/IPerspectiveAwareModel.java b/src/main/java/net/minecraftforge/client/model/IPerspectiveAwareModel.java index d28c17542..be4a2ad33 100644 --- a/src/main/java/net/minecraftforge/client/model/IPerspectiveAwareModel.java +++ b/src/main/java/net/minecraftforge/client/model/IPerspectiveAwareModel.java @@ -59,7 +59,7 @@ public interface IPerspectiveAwareModel extends IBakedModel public boolean isGui3d() { return parent.isGui3d(); } public boolean isBuiltInRenderer() { return parent.isBuiltInRenderer(); } public TextureAtlasSprite getTexture() { return parent.getTexture(); } - public ItemCameraTransforms getItemCameraTransforms() { return ItemCameraTransforms.DEFAULT; } + public ItemCameraTransforms getItemCameraTransforms() { return parent.getItemCameraTransforms(); } public List getFaceQuads(EnumFacing side) { return parent.getFaceQuads(side); } public List getGeneralQuads() { return parent.getGeneralQuads(); } public VertexFormat getFormat() { return parent.getFormat(); }