2018-08-31 22:56:57 +00:00
From 788553e0245c1df064ccea0ffe5e66754cba6bd9 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
2018-08-31 22:56:57 +00:00
index 45f96078c5..fed3e9daf1 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
2018-08-31 22:56:57 +00:00
@@ -61,7 +61,9 @@ public class DragonControllerLandedFlame extends AbstractDragonControllerLanded
2018-07-28 06:03:10 +00:00
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
}
}
2018-08-31 22:56:57 +00:00
@@ -71,6 +73,7 @@ public class DragonControllerLandedFlame extends AbstractDragonControllerLanded
2018-07-28 06:03:10 +00:00
++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
2018-08-31 22:56:57 +00:00
index 66223af9a8..7aa8a5708d 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
2018-08-31 22:56:57 +00:00
@@ -57,7 +57,9 @@ public class DragonControllerStrafe extends AbstractDragonController {
this.a.world.a((EntityHuman)null, 1017, new BlockPosition(this.a), 0);
2018-07-28 06:03:10 +00:00
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) {
2018-08-31 22:56:57 +00:00
while(!this.d.b()) {
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
2018-08-31 22:56:57 +00:00
index e746a6a0da..366ebb8d2d 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
2018-08-31 22:56:57 +00:00
@@ -32,8 +32,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
2018-07-28 06:03:10 +00:00
this.world.triggerEffect(2006, new BlockPosition(this.locX, this.locY, this.locZ), 0);
this.world.addEntity(entityareaeffectcloud);
+ } else entityareaeffectcloud.die(); // Paper
this.die();
}
--
2018-07-29 16:42:07 +00:00
2.18.0
2018-07-28 06:03:10 +00:00