diff options
author | feildmaster <admin@feildmaster.com> | 2013-09-19 13:25:08 -0500 |
---|---|---|
committer | feildmaster <admin@feildmaster.com> | 2013-09-19 20:01:02 -0500 |
commit | dcb9d6a5ef2d572b041696d5728f660aa8549e47 (patch) | |
tree | 5b81d2ea9db695ea713deb9a47b6c867fa5219b2 /src/main/java/net/minecraft/server/EntityPlayer.java | |
parent | e20ef1f60600467077bba06d36585ae9d3c5fb27 (diff) | |
download | craftbukkit-dcb9d6a5ef2d572b041696d5728f660aa8549e47.tar craftbukkit-dcb9d6a5ef2d572b041696d5728f660aa8549e47.tar.gz craftbukkit-dcb9d6a5ef2d572b041696d5728f660aa8549e47.tar.lz craftbukkit-dcb9d6a5ef2d572b041696d5728f660aa8549e47.tar.xz craftbukkit-dcb9d6a5ef2d572b041696d5728f660aa8549e47.zip |
Update CraftBukkit to 1.6.4
Diffstat (limited to 'src/main/java/net/minecraft/server/EntityPlayer.java')
-rw-r--r-- | src/main/java/net/minecraft/server/EntityPlayer.java | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java index 58e52179..2e234f11 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -4,6 +4,7 @@ import java.io.ByteArrayOutputStream; import java.io.DataOutputStream; import java.io.IOException; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collection; import java.util.Iterator; import java.util.LinkedList; @@ -39,6 +40,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { private int bU; private int bV; private boolean bW = true; + private long bX = 0L; private int containerCounter; public boolean h; public int ping; @@ -158,10 +160,9 @@ public class EntityPlayer extends EntityHuman implements ICrafting { this.activeContainer = this.defaultContainer; } - // CraftBukkit start - Check inventory status every tick - if (!this.activeContainer.a(this)) { // Should be stillValid - this.closeInventory(); - this.activeContainer = this.defaultContainer; + // CraftBukkit start + if (this.noDamageTicks > 0) { + --this.noDamageTicks; } // CraftBukkit end @@ -216,6 +217,10 @@ public class EntityPlayer extends EntityHuman implements ICrafting { } } } + + if (this.bX > 0L && this.server.ar() > 0 && MinecraftServer.aq() - this.bX > (long) (this.server.ar() * 1000 * 60)) { + this.playerConnection.disconnect("You have been idle for too long!"); + } } public void h() { @@ -242,8 +247,8 @@ public class EntityPlayer extends EntityHuman implements ICrafting { this.bR = this.foodData.e() == 0.0F; } - if (this.getHealth() + this.bm() != this.bO) { - this.bO = this.getHealth() + this.bm(); + if (this.getHealth() + this.bn() != this.bO) { + this.bO = this.getHealth() + this.bn(); // CraftBukkit - Update ALL the scores! this.world.getServer().getScoreboardManager().updateAllScoresForList(IScoreboardCriteria.f, this.getLocalizedName(), com.google.common.collect.ImmutableList.of(this)); } @@ -301,7 +306,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { } } - ChatMessage chatmessage = this.aQ().b(); + ChatMessage chatmessage = this.aR().b(); String deathmessage = chatmessage.toString(); org.bukkit.event.entity.PlayerDeathEvent event = CraftEventFactory.callPlayerDeathEvent(this, loot, deathmessage); @@ -340,7 +345,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { scoreboardscore.incrementScore(); } - EntityLiving entityliving = this.aR(); + EntityLiving entityliving = this.aS(); if (entityliving != null) { entityliving.b(this, this.bb); @@ -873,6 +878,10 @@ public class EntityPlayer extends EntityHuman implements ICrafting { return new ChunkCoordinates(MathHelper.floor(this.locX), MathHelper.floor(this.locY + 0.5D), MathHelper.floor(this.locZ)); } + public void u() { + this.bX = MinecraftServer.aq(); + } + // CraftBukkit start public long timeOffset = 0; public boolean relativeTime = true; |