mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-05 10:20:53 +01:00
2f782a6652
Upstream has released updates that appears to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing CraftBukkit Changes:17543ecf
SPIGOT-5035: Error Using Virtual Merchant GUI0fc6922b
SPIGOT-5028: Villager#setVillagerExperience() doesn't workbdbdbe44
SPIGOT-5024: Fox error - Unknown target reason
33 lines
1.7 KiB
Diff
33 lines
1.7 KiB
Diff
From b62fee29eeca0ccbebe3124e8c89eca26653863c 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/server/MobSpawnerAbstract.java b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java
|
|
index 55764deec4..dbb8098d6c 100644
|
|
--- a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java
|
|
+++ b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java
|
|
@@ -108,11 +108,11 @@ public abstract class MobSpawnerAbstract {
|
|
String key = entityType.getKey().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;
|
|
--
|
|
2.21.0
|
|
|