2011-10-10 23:47:30 +00:00
|
|
|
--- ../src_base/minecraft_server/net/minecraft/src/BlockTallGrass.java 0000-00-00 00:00:00.000000000 -0000
|
|
|
|
+++ ../src_work/minecraft_server/net/minecraft/src/BlockTallGrass.java 0000-00-00 00:00:00.000000000 -0000
|
2012-02-13 12:13:02 +00:00
|
|
|
@@ -1,8 +1,12 @@
|
2011-10-09 04:21:29 +00:00
|
|
|
package net.minecraft.src;
|
|
|
|
|
|
|
|
+import java.util.ArrayList;
|
2012-01-15 19:16:08 +00:00
|
|
|
import java.util.Random;
|
2011-10-09 04:21:29 +00:00
|
|
|
|
2012-02-13 12:13:02 +00:00
|
|
|
-public class BlockTallGrass extends BlockFlower
|
2012-01-15 19:16:08 +00:00
|
|
|
+import net.minecraft.src.forge.ForgeHooks;
|
2012-02-13 12:13:02 +00:00
|
|
|
+import net.minecraft.src.forge.IShearable;
|
2012-01-15 19:16:08 +00:00
|
|
|
+
|
2012-02-13 12:13:02 +00:00
|
|
|
+public class BlockTallGrass extends BlockFlower implements IShearable
|
2012-01-15 19:16:08 +00:00
|
|
|
{
|
|
|
|
protected BlockTallGrass(int i, int j)
|
2012-02-13 12:13:02 +00:00
|
|
|
{
|
|
|
|
@@ -33,15 +37,25 @@
|
2011-10-09 04:21:29 +00:00
|
|
|
|
2011-11-30 19:00:43 +00:00
|
|
|
public int idDropped(int i, Random random, int j)
|
2011-10-09 04:21:29 +00:00
|
|
|
{
|
2012-01-15 19:16:08 +00:00
|
|
|
- if (random.nextInt(8) == 0)
|
|
|
|
+ return -1;
|
|
|
|
+ }
|
|
|
|
+
|
2011-12-11 21:55:35 +00:00
|
|
|
+ @Override
|
2012-01-15 19:16:08 +00:00
|
|
|
+ public ArrayList<ItemStack> getBlockDropped(World world, int i, int j, int k, int md, int fortune)
|
2011-12-11 21:55:35 +00:00
|
|
|
+ {
|
2012-01-15 19:16:08 +00:00
|
|
|
+ ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
|
|
|
|
+ if (world.rand.nextInt(8) != 0)
|
|
|
|
{
|
|
|
|
- return Item.seeds.shiftedIndex;
|
|
|
|
+ return ret;
|
|
|
|
}
|
|
|
|
- else
|
|
|
|
+
|
|
|
|
+ ItemStack item = ForgeHooks.getGrassSeed(world);
|
|
|
|
+ if (item != null)
|
|
|
|
{
|
|
|
|
- return -1;
|
|
|
|
+ ret.add(item);
|
|
|
|
}
|
|
|
|
- }
|
|
|
|
+ return ret;
|
|
|
|
+ }
|
2011-10-09 04:21:29 +00:00
|
|
|
|
2012-01-11 18:13:35 +00:00
|
|
|
public int quantityDroppedWithBonus(int i, Random random)
|
2012-01-15 19:16:08 +00:00
|
|
|
{
|
2012-02-13 12:13:02 +00:00
|
|
|
@@ -50,14 +64,20 @@
|
|
|
|
|
|
|
|
public void harvestBlock(World world, EntityPlayer entityplayer, int i, int j, int k, int l)
|
|
|
|
{
|
|
|
|
- if (!world.isRemote && entityplayer.getCurrentEquippedItem() != null && entityplayer.getCurrentEquippedItem().itemID == Item.shears.shiftedIndex)
|
|
|
|
- {
|
|
|
|
- entityplayer.addStat(StatList.mineBlockStatArray[blockID], 1);
|
|
|
|
- dropBlockAsItem_do(world, i, j, k, new ItemStack(Block.tallGrass, 1, l));
|
|
|
|
- }
|
|
|
|
- else
|
|
|
|
- {
|
|
|
|
- super.harvestBlock(world, entityplayer, i, j, k, l);
|
|
|
|
- }
|
|
|
|
+ super.harvestBlock(world, entityplayer, i, j, k, l);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public boolean isShearable(ItemStack item, World world, int X, int Y, int Z)
|
|
|
|
+ {
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public ArrayList<ItemStack> onSheared(ItemStack item, World world, int X, int Y, int Z, int fortune)
|
|
|
|
+ {
|
|
|
|
+ ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
|
|
|
|
+ ret.add(new ItemStack(Block.tallGrass, 1, world.getBlockMetadata(X, Y, Z)));
|
|
|
|
+ return ret;
|
|
|
|
}
|
|
|
|
}
|