ForgePatch/patches/common/net/minecraft/src/ItemDye.java.patch
LexManos 62700fa7a8 96537dc - Fixup Item in hand rendering of textures > 16x
e88ddc5 - Make the exception print for headless servers if the Downloader cant initalize.
f24ff07 - Remove a bunch of warning about javadoc, not a real fix, but no more warning.
3420ea7 - Update MCP Mapings
87104f0 - Makes GetModSrc check the common folder when attempting to extract source files
640446b - Tie parent/child containers together again. Should close #96
2cf4917 - Village mating produces added villagers, and the egg should place added villagers too. Closes #97.
6394ee8 - Clean up stale references to the Player stored in the NetworkRegistry, closes #100
7299e05 - Merge pull request #99 from CovertJaguar/patch-1
c4bd040 - More readable init logs
2012-09-15 19:36:08 -07:00

54 lines
2.2 KiB
Diff

--- ../src_base/common/net/minecraft/src/ItemDye.java
+++ ../src_work/common/net/minecraft/src/ItemDye.java
@@ -3,6 +3,10 @@
import cpw.mods.fml.common.Side;
import cpw.mods.fml.common.asm.SideOnly;
import java.util.List;
+
+import net.minecraftforge.common.ForgeHooks;
+import net.minecraftforge.common.MinecraftForge;
+import net.minecraftforge.event.entity.player.BonemealEvent;
public class ItemDye extends Item
{
@@ -53,6 +57,21 @@
if (par1ItemStack.getItemDamage() == 15)
{
var11 = par3World.getBlockId(par4, par5, par6);
+
+ BonemealEvent event = new BonemealEvent(par2EntityPlayer, par3World, var11, par4, par5, par6);
+ if (MinecraftForge.EVENT_BUS.post(event))
+ {
+ return false;
+ }
+
+ if (event.isHandeled())
+ {
+ if (!par3World.isRemote)
+ {
+ par1ItemStack.stackSize--;
+ }
+ return true;
+ }
if (var11 == Block.sapling.blockID)
{
@@ -152,16 +171,9 @@
par3World.setBlockAndMetadataWithNotify(var13, var14, var15, Block.tallGrass.blockID, 1);
}
}
- else if (itemRand.nextInt(3) != 0)
+ else
{
- if (Block.plantYellow.canBlockStay(par3World, var13, var14, var15))
- {
- par3World.setBlockWithNotify(var13, var14, var15, Block.plantYellow.blockID);
- }
- }
- else if (Block.plantRed.canBlockStay(par3World, var13, var14, var15))
- {
- par3World.setBlockWithNotify(var13, var14, var15, Block.plantRed.blockID);
+ ForgeHooks.plantGrass(par3World, var13, var14, var15);
}
}
}