PaperMC/patches/unapplied/server/0221-EnderDragon-Events.patch

54 lines
3.8 KiB
Diff
Raw Normal View History

2021-06-11 14:02:28 +02:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
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/world/entity/boss/enderdragon/phases/DragonSittingFlamingPhase.java b/src/main/java/net/minecraft/world/entity/boss/enderdragon/phases/DragonSittingFlamingPhase.java
2023-09-22 19:59:56 +02:00
index f72ad2e7d0d5953c906d0d9f8adb9ba74d1841be..7b96cf748b69db98cb1bc3dc0430e39b9ffc93f2 100644
2021-06-11 14:02:28 +02:00
--- a/src/main/java/net/minecraft/world/entity/boss/enderdragon/phases/DragonSittingFlamingPhase.java
+++ b/src/main/java/net/minecraft/world/entity/boss/enderdragon/phases/DragonSittingFlamingPhase.java
2021-11-23 16:04:41 +01:00
@@ -83,7 +83,13 @@ public class DragonSittingFlamingPhase extends AbstractDragonSittingPhase {
2021-06-11 14:02:28 +02:00
this.flame.setDuration(200);
this.flame.setParticle(ParticleTypes.DRAGON_BREATH);
this.flame.addEffect(new MobEffectInstance(MobEffects.HARM));
+ if (new com.destroystokyo.paper.event.entity.EnderDragonFlameEvent((org.bukkit.entity.EnderDragon) this.dragon.getBukkitEntity(), (org.bukkit.entity.AreaEffectCloud) this.flame.getBukkitEntity()).callEvent()) { // Paper
2023-06-07 22:19:14 +02:00
this.dragon.level().addFreshEntity(this.flame);
2021-06-12 23:31:35 +02:00
+ // Paper start
2021-06-11 14:02:28 +02:00
+ } else {
2021-06-12 23:31:35 +02:00
+ this.end();
2021-06-11 14:02:28 +02:00
+ }
2021-06-12 23:31:35 +02:00
+ // Paper end
2021-06-11 14:02:28 +02:00
}
}
diff --git a/src/main/java/net/minecraft/world/entity/boss/enderdragon/phases/DragonStrafePlayerPhase.java b/src/main/java/net/minecraft/world/entity/boss/enderdragon/phases/DragonStrafePlayerPhase.java
2023-09-22 19:59:56 +02:00
index f54576f6450e24f574bfe7f4b8e2ad5d8c9f1ba3..a3456b35db4e938f91d6bc32d4d202a011bf13c4 100644
2021-06-11 14:02:28 +02:00
--- a/src/main/java/net/minecraft/world/entity/boss/enderdragon/phases/DragonStrafePlayerPhase.java
+++ b/src/main/java/net/minecraft/world/entity/boss/enderdragon/phases/DragonStrafePlayerPhase.java
2021-11-23 16:04:41 +01:00
@@ -74,7 +74,9 @@ public class DragonStrafePlayerPhase extends AbstractDragonPhaseInstance {
2021-06-11 14:02:28 +02:00
2023-06-07 22:19:14 +02:00
DragonFireball dragonFireball = new DragonFireball(this.dragon.level(), this.dragon, r, s, t);
2021-06-12 23:31:35 +02:00
dragonFireball.moveTo(o, p, q, 0.0F, 0.0F);
+ if (new com.destroystokyo.paper.event.entity.EnderDragonShootFireballEvent((org.bukkit.entity.EnderDragon) dragon.getBukkitEntity(), (org.bukkit.entity.DragonFireball) dragonFireball.getBukkitEntity()).callEvent()) // Paper
2023-06-07 22:19:14 +02:00
this.dragon.level().addFreshEntity(dragonFireball);
2021-06-12 23:31:35 +02:00
+ else dragonFireball.discard(); // Paper
2021-06-11 14:02:28 +02:00
this.fireballCharge = 0;
if (this.currentPath != null) {
2021-06-12 23:31:35 +02:00
while(!this.currentPath.isDone()) {
2021-06-11 14:02:28 +02:00
diff --git a/src/main/java/net/minecraft/world/entity/projectile/DragonFireball.java b/src/main/java/net/minecraft/world/entity/projectile/DragonFireball.java
2023-09-22 19:59:56 +02:00
index 796a2a88134eee4021423fef132537a5e0680bc5..9652e3385ad10e5d825dd141f6be3522c596916d 100644
2021-06-11 14:02:28 +02:00
--- a/src/main/java/net/minecraft/world/entity/projectile/DragonFireball.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/DragonFireball.java
2021-06-12 23:31:35 +02:00
@@ -52,8 +52,10 @@ public class DragonFireball extends AbstractHurtingProjectile {
2021-06-11 14:02:28 +02:00
}
}
2021-06-12 23:31:35 +02:00
+ if (new com.destroystokyo.paper.event.entity.EnderDragonFireballHitEvent((org.bukkit.entity.DragonFireball) this.getBukkitEntity(), list.stream().map(LivingEntity::getBukkitLivingEntity).collect(java.util.stream.Collectors.toList()), (org.bukkit.entity.AreaEffectCloud) areaEffectCloud.getBukkitEntity()).callEvent()) { // Paper
2023-06-07 22:19:14 +02:00
this.level().levelEvent(2006, this.blockPosition(), this.isSilent() ? -1 : 1);
this.level().addFreshEntity(areaEffectCloud);
2021-06-12 23:31:35 +02:00
+ } else areaEffectCloud.discard(); // Paper
this.discard();
2021-06-11 14:02:28 +02:00
}