diff --git a/patches/minecraft/net/minecraft/src/Block.java.patch b/patches/minecraft/net/minecraft/src/Block.java.patch index 7e1af3014a..956d3829c0 100644 --- a/patches/minecraft/net/minecraft/src/Block.java.patch +++ b/patches/minecraft/net/minecraft/src/Block.java.patch @@ -101,7 +101,7 @@ } } -@@ -805,6 +819,96 @@ +@@ -805,6 +819,104 @@ return iblockaccess.isBlockNormalCube(i, j, k) ? 0.2F : 1.0F; } @@ -194,6 +194,14 @@ + int i, int j, int k) { + return world.setBlockWithNotify(i, j, k, 0); + } ++ ++ /* FORGE: Called when a new CreativeContainer is opened, populate the list ++ * with all of the items for this block you want a player in creative mode ++ * to have access to. ++ */ ++ public void addCreativeItems(ArrayList itemList) ++ { ++ } + static Class _mthclass$(String s) { diff --git a/patches/minecraft/net/minecraft/src/ContainerCreative.java.patch b/patches/minecraft/net/minecraft/src/ContainerCreative.java.patch new file mode 100644 index 0000000000..44c2bbd4d8 --- /dev/null +++ b/patches/minecraft/net/minecraft/src/ContainerCreative.java.patch @@ -0,0 +1,25 @@ +--- ../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 +@@ -74,12 +74,20 @@ + } + itemList.add(new ItemStack(ablock[l1], 1, k2)); + } ++ ++ for(int x = 0; x < 256; x++) ++ { ++ if (Block.blocksList[x] != null) ++ { ++ Block.blocksList[x].addCreativeItems((ArrayList)itemList); ++ } ++ } + + for(int i2 = 256; i2 < Item.itemsList.length; i2++) + { +- if(Item.itemsList[i2] != null && Item.itemsList[i2].shiftedIndex != Item.potion.shiftedIndex) ++ if(Item.itemsList[i2] != null) + { +- itemList.add(new ItemStack(Item.itemsList[i2])); ++ Item.itemsList[i2].addCreativeItems((ArrayList)itemList); + } + } + diff --git a/patches/minecraft/net/minecraft/src/Item.java.patch b/patches/minecraft/net/minecraft/src/Item.java.patch index ce763e57f2..ac62ae845a 100644 --- a/patches/minecraft/net/minecraft/src/Item.java.patch +++ b/patches/minecraft/net/minecraft/src/Item.java.patch @@ -1,6 +1,14 @@ --- ../src_base/minecraft/net/minecraft/src/Item.java 0000-00-00 00:00:00.000000000 -0000 +++ ../src_work/minecraft/net/minecraft/src/Item.java 0000-00-00 00:00:00.000000000 -0000 -@@ -177,6 +177,9 @@ +@@ -5,6 +5,7 @@ + package net.minecraft.src; + + import java.io.PrintStream; ++import java.util.ArrayList; + import java.util.List; + import java.util.Random; + +@@ -177,6 +178,9 @@ private String field_39010_c; private String itemName; @@ -10,7 +18,7 @@ protected Item(int i) { maxStackSize = 64; -@@ -231,6 +234,13 @@ +@@ -231,6 +235,13 @@ return 1.0F; } @@ -24,7 +32,7 @@ public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer) { return itemstack; -@@ -278,6 +288,19 @@ +@@ -278,6 +289,19 @@ return maxDamage > 0 && !hasSubtypes; } @@ -44,3 +52,32 @@ public boolean hitEntity(ItemStack itemstack, EntityLiving entityliving, EntityLiving entityliving1) { return false; +@@ -473,6 +497,28 @@ + { + return 0; + } ++ ++ /* FORGE: Called when a new CreativeContainer is opened, populate the list ++ * with all of the items for this item you want a player in creative mode ++ * to have access to. ++ */ ++ public void addCreativeItems(ArrayList itemList) ++ { ++ if (this.shiftedIndex != Item.potion.shiftedIndex) ++ { ++ if (this.shiftedIndex == Item.dyePowder.shiftedIndex) ++ { ++ for (int x = 0; x < 16; x++) ++ { ++ itemList.add(new ItemStack(Item.dyePowder, 1, x)); ++ } ++ } ++ else ++ { ++ itemList.add(new ItemStack(this, 1)); ++ } ++ } ++ } + + static + {