summaryrefslogtreecommitdiffstats
path: root/src/main/java/net/minecraft/server/World.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/net/minecraft/server/World.java')
-rw-r--r--src/main/java/net/minecraft/server/World.java114
1 files changed, 66 insertions, 48 deletions
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 20c3ead2..cadaf7d3 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -84,21 +84,10 @@ public class World implements IBlockAccess {
this.m.a(this);
this.o = this.b();
if (flag) {
- this.r = true;
- int j = 0;
- byte b0 = 64;
-
- int k;
-
- for (k = 0; !this.m.a(j, k); k += this.k.nextInt(64) - this.k.nextInt(64)) {
- j += this.k.nextInt(64) - this.k.nextInt(64);
- }
-
- this.q.a(j, b0, k);
- this.r = false;
+ this.c();
}
- this.f();
+ this.g();
}
protected IChunkProvider b() {
@@ -107,6 +96,21 @@ public class World implements IBlockAccess {
return new ChunkProviderLoadOrGenerate(this, ichunkloader, this.m.c());
}
+ protected void c() {
+ this.r = true;
+ int i = 0;
+ byte b0 = 64;
+
+ int j;
+
+ for (j = 0; !this.m.a(i, j); j += this.k.nextInt(64) - this.k.nextInt(64)) {
+ i += this.k.nextInt(64) - this.k.nextInt(64);
+ }
+
+ this.q.a(i, b0, j);
+ this.r = false;
+ }
+
public int a(int i, int j) {
int k;
@@ -123,7 +127,7 @@ public class World implements IBlockAccess {
iprogressupdate.a("Saving level");
}
- this.r();
+ this.t();
if (iprogressupdate != null) {
iprogressupdate.b("Saving chunks");
}
@@ -132,8 +136,8 @@ public class World implements IBlockAccess {
}
}
- private void r() {
- this.i();
+ private void t() {
+ this.j();
this.p.a(this.q, this.d);
}
@@ -530,7 +534,7 @@ public class World implements IBlockAccess {
return this.m.f[this.j(i, j, k)];
}
- public boolean c() {
+ public boolean d() {
return this.e < 4;
}
@@ -731,7 +735,7 @@ public class World implements IBlockAccess {
EntityHuman entityhuman = (EntityHuman) entity;
this.d.add(entityhuman);
- this.o();
+ this.q();
}
this.c(i, j).a(entity);
@@ -762,18 +766,18 @@ public class World implements IBlockAccess {
entity.b((Entity) null);
}
- entity.C();
+ entity.D();
if (entity instanceof EntityHuman) {
this.d.remove((EntityHuman) entity);
- this.o();
+ this.q();
}
}
public void e(Entity entity) {
- entity.C();
+ entity.D();
if (entity instanceof EntityHuman) {
this.d.remove((EntityHuman) entity);
- this.o();
+ this.q();
}
int i = entity.chunkX;
@@ -900,7 +904,7 @@ public class World implements IBlockAccess {
}
}
- public void d() {
+ public void e() {
this.b.removeAll(this.v);
int i;
@@ -974,7 +978,7 @@ public class World implements IBlockAccess {
entity.lastPitch = entity.pitch;
if (flag && entity.bA) {
if (entity.vehicle != null) {
- entity.x();
+ entity.o_();
} else {
entity.f_();
}
@@ -1034,7 +1038,7 @@ public class World implements IBlockAccess {
for (int i = 0; i < list.size(); ++i) {
Entity entity = (Entity) list.get(i);
- if (!entity.dead && entity.aC) {
+ if (!entity.dead && entity.aD) {
return false;
}
}
@@ -1268,7 +1272,7 @@ public class World implements IBlockAccess {
return block == null ? false : block.a();
}
- public boolean e() {
+ public boolean f() {
if (this.C >= 50) {
return false;
} else {
@@ -1345,7 +1349,7 @@ public class World implements IBlockAccess {
}
}
- public void f() {
+ public void g() {
int i = this.a(1.0F);
if (i != this.e) {
@@ -1358,10 +1362,10 @@ public class World implements IBlockAccess {
this.E = flag1;
}
- public void g() {
+ public void h() {
long i;
- if (this.q()) {
+ if (this.s()) {
boolean flag = false;
if (this.D && this.j >= 1) {
@@ -1371,7 +1375,7 @@ public class World implements IBlockAccess {
if (!flag) {
i = this.q.f() + 24000L;
this.q.a(i - i % 24000L);
- this.p();
+ this.r();
}
}
@@ -1399,10 +1403,10 @@ public class World implements IBlockAccess {
this.q.a(i);
this.a(false);
- this.h();
+ this.i();
}
- protected void h() {
+ protected void i() {
this.F.clear();
int i;
@@ -1465,10 +1469,10 @@ public class World implements IBlockAccess {
j1 = l & 15;
k1 = l >> 8 & 15;
l1 = l >> 16 & 127;
- byte b1 = chunk.b[j1 << 11 | k1 << 7 | l1];
+ int i2 = chunk.b[j1 << 11 | k1 << 7 | l1] & 255;
- if (Block.n[b1]) {
- Block.byId[b1].a(this, j1 + i, l1, k1 + j, this.k);
+ if (Block.n[i2]) {
+ Block.byId[i2].a(this, j1 + i, l1, k1 + j, this.k);
}
}
}
@@ -1692,6 +1696,16 @@ public class World implements IBlockAccess {
return entityhuman;
}
+ public EntityHuman a(String s) {
+ for (int i = 0; i < this.d.size(); ++i) {
+ if (s.equals(((EntityHuman) this.d.get(i)).name)) {
+ return (EntityHuman) this.d.get(i);
+ }
+ }
+
+ return null;
+ }
+
public byte[] c(int i, int j, int k, int l, int i1, int j1) {
byte[] abyte = new byte[l * i1 * j1 * 5 / 2];
int k1 = i >> 4;
@@ -1741,7 +1755,7 @@ public class World implements IBlockAccess {
return abyte;
}
- public void i() {
+ public void j() {
this.p.b();
}
@@ -1749,15 +1763,15 @@ public class World implements IBlockAccess {
this.q.a(i);
}
- public long j() {
+ public long k() {
return this.q.b();
}
- public long k() {
+ public long l() {
return this.q.f();
}
- public ChunkCoordinates l() {
+ public ChunkCoordinates m() {
return new ChunkCoordinates(this.q.c(), this.q.d(), this.q.e());
}
@@ -1767,6 +1781,10 @@ public class World implements IBlockAccess {
public void a(Entity entity, byte b0) {}
+ public IChunkProvider n() {
+ return this.o;
+ }
+
public void d(int i, int j, int k, int l, int i1) {
int j1 = this.getTypeId(i, j, k);
@@ -1775,42 +1793,42 @@ public class World implements IBlockAccess {
}
}
- public IDataManager m() {
+ public IDataManager o() {
return this.p;
}
- public WorldData n() {
+ public WorldData p() {
return this.q;
}
- public void o() {
+ public void q() {
this.A = !this.d.isEmpty();
Iterator iterator = this.d.iterator();
while (iterator.hasNext()) {
EntityHuman entityhuman = (EntityHuman) iterator.next();
- if (!entityhuman.E()) {
+ if (!entityhuman.F()) {
this.A = false;
break;
}
}
}
- protected void p() {
+ protected void r() {
this.A = false;
Iterator iterator = this.d.iterator();
while (iterator.hasNext()) {
EntityHuman entityhuman = (EntityHuman) iterator.next();
- if (entityhuman.E()) {
- entityhuman.a(false, false);
+ if (entityhuman.F()) {
+ entityhuman.a(false, false, false);
}
}
}
- public boolean q() {
+ public boolean s() {
if (this.A && !this.isStatic) {
Iterator iterator = this.d.iterator();
@@ -1822,7 +1840,7 @@ public class World implements IBlockAccess {
}
entityhuman = (EntityHuman) iterator.next();
- } while (entityhuman.F());
+ } while (entityhuman.G());
return false;
} else {