2020-05-06 09:48:49 +00:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2018-07-28 06:03:10 +00:00
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
2020-08-25 02:22:08 +00:00
index 771c0b10d171da56c5156a42a6ea70b51983c684..1ff1e2c788bb6c10132e45ef1c939725bac8fcbe 100644
2018-07-28 06:03:10 +00:00
--- a/src/main/java/net/minecraft/server/DragonControllerLandedFlame.java
+++ b/src/main/java/net/minecraft/server/DragonControllerLandedFlame.java
2019-12-11 23:43:22 +00:00
@@ -71,7 +71,11 @@ public class DragonControllerLandedFlame extends AbstractDragonControllerLanded
2018-07-28 06:03:10 +00:00
this.d.setDuration(200);
2019-04-30 01:20:24 +00:00
this.d.setParticle(Particles.DRAGON_BREATH);
2019-07-20 04:01:24 +00:00
this.d.addEffect(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
2018-07-28 06:03:10 +00:00
this.a.world.addEntity(this.d);
2019-07-20 04:01:24 +00:00
+ } else {
+ this.removeAreaEffect();
+ }
2018-07-28 06:03:10 +00:00
}
}
2020-08-02 05:39:36 +00:00
@@ -82,8 +86,8 @@ public class DragonControllerLandedFlame extends AbstractDragonControllerLanded
2018-07-28 06:03:10 +00:00
++this.c;
}
2020-08-02 05:39:36 +00:00
- @Override
- public void e() {
+ public final void removeAreaEffect() { this.e(); } // Paper - OBFHELPER
+ @Override public void e() {
2018-07-28 06:03:10 +00:00
if (this.d != null) {
2020-08-02 05:39:36 +00:00
this.d.die();
this.d = null;
2018-07-28 06:03:10 +00:00
diff --git a/src/main/java/net/minecraft/server/DragonControllerStrafe.java b/src/main/java/net/minecraft/server/DragonControllerStrafe.java
2020-08-25 02:22:08 +00:00
index 740d8a3bdf8a4097b7e1b75a08e0c9dc0eb6059a..48afea81d81ee3272389f88e2115ef8c851f81f0 100644
2018-07-28 06:03:10 +00:00
--- a/src/main/java/net/minecraft/server/DragonControllerStrafe.java
+++ b/src/main/java/net/minecraft/server/DragonControllerStrafe.java
2020-06-25 14:09:55 +00:00
@@ -71,7 +71,9 @@ public class DragonControllerStrafe extends AbstractDragonController {
2018-07-28 06:03:10 +00:00
EntityDragonFireball entitydragonfireball = new EntityDragonFireball(this.a.world, this.a, d9, d10, d11);
2019-01-01 03:15:55 +00:00
2018-07-28 06:03:10 +00:00
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) {
2020-08-25 02:22:08 +00:00
while (!this.d.c()) {
2018-07-28 06:03:10 +00:00
diff --git a/src/main/java/net/minecraft/server/EntityDragonFireball.java b/src/main/java/net/minecraft/server/EntityDragonFireball.java
2020-08-25 02:22:08 +00:00
index b75810cbe27ad3b0881259470b9838006c70f4b6..27032abad4f3da1d1b28a3cec49e3fc079deadb9 100644
2018-07-28 06:03:10 +00:00
--- a/src/main/java/net/minecraft/server/EntityDragonFireball.java
+++ b/src/main/java/net/minecraft/server/EntityDragonFireball.java
2020-06-25 14:09:55 +00:00
@@ -46,8 +46,10 @@ public class EntityDragonFireball extends EntityFireball {
2018-07-28 06:03:10 +00:00
}
}
2018-08-31 22:56:57 +00:00
+ 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
2020-06-25 14:09:55 +00:00
this.world.triggerEffect(2006, this.getChunkCoordinates(), this.isSilent() ? -1 : 1);
2018-07-28 06:03:10 +00:00
this.world.addEntity(entityareaeffectcloud);
+ } else entityareaeffectcloud.die(); // Paper
this.die();
}