2018-09-27 04:35:42 +02:00
|
|
|
From ea811dc6ea87571032471d66be272a2e7dadc67b Mon Sep 17 00:00:00 2001
|
2018-09-19 01:34:11 +02: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
|
2018-09-23 05:03:53 +02:00
|
|
|
index 79600cd73e..81d0760634 100644
|
2018-09-19 01:34:11 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java
|
|
|
|
@@ -102,11 +102,11 @@ public abstract class MobSpawnerAbstract {
|
|
|
|
String key = this.getMobName().getKey();
|
|
|
|
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(
|
|
|
|
MCUtil.toLocation(world, d3, d4, d5),
|
|
|
|
type,
|
|
|
|
- org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.SPAWNER
|
|
|
|
+ MCUtil.toLocation(world, blockposition)
|
|
|
|
);
|
|
|
|
if (!event.callEvent()) {
|
|
|
|
flag = true;
|
|
|
|
--
|
2018-09-23 05:03:53 +02:00
|
|
|
2.19.0
|
2018-09-19 01:34:11 +02:00
|
|
|
|