diff options
author | Nassim Jahnke <[email protected]> | 2022-06-07 18:52:56 +0200 |
---|---|---|
committer | Nassim Jahnke <[email protected]> | 2022-06-07 18:52:56 +0200 |
commit | cb05aa6b8b312a8a99fe05b9ddb516d5466a0351 (patch) | |
tree | af13f78acc1f738e406e626cc9a0988698b79bdb /patches/api/0047-IllegalPacketEvent.patch | |
parent | 276d830d223ddf68611beacc248285ae5a4e8a1f (diff) | |
download | Paper-cb05aa6b8b312a8a99fe05b9ddb516d5466a0351.tar.gz Paper-cb05aa6b8b312a8a99fe05b9ddb516d5466a0351.zip |
Prepare for 1.19 dev
Diffstat (limited to 'patches/api/0047-IllegalPacketEvent.patch')
-rw-r--r-- | patches/api/0047-IllegalPacketEvent.patch | 89 |
1 files changed, 0 insertions, 89 deletions
diff --git a/patches/api/0047-IllegalPacketEvent.patch b/patches/api/0047-IllegalPacketEvent.patch deleted file mode 100644 index 7eb8d61aaa..0000000000 --- a/patches/api/0047-IllegalPacketEvent.patch +++ /dev/null @@ -1,89 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Aikar <[email protected]> -Date: Sun, 4 Dec 2016 01:19:14 -0500 -Subject: [PATCH] IllegalPacketEvent - -Fire an event when an illegal packet is received to let plugins handle it - -Lets plugins change the kick message and if it should kick or not. - -diff --git a/src/main/java/com/destroystokyo/paper/event/player/IllegalPacketEvent.java b/src/main/java/com/destroystokyo/paper/event/player/IllegalPacketEvent.java -new file mode 100644 -index 0000000000000000000000000000000000000000..8d8e9b16f2a6707d2af7567c7682dfc5db51a737 ---- /dev/null -+++ b/src/main/java/com/destroystokyo/paper/event/player/IllegalPacketEvent.java -@@ -0,0 +1,74 @@ -+package com.destroystokyo.paper.event.player; -+ -+import org.bukkit.Bukkit; -+import org.bukkit.entity.Player; -+import org.bukkit.event.HandlerList; -+import org.bukkit.event.player.PlayerEvent; -+import org.jetbrains.annotations.NotNull; -+import org.jetbrains.annotations.Nullable; -+ -+/** -+ * @deprecated Not used -+ */ -+@Deprecated -+public class IllegalPacketEvent extends PlayerEvent { -+ @Nullable private final String type; -+ @Nullable private final String ex; -+ @Nullable private String kickMessage; -+ private boolean shouldKick = true; -+ -+ public IllegalPacketEvent(@NotNull Player player, @Nullable String type, @Nullable String kickMessage, @NotNull Exception e) { -+ super(player); -+ this.type = type; -+ this.kickMessage = kickMessage; -+ this.ex = e.getMessage(); -+ } -+ -+ public boolean isShouldKick() { -+ return shouldKick; -+ } -+ -+ public void setShouldKick(boolean shouldKick) { -+ this.shouldKick = shouldKick; -+ } -+ -+ @Nullable -+ public String getKickMessage() { -+ return kickMessage; -+ } -+ -+ public void setKickMessage(@Nullable String kickMessage) { -+ this.kickMessage = kickMessage; -+ } -+ -+ @Nullable -+ public String getType() { -+ return type; -+ } -+ -+ @Nullable -+ public String getExceptionMessage() { -+ return ex; -+ } -+ -+ private static final HandlerList handlers = new HandlerList(); -+ -+ @NotNull -+ public HandlerList getHandlers() { -+ return handlers; -+ } -+ -+ @NotNull -+ public static HandlerList getHandlerList() { -+ return handlers; -+ } -+ -+ public static void process(@NotNull Player player, @Nullable String type, @Nullable String kickMessage, @NotNull Exception exception) { -+ IllegalPacketEvent event = new IllegalPacketEvent(player, type, kickMessage, exception); -+ event.callEvent(); -+ if (event.shouldKick) { -+ player.kickPlayer(kickMessage); -+ } -+ Bukkit.getLogger().severe(player.getName() + "/" + type + ": " + exception.getMessage()); -+ } -+} |