summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Adams <dinnerbone@dinnerbone.com>2011-12-01 21:43:54 +0000
committerNathan Adams <dinnerbone@dinnerbone.com>2011-12-01 21:43:54 +0000
commit062d94d6bc8ecb42b28214bd8a91488aecc3409a (patch)
treebe32201a87127557b99d18849c4501618e98f792
parent650717ad32a4294ecfff951c86a812d7b5b74974 (diff)
downloadcraftbukkit-062d94d6bc8ecb42b28214bd8a91488aecc3409a.tar
craftbukkit-062d94d6bc8ecb42b28214bd8a91488aecc3409a.tar.gz
craftbukkit-062d94d6bc8ecb42b28214bd8a91488aecc3409a.tar.lz
craftbukkit-062d94d6bc8ecb42b28214bd8a91488aecc3409a.tar.xz
craftbukkit-062d94d6bc8ecb42b28214bd8a91488aecc3409a.zip
Implemented 1.0.1 fixes. This fixes BUKKIT-3, BUKKIT-39, BUKKIT-150
-rw-r--r--src/main/java/net/minecraft/server/BlockDoor.java4
-rw-r--r--src/main/java/net/minecraft/server/MinecraftServer.java4
-rw-r--r--src/main/java/net/minecraft/server/NetLoginHandler.java4
-rw-r--r--src/main/java/net/minecraft/server/WorldServer.java13
4 files changed, 18 insertions, 7 deletions
diff --git a/src/main/java/net/minecraft/server/BlockDoor.java b/src/main/java/net/minecraft/server/BlockDoor.java
index a17f015c..b2482240 100644
--- a/src/main/java/net/minecraft/server/BlockDoor.java
+++ b/src/main/java/net/minecraft/server/BlockDoor.java
@@ -143,7 +143,7 @@ public class BlockDoor extends Block {
world.setTypeId(i, j, k, 0);
}
- if (l > 0 && Block.byId[l].isPowerSource()) {
+ if (l > 0 && l != this.id) {
this.doPhysics(world, i, j - 1, k, l);
}
} else {
@@ -166,8 +166,8 @@ public class BlockDoor extends Block {
if (!world.isStatic) {
this.b(world, i, j, k, i1, 0);
}
+ } else if (l > 0 && l != this.id) {
// CraftBukkit start
- } else if (l > 0 && Block.byId[l].isPowerSource()) {
org.bukkit.World bworld = world.getWorld();
org.bukkit.block.Block block = bworld.getBlockAt(i, j, k);
org.bukkit.block.Block blockTop = bworld.getBlockAt(i, j + 1, k);
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 9adc11b7..d8ae5274 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -98,7 +98,7 @@ public class MinecraftServer implements Runnable, ICommandListener, IMinecraftSe
System.setErr(new PrintStream(new LoggerOutputStream(log, Level.SEVERE), true));
// CraftBukkit end
- log.info("Starting minecraft server version 1.0.0");
+ log.info("Starting minecraft server version 1.0.1");
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\"");
@@ -639,7 +639,7 @@ public class MinecraftServer implements Runnable, ICommandListener, IMinecraftSe
}
public String getVersion() {
- return "1.0.0";
+ return "1.0.1";
}
public int getPlayerCount() {
diff --git a/src/main/java/net/minecraft/server/NetLoginHandler.java b/src/main/java/net/minecraft/server/NetLoginHandler.java
index e10062ab..073f5e2c 100644
--- a/src/main/java/net/minecraft/server/NetLoginHandler.java
+++ b/src/main/java/net/minecraft/server/NetLoginHandler.java
@@ -20,7 +20,7 @@ public class NetLoginHandler extends NetHandler {
private int f = 0;
private String g = null;
private Packet1Login h = null;
- private String i = Long.toString(d.nextLong(), 16); // CraftBukkit -- Thanks Jens! :D
+ private String i = Long.toString(d.nextLong(), 16); // CraftBukkit - Security fix
public NetLoginHandler(MinecraftServer minecraftserver, Socket socket, String s) {
this.server = minecraftserver;
@@ -60,7 +60,7 @@ public class NetLoginHandler extends NetHandler {
public void a(Packet2Handshake packet2handshake) {
if (this.server.onlineMode) {
- // this.i = Long.toHexString(d.nextLong()); // CraftBukkit
+ this.i = Long.toString(d.nextLong(), 16);
this.networkManager.queue(new Packet2Handshake(this.i));
} else {
this.networkManager.queue(new Packet2Handshake("-"));
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index 8e333e1e..adde7394 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -20,12 +20,15 @@ public class WorldServer extends World implements BlockChangeDelegate {
public boolean weirdIsOpCache = false;
public boolean savingDisabled;
public final MinecraftServer server; // CraftBukkit - private -> public final
- private IntHashMap N = new IntHashMap();
+ private IntHashMap N;
// CraftBukkit start - change signature
public WorldServer(MinecraftServer minecraftserver, IDataManager idatamanager, String s, int i, WorldSettings worldsettings, org.bukkit.World.Environment env, ChunkGenerator gen) {
super(idatamanager, s, worldsettings, WorldProvider.byDimension(env.getId()), gen, env);
this.server = minecraftserver;
+ if (this.N == null) {
+ this.N = new IntHashMap();
+ }
this.dimension = i;
this.pvpMode = minecraftserver.pvpMode;
@@ -157,6 +160,14 @@ public class WorldServer extends World implements BlockChangeDelegate {
return i1 > this.getServer().getSpawnRadius() || this.server.serverConfigurationManager.isOp(entityhuman.name);
}
+ protected void c() {
+ if (this.N == null) {
+ this.N = new IntHashMap();
+ }
+
+ super.c();
+ }
+
protected void c(Entity entity) {
super.c(entity);
this.N.a(entity.id, entity);