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
|
2024-01-24 13:07:40 +01:00
|
|
|
index 28f63a211f4ae207b2400d16b1725808ad87f334..1b0093a23011f7d1c0da88c0a934d94ad4d6b3e2 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
|
2023-12-05 23:21:44 +01:00
|
|
|
@@ -136,11 +136,11 @@ public abstract class BaseSpawner {
|
2021-06-15 07:44:37 +02: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(
|
2022-10-24 21:43:46 +02:00
|
|
|
io.papermc.paper.util.MCUtil.toLocation(world, d0, d1, d2),
|
2021-06-15 07:44:37 +02:00
|
|
|
type,
|
|
|
|
- org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.SPAWNER
|
2022-10-24 21:43:46 +02:00
|
|
|
+ io.papermc.paper.util.MCUtil.toLocation(world, pos)
|
2021-06-15 07:44:37 +02:00
|
|
|
);
|
|
|
|
if (!event.callEvent()) {
|
|
|
|
flag = true;
|