Implement new AsyncPlayerChatEvent. Addresses BUKKIT-2064
Added two utility collections for use with PlayerChatEvents allowing lazier initialization of events and less need to synchronize against the player list. Provided a hidden queue system for similar logic to pre-1.3 chat. When a plugin is listening for the deprecated PlayerChatEvent, all chat will be delayed to be mirror executed from the main thread. All developers are encouraged to immediately update to the developmental Bukkit chat API as a minimum transition for server stability. Additionally, changes were required to bring thread-safety to the flow logic. CopyOnWriteArrayList is the only viable means to produce thread safety with minimal diff; using a sane pre-implemented collection would require reworking of sections of NMS logic. As a minor change, implemented expected functionality for PlayerCommandPreProcessEvent. Setting the player should now change the player executing the command.
This commit is contained in:
@@ -30,7 +30,7 @@ public abstract class ServerConfigurationManagerAbstract {
|
||||
private static final SimpleDateFormat e = new SimpleDateFormat("yyyy-MM-dd \'at\' HH:mm:ss z");
|
||||
public static final Logger a = Logger.getLogger("Minecraft");
|
||||
private final MinecraftServer server;
|
||||
public final List players = new ArrayList();
|
||||
public final List players = new java.util.concurrent.CopyOnWriteArrayList(); // CraftBukkit - ArrayList -> CopyOnWriteArrayList: Iterator safety
|
||||
private final BanList banByName = new BanList(new File("banned-players.txt"));
|
||||
private final BanList banByIP = new BanList(new File("banned-ips.txt"));
|
||||
private Set operators = new HashSet();
|
||||
|
||||
Reference in New Issue
Block a user