From 3bb04f70caf4eeae3af001685b917ea12f697c15 Mon Sep 17 00:00:00 2001 From: LexManos Date: Tue, 17 Jan 2012 21:03:08 +0000 Subject: [PATCH] Small update to ContainerCreative hook for better compatibility with mods that extend block IDs. --- .../src/ContainerCreative.java.patch | 31 +++++++++---------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/forge/patches/minecraft/net/minecraft/src/ContainerCreative.java.patch b/forge/patches/minecraft/net/minecraft/src/ContainerCreative.java.patch index 6a5903ec26..4c0c4038e4 100644 --- a/forge/patches/minecraft/net/minecraft/src/ContainerCreative.java.patch +++ b/forge/patches/minecraft/net/minecraft/src/ContainerCreative.java.patch @@ -1,34 +1,33 @@ --- ../src_base/minecraft/net/minecraft/src/ContainerCreative.java 0000-00-00 00:00:00.000000000 -0000 +++ ../src_work/minecraft/net/minecraft/src/ContainerCreative.java 0000-00-00 00:00:00.000000000 -0000 -@@ -64,20 +64,23 @@ +@@ -64,18 +64,21 @@ } itemList.add(new ItemStack(ablock[l1], 1, k2)); } - +- for (int i2 = 256; i2 < Item.itemsList.length; i2++) + -+ for(int x = 0; x < 256; x++) -+ { ++ for(int x = 0; x < Block.blocksList.length; x++) + { +- if (Item.itemsList[i2] != null && Item.itemsList[i2].shiftedIndex != Item.potion.shiftedIndex && Item.itemsList[i2].shiftedIndex != Item.field_44019_bC.shiftedIndex) +- { +- itemList.add(new ItemStack(Item.itemsList[i2])); +- } + if (Block.blocksList[x] != null) + { + Block.blocksList[x].addCreativeItems((ArrayList)itemList); + } -+ } + } +- +- for (int j2 = 1; j2 < 16; j2++) + - for (int i2 = 256; i2 < Item.itemsList.length; i2++) ++ for (int i2 = Block.blocksList.length; i2 < Item.itemsList.length; i2++) { -- if (Item.itemsList[i2] != null && Item.itemsList[i2].shiftedIndex != Item.potion.shiftedIndex && Item.itemsList[i2].shiftedIndex != Item.field_44019_bC.shiftedIndex) +- itemList.add(new ItemStack(Item.dyePowder.shiftedIndex, 1, j2)); + if (Item.itemsList[i2] != null) - { -- itemList.add(new ItemStack(Item.itemsList[i2])); ++ { + Item.itemsList[i2].addCreativeItems((ArrayList)itemList); - } ++ } } -- for (int j2 = 1; j2 < 16; j2++) -- { -- itemList.add(new ItemStack(Item.dyePowder.shiftedIndex, 1, j2)); -- } -- Integer integer; - for (Iterator iterator = EntityList.field_44041_a.keySet().iterator(); iterator.hasNext(); itemList.add(new ItemStack(Item.field_44019_bC.shiftedIndex, 1, integer.intValue()))) - {