Paper/Spigot-Server-Patches/0753-Add-ElderGuardianAppearanceEvent.patch
Nassim b94a99b033
Updated Upstream (CraftBukkit) (#5762)
Upstream has released updates that appear 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:
90a4d64a Remove usage of Java 11 method not caught by animal sniffer
c51c0f7f SPIGOT-6483: Fix cancelling EntityPickupEvent for villagers
2021-06-01 12:19:10 +02:00

24 lines
1.6 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Owen1212055 <23108066+Owen1212055@users.noreply.github.com>
Date: Fri, 19 Mar 2021 23:39:09 -0400
Subject: [PATCH] Add ElderGuardianAppearanceEvent
diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityGuardianElder.java b/src/main/java/net/minecraft/world/entity/monster/EntityGuardianElder.java
index 9bd6f5d988c1e50e1bb729c407178b9cbcc62115..300efeb98bb68b24faa68a4af9d703bf2b8c405c 100644
--- a/src/main/java/net/minecraft/world/entity/monster/EntityGuardianElder.java
+++ b/src/main/java/net/minecraft/world/entity/monster/EntityGuardianElder.java
@@ -77,10 +77,12 @@ public class EntityGuardianElder extends EntityGuardian {
while (iterator.hasNext()) {
EntityPlayer entityplayer = (EntityPlayer) iterator.next();
+ if (new io.papermc.paper.event.entity.ElderGuardianAppearanceEvent(getBukkitEntity(), entityplayer.getBukkitEntity()).callEvent()) { // Paper - Add Guardian Appearance Event
if (!entityplayer.hasEffect(mobeffectlist) || entityplayer.getEffect(mobeffectlist).getAmplifier() < 2 || entityplayer.getEffect(mobeffectlist).getDuration() < 1200) {
entityplayer.playerConnection.sendPacket(new PacketPlayOutGameStateChange(PacketPlayOutGameStateChange.k, this.isSilent() ? 0.0F : 1.0F));
entityplayer.addEffect(new MobEffect(mobeffectlist, 6000, 2), org.bukkit.event.entity.EntityPotionEffectEvent.Cause.ATTACK); // CraftBukkit
}
+ } // Paper - Add Guardian Appearance Event
}
}