Paper/Spigot-Server-Patches/0295-EnderDragon-Events.patch
Aikar b62dfa0bf9
Updated Upstream (Bukkit/CraftBukkit)
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

Bukkit Changes:
39ce5d3a SPIGOT-4399: ItemMeta.equals broken with AttributeModifiers

CraftBukkit Changes:
1cf8b5dc SPIGOT-4400: Populators running on existing chunks
116cb9a1 SPIGOT-4399: Add attribute modifier equality test
5ee1c18a SPIGOT-4398: Set ASM7_EXPERIMENTAL flag
2018-09-28 19:31:59 -04:00

61 lines
3.6 KiB
Diff

From 34a08b36a0774cba74c90fe025e48106b243cf81 Mon Sep 17 00:00:00 2001
From: BillyGalbreath <Blake.Galbreath@GMail.com>
Date: Sat, 21 Jul 2018 01:51:27 -0500
Subject: [PATCH] EnderDragon Events
diff --git a/src/main/java/net/minecraft/server/DragonControllerLandedFlame.java b/src/main/java/net/minecraft/server/DragonControllerLandedFlame.java
index 45f96078c5..fed3e9daf1 100644
--- a/src/main/java/net/minecraft/server/DragonControllerLandedFlame.java
+++ b/src/main/java/net/minecraft/server/DragonControllerLandedFlame.java
@@ -61,7 +61,9 @@ public class DragonControllerLandedFlame extends AbstractDragonControllerLanded
this.d.setDuration(200);
this.d.setParticle(Particles.j);
this.d.a(new MobEffect(MobEffects.HARM));
+ if (new com.destroystokyo.paper.event.entity.EnderDragonFlameEvent((org.bukkit.entity.EnderDragon) this.a.getBukkitEntity(), (org.bukkit.entity.AreaEffectCloud) this.d.getBukkitEntity()).callEvent()) // Paper
this.a.world.addEntity(this.d);
+ else this.removeAreaEffect(); // Paper
}
}
@@ -71,6 +73,7 @@ public class DragonControllerLandedFlame extends AbstractDragonControllerLanded
++this.c;
}
+ public void removeAreaEffect() { this.e(); } // Paper - OBFHELPER
public void e() {
if (this.d != null) {
this.d.die();
diff --git a/src/main/java/net/minecraft/server/DragonControllerStrafe.java b/src/main/java/net/minecraft/server/DragonControllerStrafe.java
index 66223af9a8..7aa8a5708d 100644
--- a/src/main/java/net/minecraft/server/DragonControllerStrafe.java
+++ b/src/main/java/net/minecraft/server/DragonControllerStrafe.java
@@ -57,7 +57,9 @@ public class DragonControllerStrafe extends AbstractDragonController {
this.a.world.a((EntityHuman)null, 1017, new BlockPosition(this.a), 0);
EntityDragonFireball entitydragonfireball = new EntityDragonFireball(this.a.world, this.a, d9, d10, d11);
entitydragonfireball.setPositionRotation(d6, d7, d8, 0.0F, 0.0F);
+ if (new com.destroystokyo.paper.event.entity.EnderDragonShootFireballEvent((org.bukkit.entity.EnderDragon) a.getBukkitEntity(), (org.bukkit.entity.DragonFireball) entitydragonfireball.getBukkitEntity()).callEvent()) // Paper
this.a.world.addEntity(entitydragonfireball);
+ else entitydragonfireball.die(); // Paper
this.c = 0;
if (this.d != null) {
while(!this.d.b()) {
diff --git a/src/main/java/net/minecraft/server/EntityDragonFireball.java b/src/main/java/net/minecraft/server/EntityDragonFireball.java
index e746a6a0da..366ebb8d2d 100644
--- a/src/main/java/net/minecraft/server/EntityDragonFireball.java
+++ b/src/main/java/net/minecraft/server/EntityDragonFireball.java
@@ -32,8 +32,10 @@ public class EntityDragonFireball extends EntityFireball {
}
}
+ if (new com.destroystokyo.paper.event.entity.EnderDragonFireballHitEvent((org.bukkit.entity.DragonFireball) this.getBukkitEntity(), list.stream().map(EntityLiving::getBukkitLivingEntity).collect(java.util.stream.Collectors.toList()), (org.bukkit.entity.AreaEffectCloud) entityareaeffectcloud.getBukkitEntity()).callEvent()) { // Paper
this.world.triggerEffect(2006, new BlockPosition(this.locX, this.locY, this.locZ), 0);
this.world.addEntity(entityareaeffectcloud);
+ } else entityareaeffectcloud.die(); // Paper
this.die();
}
--
2.19.0