summaryrefslogtreecommitdiffstats
path: root/src/main/java/net/minecraft/server/EntityPlayer.java
diff options
context:
space:
mode:
authorEvilSeph <evilseph@gmail.com>2011-08-15 14:27:02 -0400
committerEvilSeph <evilseph@gmail.com>2011-08-15 14:27:02 -0400
commit8ea590bbcc499cd82ec246d455604692c7b74445 (patch)
treebf6019e8d37fcf0699d930472a153a89f1625bad /src/main/java/net/minecraft/server/EntityPlayer.java
parent12e377501ed7df16ce7e8de2bb99eed41d43fe4e (diff)
downloadcraftbukkit-8ea590bbcc499cd82ec246d455604692c7b74445.tar
craftbukkit-8ea590bbcc499cd82ec246d455604692c7b74445.tar.gz
craftbukkit-8ea590bbcc499cd82ec246d455604692c7b74445.tar.lz
craftbukkit-8ea590bbcc499cd82ec246d455604692c7b74445.tar.xz
craftbukkit-8ea590bbcc499cd82ec246d455604692c7b74445.zip
Revert "Implements interface for changing the view distance."
Diffstat (limited to 'src/main/java/net/minecraft/server/EntityPlayer.java')
-rw-r--r--src/main/java/net/minecraft/server/EntityPlayer.java69
1 files changed, 6 insertions, 63 deletions
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index 1146605f..c7fa3a18 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -29,16 +29,6 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
private int bO = 0;
public boolean h;
- // CraftBukkit start - extra variables
- private boolean viewDistanceSet;
- private int viewDistance; // set view distance on a per player basis
- private int actualViewDistance; // when view distance in the world changes, need to know how far I could previously see
- public String displayName;
- public org.bukkit.Location compassTarget;
- public long timeOffset = 0;
- public boolean relativeTime = true;
- // CraftBukkit end
-
public EntityPlayer(MinecraftServer minecraftserver, World world, String s, ItemInWorldManager iteminworldmanager) {
super(world);
iteminworldmanager.player = this;
@@ -61,12 +51,13 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
this.height = 0.0F;
// CraftBukkit start
- this.viewDistanceSet = false;
- this.actualViewDistance = getViewDistance(); // set the 'current' view distance. This value will be updated any time the actual view distance changes
this.displayName = this.name;
- // CraftBukkit end
}
+ public String displayName;
+ public org.bukkit.Location compassTarget;
+ // CraftBukkit end
+
public void spawnIn(World world) {
super.spawnIn(world);
// CraftBukkit - world fallback code, either respawn location or global spawn
@@ -492,6 +483,8 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
}
// CraftBukkit start
+ public long timeOffset = 0;
+ public boolean relativeTime = true;
public long getPlayerTime() {
if (this.relativeTime) {
@@ -507,55 +500,5 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
public String toString() {
return super.toString() + "(" + this.name + " at " + this.locX + "," + this.locY + "," + this.locZ + ")";
}
-
- public void setViewDistance(int viewDistance) {
- if (viewDistance < 1) { // for now must set view distance to 1 or higher. 0 might be possible, but it breaks the game at the moment
- viewDistance = 1;
- }
- this.viewDistance = viewDistance;
- this.viewDistanceSet = true;
- updateViewDistance();
- }
-
- public int getViewDistance() {
- if (viewDistanceSet) {
- return viewDistance;
- } else {
- return defaultViewDistance();
- }
- }
-
- private int defaultViewDistance() {
- org.bukkit.World world = getBukkitEntity().getWorld();
- if (world != null) {
- return world.getViewDistance();
- } else {
- return getBukkitEntity().getServer().getViewDistance();
- }
- }
-
- public void resetViewDistance() {
- this.viewDistanceSet = false;
- updateViewDistance();
- }
-
- public boolean isViewDistanceSet() {
- return viewDistanceSet;
- }
-
- /**
- * Should be called every time the view distance might have changed.
- * Ensures we are always aware of the current and previous view distances.
- *
- * synchronized so that we are always sure that we have accurately tracked the view distance changes
- */
- public synchronized void updateViewDistance() {
- if (actualViewDistance == getViewDistance()) {
- return;
- }
- // notify the player manager that our view distance may have changed
- ((CraftWorld) getBukkitEntity().getWorld()).getHandle().manager.updatePlayerViewDistance(this, actualViewDistance, getViewDistance());
- actualViewDistance = getViewDistance();
- }
// CraftBukkit end
}