mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-18 03:25:18 +00:00
Fix ItemSeed placement to take into account the IPlantable interface.
This commit is contained in:
1 parent
c689a982b5
commit
b52f397a6f
1 file changed
+14
-2
@@ -1,17 +1,29 @@
|
||||
--- ../src_base/common/net/minecraft/src/ItemSeeds.java
|
||||
+++ ../src_work/common/net/minecraft/src/ItemSeeds.java
|
||||
@@ -1,6 +1,9 @@
|
||||
@@ -1,6 +1,10 @@
|
||||
package net.minecraft.src;
|
||||
|
||||
-public class ItemSeeds extends Item
|
||||
+import net.minecraftforge.common.EnumPlantType;
|
||||
+import net.minecraftforge.common.ForgeDirection;
|
||||
+import net.minecraftforge.common.IPlantable;
|
||||
+
|
||||
+public class ItemSeeds extends Item implements IPlantable
|
||||
{
|
||||
/**
|
||||
* The type of block this seed turns into (wheat or pumpkin stems for instance)
|
||||
@@ -48,4 +51,22 @@
|
||||
@@ -31,8 +35,9 @@
|
||||
else if (par2EntityPlayer.func_82247_a(par4, par5, par6, par7, par1ItemStack) && par2EntityPlayer.func_82247_a(par4, par5 + 1, par6, par7, par1ItemStack))
|
||||
{
|
||||
int var11 = par3World.getBlockId(par4, par5, par6);
|
||||
+ Block soil = Block.blocksList[var11];
|
||||
|
||||
- if (var11 == this.soilBlockID && par3World.isAirBlock(par4, par5 + 1, par6))
|
||||
+ if (soil != null && soil.canSustainPlant(par3World, par4, par5, par6, ForgeDirection.UP, this) && par3World.isAirBlock(par4, par5 + 1, par6))
|
||||
{
|
||||
par3World.setBlockWithNotify(par4, par5 + 1, par6, this.blockType);
|
||||
--par1ItemStack.stackSize;
|
||||
@@ -48,4 +53,22 @@
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user