2020-04-12 02:39:21 +02:00
|
|
|
From c80e29b93a947435c6c116a8b60761dfb581034f Mon Sep 17 00:00:00 2001
|
2020-02-09 07:32:29 +01:00
|
|
|
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
|
|
|
Date: Sun, 9 Feb 2020 00:19:05 -0600
|
|
|
|
Subject: [PATCH] Add ThrownEggHatchEvent
|
|
|
|
|
|
|
|
Adds a new event similar to PlayerEggThrowEvent, but without the Player requirement
|
|
|
|
(dispensers can throw eggs to hatch them, too).
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityEgg.java b/src/main/java/net/minecraft/server/EntityEgg.java
|
2020-04-02 23:07:06 +02:00
|
|
|
index 970f9109d9..bdd82d052a 100644
|
2020-02-09 07:32:29 +01:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityEgg.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityEgg.java
|
|
|
|
@@ -52,6 +52,16 @@ public class EntityEgg extends EntityProjectileThrowable {
|
|
|
|
hatchingType = event.getHatchingType();
|
|
|
|
}
|
|
|
|
|
|
|
|
+ // Paper start
|
|
|
|
+ com.destroystokyo.paper.event.entity.ThrownEggHatchEvent event = new com.destroystokyo.paper.event.entity.ThrownEggHatchEvent((org.bukkit.entity.Egg) getBukkitEntity(), hatching, b0, hatchingType);
|
|
|
|
+ event.callEvent();
|
|
|
|
+
|
|
|
|
+ b0 = event.getNumHatches();
|
|
|
|
+ hatching = event.isHatching();
|
|
|
|
+ hatchingType = event.getHatchingType();
|
|
|
|
+ // Paper 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());
|
|
|
|
--
|
2020-03-15 21:03:36 +01:00
|
|
|
2.25.1
|
2020-02-09 07:32:29 +01:00
|
|
|
|