SPIGOT-1571: Add Entity Glide Events.

This commit is contained in:
0x277F
2016-03-12 20:57:32 +11:00
committed by md_5
parent d0e326a071
commit 1386bd3ddf
5 changed files with 110 additions and 53 deletions

View File

@@ -422,23 +422,24 @@
this.playerConnection.sendPacket(new PacketPlayOutCloseWindow(this.activeContainer.windowId));
this.s();
}
@@ -741,7 +916,16 @@
@@ -741,8 +916,17 @@
public void triggerHealthUpdate() {
this.lastHealthSent = -1.0E8F;
+ this.lastSentExp = -1; // CraftBukkit - Added to reset
+ }
+
}
+ // CraftBukkit start - Support multi-line messages
+ public void sendMessage(IChatBaseComponent[] ichatbasecomponent) {
+ for (IChatBaseComponent component : ichatbasecomponent) {
+ this.sendMessage(component);
+ }
}
+ }
+ // CraftBukkit end
+
public void b(IChatBaseComponent ichatbasecomponent) {
this.playerConnection.sendPacket(new PacketPlayOutChat(ichatbasecomponent));
}
@@ -802,6 +986,8 @@
}
@@ -486,10 +487,24 @@
}
public void a(EnumHand enumhand) {
@@ -962,4 +1156,127 @@
this.setFlag(7, true);
this.setFlag(7, false);
@@ -955,11 +1149,139 @@
}
public void M() {
+ if (!CraftEventFactory.callToggleGlideEvent(this, true).isCancelled()) // CraftBukkit
this.setFlag(7, true);
}
public void N() {
- this.setFlag(7, true);
- this.setFlag(7, false);
+ // CraftBukkit start
+ if (!CraftEventFactory.callToggleGlideEvent(this, false).isCancelled()) {
+ this.setFlag(7, true);
+ this.setFlag(7, false);
+ }
+ // CraftBukkit end
+ }
+
+ // CraftBukkit start - Add per-player time and weather.
+ public long timeOffset = 0;
@@ -611,6 +626,6 @@
+ @Override
+ public CraftPlayer getBukkitEntity() {
+ return (CraftPlayer) super.getBukkitEntity();
+ }
}
+ // CraftBukkit end
}