Fixed seeds/wheat not dropping from Crops/TallGrass.
All future Forge code should use proper annotations when Overriding.
This commit is contained in:
parent
5c60c2246c
commit
46a9ba178f
4 changed files with 60 additions and 42 deletions
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
// Referenced classes of package net.minecraft.src:
|
// Referenced classes of package net.minecraft.src:
|
||||||
// BlockFlower, Block, World, EntityItem,
|
// BlockFlower, Block, World, EntityItem,
|
||||||
@@ -108,28 +109,16 @@
|
@@ -108,28 +109,22 @@
|
||||||
return 6;
|
return 6;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,22 +16,22 @@
|
||||||
- {
|
- {
|
||||||
- super.dropBlockAsItemWithChance(world, i, j, k, l, f, 0);
|
- super.dropBlockAsItemWithChance(world, i, j, k, l, f, 0);
|
||||||
- if(world.multiplayerWorld)
|
- if(world.multiplayerWorld)
|
||||||
- {
|
+ @Override
|
||||||
- return;
|
+ public ArrayList<ItemStack> getBlockDropped(World world, int i, int j, int k, int md, int fortune) {
|
||||||
+ public ArrayList<ItemStack> getBlockDropped(World world,
|
|
||||||
+ int i, int j, int k, int md) {
|
|
||||||
+ ArrayList<ItemStack> tr = new ArrayList<ItemStack>();
|
+ ArrayList<ItemStack> tr = new ArrayList<ItemStack>();
|
||||||
+ if (md == 7) tr.add(new ItemStack(Item.wheat));
|
+ if (md == 7)
|
||||||
+
|
{
|
||||||
+ for(int n = 0; n < 3; n++) {
|
- return;
|
||||||
+ if (world.rand.nextInt(15) <= md)
|
+ tr.add(new ItemStack(Item.wheat));
|
||||||
+ tr.add(new ItemStack(Item.seeds));
|
|
||||||
}
|
}
|
||||||
- int j1 = 3 + i1;
|
- int j1 = 3 + i1;
|
||||||
- for(int k1 = 0; k1 < j1; k1++)
|
- for(int k1 = 0; k1 < j1; k1++)
|
||||||
- {
|
+
|
||||||
|
+ for(int n = 0; n < 3; n++)
|
||||||
|
{
|
||||||
- if(world.rand.nextInt(15) <= l)
|
- if(world.rand.nextInt(15) <= l)
|
||||||
- {
|
+ if (world.rand.nextInt(15) <= md)
|
||||||
|
{
|
||||||
- float f1 = 0.7F;
|
- float f1 = 0.7F;
|
||||||
- float f2 = world.rand.nextFloat() * f1 + (1.0F - f1) * 0.5F;
|
- float f2 = world.rand.nextFloat() * f1 + (1.0F - f1) * 0.5F;
|
||||||
- float f3 = world.rand.nextFloat() * f1 + (1.0F - f1) * 0.5F;
|
- float f3 = world.rand.nextFloat() * f1 + (1.0F - f1) * 0.5F;
|
||||||
|
@ -39,8 +39,9 @@
|
||||||
- EntityItem entityitem = new EntityItem(world, (float)i + f2, (float)j + f3, (float)k + f4, new ItemStack(Item.seeds));
|
- EntityItem entityitem = new EntityItem(world, (float)i + f2, (float)j + f3, (float)k + f4, new ItemStack(Item.seeds));
|
||||||
- entityitem.delayBeforeCanPickup = 10;
|
- entityitem.delayBeforeCanPickup = 10;
|
||||||
- world.entityJoinedWorld(entityitem);
|
- world.entityJoinedWorld(entityitem);
|
||||||
- }
|
+ tr.add(new ItemStack(Item.seeds));
|
||||||
- }
|
}
|
||||||
|
}
|
||||||
-
|
-
|
||||||
+ return tr;
|
+ return tr;
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
|
|
||||||
// Referenced classes of package net.minecraft.src:
|
// Referenced classes of package net.minecraft.src:
|
||||||
// BlockFlower, ColorizerGrass, ColorizerFoliage, IBlockAccess,
|
// BlockFlower, ColorizerGrass, ColorizerFoliage, IBlockAccess,
|
||||||
@@ -73,13 +76,17 @@
|
@@ -73,13 +76,24 @@
|
||||||
|
|
||||||
public int idDropped(int i, Random random, int j)
|
public int idDropped(int i, Random random, int j)
|
||||||
{
|
{
|
||||||
|
@ -25,13 +25,20 @@
|
||||||
+ return -1;
|
+ return -1;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ public ArrayList<ItemStack> getBlockDropped(World world,
|
+ @Override
|
||||||
+ int i, int j, int k, int md) {
|
+ public ArrayList<ItemStack> getBlockDropped(World world, int i, int j, int k, int md, int fortune)
|
||||||
+ ArrayList<ItemStack> tr=new ArrayList<ItemStack>();
|
+ {
|
||||||
+ if(world.rand.nextInt(8)!=0)
|
+ ArrayList<ItemStack> tr = new ArrayList<ItemStack>();
|
||||||
|
+ if(world.rand.nextInt(8) != 0)
|
||||||
|
+ {
|
||||||
+ return tr;
|
+ return tr;
|
||||||
+ ItemStack ist=ForgeHooks.getGrassSeed(world);
|
+ }
|
||||||
+ if(ist!=null) tr.add(ist);
|
+
|
||||||
|
+ ItemStack ist = ForgeHooks.getGrassSeed(world);
|
||||||
|
+ if (ist != null)
|
||||||
|
+ {
|
||||||
|
+ tr.add(ist);
|
||||||
|
+ }
|
||||||
+ return tr;
|
+ return tr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,30 +8,32 @@
|
||||||
|
|
||||||
// Referenced classes of package net.minecraft.src:
|
// Referenced classes of package net.minecraft.src:
|
||||||
// BlockFlower, Block, World, EntityItem,
|
// BlockFlower, Block, World, EntityItem,
|
||||||
@@ -108,28 +109,16 @@
|
@@ -108,28 +109,23 @@
|
||||||
return 6;
|
return 6;
|
||||||
}
|
}
|
||||||
|
|
||||||
- public void dropBlockAsItemWithChance(World world, int i, int j, int k, int l, float f, int i1)
|
- public void dropBlockAsItemWithChance(World world, int i, int j, int k, int l, float f, int i1)
|
||||||
- {
|
+ @Override
|
||||||
|
+ public ArrayList<ItemStack> getBlockDropped(World world, int i, int j, int k, int md, int fortune)
|
||||||
|
{
|
||||||
- super.dropBlockAsItemWithChance(world, i, j, k, l, f, 0);
|
- super.dropBlockAsItemWithChance(world, i, j, k, l, f, 0);
|
||||||
- if(world.singleplayerWorld)
|
- if(world.singleplayerWorld)
|
||||||
- {
|
|
||||||
- return;
|
|
||||||
+ public ArrayList<ItemStack> getBlockDropped(World world,
|
|
||||||
+ int i, int j, int k, int md) {
|
|
||||||
+ ArrayList<ItemStack> tr = new ArrayList<ItemStack>();
|
+ ArrayList<ItemStack> tr = new ArrayList<ItemStack>();
|
||||||
+ if (md == 7) tr.add(new ItemStack(Item.wheat));
|
+ if (md == 7)
|
||||||
|
+ {
|
||||||
|
+ tr.add(new ItemStack(Item.wheat));
|
||||||
|
+ }
|
||||||
+
|
+
|
||||||
+ for(int n = 0; n < 3; n++) {
|
+ for(int n = 0; n < 3; n++)
|
||||||
+ if (world.rand.nextInt(15) <= md)
|
{
|
||||||
+ tr.add(new ItemStack(Item.seeds));
|
- return;
|
||||||
}
|
- }
|
||||||
- int j1 = 3 + i1;
|
- int j1 = 3 + i1;
|
||||||
- for(int k1 = 0; k1 < j1; k1++)
|
- for(int k1 = 0; k1 < j1; k1++)
|
||||||
- {
|
- {
|
||||||
- if(world.rand.nextInt(15) <= l)
|
- if(world.rand.nextInt(15) <= l)
|
||||||
- {
|
+ if (world.rand.nextInt(15) <= md)
|
||||||
|
{
|
||||||
- float f1 = 0.7F;
|
- float f1 = 0.7F;
|
||||||
- float f2 = world.rand.nextFloat() * f1 + (1.0F - f1) * 0.5F;
|
- float f2 = world.rand.nextFloat() * f1 + (1.0F - f1) * 0.5F;
|
||||||
- float f3 = world.rand.nextFloat() * f1 + (1.0F - f1) * 0.5F;
|
- float f3 = world.rand.nextFloat() * f1 + (1.0F - f1) * 0.5F;
|
||||||
|
@ -39,8 +41,9 @@
|
||||||
- EntityItem entityitem = new EntityItem(world, (float)i + f2, (float)j + f3, (float)k + f4, new ItemStack(Item.seeds));
|
- EntityItem entityitem = new EntityItem(world, (float)i + f2, (float)j + f3, (float)k + f4, new ItemStack(Item.seeds));
|
||||||
- entityitem.delayBeforeCanPickup = 10;
|
- entityitem.delayBeforeCanPickup = 10;
|
||||||
- world.entityJoinedWorld(entityitem);
|
- world.entityJoinedWorld(entityitem);
|
||||||
- }
|
+ tr.add(new ItemStack(Item.seeds));
|
||||||
- }
|
}
|
||||||
|
}
|
||||||
-
|
-
|
||||||
+ return tr;
|
+ return tr;
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
|
|
||||||
// Referenced classes of package net.minecraft.src:
|
// Referenced classes of package net.minecraft.src:
|
||||||
// BlockFlower, Item, World, EntityPlayer,
|
// BlockFlower, Item, World, EntityPlayer,
|
||||||
@@ -41,13 +44,17 @@
|
@@ -41,13 +44,24 @@
|
||||||
|
|
||||||
public int idDropped(int i, Random random, int j)
|
public int idDropped(int i, Random random, int j)
|
||||||
{
|
{
|
||||||
|
@ -24,13 +24,20 @@
|
||||||
- }
|
- }
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ public ArrayList<ItemStack> getBlockDropped(World world,
|
+ @Override
|
||||||
+ int i, int j, int k, int md) {
|
+ public ArrayList<ItemStack> getBlockDropped(World world, int i, int j, int k, int md, int fortune)
|
||||||
+ ArrayList<ItemStack> tr=new ArrayList<ItemStack>();
|
+ {
|
||||||
+ if(world.rand.nextInt(8)!=0)
|
+ ArrayList<ItemStack> tr = new ArrayList<ItemStack>();
|
||||||
|
+ if (world.rand.nextInt(8) != 0)
|
||||||
|
+ {
|
||||||
+ return tr;
|
+ return tr;
|
||||||
+ ItemStack ist=ForgeHooks.getGrassSeed(world);
|
+ }
|
||||||
+ if(ist!=null) tr.add(ist);
|
+
|
||||||
|
+ ItemStack ist = ForgeHooks.getGrassSeed(world);
|
||||||
|
+ if (ist != null)
|
||||||
|
+ {
|
||||||
|
+ tr.add(ist);
|
||||||
|
+ }
|
||||||
+ return tr;
|
+ return tr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue