Class ProxyPackListener
java.lang.Object
de.themoep.resourcepacksplugin.core.SubChannelHandler<org.bukkit.entity.Player>
de.themoep.resourcepacksplugin.bukkit.listeners.ProxyPackListener
- All Implemented Interfaces:
org.bukkit.event.Listener
,org.bukkit.plugin.messaging.PluginMessageListener
public class ProxyPackListener
extends SubChannelHandler<org.bukkit.entity.Player>
implements org.bukkit.plugin.messaging.PluginMessageListener, org.bukkit.event.Listener
Created by Phoenix616 on 02.02.2016.
-
Field Summary
Fields inherited from class de.themoep.resourcepacksplugin.core.SubChannelHandler
MESSAGING_CHANNEL
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected String
loadKey()
Load the key from the storagevoid
onPlayerJoin
(org.bukkit.event.player.PlayerJoinEvent event) void
onPluginMessageReceived
(String channel, org.bukkit.entity.Player p, byte[] message) protected void
Save the key used for authenticating communicationprotected void
sendPluginMessage
(org.bukkit.entity.Player target, byte[] data) protected boolean
Check whether this implementation can trust the senderMethods inherited from class de.themoep.resourcepacksplugin.core.SubChannelHandler
acceptsNewKey, generateKey, handleMessage, readPack, registerSubChannel, reload, sendKey, sendMessage, setKey, writePack
-
Constructor Details
-
ProxyPackListener
-
-
Method Details
-
onPluginMessageReceived
- Specified by:
onPluginMessageReceived
in interfaceorg.bukkit.plugin.messaging.PluginMessageListener
-
onPlayerJoin
public void onPlayerJoin(org.bukkit.event.player.PlayerJoinEvent event) -
sendPluginMessage
protected void sendPluginMessage(org.bukkit.entity.Player target, byte[] data) - Specified by:
sendPluginMessage
in classSubChannelHandler<org.bukkit.entity.Player>
-
saveKey
Description copied from class:SubChannelHandler
Save the key used for authenticating communication- Specified by:
saveKey
in classSubChannelHandler<org.bukkit.entity.Player>
- Parameters:
key
- The key to set
-
loadKey
Description copied from class:SubChannelHandler
Load the key from the storage- Specified by:
loadKey
in classSubChannelHandler<org.bukkit.entity.Player>
- Returns:
- The key (or null if none is stored)
-
trustsSender
protected boolean trustsSender()Description copied from class:SubChannelHandler
Check whether this implementation can trust the sender- Overrides:
trustsSender
in classSubChannelHandler<org.bukkit.entity.Player>
- Returns:
- Whether the sender can be trusted or not
-