Yatopia/patches/server/0035-EMC-Add-the-BlockHarvestBeehiveEvent.patch

37 lines
1.6 KiB
Diff
Raw Normal View History

2020-02-26 20:12:29 +01:00
From f7a5489069fda6adf6956e2153881d1f6e6af444 Mon Sep 17 00:00:00 2001
From: chickeneer <emcchickeneer@gmail.com>
Date: Fri, 17 Jan 2020 21:32:10 -0600
Subject: [PATCH] EMC Add the BlockHarvestBeehiveEvent
---
src/main/java/net/minecraft/server/IDispenseBehavior.java | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/main/java/net/minecraft/server/IDispenseBehavior.java b/src/main/java/net/minecraft/server/IDispenseBehavior.java
index 3af686c7..df0501b6 100644
--- a/src/main/java/net/minecraft/server/IDispenseBehavior.java
+++ b/src/main/java/net/minecraft/server/IDispenseBehavior.java
@@ -4,6 +4,7 @@ import java.util.Iterator;
import java.util.List;
import java.util.Random;
// CraftBukkit start
+import com.empireminecraft.customevents.BlockHarvestBeehiveEvent;
import org.bukkit.Location;
import org.bukkit.TreeType;
import org.bukkit.craftbukkit.event.CraftEventFactory;
@@ -861,6 +862,11 @@ public interface IDispenseBehavior {
int k = (Integer) iblockdata.get(BlockBeehive.c);
if (k >= 5) {
+ // EMC start
+ if (!(new BlockHarvestBeehiveEvent(bukkitBlock, MCUtil.toBukkitBlock(world, blockposition), craftItem).callEvent())) {
+ return itemstack;
+ }
+ // EMC end
if (itemstack.isDamaged(1, world.random, (EntityPlayer) null)) {
itemstack.setCount(0);
}
--
2.25.1.windows.1