From 535a85a5b0a25fdbce3a5ae8440d2c60f0fae6ee Mon Sep 17 00:00:00 2001 From: Wesley Wolfe Date: Thu, 4 Apr 2013 23:35:16 -0500 Subject: [PATCH] Make auxiliary worlds use the main scoreboard. Addresses BUKKIT-3984 When a world is created using our API, it does not use secondary world server and will maintain a reference to its own scoreboard. In vanilla, this is not an issue as there is only ever one world. Similarly to maps, an overwrite to the scoreboard reference has been added for when another world has been created. This should also address BUKKIT-3982 and BUKKIT-3985 --- src/main/java/net/minecraft/server/World.java | 2 +- src/main/java/org/bukkit/craftbukkit/CraftServer.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java index 9698185458..03b716743b 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -60,7 +60,7 @@ public abstract class World implements IBlockAccess { public final MethodProfiler methodProfiler; private final Vec3DPool J = new Vec3DPool(300, 2000); private final Calendar K = Calendar.getInstance(); - protected Scoreboard scoreboard = new Scoreboard(); + public Scoreboard scoreboard = new Scoreboard(); // CraftBukkit - protected -> public private final IConsoleLogManager logAgent; private UnsafeList M = new UnsafeList(); // CraftBukkit - ArrayList -> UnsafeList private boolean N; diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java index 5baed2583c..8a079d38a9 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -721,8 +721,9 @@ public final class CraftServer implements Server { } internal.worldMaps = console.worlds.get(0).worldMaps; + internal.scoreboard = getScoreboardManager().getMainScoreboard().getHandle(); - internal.tracker = new EntityTracker(internal); // CraftBukkit + internal.tracker = new EntityTracker(internal); internal.addIWorldAccess(new WorldManager(console, internal)); internal.difficulty = 1; internal.setSpawnFlags(true, true);