mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-25 14:34:28 +00:00
Cleaner TileEntityItemStackRenderers, now stored on the Item. Modders should be careful and cache their renderers. (#4700)
This commit is contained in:
1 parent
a6bbc2761e
commit
ed314864f0
4 files changed
+44
-5
No files matched your search
@@ -0,0 +1,11 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/renderer/ChestRenderer.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/renderer/ChestRenderer.java
|
||||
@@ -13,6 +13,7 @@
|
||||
{
|
||||
GlStateManager.func_179131_c(p_178175_2_, p_178175_2_, p_178175_2_, 1.0F);
|
||||
GlStateManager.func_179114_b(90.0F, 0.0F, 1.0F, 0.0F);
|
||||
- TileEntityItemStackRenderer.field_147719_a.func_179022_a(new ItemStack(p_178175_1_));
|
||||
+ ItemStack stack = new ItemStack(p_178175_1_);
|
||||
+ stack.func_77973_b().getTileEntityItemStackRenderer().func_179022_a(stack);
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,15 @@
|
||||
this.func_175041_b();
|
||||
this.field_184395_f = p_i46552_3_;
|
||||
}
|
||||
@@ -137,7 +137,7 @@
|
||||
{
|
||||
GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
GlStateManager.func_179091_B();
|
||||
- TileEntityItemStackRenderer.field_147719_a.func_179022_a(p_180454_1_);
|
||||
+ p_180454_1_.func_77973_b().getTileEntityItemStackRenderer().func_179022_a(p_180454_1_);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -218,7 +218,7 @@
|
||||
k = k | -16777216;
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
CreativeTabs creativetabs = this.func_77640_w();
|
||||
return creativetabs != null && (p_194125_1_ == CreativeTabs.field_78027_g || p_194125_1_ == creativetabs);
|
||||
}
|
||||
@@ -435,11 +441,727 @@
|
||||
@@ -435,11 +441,746 @@
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -790,13 +790,32 @@
|
||||
+ * @param armor the armor itemstack
|
||||
+ */
|
||||
+ public void onHorseArmorTick(World world, net.minecraft.entity.EntityLiving horse, ItemStack armor) {}
|
||||
+
|
||||
+ @SideOnly(Side.CLIENT)
|
||||
+ @Nullable
|
||||
+ private net.minecraft.client.renderer.tileentity.TileEntityItemStackRenderer teisr = null;
|
||||
+
|
||||
+ /**
|
||||
+ * @return This Item's renderer, or the default instance if it does not have one.
|
||||
+ */
|
||||
+ @SideOnly(Side.CLIENT)
|
||||
+ public final net.minecraft.client.renderer.tileentity.TileEntityItemStackRenderer getTileEntityItemStackRenderer()
|
||||
+ {
|
||||
+ return teisr != null ? teisr : net.minecraft.client.renderer.tileentity.TileEntityItemStackRenderer.field_147719_a;
|
||||
+ }
|
||||
+
|
||||
+ @SideOnly(Side.CLIENT)
|
||||
+ public void setTileEntityItemStackRenderer(@Nullable net.minecraft.client.renderer.tileentity.TileEntityItemStackRenderer teisr)
|
||||
+ {
|
||||
+ this.teisr = teisr;
|
||||
+ }
|
||||
+
|
||||
+ /* ======================================== FORGE END =====================================*/
|
||||
+
|
||||
public static void func_150900_l()
|
||||
{
|
||||
func_179214_a(Blocks.field_150350_a, new ItemAir(Blocks.field_150350_a));
|
||||
@@ -999,6 +1721,8 @@
|
||||
@@ -999,6 +1740,8 @@
|
||||
private final float field_78010_h;
|
||||
private final float field_78011_i;
|
||||
private final int field_78008_j;
|
||||
@@ -805,7 +824,7 @@
|
||||
|
||||
private ToolMaterial(int p_i1874_3_, int p_i1874_4_, float p_i1874_5_, float p_i1874_6_, int p_i1874_7_)
|
||||
{
|
||||
@@ -1034,6 +1758,7 @@
|
||||
@@ -1034,6 +1777,7 @@
|
||||
return this.field_78008_j;
|
||||
}
|
||||
|
||||
@@ -813,7 +832,7 @@
|
||||
public Item func_150995_f()
|
||||
{
|
||||
if (this == WOOD)
|
||||
@@ -1057,5 +1782,21 @@
|
||||
@@ -1057,5 +1801,21 @@
|
||||
return this == DIAMOND ? Items.field_151045_i : null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -581,7 +581,7 @@ public class ForgeHooksClient
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Will be removed as soon as possible, hopefully 1.9.
|
||||
* @deprecated Will be removed as soon as possible. See {@link Item#getTileEntityItemStackRenderer()}.
|
||||
*/
|
||||
@Deprecated
|
||||
public static void registerTESRItemStack(Item item, int metadata, Class<? extends TileEntity> TileClass)
|
||||
|
||||
Reference in new issue
Block a user