mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-28 07:55:53 +00:00
130 lines
6.1 KiB
Diff
130 lines
6.1 KiB
Diff
--- ../src-base/minecraft/net/minecraft/client/renderer/entity/RenderItem.java
|
|
+++ ../src-work/minecraft/net/minecraft/client/renderer/entity/RenderItem.java
|
|
@@ -83,7 +83,7 @@
|
|
public RenderItem(TextureManager p_i46165_1_, ModelManager p_i46165_2_)
|
|
{
|
|
this.field_175057_n = p_i46165_1_;
|
|
- this.field_175059_m = new ItemModelMesher(p_i46165_2_);
|
|
+ this.field_175059_m = new net.minecraftforge.client.ItemModelMesherForge(p_i46165_2_);
|
|
this.func_175041_b();
|
|
}
|
|
|
|
@@ -212,6 +212,9 @@
|
|
private void func_175033_a(WorldRenderer p_175033_1_, BakedQuad p_175033_2_, int p_175033_3_)
|
|
{
|
|
p_175033_1_.func_178981_a(p_175033_2_.func_178209_a());
|
|
+ if(p_175033_2_ instanceof net.minecraftforge.client.model.IColoredBakedQuad)
|
|
+ net.minecraftforge.client.ForgeHooksClient.putQuadColor(p_175033_1_, p_175033_2_, p_175033_3_);
|
|
+ else
|
|
p_175033_1_.func_178968_d(p_175033_3_);
|
|
this.func_175038_a(p_175033_1_, p_175033_2_);
|
|
}
|
|
@@ -302,6 +305,10 @@
|
|
modelresourcelocation = new ModelResourceLocation("bow_pulling_0", "inventory");
|
|
}
|
|
}
|
|
+ else
|
|
+ {
|
|
+ modelresourcelocation = item.getModel(p_175049_1_, entityplayer, entityplayer.func_71052_bv());
|
|
+ }
|
|
|
|
if (modelresourcelocation != null)
|
|
{
|
|
@@ -314,6 +321,11 @@
|
|
|
|
protected void func_175034_a(ItemTransformVec3f p_175034_1_)
|
|
{
|
|
+ applyVanillaTransform(p_175034_1_);
|
|
+ }
|
|
+
|
|
+ public static void applyVanillaTransform(ItemTransformVec3f p_175034_1_)
|
|
+ {
|
|
if (p_175034_1_ != ItemTransformVec3f.field_178366_a)
|
|
{
|
|
GlStateManager.func_179109_b(p_175034_1_.field_178365_c.x + field_175055_b, p_175034_1_.field_178365_c.y + field_175056_c, p_175034_1_.field_178365_c.z + field_175053_d);
|
|
@@ -335,23 +347,7 @@
|
|
GlStateManager.func_179120_a(770, 771, 1, 0);
|
|
GlStateManager.func_179094_E();
|
|
|
|
- switch (RenderItem.SwitchTransformType.field_178640_a[p_175040_3_.ordinal()])
|
|
- {
|
|
- case 1:
|
|
- default:
|
|
- break;
|
|
- case 2:
|
|
- this.func_175034_a(p_175040_2_.func_177552_f().field_178355_b);
|
|
- break;
|
|
- case 3:
|
|
- this.func_175034_a(p_175040_2_.func_177552_f().field_178356_c);
|
|
- break;
|
|
- case 4:
|
|
- this.func_175034_a(p_175040_2_.func_177552_f().field_178353_d);
|
|
- break;
|
|
- case 5:
|
|
- this.func_175034_a(p_175040_2_.func_177552_f().field_178354_e);
|
|
- }
|
|
+ p_175040_2_ = net.minecraftforge.client.ForgeHooksClient.handleCameraTransforms(p_175040_2_, p_175040_3_);
|
|
|
|
this.func_180454_a(p_175040_1_, p_175040_2_);
|
|
GlStateManager.func_179121_F();
|
|
@@ -374,7 +370,7 @@
|
|
GlStateManager.func_179112_b(770, 771);
|
|
GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F);
|
|
this.func_180452_a(p_175042_2_, p_175042_3_, ibakedmodel.func_177556_c());
|
|
- this.func_175034_a(ibakedmodel.func_177552_f().field_178354_e);
|
|
+ ibakedmodel = net.minecraftforge.client.ForgeHooksClient.handleCameraTransforms(ibakedmodel, ItemCameraTransforms.TransformType.GUI);
|
|
this.func_180454_a(p_175042_1_, ibakedmodel);
|
|
GlStateManager.func_179118_c();
|
|
GlStateManager.func_179101_C();
|
|
@@ -485,10 +481,11 @@
|
|
GlStateManager.func_179126_j();
|
|
}
|
|
|
|
- if (p_180453_2_.func_77951_h())
|
|
+ if (p_180453_2_.func_77973_b().showDurabilityBar(p_180453_2_))
|
|
{
|
|
- int j1 = (int)Math.round(13.0D - (double)p_180453_2_.func_77952_i() * 13.0D / (double)p_180453_2_.func_77958_k());
|
|
- int k = (int)Math.round(255.0D - (double)p_180453_2_.func_77952_i() * 255.0D / (double)p_180453_2_.func_77958_k());
|
|
+ double health = p_180453_2_.func_77973_b().getDurabilityForDisplay(p_180453_2_);
|
|
+ int j1 = (int)Math.round(13.0D - health * 13.0D);
|
|
+ int k = (int)Math.round(255.0D - health * 255.0D);
|
|
GlStateManager.func_179140_f();
|
|
GlStateManager.func_179097_i();
|
|
GlStateManager.func_179090_x();
|
|
@@ -501,7 +498,7 @@
|
|
this.func_175044_a(worldrenderer, p_180453_3_ + 2, p_180453_4_ + 13, 13, 2, 0);
|
|
this.func_175044_a(worldrenderer, p_180453_3_ + 2, p_180453_4_ + 13, 12, 1, i1);
|
|
this.func_175044_a(worldrenderer, p_180453_3_ + 2, p_180453_4_ + 13, j1, 1, l);
|
|
- GlStateManager.func_179147_l();
|
|
+ //GlStateManager.enableBlend(); // Forge: Disable Bled because it screws with a lot of things down the line.
|
|
GlStateManager.func_179141_d();
|
|
GlStateManager.func_179098_w();
|
|
GlStateManager.func_179145_e();
|
|
@@ -1072,12 +1069,26 @@
|
|
this.func_175029_a(Blocks.field_150420_aW, BlockHugeMushroom.EnumType.ALL_INSIDE.func_176896_a(), "brown_mushroom_block");
|
|
this.func_175029_a(Blocks.field_150419_aX, BlockHugeMushroom.EnumType.ALL_INSIDE.func_176896_a(), "red_mushroom_block");
|
|
this.func_175031_a(Blocks.field_150380_bt, "dragon_egg");
|
|
+ net.minecraftforge.client.model.ModelLoader.onRegisterItems(this.field_175059_m);
|
|
}
|
|
|
|
public void func_110549_a(IResourceManager p_110549_1_)
|
|
{
|
|
this.field_175059_m.func_178085_b();
|
|
}
|
|
+ /*==================================== FORGE START ===========================================* /
|
|
+ private static RenderItem instance;
|
|
+ /**
|
|
+ * Returns a single lazy loaded instance of RenderItem, for use in mods who
|
|
+ * don't care about the interaction of other objects on the current state of the RenderItem they are using.
|
|
+ * @return A global instance of RenderItem
|
|
+ * /
|
|
+ public static RenderItem getInstance()
|
|
+ {
|
|
+ if (instance == null) instance = new RenderItem();
|
|
+ return instance;
|
|
+ }
|
|
+ /*==================================== FORGE END =============================================*/
|
|
|
|
@SideOnly(Side.CLIENT)
|
|
|