mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-18 17:07:43 +01:00
Add ThrownEggHatchEvent
This commit is contained in:
32
patches/server/0081-Add-ThrownEggHatchEvent.patch
Normal file
32
patches/server/0081-Add-ThrownEggHatchEvent.patch
Normal 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
|
||||
|
||||
Reference in New Issue
Block a user