<commit_before>--- ../src_base/minecraft/net/minecraft/item/ItemDye.java
+++ ../src_work/minecraft/net/minecraft/item/ItemDye.java
@@ -21,6 +21,12 @@
 import net.minecraft.util.MathHelper;
 import net.minecraft.world.World;
 
+import net.minecraftforge.common.FakePlayerFactory;
+import net.minecraftforge.common.ForgeHooks;
+import net.minecraftforge.common.MinecraftForge;
+import net.minecraftforge.event.Event.Result;
+import net.minecraftforge.event.entity.player.BonemealEvent;
+
 public class ItemDye extends Item
 {
     /** List of dye color names */
@@ -141,7 +147,27 @@
 
     public static boolean func_96604_a(ItemStack par0ItemStack, World par1World, int par2, int par3, int par4)
     {
+        return applyBonemeal(par0ItemStack, par1World, par2, par3, par4, FakePlayerFactory.getMinecraft(par1World));
+    }
+
+    public static boolean applyBonemeal(ItemStack par0ItemStack, World par1World, int par2, int par3, int par4, EntityPlayer player)
+    {
         int l = par1World.getBlockId(par2, par3, par4);
+
+        BonemealEvent event = new BonemealEvent(player, par1World, l, par2, par3, par4);
+        if (MinecraftForge.EVENT_BUS.post(event))
+        {
+            return false;
+        }
+
+        if (event.getResult() == Result.ALLOW)
+        {
+            if (!par1World.isRemote)
+            {
+                par0ItemStack.stackSize--;
+            }<commit_msg>Fix EntityPlayer passed to Bonemeal event.<commit_after>--- ../src_base/minecraft/net/minecraft/item/ItemDye.java
+++ ../src_work/minecraft/net/minecraft/item/ItemDye.java
@@ -21,6 +21,12 @@
 import net.minecraft.util.MathHelper;
 import net.minecraft.world.World;
 
+import net.minecraftforge.common.FakePlayerFactory;
+import net.minecraftforge.common.ForgeHooks;
+import net.minecraftforge.common.MinecraftForge;
+import net.minecraftforge.event.Event.Result;
+import net.minecraftforge.event.entity.player.BonemealEvent;
+
 public class ItemDye extends Item
 {
     /** List of dye color names */
@@ -73,7 +79,7 @@
         {
             if (par1ItemStack.getItemDamage() == 15)
             {
-                if (func_96604_a(par1ItemStack, par3World, par4, par5, par6))
+                if (applyBonemeal(par1ItemStack, par3World, par4, par5, par6, par2EntityPlayer))
                 {
                     if (!par3World.isRemote)
                     {
@@ -141,7 +147,27 @@
 
     public static boolean func_96604_a(ItemStack par0ItemStack, World par1World, int par2, int par3, int par4)
     {
+        return applyBonemeal(par0ItemStack, par1World, par2, par3, par4, FakePlayerFactory.getMinecraft(par1World));
+    }
+
+    public static boolean applyBonemeal(ItemStack par0ItemStack, World par1World, int par2, int par3, int par4, EntityPlayer player)
+    {
         int l = par1World.getBlockId(par2, par3, par4);
+
+        BonemealEvent event = new BonemealEvent(player, par1World, l, par2, par3, par4);
+        if (MinecraftForge.EVENT_BUS.post(event))
+        {
+            return false;
+        }
+
+        if (event.getResult() == Result.ALLOW)
+        {
+            if (!par1World.isRemote)
+            {
+                par0ItemStack.stackSize--;
+            }
{'fraction_non_alphanumeric': 0.12288930581613508, 'fraction_numerical': 0.0375234521575985, 'mean_word_length': 2.8357314148681056, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6812403', 'n_tokens_mistral': 1108, 'n_tokens_neox': 1067, 'n_words': 205}