Update CraftBukkit to 1.6.1

This commit is contained in:
Nate Mortensen
2013-07-01 06:03:00 -05:00
committed by Wesley Wolfe
parent f887b76a25
commit 6c09066e22
228 changed files with 6426 additions and 5442 deletions

View File

@@ -27,7 +27,7 @@ import org.bukkit.event.weather.ThunderChangeEvent;
public abstract class World implements IBlockAccess {
public boolean d = false;
public boolean d;
public List entityList = new ArrayList();
protected List f = new ArrayList();
public Set tileEntityList = new HashSet(); // CraftBukkit - ArrayList -> HashSet
@@ -36,14 +36,14 @@ public abstract class World implements IBlockAccess {
public List players = new ArrayList();
public List i = new ArrayList();
private long c = 16777215L;
public int j = 0;
public int j;
protected int k = (new Random()).nextInt();
protected final int l = 1013904223;
protected float m;
protected float n;
protected float o;
protected float p;
public int q = 0;
public int q;
public boolean callingPlaceEvent = false; // CraftBukkit
public int difficulty;
public Random random = new Random();
@@ -79,15 +79,15 @@ public abstract class World implements IBlockAccess {
Chunk chunk = this.getChunkAtWorldCoords(i, j);
if (chunk != null) {
return chunk.a(i & 15, j & 15, this.worldProvider.d);
return chunk.a(i & 15, j & 15, this.worldProvider.e);
}
}
return this.worldProvider.d.getBiome(i, j);
return this.worldProvider.e.getBiome(i, j);
}
public WorldChunkManager getWorldChunkManager() {
return this.worldProvider.d;
return this.worldProvider.e;
}
// CraftBukkit start
@@ -118,7 +118,6 @@ public abstract class World implements IBlockAccess {
this.O = this.random.nextInt(12000);
this.H = new int['\u8000'];
this.isStatic = false;
this.dataManager = idatamanager;
this.methodProfiler = methodprofiler;
this.worldMaps = new WorldMapCollection(idatamanager);
@@ -168,7 +167,7 @@ public abstract class World implements IBlockAccess {
this.villages.a(this);
}
this.z();
this.A();
this.a();
this.getServer().addWorld(this.world); // CraftBukkit
@@ -430,7 +429,7 @@ public abstract class World implements IBlockAccess {
k = i1;
}
if (!this.worldProvider.f) {
if (!this.worldProvider.g) {
for (i1 = k; i1 <= l; ++i1) {
this.c(EnumSkyBlock.SKY, i, i1, j);
}
@@ -549,7 +548,7 @@ public abstract class World implements IBlockAccess {
if (flag) {
int l = this.getTypeId(i, j, k);
if (Block.w[l]) {
if (Block.x[l]) {
int i1 = this.b(i, j + 1, k, false);
int j1 = this.b(i + 1, j, k, false);
int k1 = this.b(i - 1, j, k, false);
@@ -672,7 +671,7 @@ public abstract class World implements IBlockAccess {
}
public float q(int i, int j, int k) {
return this.worldProvider.g[this.getLightLevel(i, j, k)];
return this.worldProvider.h[this.getLightLevel(i, j, k)];
}
public boolean v() {
@@ -1036,12 +1035,12 @@ public abstract class World implements IBlockAccess {
for (int j2 = 0; j2 < list.size(); ++j2) {
AxisAlignedBB axisalignedbb1 = ((Entity) list.get(j2)).D();
if (axisalignedbb1 != null && axisalignedbb1.a(axisalignedbb)) {
if (axisalignedbb1 != null && axisalignedbb1.b(axisalignedbb)) {
this.M.add(axisalignedbb1);
}
axisalignedbb1 = entity.g((Entity) list.get(j2));
if (axisalignedbb1 != null && axisalignedbb1.a(axisalignedbb)) {
if (axisalignedbb1 != null && axisalignedbb1.b(axisalignedbb)) {
this.M.add(axisalignedbb1);
}
}
@@ -1098,8 +1097,8 @@ public abstract class World implements IBlockAccess {
return this.worldProvider.a(this.worldData.getDayTime(), f);
}
public int w() {
return this.worldProvider.a(this.worldData.getDayTime());
public float x() {
return WorldProvider.a[this.worldProvider.a(this.worldData.getDayTime())];
}
public float d(float f) {
@@ -1550,7 +1549,7 @@ public abstract class World implements IBlockAccess {
}
}
if (vec3d.b() > 0.0D && entity.aw()) {
if (vec3d.b() > 0.0D && entity.av()) {
vec3d = vec3d.a();
double d1 = 0.014D;
@@ -1836,7 +1835,7 @@ public abstract class World implements IBlockAccess {
}
}
public void z() {
public void A() {
int i = this.a(1.0F);
if (i != this.j) {
@@ -1863,7 +1862,7 @@ public abstract class World implements IBlockAccess {
}
protected void o() {
if (!this.worldProvider.f) {
if (!this.worldProvider.g) {
int i = this.worldData.getThunderDuration();
if (i <= 0) {
@@ -1941,11 +1940,11 @@ public abstract class World implements IBlockAccess {
}
}
public void A() {
public void B() {
this.worldData.setWeatherDuration(1);
}
protected void B() {
protected void C() {
// this.chunkTickList.clear(); // CraftBukkit - removed
this.methodProfiler.a("buildList");
@@ -2020,7 +2019,7 @@ public abstract class World implements IBlockAccess {
}
protected void g() {
this.B();
this.C();
}
public boolean x(int i, int j, int k) {
@@ -2095,7 +2094,7 @@ public abstract class World implements IBlockAccess {
}
public void A(int i, int j, int k) {
if (!this.worldProvider.f) {
if (!this.worldProvider.g) {
this.c(EnumSkyBlock.SKY, i, j, k);
}
@@ -2338,9 +2337,9 @@ public abstract class World implements IBlockAccess {
Entity entity = (Entity) this.entityList.get(j);
// CraftBukkit start - Split out persistent check, don't apply it to special persistent mobs
if (entity instanceof EntityLiving) {
EntityLiving entityliving = (EntityLiving) entity;
if (entityliving.isTypeNotPersistent() && entityliving.bU()) { // Should be isPersistent
if (entity instanceof EntityInsentient) {
EntityInsentient entityinsentient = (EntityInsentient) entity;
if (entityinsentient.isTypeNotPersistent() && entityinsentient.bA()) { // Should be isPersistent
continue;
}
}
@@ -2566,7 +2565,7 @@ public abstract class World implements IBlockAccess {
}
if (entityhuman1.isInvisible()) {
float f = entityhuman1.cc();
float f = entityhuman1.bs();
if (f < 0.1F) {
f = 0.1F;
@@ -2587,7 +2586,7 @@ public abstract class World implements IBlockAccess {
public EntityHuman a(String s) {
for (int i = 0; i < this.players.size(); ++i) {
if (s.equals(((EntityHuman) this.players.get(i)).name)) {
if (s.equals(((EntityHuman) this.players.get(i)).getName())) {
return (EntityHuman) this.players.get(i);
}
}
@@ -2595,7 +2594,7 @@ public abstract class World implements IBlockAccess {
return null;
}
public void F() throws ExceptionWorldConflict { // CraftBukkit - added throws
public void G() throws ExceptionWorldConflict { // CraftBukkit - added throws
this.dataManager.checkSession();
}
@@ -2625,7 +2624,7 @@ public abstract class World implements IBlockAccess {
public void broadcastEntityEffect(Entity entity, byte b0) {}
public IChunkProvider K() {
public IChunkProvider L() {
return this.chunkProvider;
}
@@ -2667,16 +2666,16 @@ public abstract class World implements IBlockAccess {
return this.m + (this.n - this.m) * f;
}
public boolean O() {
public boolean P() {
return (double) this.h(1.0F) > 0.9D;
}
public boolean P() {
public boolean Q() {
return (double) this.i(1.0F) > 0.2D;
}
public boolean F(int i, int j, int k) {
if (!this.P()) {
if (!this.Q()) {
return false;
} else if (!this.l(i, j, k)) {
return false;
@@ -2738,8 +2737,8 @@ public abstract class World implements IBlockAccess {
return 256;
}
public int R() {
return this.worldProvider.f ? 128 : 256;
public int S() {
return this.worldProvider.g ? 128 : 256;
}
public IUpdatePlayerListBox a(EntityMinecartAbstract entityminecartabstract) {
@@ -2754,7 +2753,7 @@ public abstract class World implements IBlockAccess {
}
public ChunkPosition b(String s, int i, int j, int k) {
return this.K().findNearestMapFeature(this, s, i, j, k);
return this.L().findNearestMapFeature(this, s, i, j, k);
}
public CrashReportSystemDetails a(CrashReport crashreport) {
@@ -2785,9 +2784,9 @@ public abstract class World implements IBlockAccess {
return this.J;
}
public Calendar V() {
public Calendar W() {
if (this.getTime() % 600L == 0L) {
this.K.setTimeInMillis(System.currentTimeMillis());
this.K.setTimeInMillis(MinecraftServer.aq());
}
return this.K;
@@ -2824,4 +2823,26 @@ public abstract class World implements IBlockAccess {
public IConsoleLogManager getLogger() {
return this.logAgent;
}
public float b(double d0, double d1, double d2) {
return this.I(MathHelper.floor(d0), MathHelper.floor(d1), MathHelper.floor(d2));
}
public float I(int i, int j, int k) {
float f = 0.0F;
boolean flag = this.difficulty == 3;
if (this.isLoaded(i, j, k)) {
float f1 = this.x();
f += MathHelper.a((float) this.getChunkAtWorldCoords(i, k).q / 3600000.0F, 0.0F, 1.0F) * (flag ? 1.0F : 0.75F);
f += f1 * 0.25F;
}
if (this.difficulty < 2) {
f *= (float) this.difficulty / 2.0F;
}
return MathHelper.a(f, 0.0F, flag ? 1.5F : 1.0F);
}
}