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
2024-10-23 11:04:00 +02:00
index fe625faf0120b72e892542e4bb5ecea4b73becc7..55b66d3e0d7394a017fb1cdd87e45d7f4eb84976 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
2024-10-23 11:04:00 +02:00
@@ -89,7 +89,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));
2024-01-21 19:37:09 +01:00
+ if (new com.destroystokyo.paper.event.entity.EnderDragonFlameEvent((org.bukkit.entity.EnderDragon) this.dragon.getBukkitEntity(), (org.bukkit.entity.AreaEffectCloud) this.flame.getBukkitEntity()).callEvent()) { // Paper - EnderDragon Events
2024-10-23 11:04:00 +02:00
world.addFreshEntity(this.flame);
2024-01-21 19:37:09 +01:00
+ // Paper start - EnderDragon Events
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
+ }
2024-01-21 19:37:09 +01:00
+ // Paper end - EnderDragon Events
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
2024-10-23 11:04:00 +02:00
index 68b7bfc139e928192005df8339be371ed8b2a9be..2db75673e525708d04bda9f6c9af80e7f8d361e6 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
2024-10-23 11:04:00 +02:00
@@ -80,7 +80,9 @@ public class DragonStrafePlayerPhase extends AbstractDragonPhaseInstance {
2021-06-11 14:02:28 +02:00
2024-10-23 11:04:00 +02:00
DragonFireball dragonFireball = new DragonFireball(world, this.dragon, vec34.normalize());
2021-06-12 23:31:35 +02:00
dragonFireball.moveTo(o, p, q, 0.0F, 0.0F);
2024-01-21 19:37:09 +01:00
+ if (new com.destroystokyo.paper.event.entity.EnderDragonShootFireballEvent((org.bukkit.entity.EnderDragon) dragon.getBukkitEntity(), (org.bukkit.entity.DragonFireball) dragonFireball.getBukkitEntity()).callEvent()) // Paper - EnderDragon Events
2024-10-23 11:04:00 +02:00
world.addFreshEntity(dragonFireball);
Updated Upstream (Bukkit/CraftBukkit/Spigot) (#10277)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing
Bukkit Changes:
9a80d38c SPIGOT-336, SPIGOT-3366, SPIGOT-5768, SPIGOT-6409, SPIGOT-6861, PR-722: Add EntityRemoveEvent
258086d9 SPIGOT-7417, PR-967: Add Sign#getTargetSide and Sign#getAllowedEditor
ffaba051 SPIGOT-7584: Add missing Tag.ITEMS_NON_FLAMMABLE_WOOD
CraftBukkit Changes:
98b6c1ac7 SPIGOT-7589 Fix NullPointerException when bans expire
a2736ddb0 SPIGOT-336, SPIGOT-3366, SPIGOT-5768, SPIGOT-6409, SPIGOT-6861, PR-1008: Add EntityRemoveEvent
5bf12cb89 SPIGOT-7565: Throw a more descriptive error message when a developer tries to spawn an entity from a CraftBukkit class
76d95fe7e SPIGOT-7417, PR-1343: Add Sign#getTargetSide and Sign#getAllowedEditor
Spigot Changes:
e9ec5485 Rebuild patches
f1b62e0c Rebuild patches
2024-02-23 14:37:33 +01:00
+ else dragonFireball.discard(null); // Paper - EnderDragon Events
2021-06-11 14:02:28 +02:00
this.fireballCharge = 0;
if (this.currentPath != null) {
2024-04-12 21:14:06 +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
2024-10-23 11:04:00 +02:00
index 5b8f3cf80b4fb425bdd0e3b9a431128536c7f1b1..2eecdcbea3d51b1fb6e0c3db0667464a699ca0df 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
2024-10-23 11:04:00 +02:00
@@ -62,8 +62,10 @@ public class DragonFireball extends AbstractHurtingProjectile {
2021-06-11 14:02:28 +02:00
}
}
Updated Upstream (Bukkit/CraftBukkit/Spigot) (#10277)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing
Bukkit Changes:
9a80d38c SPIGOT-336, SPIGOT-3366, SPIGOT-5768, SPIGOT-6409, SPIGOT-6861, PR-722: Add EntityRemoveEvent
258086d9 SPIGOT-7417, PR-967: Add Sign#getTargetSide and Sign#getAllowedEditor
ffaba051 SPIGOT-7584: Add missing Tag.ITEMS_NON_FLAMMABLE_WOOD
CraftBukkit Changes:
98b6c1ac7 SPIGOT-7589 Fix NullPointerException when bans expire
a2736ddb0 SPIGOT-336, SPIGOT-3366, SPIGOT-5768, SPIGOT-6409, SPIGOT-6861, PR-1008: Add EntityRemoveEvent
5bf12cb89 SPIGOT-7565: Throw a more descriptive error message when a developer tries to spawn an entity from a CraftBukkit class
76d95fe7e SPIGOT-7417, PR-1343: Add Sign#getTargetSide and Sign#getAllowedEditor
Spigot Changes:
e9ec5485 Rebuild patches
f1b62e0c Rebuild patches
2024-02-23 14:37:33 +01: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) entityareaeffectcloud.getBukkitEntity()).callEvent()) { // Paper - EnderDragon Events
2023-06-07 22:19:14 +02:00
this.level().levelEvent(2006, this.blockPosition(), this.isSilent() ? -1 : 1);
Updated Upstream (Bukkit/CraftBukkit/Spigot) (#10277)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing
Bukkit Changes:
9a80d38c SPIGOT-336, SPIGOT-3366, SPIGOT-5768, SPIGOT-6409, SPIGOT-6861, PR-722: Add EntityRemoveEvent
258086d9 SPIGOT-7417, PR-967: Add Sign#getTargetSide and Sign#getAllowedEditor
ffaba051 SPIGOT-7584: Add missing Tag.ITEMS_NON_FLAMMABLE_WOOD
CraftBukkit Changes:
98b6c1ac7 SPIGOT-7589 Fix NullPointerException when bans expire
a2736ddb0 SPIGOT-336, SPIGOT-3366, SPIGOT-5768, SPIGOT-6409, SPIGOT-6861, PR-1008: Add EntityRemoveEvent
5bf12cb89 SPIGOT-7565: Throw a more descriptive error message when a developer tries to spawn an entity from a CraftBukkit class
76d95fe7e SPIGOT-7417, PR-1343: Add Sign#getTargetSide and Sign#getAllowedEditor
Spigot Changes:
e9ec5485 Rebuild patches
f1b62e0c Rebuild patches
2024-02-23 14:37:33 +01:00
this.level().addFreshEntity(entityareaeffectcloud);
+ } else entityareaeffectcloud.discard(null); // Paper - EnderDragon Events
this.discard(EntityRemoveEvent.Cause.HIT); // CraftBukkit - add Bukkit remove cause
2021-06-11 14:02:28 +02:00
}