Expand definition of isFrozen

This commit is contained in:
md_5 2016-11-30 09:16:01 +11:00
parent ff324aabe6
commit 8d7e4d17e9

View File

@ -419,24 +419,23 @@
this.playerConnection.sendPacket(new PacketPlayOutCloseWindow(this.activeContainer.windowId)); this.playerConnection.sendPacket(new PacketPlayOutCloseWindow(this.activeContainer.windowId));
this.s(); this.s();
} }
@@ -743,8 +906,17 @@ @@ -743,7 +906,16 @@
public void triggerHealthUpdate() { public void triggerHealthUpdate() {
this.lastHealthSent = -1.0E8F; this.lastHealthSent = -1.0E8F;
+ this.lastSentExp = -1; // CraftBukkit - Added to reset + this.lastSentExp = -1; // CraftBukkit - Added to reset
} + }
+
+ // CraftBukkit start - Support multi-line messages + // CraftBukkit start - Support multi-line messages
+ public void sendMessage(IChatBaseComponent[] ichatbasecomponent) { + public void sendMessage(IChatBaseComponent[] ichatbasecomponent) {
+ for (IChatBaseComponent component : ichatbasecomponent) { + for (IChatBaseComponent component : ichatbasecomponent) {
+ this.sendMessage(component); + this.sendMessage(component);
+ } + }
+ } }
+ // CraftBukkit end + // CraftBukkit end
+
public void a(IChatBaseComponent ichatbasecomponent, boolean flag) { public void a(IChatBaseComponent ichatbasecomponent, boolean flag) {
this.playerConnection.sendPacket(new PacketPlayOutChat(ichatbasecomponent, (byte) (flag ? 2 : 0))); this.playerConnection.sendPacket(new PacketPlayOutChat(ichatbasecomponent, (byte) (flag ? 2 : 0)));
}
@@ -804,6 +976,8 @@ @@ -804,6 +976,8 @@
} }
@ -500,7 +499,7 @@
} }
public void a(EnumHand enumhand) { public void a(EnumHand enumhand) {
@@ -958,11 +1149,145 @@ @@ -958,11 +1149,150 @@
} }
public void M() { public void M() {
@ -609,6 +608,11 @@
+ this.playerConnection.syncPosition(); + this.playerConnection.syncPosition();
+ } + }
+ +
+ @Override
+ protected boolean isFrozen() {
+ return super.isFrozen() || !getBukkitEntity().isOnline();
+ }
+
+ public void reset() { + public void reset() {
+ float exp = 0; + float exp = 0;
+ boolean keepInventory = this.world.getGameRules().getBoolean("keepInventory"); + boolean keepInventory = this.world.getGameRules().getBoolean("keepInventory");