ForgePatch/patches/minecraft/net/minecraft/block/BlockReed.java.patch

47 lines
2.2 KiB
Diff

--- ../src-base/minecraft/net/minecraft/block/BlockReed.java
+++ ../src-work/minecraft/net/minecraft/block/BlockReed.java
@@ -11,7 +11,11 @@
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
-public class BlockReed extends Block
+import net.minecraftforge.common.EnumPlantType;
+import net.minecraftforge.common.util.ForgeDirection;
+import net.minecraftforge.common.IPlantable;
+
+public class BlockReed extends Block implements IPlantable
{
private static final String __OBFID = "CL_00000300";
@@ -57,7 +61,7 @@
public boolean func_149742_c(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_)
{
Block block = p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_ - 1, p_149742_4_);
- return block == this ? true : (block != Blocks.grass && block != Blocks.dirt && block != Blocks.sand ? false : (p_149742_1_.func_147439_a(p_149742_2_ - 1, p_149742_3_ - 1, p_149742_4_).func_149688_o() == Material.field_151586_h ? true : (p_149742_1_.func_147439_a(p_149742_2_ + 1, p_149742_3_ - 1, p_149742_4_).func_149688_o() == Material.field_151586_h ? true : (p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_ - 1, p_149742_4_ - 1).func_149688_o() == Material.field_151586_h ? true : p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_ - 1, p_149742_4_ + 1).func_149688_o() == Material.field_151586_h))));
+ return block.canSustainPlant(p_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_, ForgeDirection.UP, this);
}
public void func_149695_a(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_)
@@ -120,4 +124,22 @@
{
return p_149720_1_.getBiomeGenForCoords(p_149720_2_, p_149720_4_).func_150558_b(p_149720_2_, p_149720_3_, p_149720_4_);
}
+
+ @Override
+ public EnumPlantType getPlantType(IBlockAccess world, int x, int y, int z)
+ {
+ return EnumPlantType.Beach;
+ }
+
+ @Override
+ public Block getPlant(IBlockAccess world, int x, int y, int z)
+ {
+ return this;
+ }
+
+ @Override
+ public int getPlantMetadata(IBlockAccess world, int x, int y, int z)
+ {
+ return world.getBlockMetadata(x, y, z);
+ }
}