fixed ConcurrentModificationException for real
This commit is contained in:
parent
fd317f4158
commit
cbf3341320
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
|
@ -29,10 +29,8 @@ public class WorkerListenThread {
|
||||||
*/
|
*/
|
||||||
public void addPlayer(NetHandler par1NetServerHandler) {
|
public void addPlayer(NetHandler par1NetServerHandler) {
|
||||||
System.out.println("[Server][ADDPLAYER][" + par1NetServerHandler.getClass().getSimpleName() + "]");
|
System.out.println("[Server][ADDPLAYER][" + par1NetServerHandler.getClass().getSimpleName() + "]");
|
||||||
synchronized(this.connections) {
|
|
||||||
this.connections.add(par1NetServerHandler);
|
this.connections.add(par1NetServerHandler);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public void stopListening() {
|
public void stopListening() {
|
||||||
this.isListening = false;
|
this.isListening = false;
|
||||||
|
@ -81,18 +79,17 @@ public class WorkerListenThread {
|
||||||
* Handles all incoming connections and packets
|
* Handles all incoming connections and packets
|
||||||
*/
|
*/
|
||||||
public void handleNetworkListenThread() {
|
public void handleNetworkListenThread() {
|
||||||
synchronized(this.connections) {
|
|
||||||
|
|
||||||
deleteDeadConnections();
|
deleteDeadConnections();
|
||||||
|
|
||||||
for (NetHandler var2 : this.connections) {
|
List<NetHandler> conns = new ArrayList(this.connections);
|
||||||
|
for (NetHandler var2 : conns) {
|
||||||
var2.handlePackets();
|
var2.handlePackets();
|
||||||
}
|
}
|
||||||
|
|
||||||
deleteDeadConnections();
|
deleteDeadConnections();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public MinecraftServer getServer() {
|
public MinecraftServer getServer() {
|
||||||
return this.mcServer;
|
return this.mcServer;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user