From 062d94d6bc8ecb42b28214bd8a91488aecc3409a Mon Sep 17 00:00:00 2001 From: Nathan Adams Date: Thu, 1 Dec 2011 21:43:54 +0000 Subject: [PATCH] Implemented 1.0.1 fixes. This fixes BUKKIT-3, BUKKIT-39, BUKKIT-150 --- src/main/java/net/minecraft/server/BlockDoor.java | 4 ++-- .../java/net/minecraft/server/MinecraftServer.java | 4 ++-- .../java/net/minecraft/server/NetLoginHandler.java | 4 ++-- src/main/java/net/minecraft/server/WorldServer.java | 13 ++++++++++++- 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 a17f015c09..b2482240d2 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 9adc11b731..d8ae52743d 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 e10062ab6f..073f5e2c7b 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 8e333e1e11..adde7394bd 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);