From 8f30199a22f1228bf3442b5e2e28ae16d3ff20fb Mon Sep 17 00:00:00 2001 From: "Kristian S. Stangeland" Date: Wed, 17 Jul 2013 05:51:22 +0200 Subject: [PATCH] Adding a packet handler adapter, for symmetri with PacketAdapter. --- .../protocol/events/PacketOutputAdapter.java | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 ProtocolLib/src/main/java/com/comphenix/protocol/events/PacketOutputAdapter.java diff --git a/ProtocolLib/src/main/java/com/comphenix/protocol/events/PacketOutputAdapter.java b/ProtocolLib/src/main/java/com/comphenix/protocol/events/PacketOutputAdapter.java new file mode 100644 index 00000000..4cf5d417 --- /dev/null +++ b/ProtocolLib/src/main/java/com/comphenix/protocol/events/PacketOutputAdapter.java @@ -0,0 +1,33 @@ +package com.comphenix.protocol.events; + +import org.bukkit.plugin.Plugin; + +/** + * Represents an adapter version of the output handler interface. + * + * @author Kristian + */ +public abstract class PacketOutputAdapter implements PacketOutputHandler { + private final Plugin plugin; + private final ListenerPriority priority; + + /** + * Construct a new packet output adapter with the given values. + * @param priority - the output handler priority. + * @param plugin - the owner plugin. + */ + public PacketOutputAdapter(Plugin plugin, ListenerPriority priority) { + this.priority = priority; + this.plugin = plugin; + } + + @Override + public Plugin getPlugin() { + return plugin; + } + + @Override + public ListenerPriority getPriority() { + return priority; + } +}