2019-06-25 19:18:50 +00:00
|
|
|
From aeb29f0e2b123d32d1a8a09033ab4ae79b48e2bb Mon Sep 17 00:00:00 2001
|
2018-09-18 23:34:11 +00:00
|
|
|
From: Phoenix616 <mail@moep.tv>
|
|
|
|
Date: Tue, 18 Sep 2018 23:53:23 +0100
|
|
|
|
Subject: [PATCH] PreSpawnerSpawnEvent
|
|
|
|
|
|
|
|
This adds a separate event before an entity is spawned by a spawner
|
|
|
|
which contains the location of the spawner too similarly to how the
|
|
|
|
SpawnerSpawnEvent gets called instead of the CreatureSpawnEvent for
|
|
|
|
spawners.
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java
|
2019-06-25 01:47:58 +00:00
|
|
|
index 6f5d8b0315..079099e308 100644
|
2018-09-18 23:34:11 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java
|
2019-06-25 01:47:58 +00:00
|
|
|
@@ -110,11 +110,11 @@ public abstract class MobSpawnerAbstract {
|
2019-06-15 05:06:36 +00:00
|
|
|
|
2018-09-18 23:34:11 +00:00
|
|
|
org.bukkit.entity.EntityType type = org.bukkit.entity.EntityType.fromName(key);
|
|
|
|
if (type != null) {
|
|
|
|
- com.destroystokyo.paper.event.entity.PreCreatureSpawnEvent event;
|
|
|
|
- event = new com.destroystokyo.paper.event.entity.PreCreatureSpawnEvent(
|
|
|
|
+ com.destroystokyo.paper.event.entity.PreSpawnerSpawnEvent event;
|
|
|
|
+ event = new com.destroystokyo.paper.event.entity.PreSpawnerSpawnEvent(
|
2019-05-05 08:33:44 +00:00
|
|
|
MCUtil.toLocation(world, d3, d4, d5),
|
|
|
|
type,
|
|
|
|
- org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.SPAWNER
|
|
|
|
+ MCUtil.toLocation(world, blockposition)
|
2018-09-18 23:34:11 +00:00
|
|
|
);
|
|
|
|
if (!event.callEvent()) {
|
|
|
|
flag = true;
|
|
|
|
--
|
2019-06-25 01:47:58 +00:00
|
|
|
2.22.0
|
2018-09-18 23:34:11 +00:00
|
|
|
|