Fixed custom soil checks for NetherStalk and Reeds

This commit is contained in:
LexManos 2012-11-18 01:36:21 -08:00
parent 8bbe281de9
commit 24f8d6be02
2 changed files with 30 additions and 5 deletions

View file

@ -1,15 +1,28 @@
--- ../src_base/common/net/minecraft/src/BlockNetherStalk.java
+++ ../src_work/common/net/minecraft/src/BlockNetherStalk.java
@@ -2,6 +2,8 @@
@@ -2,7 +2,11 @@
import cpw.mods.fml.common.Side;
import cpw.mods.fml.common.asm.SideOnly;
+
+import java.util.ArrayList;
import java.util.Random;
+
+import net.minecraftforge.common.ForgeDirection;
public class BlockNetherStalk extends BlockFlower
@@ -69,25 +71,7 @@
{
@@ -29,7 +33,8 @@
*/
public boolean canBlockStay(World par1World, int par2, int par3, int par4)
{
- return this.canThisPlantGrowOnThisBlockID(par1World.getBlockId(par2, par3 - 1, par4));
+ Block block = Block.blocksList[par1World.getBlockId(par2, par3 - 1, par4)];
+ return (block != null && block.canSustainPlant(par1World, par2, par3 - 1, par4, ForgeDirection.UP, this));
}
/**
@@ -69,25 +74,7 @@
*/
public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7)
{
@ -36,7 +49,7 @@
}
/**
@@ -115,4 +99,23 @@
@@ -115,4 +102,23 @@
{
return Item.netherStalkSeeds.shiftedIndex;
}

View file

@ -1,18 +1,30 @@
--- ../src_base/common/net/minecraft/src/BlockReed.java
+++ ../src_work/common/net/minecraft/src/BlockReed.java
@@ -4,7 +4,10 @@
@@ -4,7 +4,11 @@
import cpw.mods.fml.common.asm.SideOnly;
import java.util.Random;
-public class BlockReed extends Block
+import net.minecraftforge.common.EnumPlantType;
+import net.minecraftforge.common.ForgeDirection;
+import net.minecraftforge.common.IPlantable;
+
+public class BlockReed extends Block implements IPlantable
{
protected BlockReed(int par1, int par2)
{
@@ -135,4 +138,22 @@
@@ -51,8 +55,8 @@
*/
public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4)
{
- int var5 = par1World.getBlockId(par2, par3 - 1, par4);
- return var5 == this.blockID ? true : (var5 != Block.grass.blockID && var5 != Block.dirt.blockID && var5 != Block.sand.blockID ? false : (par1World.getBlockMaterial(par2 - 1, par3 - 1, par4) == Material.water ? true : (par1World.getBlockMaterial(par2 + 1, par3 - 1, par4) == Material.water ? true : (par1World.getBlockMaterial(par2, par3 - 1, par4 - 1) == Material.water ? true : par1World.getBlockMaterial(par2, par3 - 1, par4 + 1) == Material.water))));
+ Block block = Block.blocksList[par1World.getBlockId(par2, par3 - 1, par4)];
+ return (block != null && block.canSustainPlant(par1World, par2, par3 - 1, par4, ForgeDirection.UP, this));
}
/**
@@ -135,4 +139,22 @@
{
return Item.reed.shiftedIndex;
}