Adding desperately needed async/sync documentation.
Dieser Commit ist enthalten in:
Ursprung
77376a2fa3
Commit
bc7b395889
@ -138,6 +138,9 @@ public interface ProtocolManager {
|
||||
|
||||
/**
|
||||
* Completely refresh all clients about an entity.
|
||||
* <p>
|
||||
* Note that this method is NOT thread safe. If you call this method from anything
|
||||
* but the main thread, it will throw an exception.
|
||||
* @param entity - entity to refresh.
|
||||
* @param observers - the clients to update.
|
||||
*/
|
||||
|
@ -31,6 +31,8 @@ public interface PacketListener {
|
||||
* Invoked right before a packet is transmitted from the server to the client.
|
||||
* <p>
|
||||
* Note that the packet may be replaced, if needed.
|
||||
* <p>
|
||||
* This method is executed on the main thread, and thus the Bukkit API is safe to use.
|
||||
*
|
||||
* @param event - the packet that should be sent.
|
||||
*/
|
||||
@ -38,6 +40,11 @@ public interface PacketListener {
|
||||
|
||||
/**
|
||||
* Invoked right before a recieved packet from a client is being processed.
|
||||
* <p>
|
||||
* <b>WARNING</b>: </br>
|
||||
* This method will be called <i>asynchronously</i>! You should synchronize with the main
|
||||
* thread using {@link org.bukkit.scheduler.BukkitScheduler#scheduleSyncDelayedTask(Plugin, Runnable, long) scheduleSyncDelayedTask}
|
||||
* if you need to call the Bukkit API.
|
||||
* @param event - the packet that has been recieved.
|
||||
*/
|
||||
public void onPacketReceiving(PacketEvent event);
|
||||
|
@ -343,6 +343,8 @@ public final class PacketFilterManager implements ProtocolManager {
|
||||
|
||||
@Override
|
||||
public void updateEntity(Entity entity, List<Player> observers) throws FieldAccessException {
|
||||
|
||||
|
||||
EntityUtilities.updateEntity(entity, observers);
|
||||
}
|
||||
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren