
walkmc.event.PacketSendEvent.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of walk-server Show documentation
Show all versions of walk-server Show documentation
A spigot fork to kotlin structure and news.
package walkmc.event
import com.google.common.io.*
import net.minecraft.server.*
import org.bukkit.entity.*
import walkmc.*
import walkmc.extensions.*
/**
* Represents a packet send event.
*
* This will be called when a packet is sended to a player.
*/
open class PacketSendEvent(val player: Player, var packet: Packet<*>) : CancellableEvent()
/**
* Represents a base class for any payload-related event.
*/
abstract class PayloadEvent(
val player: Player,
var channel: String,
val writer: ByteArrayDataOutput,
val message: ByteArray,
) : CancellableEvent() {
val reader = message.toDataInput()
}
/**
* Represents payload receive event.
*
* Called when a client receive a message from the server.
*/
open class PayloadReceiveEvent(
player: Player,
channel: String,
writer: ByteArrayDataOutput,
message: ByteArray,
) : PayloadEvent(player, channel, writer, message)
/**
* Represents payload send event.
*
* Called when a server send message to a client
*/
open class PayloadSendEvent(
player: Player,
channel: String,
writer: ByteArrayDataOutput,
message: ByteArray,
) : PayloadEvent(player, channel, writer, message)
© 2015 - 2025 Weber Informatics LLC | Privacy Policy