summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/net/minecraft/server/BlockDoor.java4
-rw-r--r--src/main/java/net/minecraft/server/BlockIce.java7
-rw-r--r--src/main/java/net/minecraft/server/ConsoleCommandHandler.java4
-rw-r--r--src/main/java/net/minecraft/server/ContainerWorkbench.java2
-rw-r--r--src/main/java/net/minecraft/server/Entity.java12
-rw-r--r--src/main/java/net/minecraft/server/EntityLiving.java4
-rw-r--r--src/main/java/net/minecraft/server/EntityMinecart.java12
-rw-r--r--src/main/java/net/minecraft/server/EntityPainting.java14
-rw-r--r--src/main/java/net/minecraft/server/EntityTrackerEntry.java2
-rw-r--r--src/main/java/net/minecraft/server/Explosion.java2
-rw-r--r--src/main/java/net/minecraft/server/MinecraftServer.java2
-rw-r--r--src/main/java/net/minecraft/server/NetServerHandler.java2
-rw-r--r--src/main/java/net/minecraft/server/TileEntityChest.java2
-rw-r--r--src/main/java/net/minecraft/server/TileEntityDispenser.java2
-rw-r--r--src/main/java/net/minecraft/server/TileEntityFurnace.java2
-rw-r--r--src/main/java/net/minecraft/server/TileEntitySign.java6
-rw-r--r--src/main/java/net/minecraft/server/World.java85
-rw-r--r--src/main/java/org/bukkit/craftbukkit/CraftServer.java2
18 files changed, 103 insertions, 63 deletions
diff --git a/src/main/java/net/minecraft/server/BlockDoor.java b/src/main/java/net/minecraft/server/BlockDoor.java
index 60973530..1308051e 100644
--- a/src/main/java/net/minecraft/server/BlockDoor.java
+++ b/src/main/java/net/minecraft/server/BlockDoor.java
@@ -204,4 +204,8 @@ public class BlockDoor extends Block {
public static boolean e(int i) {
return (i & 4) != 0;
}
+
+ public int e() {
+ return 1;
+ }
}
diff --git a/src/main/java/net/minecraft/server/BlockIce.java b/src/main/java/net/minecraft/server/BlockIce.java
index 2ba8c887..a9bb77a6 100644
--- a/src/main/java/net/minecraft/server/BlockIce.java
+++ b/src/main/java/net/minecraft/server/BlockIce.java
@@ -12,7 +12,8 @@ public class BlockIce extends BlockBreakable {
this.a(true);
}
- public void remove(World world, int i, int j, int k) {
+ public void a(World world, EntityHuman entityhuman, int i, int j, int k, int l) {
+ super.a(world, entityhuman, i, j, k, l);
Material material = world.getMaterial(i, j - 1, k);
if (material.isSolid() || material.isLiquid()) {
@@ -42,4 +43,8 @@ public class BlockIce extends BlockBreakable {
world.setTypeId(i, j, k, Block.STATIONARY_WATER.id);
}
}
+
+ public int e() {
+ return 0;
+ }
}
diff --git a/src/main/java/net/minecraft/server/ConsoleCommandHandler.java b/src/main/java/net/minecraft/server/ConsoleCommandHandler.java
index 680bdde6..a7398b5f 100644
--- a/src/main/java/net/minecraft/server/ConsoleCommandHandler.java
+++ b/src/main/java/net/minecraft/server/ConsoleCommandHandler.java
@@ -205,14 +205,14 @@ public class ConsoleCommandHandler {
if ("add".equalsIgnoreCase(s3)) {
for (k = 0; k < this.server.worlds.size(); ++k) { // CraftBukkit
worldserver1 = this.server.worlds.get(k); // CraftBukkit
- worldserver1.setTime(worldserver1.getTime() + (long) j);
+ worldserver1.setTimeAndFixTicklists(worldserver1.getTime() + (long) j);
}
this.print(s1, "Added " + j + " to time");
} else if ("set".equalsIgnoreCase(s3)) {
for (k = 0; k < this.server.worlds.size(); ++k) { // CraftBukkit
worldserver1 = this.server.worlds.get(k); // CraftBukkit
- worldserver1.setTime((long) j);
+ worldserver1.setTimeAndFixTicklists((long) j);
}
this.print(s1, "Set time to " + j);
diff --git a/src/main/java/net/minecraft/server/ContainerWorkbench.java b/src/main/java/net/minecraft/server/ContainerWorkbench.java
index 8d180e90..221cc768 100644
--- a/src/main/java/net/minecraft/server/ContainerWorkbench.java
+++ b/src/main/java/net/minecraft/server/ContainerWorkbench.java
@@ -65,7 +65,7 @@ public class ContainerWorkbench extends Container {
}
public boolean b(EntityHuman entityhuman) {
- return this.c.getTypeId(this.h, this.i, this.j) != Block.WORKBENCH.id ? false : entityhuman.d((double) this.h + 0.5D, (double) this.i + 0.5D, (double) this.j + 0.5D) <= 64.0D;
+ return this.c.getTypeId(this.h, this.i, this.j) != Block.WORKBENCH.id ? false : entityhuman.e((double) this.h + 0.5D, (double) this.i + 0.5D, (double) this.j + 0.5D) <= 64.0D;
}
public ItemStack a(int i) {
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index a786cc7c..2c1f11da 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -334,7 +334,7 @@ public abstract class Entity {
this.die();
}
- public boolean b(double d0, double d1, double d2) {
+ public boolean d(double d0, double d1, double d2) {
AxisAlignedBB axisalignedbb = this.boundingBox.c(d0, d1, d2);
List list = this.world.getEntities(this, axisalignedbb);
@@ -798,7 +798,7 @@ public abstract class Entity {
return MathHelper.c(f * f + f1 * f1 + f2 * f2);
}
- public double d(double d0, double d1, double d2) {
+ public double e(double d0, double d1, double d2) {
double d3 = this.locX - d0;
double d4 = this.locY - d1;
double d5 = this.locZ - d2;
@@ -806,7 +806,7 @@ public abstract class Entity {
return d3 * d3 + d4 * d4 + d5 * d5;
}
- public double e(double d0, double d1, double d2) {
+ public double f(double d0, double d1, double d2) {
double d3 = this.locX - d0;
double d4 = this.locY - d1;
double d5 = this.locZ - d2;
@@ -846,13 +846,13 @@ public abstract class Entity {
d1 *= 0.05000000074505806D;
d0 *= (double) (1.0F - this.bu);
d1 *= (double) (1.0F - this.bu);
- this.f(-d0, 0.0D, -d1);
- entity.f(d0, 0.0D, d1);
+ this.b(-d0, 0.0D, -d1);
+ entity.b(d0, 0.0D, d1);
}
}
}
- public void f(double d0, double d1, double d2) {
+ public void b(double d0, double d1, double d2) {
this.motX += d0;
this.motY += d1;
this.motZ += d2;
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
index abe40d0e..1ea01a1d 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -511,7 +511,7 @@ public abstract class EntityLiving extends Entity {
this.motY *= 0.800000011920929D;
this.motZ *= 0.800000011920929D;
this.motY -= 0.02D;
- if (this.positionChanged && this.b(this.motX, this.motY + 0.6000000238418579D - this.locY + d0, this.motZ)) {
+ if (this.positionChanged && this.d(this.motX, this.motY + 0.6000000238418579D - this.locY + d0, this.motZ)) {
this.motY = 0.30000001192092896D;
}
} else if (this.ae()) {
@@ -522,7 +522,7 @@ public abstract class EntityLiving extends Entity {
this.motY *= 0.5D;
this.motZ *= 0.5D;
this.motY -= 0.02D;
- if (this.positionChanged && this.b(this.motX, this.motY + 0.6000000238418579D - this.locY + d0, this.motZ)) {
+ if (this.positionChanged && this.d(this.motX, this.motY + 0.6000000238418579D - this.locY + d0, this.motZ)) {
this.motY = 0.30000001192092896D;
}
} else {
diff --git a/src/main/java/net/minecraft/server/EntityMinecart.java b/src/main/java/net/minecraft/server/EntityMinecart.java
index 79c946ae..60e1bdf0 100644
--- a/src/main/java/net/minecraft/server/EntityMinecart.java
+++ b/src/main/java/net/minecraft/server/EntityMinecart.java
@@ -769,13 +769,13 @@ public class EntityMinecart extends Entity implements IInventory {
if (((EntityMinecart) entity).type == 2 && this.type != 2) {
this.motX *= 0.20000000298023224D;
this.motZ *= 0.20000000298023224D;
- this.f(entity.motX - d0, 0.0D, entity.motZ - d1);
+ this.b(entity.motX - d0, 0.0D, entity.motZ - d1);
entity.motX *= 0.699999988079071D;
entity.motZ *= 0.699999988079071D;
} else if (((EntityMinecart) entity).type != 2 && this.type == 2) {
entity.motX *= 0.20000000298023224D;
entity.motZ *= 0.20000000298023224D;
- entity.f(this.motX + d0, 0.0D, this.motZ + d1);
+ entity.b(this.motX + d0, 0.0D, this.motZ + d1);
this.motX *= 0.699999988079071D;
this.motZ *= 0.699999988079071D;
} else {
@@ -783,14 +783,14 @@ public class EntityMinecart extends Entity implements IInventory {
d8 /= 2.0D;
this.motX *= 0.20000000298023224D;
this.motZ *= 0.20000000298023224D;
- this.f(d7 - d0, 0.0D, d8 - d1);
+ this.b(d7 - d0, 0.0D, d8 - d1);
entity.motX *= 0.20000000298023224D;
entity.motZ *= 0.20000000298023224D;
- entity.f(d7 + d0, 0.0D, d8 + d1);
+ entity.b(d7 + d0, 0.0D, d8 + d1);
}
} else {
- this.f(-d0, 0.0D, -d1);
- entity.f(d0 / 4.0D, 0.0D, d1 / 4.0D);
+ this.b(-d0, 0.0D, -d1);
+ entity.b(d0 / 4.0D, 0.0D, d1 / 4.0D);
}
}
}
diff --git a/src/main/java/net/minecraft/server/EntityPainting.java b/src/main/java/net/minecraft/server/EntityPainting.java
index 75431546..40d28bae 100644
--- a/src/main/java/net/minecraft/server/EntityPainting.java
+++ b/src/main/java/net/minecraft/server/EntityPainting.java
@@ -248,4 +248,18 @@ public class EntityPainting extends Entity {
this.b(this.a);
}
+
+ public void a(double d0, double d1, double d2) {
+ if (!this.world.isStatic && d0 * d0 + d1 * d1 + d2 * d2 > 0.0D) {
+ this.die();
+ this.world.addEntity(new EntityItem(this.world, this.locX, this.locY, this.locZ, new ItemStack(Item.PAINTING)));
+ }
+ }
+
+ public void b(double d0, double d1, double d2) {
+ if (!this.world.isStatic && d0 * d0 + d1 * d1 + d2 * d2 > 0.0D) {
+ this.die();
+ this.world.addEntity(new EntityItem(this.world, this.locX, this.locY, this.locZ, new ItemStack(Item.PAINTING)));
+ }
+ }
}
diff --git a/src/main/java/net/minecraft/server/EntityTrackerEntry.java b/src/main/java/net/minecraft/server/EntityTrackerEntry.java
index 4f2f5a83..b53db69c 100644
--- a/src/main/java/net/minecraft/server/EntityTrackerEntry.java
+++ b/src/main/java/net/minecraft/server/EntityTrackerEntry.java
@@ -50,7 +50,7 @@ public class EntityTrackerEntry {
public void track(List list) {
this.m = false;
- if (!this.r || this.tracker.d(this.o, this.p, this.q) > 16.0D) {
+ if (!this.r || this.tracker.e(this.o, this.p, this.q) > 16.0D) {
this.o = this.tracker.locX;
this.p = this.tracker.locY;
this.q = this.tracker.locZ;
diff --git a/src/main/java/net/minecraft/server/Explosion.java b/src/main/java/net/minecraft/server/Explosion.java
index 8f2309fb..0903af4a 100644
--- a/src/main/java/net/minecraft/server/Explosion.java
+++ b/src/main/java/net/minecraft/server/Explosion.java
@@ -102,7 +102,7 @@ public class Explosion {
for (int k2 = 0; k2 < list.size(); ++k2) {
Entity entity = (Entity) list.get(k2);
- double d7 = entity.e(this.posX, this.posY, this.posZ) / (double) this.size;
+ double d7 = entity.f(this.posX, this.posY, this.posZ) / (double) this.size;
if (d7 <= 1.0D) {
d0 = entity.locX - this.posX;
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 9ac802a4..13601d9e 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -89,7 +89,7 @@ public class MinecraftServer implements Runnable, ICommandListener {
System.setErr(new PrintStream(new LoggerOutputStream(log, Level.SEVERE), true));
// CraftBukkit end
- log.info("Starting minecraft server version Beta 1.7.2");
+ log.info("Starting minecraft server version Beta 1.7.3");
if (Runtime.getRuntime().maxMemory() / 1024L / 1024L < 512L) {
log.warning("**** NOT ENOUGH RAM!");
log.warning("To start the server with more ram, launch it as \"java -Xmx1024M -Xms1024M -jar minecraft_server.jar\"");
diff --git a/src/main/java/net/minecraft/server/NetServerHandler.java b/src/main/java/net/minecraft/server/NetServerHandler.java
index 34e5d0b8..00b8de8d 100644
--- a/src/main/java/net/minecraft/server/NetServerHandler.java
+++ b/src/main/java/net/minecraft/server/NetServerHandler.java
@@ -970,7 +970,7 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
for (int l = 0; l < 4; ++l) {
tileentitysign1.lines[l] = event.getLine(l);
}
- tileentitysign1.setEditable(false);
+ tileentitysign1.a(false);
}
// CraftBukkit end
diff --git a/src/main/java/net/minecraft/server/TileEntityChest.java b/src/main/java/net/minecraft/server/TileEntityChest.java
index 48ff6c9b..dbf08c15 100644
--- a/src/main/java/net/minecraft/server/TileEntityChest.java
+++ b/src/main/java/net/minecraft/server/TileEntityChest.java
@@ -94,6 +94,6 @@ public class TileEntityChest extends TileEntity implements IInventory {
}
public boolean a_(EntityHuman entityhuman) {
- return this.world.getTileEntity(this.x, this.y, this.z) != this ? false : entityhuman.d((double) this.x + 0.5D, (double) this.y + 0.5D, (double) this.z + 0.5D) <= 64.0D;
+ return this.world.getTileEntity(this.x, this.y, this.z) != this ? false : entityhuman.e((double) this.x + 0.5D, (double) this.y + 0.5D, (double) this.z + 0.5D) <= 64.0D;
}
}
diff --git a/src/main/java/net/minecraft/server/TileEntityDispenser.java b/src/main/java/net/minecraft/server/TileEntityDispenser.java
index 33b739f2..7a9aab7a 100644
--- a/src/main/java/net/minecraft/server/TileEntityDispenser.java
+++ b/src/main/java/net/minecraft/server/TileEntityDispenser.java
@@ -124,6 +124,6 @@ public class TileEntityDispenser extends TileEntity implements IInventory {
}
public boolean a_(EntityHuman entityhuman) {
- return this.world.getTileEntity(this.x, this.y, this.z) != this ? false : entityhuman.d((double) this.x + 0.5D, (double) this.y + 0.5D, (double) this.z + 0.5D) <= 64.0D;
+ return this.world.getTileEntity(this.x, this.y, this.z) != this ? false : entityhuman.e((double) this.x + 0.5D, (double) this.y + 0.5D, (double) this.z + 0.5D) <= 64.0D;
}
}
diff --git a/src/main/java/net/minecraft/server/TileEntityFurnace.java b/src/main/java/net/minecraft/server/TileEntityFurnace.java
index a3969e02..1503cbdf 100644
--- a/src/main/java/net/minecraft/server/TileEntityFurnace.java
+++ b/src/main/java/net/minecraft/server/TileEntityFurnace.java
@@ -243,6 +243,6 @@ public class TileEntityFurnace extends TileEntity implements IInventory {
}
public boolean a_(EntityHuman entityhuman) {
- return this.world.getTileEntity(this.x, this.y, this.z) != this ? false : entityhuman.d((double) this.x + 0.5D, (double) this.y + 0.5D, (double) this.z + 0.5D) <= 64.0D;
+ return this.world.getTileEntity(this.x, this.y, this.z) != this ? false : entityhuman.e((double) this.x + 0.5D, (double) this.y + 0.5D, (double) this.z + 0.5D) <= 64.0D;
}
}
diff --git a/src/main/java/net/minecraft/server/TileEntitySign.java b/src/main/java/net/minecraft/server/TileEntitySign.java
index a44e086f..cfbf6a0b 100644
--- a/src/main/java/net/minecraft/server/TileEntitySign.java
+++ b/src/main/java/net/minecraft/server/TileEntitySign.java
@@ -48,9 +48,7 @@ public class TileEntitySign extends TileEntity {
return this.isEditable;
}
- // CraftBukkit start
- public void setEditable(boolean editable) {
- this.isEditable = editable;
+ public void a(boolean flag) {
+ this.isEditable = flag;
}
- // CraftBukkit end
}
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 5f2d404d..aca1058d 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -1577,11 +1577,11 @@ public class World implements IBlockAccess {
} else {
++this.M;
+ boolean flag;
+
try {
int i = 500;
- boolean flag;
-
while (this.C.size() > 0) {
--i;
if (i <= 0) {
@@ -1593,10 +1593,11 @@ public class World implements IBlockAccess {
}
flag = false;
- return flag;
} finally {
--this.M;
}
+
+ return flag;
}
}
@@ -1609,38 +1610,44 @@ public class World implements IBlockAccess {
++A;
try {
- if (A != 50) {
- int k1 = (l + i) / 2;
- int l1 = (j1 + k) / 2;
-
- if (this.isLoaded(k1, 64, l1)) {
- if (!this.getChunkAtWorldCoords(k1, l1).isEmpty()) {
- int i2 = this.C.size();
- int j2;
-
- if (flag) {
- j2 = 5;
- if (j2 > i2) {
- j2 = i2;
- }
-
- for (int k2 = 0; k2 < j2; ++k2) {
- MetadataChunkBlock metadatachunkblock = (MetadataChunkBlock) this.C.get(this.C.size() - k2 - 1);
-
- if (metadatachunkblock.a == enumskyblock && metadatachunkblock.a(i, j, k, l, i1, j1)) {
- return;
- }
- }
- }
+ if (A == 50) {
+ return;
+ }
+
+ int k1 = (l + i) / 2;
+ int l1 = (j1 + k) / 2;
+
+ if (this.isLoaded(k1, 64, l1)) {
+ if (this.getChunkAtWorldCoords(k1, l1).isEmpty()) {
+ return;
+ }
+
+ int i2 = this.C.size();
+ int j2;
- this.C.add(new MetadataChunkBlock(enumskyblock, i, j, k, l, i1, j1));
- j2 = 1000000;
- if (this.C.size() > 1000000) {
- System.out.println("More than " + j2 + " updates, aborting lighting updates");
- this.C.clear();
+ if (flag) {
+ j2 = 5;
+ if (j2 > i2) {
+ j2 = i2;
+ }
+
+ for (int k2 = 0; k2 < j2; ++k2) {
+ MetadataChunkBlock metadatachunkblock = (MetadataChunkBlock) this.C.get(this.C.size() - k2 - 1);
+
+ if (metadatachunkblock.a == enumskyblock && metadatachunkblock.a(i, j, k, l, i1, j1)) {
+ return;
}
}
}
+
+ this.C.add(new MetadataChunkBlock(enumskyblock, i, j, k, l, i1, j1));
+ j2 = 1000000;
+ if (this.C.size() > 1000000) {
+ System.out.println("More than " + j2 + " updates, aborting lighting updates");
+ this.C.clear();
+ }
+
+ return;
}
} finally {
--A;
@@ -1866,7 +1873,7 @@ public class World implements IBlockAccess {
if (l1 == 0 && this.k(l, k1, j1) <= this.random.nextInt(8) && this.a(EnumSkyBlock.SKY, l, k1, j1) <= 0) {
EntityHuman entityhuman1 = this.a((double) l + 0.5D, (double) k1 + 0.5D, (double) j1 + 0.5D, 8.0D);
- if (entityhuman1 != null && entityhuman1.d((double) l + 0.5D, (double) k1 + 0.5D, (double) j1 + 0.5D) > 4.0D) {
+ if (entityhuman1 != null && entityhuman1.e((double) l + 0.5D, (double) k1 + 0.5D, (double) j1 + 0.5D) > 4.0D) {
this.makeSound((double) l + 0.5D, (double) k1 + 0.5D, (double) j1 + 0.5D, "ambient.cave.cave", 0.7F, 0.8F + this.random.nextFloat() * 0.2F);
this.Q = this.random.nextInt(12000) + 6000;
}
@@ -2152,7 +2159,7 @@ public class World implements IBlockAccess {
continue;
}
// CraftBukkit end
- double d5 = entityhuman1.d(d0, d1, d2);
+ double d5 = entityhuman1.e(d0, d1, d2);
if ((d3 < 0.0D || d5 < d3 * d3) && (d4 == -1.0D || d5 < d4)) {
d4 = d5;
@@ -2230,6 +2237,18 @@ public class World implements IBlockAccess {
this.worldData.a(i);
}
+ public void setTimeAndFixTicklists(long i) {
+ long j = i - this.worldData.f();
+
+ NextTickListEntry nextticklistentry;
+
+ for (Iterator iterator = this.F.iterator(); iterator.hasNext(); nextticklistentry.e += j) {
+ nextticklistentry = (NextTickListEntry) iterator.next();
+ }
+
+ this.setTime(i);
+ }
+
public long getSeed() {
return this.worldData.getSeed();
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 30a382c0..59e4f85a 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -65,7 +65,7 @@ import org.bukkit.util.config.ConfigurationNode;
public final class CraftServer implements Server {
private final String serverName = "Craftbukkit";
private final String serverVersion;
- private final String protocolVersion = "1.7.2";
+ private final String protocolVersion = "1.7.3";
private final ServicesManager servicesManager = new SimpleServicesManager();
private final BukkitScheduler scheduler = new CraftScheduler(this);
private final SimpleCommandMap commandMap = new SimpleCommandMap(this);