72 lines
3.8 KiB
Diff
72 lines
3.8 KiB
Diff
--- ../src-base/minecraft/net/minecraft/block/BlockDoublePlant.java
|
|
+++ ../src-work/minecraft/net/minecraft/block/BlockDoublePlant.java
|
|
@@ -24,7 +24,7 @@
|
|
import net.minecraftforge.fml.relauncher.Side;
|
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
|
|
|
-public class BlockDoublePlant extends BlockBush implements IGrowable
|
|
+public class BlockDoublePlant extends BlockBush implements IGrowable, net.minecraftforge.common.IShearable
|
|
{
|
|
public static final PropertyEnum field_176493_a = PropertyEnum.func_177709_a("variant", BlockDoublePlant.EnumPlantType.class);
|
|
public static final PropertyEnum field_176492_b = PropertyEnum.func_177709_a("half", BlockDoublePlant.EnumBlockHalf.class);
|
|
@@ -89,6 +89,8 @@
|
|
Object object = flag ? this : p_176475_1_.func_180495_p(blockpos1).func_177230_c();
|
|
Object object1 = flag ? p_176475_1_.func_180495_p(blockpos2).func_177230_c() : this;
|
|
|
|
+ if (!flag) this.func_176226_b(p_176475_1_, p_176475_2_, p_176475_3_, 0); //Forge move above the setting to air.
|
|
+
|
|
if (object == this)
|
|
{
|
|
p_176475_1_.func_180501_a(blockpos1, Blocks.field_150350_a.func_176223_P(), 3);
|
|
@@ -97,17 +99,13 @@
|
|
if (object1 == this)
|
|
{
|
|
p_176475_1_.func_180501_a(blockpos2, Blocks.field_150350_a.func_176223_P(), 3);
|
|
-
|
|
- if (!flag)
|
|
- {
|
|
- this.func_176226_b(p_176475_1_, blockpos2, p_176475_3_, 0);
|
|
- }
|
|
}
|
|
}
|
|
}
|
|
|
|
public boolean func_180671_f(World p_180671_1_, BlockPos p_180671_2_, IBlockState p_180671_3_)
|
|
{
|
|
+ if (p_180671_3_.func_177230_c() != this) return super.func_180671_f(p_180671_1_, p_180671_2_, p_180671_3_); //Forge: This function is called during world gen and placement, before this block is set, so if we are not 'here' then assume it's the pre-check.
|
|
if (p_180671_3_.func_177229_b(field_176492_b) == BlockDoublePlant.EnumBlockHalf.UPPER)
|
|
{
|
|
return p_180671_1_.func_180495_p(p_180671_2_.func_177977_b()).func_177230_c() == this;
|
|
@@ -157,7 +155,6 @@
|
|
|
|
public void func_180657_a(World p_180657_1_, EntityPlayer p_180657_2_, BlockPos p_180657_3_, IBlockState p_180657_4_, TileEntity p_180657_5_)
|
|
{
|
|
- if (p_180657_1_.field_72995_K || p_180657_2_.func_71045_bC() == null || p_180657_2_.func_71045_bC().func_77973_b() != Items.field_151097_aZ || p_180657_4_.func_177229_b(field_176492_b) != BlockDoublePlant.EnumBlockHalf.LOWER || !this.func_176489_b(p_180657_1_, p_180657_3_, p_180657_4_, p_180657_2_))
|
|
{
|
|
super.func_180657_a(p_180657_1_, p_180657_2_, p_180657_3_, p_180657_4_, p_180657_5_);
|
|
}
|
|
@@ -296,6 +293,23 @@
|
|
return Block.EnumOffsetType.XZ;
|
|
}
|
|
|
|
+ @Override
|
|
+ public boolean isShearable(ItemStack item, IBlockAccess world, BlockPos pos)
|
|
+ {
|
|
+ IBlockState state = world.func_180495_p(pos);
|
|
+ EnumPlantType type = (EnumPlantType)state.func_177229_b(field_176493_a);
|
|
+ return state.func_177229_b(field_176492_b) == EnumBlockHalf.LOWER && (type == EnumPlantType.FERN || type == EnumPlantType.GRASS);
|
|
+ }
|
|
+ @Override
|
|
+ public java.util.List<ItemStack> onSheared(ItemStack item, net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune)
|
|
+ {
|
|
+ java.util.List<ItemStack> ret = new java.util.ArrayList<ItemStack>();
|
|
+ EnumPlantType type = (EnumPlantType)world.func_180495_p(pos).func_177229_b(field_176493_a);
|
|
+ if (type == EnumPlantType.FERN) ret.add(new ItemStack(Blocks.field_150329_H, 2, BlockTallGrass.EnumType.FERN.func_177044_a()));
|
|
+ if (type == EnumPlantType.GRASS) ret.add(new ItemStack(Blocks.field_150329_H, 2, BlockTallGrass.EnumType.GRASS.func_177044_a()));
|
|
+ return ret;
|
|
+ }
|
|
+
|
|
static enum EnumBlockHalf implements IStringSerializable
|
|
{
|
|
UPPER,
|