69 lines
2.6 KiB
Diff
69 lines
2.6 KiB
Diff
--- ../src-base/minecraft/net/minecraft/block/BlockCrops.java
|
|
+++ ../src-work/minecraft/net/minecraft/block/BlockCrops.java
|
|
@@ -82,11 +82,11 @@
|
|
float f1 = 0.0F;
|
|
IBlockState iblockstate = p_180672_1_.func_180495_p(blockpos1.func_177982_a(i, 0, j));
|
|
|
|
- if (iblockstate.func_177230_c() == Blocks.field_150458_ak)
|
|
+ if (iblockstate.func_177230_c().canSustainPlant(p_180672_1_, blockpos1.func_177982_a(i, 0, j), net.minecraft.util.EnumFacing.UP, (net.minecraftforge.common.IPlantable)p_180672_0_))
|
|
{
|
|
f1 = 1.0F;
|
|
|
|
- if (((Integer)iblockstate.func_177229_b(BlockFarmland.field_176531_a)).intValue() > 0)
|
|
+ if (iblockstate.func_177230_c().isFertile(p_180672_1_, blockpos1.func_177982_a(i, 0, j)))
|
|
{
|
|
f1 = 3.0F;
|
|
}
|
|
@@ -143,24 +143,6 @@
|
|
public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_)
|
|
{
|
|
super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, 0);
|
|
-
|
|
- if (!p_180653_1_.field_72995_K)
|
|
- {
|
|
- int j = ((Integer)p_180653_3_.func_177229_b(field_176488_a)).intValue();
|
|
-
|
|
- if (j >= 7)
|
|
- {
|
|
- int k = 3 + p_180653_5_;
|
|
-
|
|
- for (int l = 0; l < k; ++l)
|
|
- {
|
|
- if (p_180653_1_.field_73012_v.nextInt(15) <= j)
|
|
- {
|
|
- func_180635_a(p_180653_1_, p_180653_2_, new ItemStack(this.func_149866_i(), 1, 0));
|
|
- }
|
|
- }
|
|
- }
|
|
- }
|
|
}
|
|
|
|
public Item func_180660_a(IBlockState p_180660_1_, Random p_180660_2_, int p_180660_3_)
|
|
@@ -203,4 +185,26 @@
|
|
{
|
|
return new BlockState(this, new IProperty[] {field_176488_a});
|
|
}
|
|
+
|
|
+ @Override
|
|
+ public java.util.List<ItemStack> getDrops(net.minecraft.world.IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
|
|
+ {
|
|
+ java.util.List<ItemStack> ret = super.getDrops(world, pos, state, fortune);
|
|
+ int age = ((Integer)state.func_177229_b(field_176488_a)).intValue();
|
|
+ Random rand = world instanceof World ? ((World)world).field_73012_v : new Random();
|
|
+
|
|
+ if (age >= 7)
|
|
+ {
|
|
+ int k = 3 + fortune;
|
|
+
|
|
+ for (int i = 0; i < 3 + fortune; ++i)
|
|
+ {
|
|
+ if (rand.nextInt(15) <= age)
|
|
+ {
|
|
+ ret.add(new ItemStack(this.func_149866_i(), 1, 0));
|
|
+ }
|
|
+ }
|
|
+ }
|
|
+ return ret;
|
|
+ }
|
|
}
|