2016-03-16 04:32:37 +01:00
|
|
|
--- a/net/minecraft/server/DragonControllerManager.java
|
|
|
|
+++ b/net/minecraft/server/DragonControllerManager.java
|
2016-05-10 13:47:39 +02:00
|
|
|
@@ -2,6 +2,10 @@
|
2016-03-16 04:32:37 +01:00
|
|
|
|
|
|
|
import org.apache.logging.log4j.LogManager;
|
|
|
|
import org.apache.logging.log4j.Logger;
|
2016-05-10 13:47:39 +02:00
|
|
|
+// CraftBukkit start
|
2016-03-16 04:32:37 +01:00
|
|
|
+import org.bukkit.craftbukkit.entity.CraftEnderDragon;
|
|
|
|
+import org.bukkit.event.entity.EnderDragonChangePhaseEvent;
|
2016-05-10 13:47:39 +02:00
|
|
|
+// CraftBukkit end
|
2016-03-16 04:32:37 +01:00
|
|
|
|
|
|
|
public class DragonControllerManager {
|
|
|
|
|
2016-05-10 13:47:39 +02:00
|
|
|
@@ -21,6 +25,19 @@
|
|
|
|
this.currentDragonController.e();
|
2016-03-16 04:32:37 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
+ // CraftBukkit start - Call EnderDragonChangePhaseEvent
|
2016-05-10 13:47:39 +02:00
|
|
|
+ EnderDragonChangePhaseEvent event = new EnderDragonChangePhaseEvent(
|
|
|
|
+ (CraftEnderDragon) this.enderDragon.getBukkitEntity(),
|
|
|
|
+ (this.currentDragonController == null) ? null : CraftEnderDragon.getBukkitPhase(this.currentDragonController.getControllerPhase()),
|
|
|
|
+ CraftEnderDragon.getBukkitPhase(dragoncontrollerphase)
|
|
|
|
+ );
|
|
|
|
+ this.enderDragon.world.getServer().getPluginManager().callEvent(event);
|
2016-03-16 04:32:37 +01:00
|
|
|
+ if (event.isCancelled()) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ dragoncontrollerphase = CraftEnderDragon.getMinecraftPhase(event.getNewPhase());
|
|
|
|
+ // CraftBukkit end
|
2016-05-10 13:47:39 +02:00
|
|
|
+
|
|
|
|
this.currentDragonController = this.b(dragoncontrollerphase);
|
|
|
|
if (!this.enderDragon.world.isClientSide) {
|
2018-12-06 00:00:00 +01:00
|
|
|
this.enderDragon.getDataWatcher().set(EntityEnderDragon.PHASE, dragoncontrollerphase.b());
|
2016-05-10 13:47:39 +02:00
|
|
|
@@ -42,6 +59,6 @@
|
|
|
|
this.dragonControllers[i] = dragoncontrollerphase.a(this.enderDragon);
|
2016-03-16 04:32:37 +01:00
|
|
|
}
|
|
|
|
|
2016-05-10 13:47:39 +02:00
|
|
|
- return this.dragonControllers[i];
|
|
|
|
+ return (T) this.dragonControllers[i]; // CraftBukkit - decompile error
|
2016-03-16 04:32:37 +01:00
|
|
|
}
|
|
|
|
}
|