Paper/patches/server/0250-PreSpawnerSpawnEvent.patch

28 lines
1.7 KiB
Diff
Raw Normal View History

2021-06-15 07:44:37 +02:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
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/world/level/BaseSpawner.java b/src/main/java/net/minecraft/world/level/BaseSpawner.java
index bb3f3bec350dda43dbf5eda0a8c8057a413694b2..261de9ea37d22023da6a306b58b1b62a54dc03da 100644
2021-06-15 07:44:37 +02:00
--- a/src/main/java/net/minecraft/world/level/BaseSpawner.java
+++ b/src/main/java/net/minecraft/world/level/BaseSpawner.java
2024-04-24 07:43:09 +02:00
@@ -133,10 +133,10 @@ public abstract class BaseSpawner {
2024-02-01 10:15:57 +01:00
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;