mirror of
https://github.com/PaperMC/Paper.git
synced 2025-04-06 03:56:21 +02:00
EnderDragon Events
This commit is contained in:
parent
eb528f5f37
commit
e054d501fb
@ -10,7 +10,21 @@
|
|||||||
|
|
||||||
public class DragonSittingFlamingPhase extends AbstractDragonSittingPhase {
|
public class DragonSittingFlamingPhase extends AbstractDragonSittingPhase {
|
||||||
|
|
||||||
@@ -100,7 +103,7 @@
|
@@ -86,7 +89,13 @@
|
||||||
|
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 - EnderDragon Events
|
||||||
|
world.addFreshEntity(this.flame);
|
||||||
|
+ // Paper start - EnderDragon Events
|
||||||
|
+ } else {
|
||||||
|
+ this.end();
|
||||||
|
+ }
|
||||||
|
+ // Paper end - EnderDragon Events
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
@@ -100,7 +109,7 @@
|
||||||
@Override
|
@Override
|
||||||
public void end() {
|
public void end() {
|
||||||
if (this.flame != null) {
|
if (this.flame != null) {
|
||||||
|
@ -0,0 +1,12 @@
|
|||||||
|
--- a/net/minecraft/world/entity/boss/enderdragon/phases/DragonStrafePlayerPhase.java
|
||||||
|
+++ b/net/minecraft/world/entity/boss/enderdragon/phases/DragonStrafePlayerPhase.java
|
||||||
|
@@ -80,7 +80,9 @@
|
||||||
|
|
||||||
|
DragonFireball dragonFireball = new DragonFireball(world, this.dragon, vec34.normalize());
|
||||||
|
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 - EnderDragon Events
|
||||||
|
world.addFreshEntity(dragonFireball);
|
||||||
|
+ else dragonFireball.discard(null); // Paper - EnderDragon Events
|
||||||
|
this.fireballCharge = 0;
|
||||||
|
if (this.currentPath != null) {
|
||||||
|
while (!this.currentPath.isDone()) {
|
@ -10,11 +10,15 @@
|
|||||||
|
|
||||||
public class DragonFireball extends AbstractHurtingProjectile {
|
public class DragonFireball extends AbstractHurtingProjectile {
|
||||||
|
|
||||||
@@ -61,7 +64,7 @@
|
@@ -59,9 +62,11 @@
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
+ 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
|
||||||
this.level().levelEvent(2006, this.blockPosition(), this.isSilent() ? -1 : 1);
|
this.level().levelEvent(2006, this.blockPosition(), this.isSilent() ? -1 : 1);
|
||||||
this.level().addFreshEntity(entityareaeffectcloud);
|
this.level().addFreshEntity(entityareaeffectcloud);
|
||||||
- this.discard();
|
- this.discard();
|
||||||
|
+ } else entityareaeffectcloud.discard(null); // Paper - EnderDragon Events
|
||||||
+ this.discard(EntityRemoveEvent.Cause.HIT); // CraftBukkit - add Bukkit remove cause
|
+ this.discard(EntityRemoveEvent.Cause.HIT); // CraftBukkit - add Bukkit remove cause
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user