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
diff --git a/src/main/java/net/minecraft/server/DragonControllerLandedFlame.java b/src/main/java/net/minecraft/server/DragonControllerLandedFlame.java
2020-05-06 11:48:49 +02:00
index 40a8beff556873a5db108e44fd053e8de80e36a6..18fdcd453af5dc22a5b0e3c41e77e3d3dbb70fea 100644
2018-07-28 08:03:10 +02:00
--- a/src/main/java/net/minecraft/server/DragonControllerLandedFlame.java
+++ b/src/main/java/net/minecraft/server/DragonControllerLandedFlame.java
2019-12-12 00:43:22 +01:00
@@ -71,7 +71,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
}
}
2019-12-12 00:43:22 +01:00
@@ -82,6 +86,7 @@ public class DragonControllerLandedFlame extends AbstractDragonControllerLanded
2018-07-28 08:03:10 +02:00
++this.c;
}
+ public void removeAreaEffect() { this.e(); } // Paper - OBFHELPER
2019-04-30 03:20:24 +02:00
@Override
2018-07-28 08:03:10 +02:00
public void e() {
if (this.d != null) {
diff --git a/src/main/java/net/minecraft/server/DragonControllerStrafe.java b/src/main/java/net/minecraft/server/DragonControllerStrafe.java
2020-05-06 11:48:49 +02:00
index a2c36548caea7c6a0050bb3b18675567a61fb96e..a9d20ee3bbaf4dd77204df9c28a233a0d36cdbd2 100644
2018-07-28 08:03:10 +02:00
--- a/src/main/java/net/minecraft/server/DragonControllerStrafe.java
+++ b/src/main/java/net/minecraft/server/DragonControllerStrafe.java
2019-04-30 03:20:24 +02:00
@@ -68,7 +68,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) {
2019-01-01 04:15:55 +01:00
while (!this.d.b()) {
2018-07-28 08:03:10 +02:00
diff --git a/src/main/java/net/minecraft/server/EntityDragonFireball.java b/src/main/java/net/minecraft/server/EntityDragonFireball.java
2020-05-06 11:48:49 +02:00
index bc08b53fcdd411f15afb939702d68c98ed697479..db43ac1cc4ae959a432eedd3efee891b4e141c7f 100644
2018-07-28 08:03:10 +02:00
--- a/src/main/java/net/minecraft/server/EntityDragonFireball.java
+++ b/src/main/java/net/minecraft/server/EntityDragonFireball.java
2019-12-12 00:43:22 +01:00
@@ -41,8 +41,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
2019-12-12 00:43:22 +01:00
this.world.triggerEffect(2006, new BlockPosition(this), 0);
2018-07-28 08:03:10 +02:00
this.world.addEntity(entityareaeffectcloud);
+ } else entityareaeffectcloud.die(); // Paper
this.die();
}