Archiviert
13
0

Added a couple of extra constructors.

Dieser Commit ist enthalten in:
Kristian S. Stangeland 2012-10-17 05:58:47 +02:00
Ursprung 4717cca2ec
Commit 2b6a4570ab
3 geänderte Dateien mit 27 neuen und 2 gelöschten Zeilen

Datei anzeigen

@ -4,7 +4,7 @@
<groupId>com.comphenix.protocol</groupId> <groupId>com.comphenix.protocol</groupId>
<artifactId>ProtocolLib</artifactId> <artifactId>ProtocolLib</artifactId>
<name>ProtocolLib</name> <name>ProtocolLib</name>
<version>1.3.3-SNAPSHOT</version> <version>1.4.0</version>
<description>Provides read/write access to the Minecraft protocol.</description> <description>Provides read/write access to the Minecraft protocol.</description>
<url>http://dev.bukkit.org/server-mods/protocollib/</url> <url>http://dev.bukkit.org/server-mods/protocollib/</url>
<developers> <developers>

Datei anzeigen

@ -57,6 +57,19 @@ public abstract class PacketAdapter implements PacketListener {
this(plugin, connectionSide, listenerPriority, GamePhase.PLAYING, packets.toArray(new Integer[0])); this(plugin, connectionSide, listenerPriority, GamePhase.PLAYING, packets.toArray(new Integer[0]));
} }
/**
* Initialize a packet listener for a single connection side.
* <p>
* The game phase is used to optmize performance. A listener should only choose BOTH or LOGIN if it's absolutely necessary.
* @param plugin - the plugin that spawned this listener.
* @param connectionSide - the packet type the listener is looking for.
* @param gamePhase - which game phase this listener is active under.
* @param packets - the packet IDs the listener is looking for.
*/
public PacketAdapter(Plugin plugin, ConnectionSide connectionSide, GamePhase gamePhase, Set<Integer> packets) {
this(plugin, connectionSide, ListenerPriority.NORMAL, gamePhase, packets.toArray(new Integer[0]));
}
/** /**
* Initialize a packet listener for a single connection side. * Initialize a packet listener for a single connection side.
* <p> * <p>
@ -64,6 +77,7 @@ public abstract class PacketAdapter implements PacketListener {
* @param plugin - the plugin that spawned this listener. * @param plugin - the plugin that spawned this listener.
* @param connectionSide - the packet type the listener is looking for. * @param connectionSide - the packet type the listener is looking for.
* @param listenerPriority - the event priority. * @param listenerPriority - the event priority.
* @param gamePhase - which game phase this listener is active under.
* @param packets - the packet IDs the listener is looking for. * @param packets - the packet IDs the listener is looking for.
*/ */
public PacketAdapter(Plugin plugin, ConnectionSide connectionSide, ListenerPriority listenerPriority, GamePhase gamePhase, Set<Integer> packets) { public PacketAdapter(Plugin plugin, ConnectionSide connectionSide, ListenerPriority listenerPriority, GamePhase gamePhase, Set<Integer> packets) {
@ -81,6 +95,18 @@ public abstract class PacketAdapter implements PacketListener {
this(plugin, connectionSide, listenerPriority, GamePhase.PLAYING, packets); this(plugin, connectionSide, listenerPriority, GamePhase.PLAYING, packets);
} }
/**
* Initialize a packet listener for a single connection side.
* @param plugin - the plugin that spawned this listener.
* @param connectionSide - the packet type the listener is looking for.
* @param listenerPriority - the event priority.
* @param gamePhase - which game phase this listener is active under.
* @param packets - the packet IDs the listener is looking for.
*/
public PacketAdapter(Plugin plugin, ConnectionSide connectionSide, GamePhase gamePhase, Integer... packets) {
this(plugin, connectionSide, ListenerPriority.NORMAL, GamePhase.PLAYING, packets);
}
/** /**
* Initialize a packet listener for a single connection side. * Initialize a packet listener for a single connection side.
* <p> * <p>

Datei anzeigen

@ -19,7 +19,6 @@ package com.comphenix.protocol.injector.player;
import java.lang.reflect.InvocationTargetException; import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.util.Set;
import java.util.logging.Logger; import java.util.logging.Logger;
import net.minecraft.server.Packet; import net.minecraft.server.Packet;