Archiviert
13
0

Possibly fixed block/chunk leaking

Dieser Commit ist enthalten in:
Dinnerbone 2011-02-06 22:53:48 +00:00
Ursprung 8b14c72a8d
Commit 7bdc190637
4 geänderte Dateien mit 24 neuen und 14 gelöschten Zeilen

Datei anzeigen

@ -9,9 +9,13 @@ public class PlayerManager {
private PlayerList b = new PlayerList(); private PlayerList b = new PlayerList();
private List c = new ArrayList(); private List c = new ArrayList();
private MinecraftServer d; private MinecraftServer d;
private WorldServer world; // Craftbukkit
public PlayerManager(MinecraftServer minecraftserver) { // Craftbukkit - change of method signature
public PlayerManager(MinecraftServer minecraftserver, WorldServer world) {
this.d = minecraftserver; this.d = minecraftserver;
this.world = world; // Craftbukkit
} }
public void a() { public void a() {

Datei anzeigen

@ -28,7 +28,7 @@ public class ServerConfigurationManager {
public static Logger a = Logger.getLogger("Minecraft"); public static Logger a = Logger.getLogger("Minecraft");
public List b = new ArrayList(); public List b = new ArrayList();
public MinecraftServer c; // Craftbukkit - public public MinecraftServer c; // Craftbukkit - public
public PlayerManager d; // Craftbukkit - public // public PlayerManager d; // Craftbukkit - removed!
private int e; private int e;
private Set f = new HashSet(); private Set f = new HashSet();
private Set g = new HashSet(); private Set g = new HashSet();
@ -54,7 +54,7 @@ public class ServerConfigurationManager {
this.i = minecraftserver.a("banned-players.txt"); this.i = minecraftserver.a("banned-players.txt");
this.j = minecraftserver.a("banned-ips.txt"); this.j = minecraftserver.a("banned-ips.txt");
this.k = minecraftserver.a("ops.txt"); this.k = minecraftserver.a("ops.txt");
this.d = new PlayerManager(minecraftserver); // this.d = new PlayerManager(minecraftserver); // Craftbukkit - removed!
this.e = minecraftserver.d.a("max-players", 20); this.e = minecraftserver.d.a("max-players", 20);
this.e(); this.e();
this.g(); this.g();
@ -69,7 +69,7 @@ public class ServerConfigurationManager {
} }
public int a() { public int a() {
return this.d.b(); return 144; // Craftbukkit - magic number from PlayerManager.b() (??)
} }
public void a(EntityPlayer entityplayer) { public void a(EntityPlayer entityplayer) {
@ -86,22 +86,22 @@ public class ServerConfigurationManager {
entityplayer.world.a(entityplayer); entityplayer.world.a(entityplayer);
server.getPluginManager().callEvent(new PlayerEvent(PlayerEvent.Type.PLAYER_JOIN, server.getPlayer(entityplayer))); server.getPluginManager().callEvent(new PlayerEvent(PlayerEvent.Type.PLAYER_JOIN, server.getPlayer(entityplayer)));
((WorldServer)entityplayer.world).manager.a(entityplayer);
// Craftbukkit end // Craftbukkit end
this.d.a(entityplayer);
} }
public void b(EntityPlayer entityplayer) { public void b(EntityPlayer entityplayer) {
this.d.c(entityplayer); ((WorldServer)entityplayer.world).c(entityplayer); // Craftbukkit
} }
public void c(EntityPlayer entityplayer) { public void c(EntityPlayer entityplayer) {
this.l.a(entityplayer); this.l.a(entityplayer);
entityplayer.world.d(entityplayer); // Craftbukkit entityplayer.world.d(entityplayer); // Craftbukkit
this.b.remove(entityplayer); this.b.remove(entityplayer);
this.d.b(entityplayer);
// CraftBukkit start // CraftBukkit start
((WorldServer)entityplayer.world).manager.b(entityplayer);
server.getPluginManager().callEvent(new PlayerEvent(PlayerEvent.Type.PLAYER_QUIT, server.getPlayer(entityplayer))); // CraftBukkit server.getPluginManager().callEvent(new PlayerEvent(PlayerEvent.Type.PLAYER_QUIT, server.getPlayer(entityplayer))); // CraftBukkit
// CraftBukkit end // CraftBukkit end
} }
@ -150,7 +150,7 @@ public class ServerConfigurationManager {
// Craftbukkit start - every reference to this.c.e should be entityplayer.world // Craftbukkit start - every reference to this.c.e should be entityplayer.world
this.c.k.a(entityplayer); this.c.k.a(entityplayer);
this.c.k.b(entityplayer); this.c.k.b(entityplayer);
this.d.b(entityplayer); ((WorldServer)entityplayer.world).manager.b(entityplayer);
this.b.remove(entityplayer); this.b.remove(entityplayer);
entityplayer.world.e(entityplayer); entityplayer.world.e(entityplayer);
EntityPlayer entityplayer1 = new EntityPlayer(this.c, entityplayer.world, entityplayer.name, new ItemInWorldManager(entityplayer.world)); EntityPlayer entityplayer1 = new EntityPlayer(this.c, entityplayer.world, entityplayer.name, new ItemInWorldManager(entityplayer.world));
@ -177,7 +177,7 @@ public class ServerConfigurationManager {
entityplayer1.a.b((Packet) (new Packet9Respawn())); entityplayer1.a.b((Packet) (new Packet9Respawn()));
entityplayer1.a.a(entityplayer1.locX, entityplayer1.locY, entityplayer1.locZ, entityplayer1.yaw, entityplayer1.pitch); entityplayer1.a.a(entityplayer1.locX, entityplayer1.locY, entityplayer1.locZ, entityplayer1.yaw, entityplayer1.pitch);
this.d.a(entityplayer1); ((WorldServer)entityplayer1.world).manager.a(entityplayer1);
entityplayer.world.a(entityplayer1); entityplayer.world.a(entityplayer1);
this.b.add(entityplayer1); this.b.add(entityplayer1);
entityplayer1.l(); entityplayer1.l();
@ -186,12 +186,16 @@ public class ServerConfigurationManager {
} }
public void b() { public void b() {
this.d.a(); // Craftbukkit start
for (WorldServer world : c.worlds) {
world.manager.a();
}
// Craftbukkit end
} }
// Craftbukkit - changed signature // Craftbukkit - changed signature
public void a(int i, int j, int k, WorldServer world) { public void a(int i, int j, int k, WorldServer world) {
this.d.a(i, j, k, world); // Craftbukkit world.manager.a(i, j, k, world); // Craftbukkit
} }
public void a(Packet packet) { public void a(Packet packet) {

Datei anzeigen

@ -22,6 +22,7 @@ public class WorldServer extends World implements BlockChangeDelegate {
public boolean C; public boolean C;
private MinecraftServer D; private MinecraftServer D;
private EntityList E = new EntityList(); private EntityList E = new EntityList();
public PlayerManager manager; // Craftbukkit
public WorldServer(MinecraftServer minecraftserver, File file1, String s, int i) { public WorldServer(MinecraftServer minecraftserver, File file1, String s, int i) {
super(file1, s, (new Random()).nextLong(), WorldProvider.a(i)); super(file1, s, (new Random()).nextLong(), WorldProvider.a(i));
@ -30,6 +31,7 @@ public class WorldServer extends World implements BlockChangeDelegate {
// CraftBukkit start // CraftBukkit start
world = new CraftWorld(this); world = new CraftWorld(this);
server = minecraftserver.server; server = minecraftserver.server;
manager = new PlayerManager(minecraftserver, this);
} }
private final CraftWorld world; private final CraftWorld world;

Datei anzeigen

@ -123,7 +123,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
if (oldWorld != newWorld) { if (oldWorld != newWorld) {
manager.c.k.a(entity); manager.c.k.a(entity);
manager.c.k.b(entity); manager.c.k.b(entity);
manager.d.b(entity); oldWorld.manager.b(entity);
manager.b.remove(entity); manager.b.remove(entity);
oldWorld.e(entity); oldWorld.e(entity);
@ -136,7 +136,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
newWorld.A.d((int) location.getBlockX() >> 4, (int) location.getBlockZ() >> 4); newWorld.A.d((int) location.getBlockX() >> 4, (int) location.getBlockZ() >> 4);
newEntity.a.a(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch()); newEntity.a.a(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch());
manager.d.a(newEntity); newWorld.manager.a(newEntity);
newWorld.a(newEntity); newWorld.a(newEntity);
manager.b.add(newEntity); manager.b.add(newEntity);
newEntity.l(); newEntity.l();