mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-21 12:42:26 +00:00
39 lines
1.7 KiB
Diff
39 lines
1.7 KiB
Diff
--- a/net/minecraft/block/BlockShearableDoublePlant.java
|
|
+++ b/net/minecraft/block/BlockShearableDoublePlant.java
|
|
@@ -11,7 +11,7 @@
|
|
import net.minecraft.util.math.BlockPos;
|
|
import net.minecraft.world.World;
|
|
|
|
-public class BlockShearableDoublePlant extends BlockDoublePlant {
|
|
+public class BlockShearableDoublePlant extends BlockDoublePlant implements net.minecraftforge.common.IShearable {
|
|
public static final EnumProperty<DoubleBlockHalf> field_208063_b = BlockDoublePlant.field_176492_b;
|
|
private final Block field_196392_b;
|
|
|
|
@@ -26,9 +26,7 @@
|
|
}
|
|
|
|
protected void func_196391_a(IBlockState p_196391_1_, World p_196391_2_, BlockPos p_196391_3_, ItemStack p_196391_4_) {
|
|
- if (p_196391_4_.func_77973_b() == Items.field_151097_aZ) {
|
|
- func_180635_a(p_196391_2_, p_196391_3_, new ItemStack(this.field_196392_b, 2));
|
|
- } else {
|
|
+ {
|
|
super.func_196391_a(p_196391_1_, p_196391_2_, p_196391_3_, p_196391_4_);
|
|
}
|
|
|
|
@@ -37,4 +35,15 @@
|
|
public IItemProvider func_199769_a(IBlockState p_199769_1_, World p_199769_2_, BlockPos p_199769_3_, int p_199769_4_) {
|
|
return p_199769_1_.func_177229_b(field_208063_b) == DoubleBlockHalf.LOWER && this == Blocks.field_196804_gh && p_199769_2_.field_73012_v.nextInt(8) == 0 ? Items.field_151014_N : Items.field_190931_a;
|
|
}
|
|
+
|
|
+ @Override
|
|
+ public boolean isShearable(ItemStack item, net.minecraft.world.IWorldReader world, BlockPos pos) {
|
|
+ return true;
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ public java.util.List<ItemStack> onSheared(ItemStack item, net.minecraft.world.IWorld world, BlockPos pos, int fortune) {
|
|
+ world.func_180501_a(pos, Blocks.field_150350_a.func_176223_P(), 11);
|
|
+ return java.util.Arrays.asList(new ItemStack(this.field_196392_b, 2));
|
|
+ }
|
|
}
|