From b2cbea9e6348a5ab2b4bb40f60780c730759fd9e Mon Sep 17 00:00:00 2001 From: Phoenix616 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. --- .../sources/net/minecraft/world/level/BaseSpawner.java.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/paper-server/patches/sources/net/minecraft/world/level/BaseSpawner.java.patch b/paper-server/patches/sources/net/minecraft/world/level/BaseSpawner.java.patch index ce9e5d276f..027b08f4af 100644 --- a/paper-server/patches/sources/net/minecraft/world/level/BaseSpawner.java.patch +++ b/paper-server/patches/sources/net/minecraft/world/level/BaseSpawner.java.patch @@ -47,10 +47,10 @@ + continue; + } + // Paper start - PreCreatureSpawnEvent -+ com.destroystokyo.paper.event.entity.PreCreatureSpawnEvent event = new com.destroystokyo.paper.event.entity.PreCreatureSpawnEvent( ++ com.destroystokyo.paper.event.entity.PreSpawnerSpawnEvent event = new com.destroystokyo.paper.event.entity.PreSpawnerSpawnEvent( + io.papermc.paper.util.MCUtil.toLocation(world, d0, d1, d2), + org.bukkit.craftbukkit.entity.CraftEntityType.minecraftToBukkit(optional.get()), -+ org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.SPAWNER ++ io.papermc.paper.util.MCUtil.toLocation(world, pos) + ); + if (!event.callEvent()) { + flag = true;