Moved dye creative adds to the ItemDye class.

This commit is contained in:
LexManos 2011-12-02 03:57:11 +00:00
parent 6c578cd84d
commit a2c606e98c
3 changed files with 34 additions and 16 deletions

View file

@ -1,6 +1,6 @@
--- ../src_base/minecraft/net/minecraft/src/ContainerCreative.java 0000-00-00 00:00:00.000000000 -0000 --- ../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 +++ ../src_work/minecraft/net/minecraft/src/ContainerCreative.java 0000-00-00 00:00:00.000000000 -0000
@@ -74,12 +74,20 @@ @@ -74,20 +74,23 @@
} }
itemList.add(new ItemStack(ablock[l1], 1, k2)); itemList.add(new ItemStack(ablock[l1], 1, k2));
} }
@ -23,3 +23,11 @@
} }
} }
- for(int j2 = 1; j2 < 16; j2++)
- {
- itemList.add(new ItemStack(Item.dyePowder.shiftedIndex, 1, j2));
- }
-
InventoryPlayer inventoryplayer = entityplayer.inventory;
for(int l2 = 0; l2 < 9; l2++)
{

View file

@ -52,7 +52,7 @@
public boolean hitEntity(ItemStack itemstack, EntityLiving entityliving, EntityLiving entityliving1) public boolean hitEntity(ItemStack itemstack, EntityLiving entityliving, EntityLiving entityliving1)
{ {
return false; return false;
@@ -473,6 +497,28 @@ @@ -473,6 +497,18 @@
{ {
return 0; return 0;
} }
@ -65,17 +65,7 @@
+ { + {
+ if (this.shiftedIndex != Item.potion.shiftedIndex) + if (this.shiftedIndex != Item.potion.shiftedIndex)
+ { + {
+ if (this.shiftedIndex == Item.dyePowder.shiftedIndex) + itemList.add(new ItemStack(this, 1));
+ {
+ for (int x = 0; x < 16; x++)
+ {
+ itemList.add(new ItemStack(Item.dyePowder, 1, x));
+ }
+ }
+ else
+ {
+ itemList.add(new ItemStack(this, 1));
+ }
+ } + }
+ } + }

View file

@ -1,14 +1,16 @@
--- ../src_base/minecraft/net/minecraft/src/ItemDye.java 0000-00-00 00:00:00.000000000 -0000 --- ../src_base/minecraft/net/minecraft/src/ItemDye.java 0000-00-00 00:00:00.000000000 -0000
+++ ../src_work/minecraft/net/minecraft/src/ItemDye.java 0000-00-00 00:00:00.000000000 -0000 +++ ../src_work/minecraft/net/minecraft/src/ItemDye.java 0000-00-00 00:00:00.000000000 -0000
@@ -3,6 +3,7 @@ @@ -3,7 +3,9 @@
// Decompiler options: packimports(3) braces deadcode fieldsfirst // Decompiler options: packimports(3) braces deadcode fieldsfirst
package net.minecraft.src; package net.minecraft.src;
+import net.minecraft.src.forge.ForgeHooks; +import net.minecraft.src.forge.ForgeHooks;
+import java.util.ArrayList;
import java.util.Random; import java.util.Random;
@@ -45,13 +46,18 @@ // Referenced classes of package net.minecraft.src:
@@ -45,13 +47,18 @@
public boolean onItemUse(ItemStack itemstack, EntityPlayer entityplayer, World world, int i, int j, int k, int l) public boolean onItemUse(ItemStack itemstack, EntityPlayer entityplayer, World world, int i, int j, int k, int l)
{ {
@ -28,7 +30,7 @@
if(i1 == Block.sapling.blockID) if(i1 == Block.sapling.blockID)
{ {
if(!world.multiplayerWorld) if(!world.multiplayerWorld)
@@ -118,13 +124,7 @@ @@ -118,13 +125,7 @@
world.setBlockAndMetadataWithNotify(k1, l1, i2, Block.tallGrass.blockID, 1); world.setBlockAndMetadataWithNotify(k1, l1, i2, Block.tallGrass.blockID, 1);
continue; continue;
} }
@ -43,3 +45,21 @@
} }
} }
@@ -147,5 +148,17 @@
}
}
}
+
+ /* 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)
+ {
+ for (int x = 0; x < 16; x++)
+ {
+ itemList.add(new ItemStack(this, 1, x));
+ }
+ }
}