2019-05-27 17:13:41 +08:00
From dffbb87fbab5fa0d05c2dd60d7e56c6d36045ca9 Mon Sep 17 00:00:00 2001
2018-07-28 14:03:10 +08: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
2019-05-27 17:13:41 +08:00
index 4ab310cd6..90f6d58dd 100644
2018-07-28 14:03:10 +08:00
--- a/src/main/java/net/minecraft/server/DragonControllerLandedFlame.java
+++ b/src/main/java/net/minecraft/server/DragonControllerLandedFlame.java
2019-04-30 09:20:24 +08:00
@@ -65,7 +65,9 @@ public class DragonControllerLandedFlame extends AbstractDragonControllerLanded
2018-07-28 14:03:10 +08:00
this.d.setDuration(200);
2019-04-30 09:20:24 +08:00
this.d.setParticle(Particles.DRAGON_BREATH);
2018-07-28 14:03:10 +08:00
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
}
}
2019-04-30 09:20:24 +08:00
@@ -76,6 +78,8 @@ public class DragonControllerLandedFlame extends AbstractDragonControllerLanded
2018-07-28 14:03:10 +08:00
++this.c;
}
2019-04-30 09:20:24 +08:00
+
2018-07-28 14:03:10 +08:00
+ public void removeAreaEffect() { this.e(); } // Paper - OBFHELPER
2019-04-30 09:20:24 +08:00
@Override
2018-07-28 14:03:10 +08: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
2019-05-27 17:13:41 +08:00
index b46660576..bf15964e7 100644
2018-07-28 14:03:10 +08:00
--- a/src/main/java/net/minecraft/server/DragonControllerStrafe.java
+++ b/src/main/java/net/minecraft/server/DragonControllerStrafe.java
2019-04-30 09:20:24 +08:00
@@ -68,7 +68,9 @@ public class DragonControllerStrafe extends AbstractDragonController {
2018-07-28 14:03:10 +08:00
EntityDragonFireball entitydragonfireball = new EntityDragonFireball(this.a.world, this.a, d9, d10, d11);
2019-01-01 11:15:55 +08:00
2018-07-28 14:03:10 +08: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 11:15:55 +08:00
while (!this.d.b()) {
2018-07-28 14:03:10 +08:00
diff --git a/src/main/java/net/minecraft/server/EntityDragonFireball.java b/src/main/java/net/minecraft/server/EntityDragonFireball.java
2019-05-27 17:13:41 +08:00
index 239be99c5..2195b83ce 100644
2018-07-28 14:03:10 +08:00
--- a/src/main/java/net/minecraft/server/EntityDragonFireball.java
+++ b/src/main/java/net/minecraft/server/EntityDragonFireball.java
2019-04-30 09:20:24 +08:00
@@ -40,8 +40,10 @@ public class EntityDragonFireball extends EntityFireball {
2018-07-28 14:03:10 +08:00
}
}
2018-09-01 06:56:57 +08: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 14:03:10 +08:00
this.world.triggerEffect(2006, new BlockPosition(this.locX, this.locY, this.locZ), 0);
this.world.addEntity(entityareaeffectcloud);
+ } else entityareaeffectcloud.die(); // Paper
this.die();
}
--
2019-03-20 09:46:00 +08:00
2.21.0
2018-07-28 14:03:10 +08:00