mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-12 18:55:51 -07:00
Minecraft 1.9.4
This commit is contained in:
@@ -1,64 +1,41 @@
|
||||
--- a/net/minecraft/server/DragonControllerManager.java
|
||||
+++ b/net/minecraft/server/DragonControllerManager.java
|
||||
@@ -2,32 +2,44 @@
|
||||
@@ -2,6 +2,10 @@
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
+// CraftBukkit start
|
||||
+import org.bukkit.craftbukkit.entity.CraftEnderDragon;
|
||||
+import org.bukkit.entity.EnderDragon;
|
||||
+import org.bukkit.event.entity.EnderDragonChangePhaseEvent;
|
||||
+// CraftBukkit end
|
||||
|
||||
public class DragonControllerManager {
|
||||
|
||||
private static final Logger a = LogManager.getLogger();
|
||||
- private final EntityEnderDragon b;
|
||||
- private final IDragonController[] c = new IDragonController[DragonControllerPhase.c()];
|
||||
- private IDragonController d;
|
||||
+ private final EntityEnderDragon b; // PAIL: Rename enderDragon
|
||||
+ private final IDragonController[] c = new IDragonController[DragonControllerPhase.c()]; // PAIL: Rename dragonControllers
|
||||
+ private IDragonController d; // PAIL: Rename currentDragonController
|
||||
|
||||
public DragonControllerManager(EntityEnderDragon entityenderdragon) {
|
||||
this.b = entityenderdragon;
|
||||
this.a(DragonControllerPhase.k);
|
||||
}
|
||||
|
||||
- public void a(DragonControllerPhase<?> dragoncontrollerphase) {
|
||||
- if (this.d == null || dragoncontrollerphase != this.d.i()) {
|
||||
+ public void a(DragonControllerPhase<?> dragoncontrollerphase) { // PAIL: Rename setControllerPhase
|
||||
+ if (this.d == null || dragoncontrollerphase != this.d.i()) { // PAIL: Rename getControllerPhase
|
||||
if (this.d != null) {
|
||||
- this.d.e();
|
||||
+ this.d.e(); // PAIL: Rename
|
||||
@@ -21,6 +25,19 @@
|
||||
this.currentDragonController.e();
|
||||
}
|
||||
|
||||
- this.d = this.b(dragoncontrollerphase);
|
||||
+ // CraftBukkit start - Call EnderDragonChangePhaseEvent
|
||||
+ EnderDragonChangePhaseEvent event = new EnderDragonChangePhaseEvent((CraftEnderDragon) this.b.getBukkitEntity(), this.d == null ? null : CraftEnderDragon.getBukkitPhase(this.d.i()), CraftEnderDragon.getBukkitPhase(dragoncontrollerphase));
|
||||
+ this.b.world.getServer().getPluginManager().callEvent(event);
|
||||
+ 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);
|
||||
+ if (event.isCancelled()) {
|
||||
+ return;
|
||||
+ }
|
||||
+ dragoncontrollerphase = CraftEnderDragon.getMinecraftPhase(event.getNewPhase());
|
||||
+ // CraftBukkit end
|
||||
+
|
||||
+ this.d = this.b(dragoncontrollerphase); // PAIL: Rename getDragonController
|
||||
if (!this.b.world.isClientSide) {
|
||||
- this.b.getDataWatcher().set(EntityEnderDragon.a, Integer.valueOf(dragoncontrollerphase.b()));
|
||||
+ this.b.getDataWatcher().set(EntityEnderDragon.a, Integer.valueOf(dragoncontrollerphase.b())); // PAIL: Rename getId
|
||||
}
|
||||
|
||||
DragonControllerManager.a.debug("Dragon is now in phase {} on the {}", new Object[] { dragoncontrollerphase, this.b.world.isClientSide ? "client" : "server"});
|
||||
- this.d.d();
|
||||
+ this.d.d(); // PAIL: Rename reset
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,6 +54,6 @@
|
||||
this.c[i] = dragoncontrollerphase.a(this.b);
|
||||
+
|
||||
this.currentDragonController = this.b(dragoncontrollerphase);
|
||||
if (!this.enderDragon.world.isClientSide) {
|
||||
this.enderDragon.getDataWatcher().set(EntityEnderDragon.PHASE, Integer.valueOf(dragoncontrollerphase.b()));
|
||||
@@ -42,6 +59,6 @@
|
||||
this.dragonControllers[i] = dragoncontrollerphase.a(this.enderDragon);
|
||||
}
|
||||
|
||||
- return this.c[i];
|
||||
+ return (T) this.c[i];
|
||||
- return this.dragonControllers[i];
|
||||
+ return (T) this.dragonControllers[i]; // CraftBukkit - decompile error
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user