2020-05-06 11:48:49 +02:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2018-07-28 08:03:10 +02:00
From: BillyGalbreath <Blake.Galbreath@GMail.com>
Date: Sat, 21 Jul 2018 01:51:27 -0500
Subject: [PATCH] EnderDragon Events
2021-03-16 08:19:45 +01:00
diff --git a/src/main/java/net/minecraft/world/entity/boss/enderdragon/phases/DragonControllerLandedFlame.java b/src/main/java/net/minecraft/world/entity/boss/enderdragon/phases/DragonControllerLandedFlame.java
index 5adbd9fe858aad9c775a10254eb53b34719a9bd6..91de4e6c1d478e001c8672d34b4ffe57f6cba0a6 100644
--- a/src/main/java/net/minecraft/world/entity/boss/enderdragon/phases/DragonControllerLandedFlame.java
+++ b/src/main/java/net/minecraft/world/entity/boss/enderdragon/phases/DragonControllerLandedFlame.java
@@ -80,7 +80,11 @@ public class DragonControllerLandedFlame extends AbstractDragonControllerLanded
2018-07-28 08:03:10 +02:00
this.d.setDuration(200);
2019-04-30 03:20:24 +02:00
this.d.setParticle(Particles.DRAGON_BREATH);
2019-07-20 06:01:24 +02: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 08:03:10 +02:00
this.a.world.addEntity(this.d);
2019-07-20 06:01:24 +02:00
+ } else {
+ this.removeAreaEffect();
+ }
2018-07-28 08:03:10 +02:00
}
}
2021-03-16 08:19:45 +01:00
@@ -91,8 +95,8 @@ public class DragonControllerLandedFlame extends AbstractDragonControllerLanded
2018-07-28 08:03:10 +02:00
++this.c;
}
2020-08-02 07:39:36 +02:00
- @Override
- public void e() {
+ public final void removeAreaEffect() { this.e(); } // Paper - OBFHELPER
+ @Override public void e() {
2018-07-28 08:03:10 +02:00
if (this.d != null) {
2020-08-02 07:39:36 +02:00
this.d.die();
this.d = null;
2021-03-16 08:19:45 +01:00
diff --git a/src/main/java/net/minecraft/world/entity/boss/enderdragon/phases/DragonControllerStrafe.java b/src/main/java/net/minecraft/world/entity/boss/enderdragon/phases/DragonControllerStrafe.java
index db3cef26c8d5cdf740bb151a5525d8740a0e8bbd..1a5d5d39d3090acc3914e40e8d30c4a09789dbc9 100644
--- a/src/main/java/net/minecraft/world/entity/boss/enderdragon/phases/DragonControllerStrafe.java
+++ b/src/main/java/net/minecraft/world/entity/boss/enderdragon/phases/DragonControllerStrafe.java
@@ -81,7 +81,9 @@ public class DragonControllerStrafe extends AbstractDragonController {
2018-07-28 08:03:10 +02:00
EntityDragonFireball entitydragonfireball = new EntityDragonFireball(this.a.world, this.a, d9, d10, d11);
2019-01-01 04:15:55 +01:00
2018-07-28 08:03:10 +02: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 04:22:08 +02:00
while (!this.d.c()) {
2021-03-16 08:19:45 +01:00
diff --git a/src/main/java/net/minecraft/world/entity/projectile/EntityDragonFireball.java b/src/main/java/net/minecraft/world/entity/projectile/EntityDragonFireball.java
index 59b5484731a5f71005c3efa56cbe40012d9641b5..27853f510e15e40c66da2cb4905c43f5e8f99d3d 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/EntityDragonFireball.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/EntityDragonFireball.java
@@ -58,8 +58,10 @@ public class EntityDragonFireball extends EntityFireball {
2018-07-28 08:03:10 +02:00
}
}
2018-09-01 00:56:57 +02: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 16:09:55 +02:00
this.world.triggerEffect(2006, this.getChunkCoordinates(), this.isSilent() ? -1 : 1);
2018-07-28 08:03:10 +02:00
this.world.addEntity(entityareaeffectcloud);
+ } else entityareaeffectcloud.die(); // Paper
this.die();
}