Add ThrownEggHatchEvent

This commit is contained in:
William Blake Galbreath
2019-10-19 03:29:31 -05:00
parent 5140aebc75
commit 7672c9e043
2 changed files with 164 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
From 88d27f66cf67e8193eb5f3bdea6981716bd49d42 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <blake.galbreath@gmail.com>
Date: Sat, 19 Oct 2019 03:28:06 -0500
Subject: [PATCH] Add ThrownEggHatchEvent
---
src/main/java/net/minecraft/server/EntityEgg.java | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/src/main/java/net/minecraft/server/EntityEgg.java b/src/main/java/net/minecraft/server/EntityEgg.java
index aedf2ce17d..e82798cf21 100644
--- a/src/main/java/net/minecraft/server/EntityEgg.java
+++ b/src/main/java/net/minecraft/server/EntityEgg.java
@@ -52,6 +52,15 @@ public class EntityEgg extends EntityProjectileThrowable {
hatchingType = event.getHatchingType();
}
+ // Purpur start
+ net.pl3x.purpur.event.entity.ThrownEggHatchEvent event = new net.pl3x.purpur.event.entity.ThrownEggHatchEvent((org.bukkit.entity.Egg) getBukkitEntity(), hatching, b0, hatchingType);
+ event.callEvent();
+
+ b0 = event.getNumHatches();
+ hatching = event.isHatching();
+ hatchingType = event.getHatchingType();
+ // Purpur end
+
if (hatching) {
for (int i = 0; i < b0; ++i) {
Entity entity = world.getWorld().createEntity(new org.bukkit.Location(world.getWorld(), this.locX, this.locY, this.locZ, this.yaw, 0.0F), hatchingType.getEntityClass());
--
2.23.0.rc1