From 3f41a42781bf6876f876ca59ddfba5e3c60c9bec Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Sat, 12 Jun 2021 13:18:01 +0200 Subject: [PATCH] More more work --- ...or-plugins-modifying-the-parent-of-t.patch | 234 +++++++++--------- .../Add-UnknownCommandEvent.patch | 0 .../Add-getI18NDisplayName-API.patch | 6 +- ...or-plugins-modifying-the-parent-of-t.patch | 117 +++++++++ ...low-plugins-to-use-SLF4J-for-logging.patch | 28 +-- .../Basic-PlayerProfile-API.patch | 0 .../Entity-fromMobSpawner.patch | 0 ...efixes-in-implementation-logging-con.patch | 0 .../Improve-the-Saddle-API-for-Horses.patch | 0 .../LivingEntity-setKiller.patch | 0 .../Make-plugins-list-alphabetical.patch | 0 .../PlayerAttemptPickupItemEvent.patch | 0 ...PlayerPickupItemEvent-setFlyAtPlayer.patch | 6 +- .../Profile-Lookup-Events.patch | 0 .../ProfileWhitelistVerifyEvent.patch | 0 .../Shoulder-Entities-Release-API.patch | 0 .../ensureServerConversions-API.patch | 13 +- .../Fix-MC-117075-TE-Unload-Lag-Spike.patch | 23 -- .../Add-UnknownCommandEvent.patch | 0 ...-a-custom-authentication-servers-dow.patch | 0 .../Basic-PlayerProfile-API.patch | 33 +-- ...player-logins-during-server-shutdown.patch | 0 .../Entity-fromMobSpawner.patch | 26 +- .../Fix-this-stupid-bullshit.patch | 2 +- ...mplement-ensureServerConversions-API.patch | 0 .../Implement-getI18NDisplayName.patch | 20 +- .../Improve-the-Saddle-API-for-Horses.patch | 2 +- .../LivingEntity-setKiller.patch | 4 +- ...awns-should-honor-nametags-and-leash.patch | 0 .../PlayerAttemptPickupItemEvent.patch | 0 .../Profile-Lookup-Events.patch | 0 .../ProfileWhitelistVerifyEvent.patch | 4 +- ...imer-when-spawner-event-is-cancelled.patch | 24 +- .../Shoulder-Entities-Release-API.patch | 4 +- 34 files changed, 301 insertions(+), 245 deletions(-) rename patches/{api-unmapped => api}/Add-UnknownCommandEvent.patch (100%) rename patches/{api-unmapped => api}/Add-getI18NDisplayName-API.patch (90%) create mode 100644 patches/api/Add-workaround-for-plugins-modifying-the-parent-of-t.patch rename patches/{api-unmapped => api}/Allow-plugins-to-use-SLF4J-for-logging.patch (74%) rename patches/{api-unmapped => api}/Basic-PlayerProfile-API.patch (100%) rename patches/{api-unmapped => api}/Entity-fromMobSpawner.patch (100%) rename patches/{api-unmapped => api}/Handle-plugin-prefixes-in-implementation-logging-con.patch (100%) rename patches/{api-unmapped => api}/Improve-the-Saddle-API-for-Horses.patch (100%) rename patches/{api-unmapped => api}/LivingEntity-setKiller.patch (100%) rename patches/{api-unmapped => api}/Make-plugins-list-alphabetical.patch (100%) rename patches/{api-unmapped => api}/PlayerAttemptPickupItemEvent.patch (100%) rename patches/{api-unmapped => api}/Profile-Lookup-Events.patch (100%) rename patches/{api-unmapped => api}/ProfileWhitelistVerifyEvent.patch (100%) rename patches/{api-unmapped => api}/Shoulder-Entities-Release-API.patch (100%) rename patches/{api-unmapped => api}/ensureServerConversions-API.patch (91%) delete mode 100644 patches/server-remapped/Fix-MC-117075-TE-Unload-Lag-Spike.patch rename patches/{server-remapped => server}/Add-UnknownCommandEvent.patch (100%) rename patches/{server-remapped => server}/Allow-specifying-a-custom-authentication-servers-dow.patch (100%) rename patches/{server-remapped => server}/Basic-PlayerProfile-API.patch (93%) rename patches/{server-remapped => server}/Block-player-logins-during-server-shutdown.patch (100%) rename patches/{server-remapped => server}/Entity-fromMobSpawner.patch (74%) rename patches/{server-remapped => server}/Fix-this-stupid-bullshit.patch (96%) rename patches/{server-remapped => server}/Implement-ensureServerConversions-API.patch (100%) rename patches/{server-remapped => server}/Implement-getI18NDisplayName.patch (71%) rename patches/{server-remapped => server}/Improve-the-Saddle-API-for-Horses.patch (97%) rename patches/{server-remapped => server}/LivingEntity-setKiller.patch (92%) rename patches/{server-remapped => server}/Ocelot-despawns-should-honor-nametags-and-leash.patch (100%) rename patches/{server-remapped => server}/PlayerAttemptPickupItemEvent.patch (100%) rename patches/{server-remapped => server}/Profile-Lookup-Events.patch (100%) rename patches/{server-remapped => server}/ProfileWhitelistVerifyEvent.patch (91%) rename patches/{server-remapped => server}/Reset-spawner-timer-when-spawner-event-is-cancelled.patch (54%) rename patches/{server-remapped => server}/Shoulder-Entities-Release-API.patch (96%) diff --git a/patches/api-unmapped/Add-workaround-for-plugins-modifying-the-parent-of-t.patch b/patches/api-unmapped/Add-workaround-for-plugins-modifying-the-parent-of-t.patch index 2406cc6426..354112bc8f 100644 --- a/patches/api-unmapped/Add-workaround-for-plugins-modifying-the-parent-of-t.patch +++ b/patches/api-unmapped/Add-workaround-for-plugins-modifying-the-parent-of-t.patch @@ -1,117 +1,117 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Minecrell -Date: Thu, 21 Sep 2017 19:41:20 +0200 -Subject: [PATCH] Add workaround for plugins modifying the parent of the plugin - logger - -Essentials uses a custom logger name ("Essentials") instead of the -plugin logger. Log messages are redirected to the plugin logger by -setting the parent of the "Essentials" logger to the plugin logger. - -With our changes, the plugin logger is now also called "Essentials", -resulting in an infinite loop. Make sure plugins can't change the -parent of the plugin logger to avoid this. - -diff --git a/src/main/java/com/destroystokyo/paper/utils/PaperPluginLogger.java b/src/main/java/com/destroystokyo/paper/utils/PaperPluginLogger.java -new file mode 100644 -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 ---- /dev/null -+++ b/src/main/java/com/destroystokyo/paper/utils/PaperPluginLogger.java -@@ -0,0 +0,0 @@ -+package com.destroystokyo.paper.utils; -+ -+import org.bukkit.plugin.PluginDescriptionFile; -+ -+import java.util.logging.Level; -+import java.util.logging.LogManager; -+import java.util.logging.Logger; -+import org.jetbrains.annotations.NotNull; -+ -+/** -+ * Prevents plugins (e.g. Essentials) from changing the parent of the plugin logger. -+ */ -+public class PaperPluginLogger extends Logger { -+ -+ @NotNull -+ public static Logger getLogger(@NotNull PluginDescriptionFile description) { -+ Logger logger = new PaperPluginLogger(description); -+ if (!LogManager.getLogManager().addLogger(logger)) { -+ // Disable this if it's going to happen across reloads anyways... -+ //logger.log(Level.WARNING, "Could not insert plugin logger - one was already found: {}", LogManager.getLogManager().getLogger(this.getName())); -+ logger = LogManager.getLogManager().getLogger(description.getPrefix() != null ? description.getPrefix() : description.getName()); -+ } -+ -+ return logger; -+ } -+ -+ private PaperPluginLogger(@NotNull PluginDescriptionFile description) { -+ super(description.getPrefix() != null ? description.getPrefix() : description.getName(), null); -+ } -+ -+ @Override -+ public void setParent(@NotNull Logger parent) { -+ if (getParent() != null) { -+ warning("Ignoring attempt to change parent of plugin logger"); -+ } else { -+ this.log(Level.FINE, "Setting plugin logger parent to {0}", parent); -+ super.setParent(parent); -+ } -+ } -+ -+} -diff --git a/src/main/java/org/bukkit/plugin/java/JavaPlugin.java b/src/main/java/org/bukkit/plugin/java/JavaPlugin.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/org/bukkit/plugin/java/JavaPlugin.java -+++ b/src/main/java/org/bukkit/plugin/java/JavaPlugin.java -@@ -0,0 +0,0 @@ public abstract class JavaPlugin extends PluginBase { - private boolean naggable = true; - private FileConfiguration newConfig = null; - private File configFile = null; -- private Logger logger = null; // Paper - PluginLogger -> Logger -+ Logger logger = null; // Paper - PluginLogger -> Logger, package-private - - public JavaPlugin() { - final ClassLoader classLoader = this.getClass().getClassLoader(); -@@ -0,0 +0,0 @@ public abstract class JavaPlugin extends PluginBase { - this.dataFolder = dataFolder; - this.classLoader = classLoader; - this.configFile = new File(dataFolder, "config.yml"); -- // Paper - Handle plugin prefix in implementation -- this.logger = Logger.getLogger(description.getPrefix() != null ? description.getPrefix() : description.getName()); -+ // Paper start -+ if (this.logger == null) { -+ this.logger = com.destroystokyo.paper.utils.PaperPluginLogger.getLogger(this.description); -+ } -+ // Paper end - } - - /** -diff --git a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java -+++ b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java -@@ -0,0 +0,0 @@ public final class PluginClassLoader extends URLClassLoader { // Spigot - private JavaPlugin pluginInit; - private IllegalStateException pluginState; - private final Set seenIllegalAccess = Collections.newSetFromMap(new ConcurrentHashMap<>()); -+ private java.util.logging.Logger logger; // Paper - add field - - static { - ClassLoader.registerAsParallelCapable(); -@@ -0,0 +0,0 @@ public final class PluginClassLoader extends URLClassLoader { // Spigot - this.url = file.toURI().toURL(); - this.libraryLoader = libraryLoader; - -+ this.logger = com.destroystokyo.paper.utils.PaperPluginLogger.getLogger(description); // Paper - Register logger early -+ - try { - Class jarClass; - try { -@@ -0,0 +0,0 @@ public final class PluginClassLoader extends URLClassLoader { // Spigot - pluginState = new IllegalStateException("Initial initialization"); - this.pluginInit = javaPlugin; - -+ javaPlugin.logger = this.logger; // Paper - set logger - javaPlugin.init(loader, loader.server, description, dataFolder, file, this); - } - } +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Minecrell +Date: Thu, 21 Sep 2017 19:41:20 +0200 +Subject: [PATCH] Add workaround for plugins modifying the parent of the plugin + logger + +Essentials uses a custom logger name ("Essentials") instead of the +plugin logger. Log messages are redirected to the plugin logger by +setting the parent of the "Essentials" logger to the plugin logger. + +With our changes, the plugin logger is now also called "Essentials", +resulting in an infinite loop. Make sure plugins can't change the +parent of the plugin logger to avoid this. + +diff --git a/src/main/java/com/destroystokyo/paper/utils/PaperPluginLogger.java b/src/main/java/com/destroystokyo/paper/utils/PaperPluginLogger.java +new file mode 100644 +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 +--- /dev/null ++++ b/src/main/java/com/destroystokyo/paper/utils/PaperPluginLogger.java +@@ -0,0 +0,0 @@ ++package com.destroystokyo.paper.utils; ++ ++import org.bukkit.plugin.PluginDescriptionFile; ++ ++import java.util.logging.Level; ++import java.util.logging.LogManager; ++import java.util.logging.Logger; ++import org.jetbrains.annotations.NotNull; ++ ++/** ++ * Prevents plugins (e.g. Essentials) from changing the parent of the plugin logger. ++ */ ++public class PaperPluginLogger extends Logger { ++ ++ @NotNull ++ public static Logger getLogger(@NotNull PluginDescriptionFile description) { ++ Logger logger = new PaperPluginLogger(description); ++ if (!LogManager.getLogManager().addLogger(logger)) { ++ // Disable this if it's going to happen across reloads anyways... ++ //logger.log(Level.WARNING, "Could not insert plugin logger - one was already found: {}", LogManager.getLogManager().getLogger(this.getName())); ++ logger = LogManager.getLogManager().getLogger(description.getPrefix() != null ? description.getPrefix() : description.getName()); ++ } ++ ++ return logger; ++ } ++ ++ private PaperPluginLogger(@NotNull PluginDescriptionFile description) { ++ super(description.getPrefix() != null ? description.getPrefix() : description.getName(), null); ++ } ++ ++ @Override ++ public void setParent(@NotNull Logger parent) { ++ if (getParent() != null) { ++ warning("Ignoring attempt to change parent of plugin logger"); ++ } else { ++ this.log(Level.FINE, "Setting plugin logger parent to {0}", parent); ++ super.setParent(parent); ++ } ++ } ++ ++} +diff --git a/src/main/java/org/bukkit/plugin/java/JavaPlugin.java b/src/main/java/org/bukkit/plugin/java/JavaPlugin.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/plugin/java/JavaPlugin.java ++++ b/src/main/java/org/bukkit/plugin/java/JavaPlugin.java +@@ -0,0 +0,0 @@ public abstract class JavaPlugin extends PluginBase { + private boolean naggable = true; + private FileConfiguration newConfig = null; + private File configFile = null; +- private Logger logger = null; // Paper - PluginLogger -> Logger ++ Logger logger = null; // Paper - PluginLogger -> Logger, package-private + + public JavaPlugin() { + final ClassLoader classLoader = this.getClass().getClassLoader(); +@@ -0,0 +0,0 @@ public abstract class JavaPlugin extends PluginBase { + this.dataFolder = dataFolder; + this.classLoader = classLoader; + this.configFile = new File(dataFolder, "config.yml"); +- // Paper - Handle plugin prefix in implementation +- this.logger = Logger.getLogger(description.getPrefix() != null ? description.getPrefix() : description.getName()); ++ // Paper start ++ if (this.logger == null) { ++ this.logger = com.destroystokyo.paper.utils.PaperPluginLogger.getLogger(this.description); ++ } ++ // Paper end + } + + /** +diff --git a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java ++++ b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java +@@ -0,0 +0,0 @@ public final class PluginClassLoader extends URLClassLoader { // Spigot + private JavaPlugin pluginInit; + private IllegalStateException pluginState; + private final Set seenIllegalAccess = Collections.newSetFromMap(new ConcurrentHashMap<>()); ++ private java.util.logging.Logger logger; // Paper - add field + + static { + ClassLoader.registerAsParallelCapable(); +@@ -0,0 +0,0 @@ public final class PluginClassLoader extends URLClassLoader { // Spigot + this.url = file.toURI().toURL(); + this.libraryLoader = libraryLoader; + ++ this.logger = com.destroystokyo.paper.utils.PaperPluginLogger.getLogger(description); // Paper - Register logger early ++ + try { + Class jarClass; + try { +@@ -0,0 +0,0 @@ public final class PluginClassLoader extends URLClassLoader { // Spigot + pluginState = new IllegalStateException("Initial initialization"); + this.pluginInit = javaPlugin; + ++ javaPlugin.logger = this.logger; // Paper - set logger + javaPlugin.init(loader, loader.server, description, dataFolder, file, this); + } + } diff --git a/patches/api-unmapped/Add-UnknownCommandEvent.patch b/patches/api/Add-UnknownCommandEvent.patch similarity index 100% rename from patches/api-unmapped/Add-UnknownCommandEvent.patch rename to patches/api/Add-UnknownCommandEvent.patch diff --git a/patches/api-unmapped/Add-getI18NDisplayName-API.patch b/patches/api/Add-getI18NDisplayName-API.patch similarity index 90% rename from patches/api-unmapped/Add-getI18NDisplayName-API.patch rename to patches/api/Add-getI18NDisplayName-API.patch index ab34aeefde..bc3a4e72e8 100644 --- a/patches/api-unmapped/Add-getI18NDisplayName-API.patch +++ b/patches/api/Add-getI18NDisplayName-API.patch @@ -14,7 +14,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @@ -0,0 +0,0 @@ public interface ItemFactory { */ @NotNull - ItemStack ensureServerConversions(@NotNull ItemStack item); + net.kyori.adventure.text.Component displayName(@NotNull ItemStack itemStack); + + /** + * Gets the Display name as seen in the Client. @@ -33,8 +33,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/org/bukkit/inventory/ItemStack.java +++ b/src/main/java/org/bukkit/inventory/ItemStack.java @@ -0,0 +0,0 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, net.kyor - public ItemStack ensureServerConversions() { - return Bukkit.getServer().getItemFactory().ensureServerConversions(this); + public @NotNull net.kyori.adventure.text.Component displayName() { + return Bukkit.getServer().getItemFactory().displayName(this); } + + /** diff --git a/patches/api/Add-workaround-for-plugins-modifying-the-parent-of-t.patch b/patches/api/Add-workaround-for-plugins-modifying-the-parent-of-t.patch new file mode 100644 index 0000000000..2406cc6426 --- /dev/null +++ b/patches/api/Add-workaround-for-plugins-modifying-the-parent-of-t.patch @@ -0,0 +1,117 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Minecrell +Date: Thu, 21 Sep 2017 19:41:20 +0200 +Subject: [PATCH] Add workaround for plugins modifying the parent of the plugin + logger + +Essentials uses a custom logger name ("Essentials") instead of the +plugin logger. Log messages are redirected to the plugin logger by +setting the parent of the "Essentials" logger to the plugin logger. + +With our changes, the plugin logger is now also called "Essentials", +resulting in an infinite loop. Make sure plugins can't change the +parent of the plugin logger to avoid this. + +diff --git a/src/main/java/com/destroystokyo/paper/utils/PaperPluginLogger.java b/src/main/java/com/destroystokyo/paper/utils/PaperPluginLogger.java +new file mode 100644 +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 +--- /dev/null ++++ b/src/main/java/com/destroystokyo/paper/utils/PaperPluginLogger.java +@@ -0,0 +0,0 @@ ++package com.destroystokyo.paper.utils; ++ ++import org.bukkit.plugin.PluginDescriptionFile; ++ ++import java.util.logging.Level; ++import java.util.logging.LogManager; ++import java.util.logging.Logger; ++import org.jetbrains.annotations.NotNull; ++ ++/** ++ * Prevents plugins (e.g. Essentials) from changing the parent of the plugin logger. ++ */ ++public class PaperPluginLogger extends Logger { ++ ++ @NotNull ++ public static Logger getLogger(@NotNull PluginDescriptionFile description) { ++ Logger logger = new PaperPluginLogger(description); ++ if (!LogManager.getLogManager().addLogger(logger)) { ++ // Disable this if it's going to happen across reloads anyways... ++ //logger.log(Level.WARNING, "Could not insert plugin logger - one was already found: {}", LogManager.getLogManager().getLogger(this.getName())); ++ logger = LogManager.getLogManager().getLogger(description.getPrefix() != null ? description.getPrefix() : description.getName()); ++ } ++ ++ return logger; ++ } ++ ++ private PaperPluginLogger(@NotNull PluginDescriptionFile description) { ++ super(description.getPrefix() != null ? description.getPrefix() : description.getName(), null); ++ } ++ ++ @Override ++ public void setParent(@NotNull Logger parent) { ++ if (getParent() != null) { ++ warning("Ignoring attempt to change parent of plugin logger"); ++ } else { ++ this.log(Level.FINE, "Setting plugin logger parent to {0}", parent); ++ super.setParent(parent); ++ } ++ } ++ ++} +diff --git a/src/main/java/org/bukkit/plugin/java/JavaPlugin.java b/src/main/java/org/bukkit/plugin/java/JavaPlugin.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/plugin/java/JavaPlugin.java ++++ b/src/main/java/org/bukkit/plugin/java/JavaPlugin.java +@@ -0,0 +0,0 @@ public abstract class JavaPlugin extends PluginBase { + private boolean naggable = true; + private FileConfiguration newConfig = null; + private File configFile = null; +- private Logger logger = null; // Paper - PluginLogger -> Logger ++ Logger logger = null; // Paper - PluginLogger -> Logger, package-private + + public JavaPlugin() { + final ClassLoader classLoader = this.getClass().getClassLoader(); +@@ -0,0 +0,0 @@ public abstract class JavaPlugin extends PluginBase { + this.dataFolder = dataFolder; + this.classLoader = classLoader; + this.configFile = new File(dataFolder, "config.yml"); +- // Paper - Handle plugin prefix in implementation +- this.logger = Logger.getLogger(description.getPrefix() != null ? description.getPrefix() : description.getName()); ++ // Paper start ++ if (this.logger == null) { ++ this.logger = com.destroystokyo.paper.utils.PaperPluginLogger.getLogger(this.description); ++ } ++ // Paper end + } + + /** +diff --git a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java ++++ b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java +@@ -0,0 +0,0 @@ public final class PluginClassLoader extends URLClassLoader { // Spigot + private JavaPlugin pluginInit; + private IllegalStateException pluginState; + private final Set seenIllegalAccess = Collections.newSetFromMap(new ConcurrentHashMap<>()); ++ private java.util.logging.Logger logger; // Paper - add field + + static { + ClassLoader.registerAsParallelCapable(); +@@ -0,0 +0,0 @@ public final class PluginClassLoader extends URLClassLoader { // Spigot + this.url = file.toURI().toURL(); + this.libraryLoader = libraryLoader; + ++ this.logger = com.destroystokyo.paper.utils.PaperPluginLogger.getLogger(description); // Paper - Register logger early ++ + try { + Class jarClass; + try { +@@ -0,0 +0,0 @@ public final class PluginClassLoader extends URLClassLoader { // Spigot + pluginState = new IllegalStateException("Initial initialization"); + this.pluginInit = javaPlugin; + ++ javaPlugin.logger = this.logger; // Paper - set logger + javaPlugin.init(loader, loader.server, description, dataFolder, file, this); + } + } diff --git a/patches/api-unmapped/Allow-plugins-to-use-SLF4J-for-logging.patch b/patches/api/Allow-plugins-to-use-SLF4J-for-logging.patch similarity index 74% rename from patches/api-unmapped/Allow-plugins-to-use-SLF4J-for-logging.patch rename to patches/api/Allow-plugins-to-use-SLF4J-for-logging.patch index 648442db18..5c67078293 100644 --- a/patches/api-unmapped/Allow-plugins-to-use-SLF4J-for-logging.patch +++ b/patches/api/Allow-plugins-to-use-SLF4J-for-logging.patch @@ -13,24 +13,18 @@ Expose SLF4J as optional logging API for plugins, so they can use it without having to shade it in the plugin and going through several layers of logging abstraction. -diff --git a/pom.xml b/pom.xml +diff --git a/build.gradle.kts b/build.gradle.kts index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/pom.xml -+++ b/pom.xml -@@ -0,0 +0,0 @@ - 21.0.1 - provided - -+ -+ -+ org.slf4j -+ slf4j-api -+ 1.7.25 -+ compile -+ - - - junit +--- a/build.gradle.kts ++++ b/build.gradle.kts +@@ -0,0 +0,0 @@ dependencies { + api("net.kyori:adventure-text-serializer-plain") + api("org.ow2.asm:asm:9.0") + api("org.ow2.asm:asm-commons:9.0") ++ api("org.apache.logging.log4j:log4j-api:2.14.1") // Paper + + compileOnly("org.apache.maven:maven-resolver-provider:3.8.1") + compileOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.7.0") diff --git a/src/main/java/org/bukkit/plugin/Plugin.java b/src/main/java/org/bukkit/plugin/Plugin.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/plugin/Plugin.java diff --git a/patches/api-unmapped/Basic-PlayerProfile-API.patch b/patches/api/Basic-PlayerProfile-API.patch similarity index 100% rename from patches/api-unmapped/Basic-PlayerProfile-API.patch rename to patches/api/Basic-PlayerProfile-API.patch diff --git a/patches/api-unmapped/Entity-fromMobSpawner.patch b/patches/api/Entity-fromMobSpawner.patch similarity index 100% rename from patches/api-unmapped/Entity-fromMobSpawner.patch rename to patches/api/Entity-fromMobSpawner.patch diff --git a/patches/api-unmapped/Handle-plugin-prefixes-in-implementation-logging-con.patch b/patches/api/Handle-plugin-prefixes-in-implementation-logging-con.patch similarity index 100% rename from patches/api-unmapped/Handle-plugin-prefixes-in-implementation-logging-con.patch rename to patches/api/Handle-plugin-prefixes-in-implementation-logging-con.patch diff --git a/patches/api-unmapped/Improve-the-Saddle-API-for-Horses.patch b/patches/api/Improve-the-Saddle-API-for-Horses.patch similarity index 100% rename from patches/api-unmapped/Improve-the-Saddle-API-for-Horses.patch rename to patches/api/Improve-the-Saddle-API-for-Horses.patch diff --git a/patches/api-unmapped/LivingEntity-setKiller.patch b/patches/api/LivingEntity-setKiller.patch similarity index 100% rename from patches/api-unmapped/LivingEntity-setKiller.patch rename to patches/api/LivingEntity-setKiller.patch diff --git a/patches/api-unmapped/Make-plugins-list-alphabetical.patch b/patches/api/Make-plugins-list-alphabetical.patch similarity index 100% rename from patches/api-unmapped/Make-plugins-list-alphabetical.patch rename to patches/api/Make-plugins-list-alphabetical.patch diff --git a/patches/api-unmapped/PlayerAttemptPickupItemEvent.patch b/patches/api/PlayerAttemptPickupItemEvent.patch similarity index 100% rename from patches/api-unmapped/PlayerAttemptPickupItemEvent.patch rename to patches/api/PlayerAttemptPickupItemEvent.patch diff --git a/patches/api/PlayerPickupItemEvent-setFlyAtPlayer.patch b/patches/api/PlayerPickupItemEvent-setFlyAtPlayer.patch index 62d8f08dc2..71a965b6fc 100644 --- a/patches/api/PlayerPickupItemEvent-setFlyAtPlayer.patch +++ b/patches/api/PlayerPickupItemEvent-setFlyAtPlayer.patch @@ -15,11 +15,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + private boolean flyAtPlayer = true; // Paper private boolean cancel = false; private final int remaining; - + @@ -0,0 +0,0 @@ public class PlayerPickupItemEvent extends PlayerEvent implements Cancellable { return remaining; } - + + // Paper Start + /** + * Set if the item will fly at the player @@ -50,5 +50,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 this.cancel = cancel; + this.flyAtPlayer = !cancel; // Paper } - + @NotNull diff --git a/patches/api-unmapped/Profile-Lookup-Events.patch b/patches/api/Profile-Lookup-Events.patch similarity index 100% rename from patches/api-unmapped/Profile-Lookup-Events.patch rename to patches/api/Profile-Lookup-Events.patch diff --git a/patches/api-unmapped/ProfileWhitelistVerifyEvent.patch b/patches/api/ProfileWhitelistVerifyEvent.patch similarity index 100% rename from patches/api-unmapped/ProfileWhitelistVerifyEvent.patch rename to patches/api/ProfileWhitelistVerifyEvent.patch diff --git a/patches/api-unmapped/Shoulder-Entities-Release-API.patch b/patches/api/Shoulder-Entities-Release-API.patch similarity index 100% rename from patches/api-unmapped/Shoulder-Entities-Release-API.patch rename to patches/api/Shoulder-Entities-Release-API.patch diff --git a/patches/api-unmapped/ensureServerConversions-API.patch b/patches/api/ensureServerConversions-API.patch similarity index 91% rename from patches/api-unmapped/ensureServerConversions-API.patch rename to patches/api/ensureServerConversions-API.patch index 55f425d4d7..374584c2b8 100644 --- a/patches/api-unmapped/ensureServerConversions-API.patch +++ b/patches/api/ensureServerConversions-API.patch @@ -12,8 +12,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +++ b/src/main/java/org/bukkit/inventory/ItemFactory.java @@ -0,0 +0,0 @@ public interface ItemFactory { */ - @NotNull - net.kyori.adventure.text.Component displayName(@NotNull ItemStack itemStack); + @Nullable + String getI18NDisplayName(@Nullable ItemStack item); + + /** + * Minecraft updates are converting simple item stacks into more complex NBT oriented Item Stacks. @@ -42,10 +42,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 /** @@ -0,0 +0,0 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, net.kyor - public @NotNull net.kyori.adventure.text.Component displayName() { return Bukkit.getServer().getItemFactory().displayName(this); } -+ + + /** + * Minecraft updates are converting simple item stacks into more complex NBT oriented Item Stacks. + * @@ -58,5 +57,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + public ItemStack ensureServerConversions() { + return Bukkit.getServer().getItemFactory().ensureServerConversions(this); + } - // Paper end - } ++ + /** + * Gets the Display name as seen in the Client. + * Currently the server only supports the English language. To override this, diff --git a/patches/server-remapped/Fix-MC-117075-TE-Unload-Lag-Spike.patch b/patches/server-remapped/Fix-MC-117075-TE-Unload-Lag-Spike.patch deleted file mode 100644 index 4cf025d7f5..0000000000 --- a/patches/server-remapped/Fix-MC-117075-TE-Unload-Lag-Spike.patch +++ /dev/null @@ -1,23 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: mezz -Date: Wed, 9 Aug 2017 17:51:22 -0500 -Subject: [PATCH] Fix MC-117075: TE Unload Lag Spike - - -diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/world/level/Level.java -+++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -0,0 +0,0 @@ public abstract class Level implements LevelAccessor, AutoCloseable { - gameprofilerfiller.push("blockEntities"); - timings.tileEntityTick.startTiming(); // Spigot - if (!this.tileEntityListUnload.isEmpty()) { -- this.tickableBlockEntities.removeAll(this.tileEntityListUnload); -+ // Paper start - Use alternate implementation with faster contains -+ java.util.Set toRemove = java.util.Collections.newSetFromMap(new java.util.IdentityHashMap<>()); -+ toRemove.addAll(tileEntityListUnload); -+ this.tickableBlockEntities.removeAll(toRemove); -+ // Paper end - //this.tileEntityList.removeAll(this.tileEntityListUnload); // Paper - remove unused list - this.tileEntityListUnload.clear(); - } diff --git a/patches/server-remapped/Add-UnknownCommandEvent.patch b/patches/server/Add-UnknownCommandEvent.patch similarity index 100% rename from patches/server-remapped/Add-UnknownCommandEvent.patch rename to patches/server/Add-UnknownCommandEvent.patch diff --git a/patches/server-remapped/Allow-specifying-a-custom-authentication-servers-dow.patch b/patches/server/Allow-specifying-a-custom-authentication-servers-dow.patch similarity index 100% rename from patches/server-remapped/Allow-specifying-a-custom-authentication-servers-dow.patch rename to patches/server/Allow-specifying-a-custom-authentication-servers-dow.patch diff --git a/patches/server-remapped/Basic-PlayerProfile-API.patch b/patches/server/Basic-PlayerProfile-API.patch similarity index 93% rename from patches/server-remapped/Basic-PlayerProfile-API.patch rename to patches/server/Basic-PlayerProfile-API.patch index 311030e827..0fec9ba8a7 100644 --- a/patches/server-remapped/Basic-PlayerProfile-API.patch +++ b/patches/server/Basic-PlayerProfile-API.patch @@ -13,8 +13,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @@ -0,0 +0,0 @@ +package com.destroystokyo.paper.profile; + -+import PlayerProfile; -+import ProfileProperty; ++import com.destroystokyo.paper.profile.PlayerProfile; ++import com.destroystokyo.paper.profile.ProfileProperty; +import com.destroystokyo.paper.PaperConfig; +import com.google.common.base.Charsets; +import com.mojang.authlib.GameProfile; @@ -207,7 +207,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + copyProfileProperties(result, this.profile, true); + } + if (this.profile.isComplete()) { -+ server.getProfileCache().saveProfile(this.profile); ++ server.getProfileCache().add(this.profile); + } + } + return profile.isComplete() && (!onlineMode || !textures || hasTextures()); @@ -436,7 +436,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @@ -0,0 +0,0 @@ package net.minecraft.server; - import com.destroystokyo.paper.block.TargetBlockInfo; +import com.destroystokyo.paper.profile.CraftPlayerProfile; +import com.destroystokyo.paper.profile.PlayerProfile; import com.google.common.util.concurrent.ThreadFactoryBuilder; @@ -478,30 +477,21 @@ diff --git a/src/main/java/net/minecraft/server/players/GameProfileCache.java b/ index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/players/GameProfileCache.java +++ b/src/main/java/net/minecraft/server/players/GameProfileCache.java -@@ -0,0 +0,0 @@ public class GameProfileCache { - - private static final Logger LOGGER = LogManager.getLogger(); - private static boolean usesAuthentication; -- private final Map profilesByName = Maps.newConcurrentMap(); -+ private final Map profilesByName = Maps.newConcurrentMap();private final Map nameCache = profilesByName; // Paper - OBFHELPER // Paper - private final Map profilesByUUID = Maps.newConcurrentMap(); - private final GameProfileRepository profileRepository; - private final Gson gson = (new GsonBuilder()).create(); @@ -0,0 +0,0 @@ public class GameProfileCache { return com.destroystokyo.paper.PaperConfig.isProxyOnlineMode(); // Paper } -+ public void saveProfile(GameProfile gameprofile) { add(gameprofile); } // Paper - OBFHELPER - public synchronized void add(GameProfile gameprofile) { // Paper - synchronize ++ @Deprecated public void saveProfile(GameProfile gameprofile) { add(gameprofile); } // Paper - OBFHELPER + public synchronized void add(GameProfile profile) { // Paper - synchronize Calendar calendar = Calendar.getInstance(); @@ -0,0 +0,0 @@ public class GameProfileCache { - return gameprofile; + } } + // Paper start + @Nullable public GameProfile getProfileIfCached(String name) { -+ GameProfileCache.GameProfileInfo entry = this.nameCache.get(name.toLowerCase(Locale.ROOT)); ++ GameProfileCache.GameProfileInfo entry = this.profilesByName.get(name.toLowerCase(Locale.ROOT)); + return entry == null ? null : entry.getProfile(); + } + // Paper end @@ -509,15 +499,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @Nullable public GameProfile get(UUID uuid) { GameProfileCache.GameProfileInfo usercache_usercacheentry = (GameProfileCache.GameProfileInfo) this.profilesByUUID.get(uuid); -@@ -0,0 +0,0 @@ public class GameProfileCache { - - static class GameProfileInfo { - -- private final GameProfile profile; -+ private final GameProfile profile;public GameProfile getProfile() { return profile; } // Paper - OBFHELPER - private final Date expirationDate; - private volatile long lastAccess; - diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/patches/server-remapped/Block-player-logins-during-server-shutdown.patch b/patches/server/Block-player-logins-during-server-shutdown.patch similarity index 100% rename from patches/server-remapped/Block-player-logins-during-server-shutdown.patch rename to patches/server/Block-player-logins-during-server-shutdown.patch diff --git a/patches/server-remapped/Entity-fromMobSpawner.patch b/patches/server/Entity-fromMobSpawner.patch similarity index 74% rename from patches/server-remapped/Entity-fromMobSpawner.patch rename to patches/server/Entity-fromMobSpawner.patch index e313fec8bb..6ecce72fa1 100644 --- a/patches/server-remapped/Entity-fromMobSpawner.patch +++ b/patches/server/Entity-fromMobSpawner.patch @@ -8,7 +8,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/jav index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, CommandSource, net.minecraft.s +@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n public final org.spigotmc.ActivationRange.ActivationType activationType = org.spigotmc.ActivationRange.initializeEntityActivationType(this); public final boolean defaultActivationState; public long activatedTick = Integer.MIN_VALUE; @@ -16,23 +16,23 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 protected int numCollisions = 0; // Paper public void inactiveTick() { } // Spigot end -@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, CommandSource, net.minecraft.s - tag.setUUID("Paper.OriginWorld", origin.getWorld().getUID()); - tag.put("Paper.Origin", this.createList(origin.getX(), origin.getY(), origin.getZ())); +@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n + nbt.setUUID("Paper.OriginWorld", origin.getWorld().getUID()); + nbt.put("Paper.Origin", this.newDoubleList(origin.getX(), origin.getY(), origin.getZ())); } + // Save entity's from mob spawner status + if (spawnedViaMobSpawner) { -+ tag.putBoolean("Paper.FromMobSpawner", true); ++ nbt.putBoolean("Paper.FromMobSpawner", true); + } // Paper end - return tag; + return nbt; } catch (Throwable throwable) { -@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, CommandSource, net.minecraft.s +@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n } origin = new org.bukkit.Location(originWorld, originTag.getDoubleAt(0), originTag.getDoubleAt(1), originTag.getDoubleAt(2)); } + -+ spawnedViaMobSpawner = tag.getBoolean("Paper.FromMobSpawner"); // Restore entity's from mob spawner status ++ spawnedViaMobSpawner = nbt.getBoolean("Paper.FromMobSpawner"); // Restore entity's from mob spawner status // Paper end } catch (Throwable throwable) { @@ -41,13 +41,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/world/level/BaseSpawner.java +++ b/src/main/java/net/minecraft/world/level/BaseSpawner.java @@ -0,0 +0,0 @@ public abstract class BaseSpawner { - } - // Spigot End + if (this.nextSpawnData.getTag().size() == 1 && this.nextSpawnData.getTag().contains("id", 8)) { + ((Mob) entity).finalizeSpawn(world, world.getCurrentDifficultyAt(entity.blockPosition()), MobSpawnType.SPAWNER, (SpawnGroupData) null, (CompoundTag) null); } -+ entity.spawnedViaMobSpawner = true; // Paper ++ entity.spawnedViaMobSpawner = true; // Paper // Spigot Start - if (org.bukkit.craftbukkit.event.CraftEventFactory.callSpawnerSpawnEvent(entity, blockposition).isCancelled()) { - Entity vehicle = entity.getVehicle(); + if (entityinsentient.level.spigotConfig.nerfSpawnerMobs) { + entityinsentient.aware = false; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java diff --git a/patches/server-remapped/Fix-this-stupid-bullshit.patch b/patches/server/Fix-this-stupid-bullshit.patch similarity index 96% rename from patches/server-remapped/Fix-this-stupid-bullshit.patch rename to patches/server/Fix-this-stupid-bullshit.patch index dbed0057de..df33fd65b8 100644 --- a/patches/server-remapped/Fix-this-stupid-bullshit.patch +++ b/patches/server/Fix-this-stupid-bullshit.patch @@ -14,7 +14,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -0,0 +0,0 @@ public class Main { Calendar deadline = Calendar.getInstance(); - deadline.add(Calendar.DAY_OF_YEAR, -28); + deadline.add(Calendar.DAY_OF_YEAR, -3); if (buildDate.before(deadline.getTime())) { - System.err.println("*** Error, this build is outdated ***"); + // Paper start - This is some stupid bullshit diff --git a/patches/server-remapped/Implement-ensureServerConversions-API.patch b/patches/server/Implement-ensureServerConversions-API.patch similarity index 100% rename from patches/server-remapped/Implement-ensureServerConversions-API.patch rename to patches/server/Implement-ensureServerConversions-API.patch diff --git a/patches/server-remapped/Implement-getI18NDisplayName.patch b/patches/server/Implement-getI18NDisplayName.patch similarity index 71% rename from patches/server-remapped/Implement-getI18NDisplayName.patch rename to patches/server/Implement-getI18NDisplayName.patch index 8e8a2c8807..e1561c8c64 100644 --- a/patches/server-remapped/Implement-getI18NDisplayName.patch +++ b/patches/server/Implement-getI18NDisplayName.patch @@ -12,24 +12,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/locale/Language.java +++ b/src/main/java/net/minecraft/locale/Language.java @@ -0,0 +0,0 @@ public abstract class Language { - - private static Language loadDefault() { - Builder builder = ImmutableMap.builder(); -- BiConsumer biconsumer = builder::put; -+ BiConsumer biconsumer = builder::put; // Paper - decompile fix - - try { - InputStream inputstream = Language.class.getResourceAsStream("/assets/minecraft/lang/en_us.json"); -@@ -0,0 +0,0 @@ public abstract class Language { - + instance = language; } -+ public static Language getInstance() { return getInstance(); } // Paper - OBFHELPER - public static Language getInstance() { - return Language.instance; - } - -+ public String translateKey(String key) { return getOrDefault(key); } // Paper - OBFHELPER ++ @Deprecated public String translateKey(String key) { return getOrDefault(key); } // Paper - OBFHELPER public abstract String getOrDefault(String key); public abstract boolean has(String key); @@ -52,7 +38,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + nms = CraftItemStack.asNMSCopy(item); + } + -+ return nms != null ? net.minecraft.locale.Language.getInstance().translateKey(nms.getItem().getDescriptionId()) : null; ++ return nms != null ? net.minecraft.locale.Language.getInstance().getOrDefault(nms.getItem().getDescriptionId()) : null; + } // Paper end } diff --git a/patches/server-remapped/Improve-the-Saddle-API-for-Horses.patch b/patches/server/Improve-the-Saddle-API-for-Horses.patch similarity index 97% rename from patches/server-remapped/Improve-the-Saddle-API-for-Horses.patch rename to patches/server/Improve-the-Saddle-API-for-Horses.patch index ec49955f27..29ff4077ca 100644 --- a/patches/server-remapped/Improve-the-Saddle-API-for-Horses.patch +++ b/patches/server/Improve-the-Saddle-API-for-Horses.patch @@ -22,7 +22,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @Override public AbstractHorseInventory getInventory() { -- return new CraftInventoryAbstractHorse(getHandle().inventory); +- return new CraftInventoryAbstractHorse(this.getHandle().inventory); + return new CraftSaddledInventory(getHandle().inventory); } } diff --git a/patches/server-remapped/LivingEntity-setKiller.patch b/patches/server/LivingEntity-setKiller.patch similarity index 92% rename from patches/server-remapped/LivingEntity-setKiller.patch rename to patches/server/LivingEntity-setKiller.patch index 9081937473..5f5f3baeff 100644 --- a/patches/server-remapped/LivingEntity-setKiller.patch +++ b/patches/server/LivingEntity-setKiller.patch @@ -30,7 +30,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 import net.minecraft.world.damagesource.DamageSource; import net.minecraft.world.effect.MobEffect; @@ -0,0 +0,0 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { - return getHandle().lastHurtByPlayer == null ? null : (Player) getHandle().lastHurtByPlayer.getBukkitEntity(); + return this.getHandle().lastHurtByPlayer == null ? null : (Player) this.getHandle().lastHurtByPlayer.getBukkitEntity(); } + // Paper start @@ -45,4 +45,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + @Override public boolean addPotionEffect(PotionEffect effect) { - return addPotionEffect(effect, false); + return this.addPotionEffect(effect, false); diff --git a/patches/server-remapped/Ocelot-despawns-should-honor-nametags-and-leash.patch b/patches/server/Ocelot-despawns-should-honor-nametags-and-leash.patch similarity index 100% rename from patches/server-remapped/Ocelot-despawns-should-honor-nametags-and-leash.patch rename to patches/server/Ocelot-despawns-should-honor-nametags-and-leash.patch diff --git a/patches/server-remapped/PlayerAttemptPickupItemEvent.patch b/patches/server/PlayerAttemptPickupItemEvent.patch similarity index 100% rename from patches/server-remapped/PlayerAttemptPickupItemEvent.patch rename to patches/server/PlayerAttemptPickupItemEvent.patch diff --git a/patches/server-remapped/Profile-Lookup-Events.patch b/patches/server/Profile-Lookup-Events.patch similarity index 100% rename from patches/server-remapped/Profile-Lookup-Events.patch rename to patches/server/Profile-Lookup-Events.patch diff --git a/patches/server-remapped/ProfileWhitelistVerifyEvent.patch b/patches/server/ProfileWhitelistVerifyEvent.patch similarity index 91% rename from patches/server-remapped/ProfileWhitelistVerifyEvent.patch rename to patches/server/ProfileWhitelistVerifyEvent.patch index 1f668d6f0f..9fece971c0 100644 --- a/patches/server-remapped/ProfileWhitelistVerifyEvent.patch +++ b/patches/server/ProfileWhitelistVerifyEvent.patch @@ -18,7 +18,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } else if (!this.isWhitelisted(gameprofile, event)) { // Paper + //chatmessage = new ChatMessage("multiplayer.disconnect.not_whitelisted"); // Paper + //event.disallow(PlayerLoginEvent.Result.KICK_WHITELIST, org.spigotmc.SpigotConfig.whitelistMessage); // Spigot // Paper - moved to isWhitelisted - } else if (getIpBans().isBanned(socketaddress) && !getIpBans().get(socketaddress).hasExpired()) { + } else if (this.getIpBans().isBanned(socketaddress) && !this.getIpBans().get(socketaddress).hasExpired()) { IpBanListEntry ipbanentry = this.ipBans.get(socketaddress); @@ -0,0 +0,0 @@ public abstract class PlayerList { @@ -34,7 +34,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + boolean isOp = this.ops.contains(gameprofile); + boolean isWhitelisted = !this.doWhiteList || isOp || this.whitelist.contains(gameprofile); + final com.destroystokyo.paper.event.profile.ProfileWhitelistVerifyEvent event; -+ event = new com.destroystokyo.paper.event.profile.ProfileWhitelistVerifyEvent(MCUtil.toBukkit(gameprofile), this.doWhiteList, isWhitelisted, isOp, org.spigotmc.SpigotConfig.whitelistMessage); ++ event = new com.destroystokyo.paper.event.profile.ProfileWhitelistVerifyEvent(net.minecraft.server.MCUtil.toBukkit(gameprofile), this.doWhiteList, isWhitelisted, isOp, org.spigotmc.SpigotConfig.whitelistMessage); + event.callEvent(); + if (!event.isWhitelisted()) { + if (loginEvent != null) { diff --git a/patches/server-remapped/Reset-spawner-timer-when-spawner-event-is-cancelled.patch b/patches/server/Reset-spawner-timer-when-spawner-event-is-cancelled.patch similarity index 54% rename from patches/server-remapped/Reset-spawner-timer-when-spawner-event-is-cancelled.patch rename to patches/server/Reset-spawner-timer-when-spawner-event-is-cancelled.patch index 3f6a64b5ec..d3b6e70012 100644 --- a/patches/server-remapped/Reset-spawner-timer-when-spawner-event-is-cancelled.patch +++ b/patches/server/Reset-spawner-timer-when-spawner-event-is-cancelled.patch @@ -9,19 +9,19 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/world/level/BaseSpawner.java +++ b/src/main/java/net/minecraft/world/level/BaseSpawner.java @@ -0,0 +0,0 @@ public abstract class BaseSpawner { - // Spigot End } - entity.spawnedViaMobSpawner = true; // Paper -+ flag = true; // Paper - // Spigot Start - if (org.bukkit.craftbukkit.event.CraftEventFactory.callSpawnerSpawnEvent(entity, blockposition).isCancelled()) { - Entity vehicle = entity.getVehicle(); -@@ -0,0 +0,0 @@ public abstract class BaseSpawner { - ((Mob) entity).spawnAnim(); - } - -- flag = true; -+ /*flag = true;*/ // Paper - moved up above cancellable event + // Spigot End } ++ flag = true; // Paper + // Spigot Start + if (org.bukkit.craftbukkit.event.CraftEventFactory.callSpawnerSpawnEvent(entity, pos).isCancelled()) { + Entity vehicle = entity.getVehicle(); +@@ -0,0 +0,0 @@ public abstract class BaseSpawner { + ((Mob) entity).spawnAnim(); + } + +- flag = true; ++ //flag = true; // Paper - moved up above cancellable event } } + diff --git a/patches/server-remapped/Shoulder-Entities-Release-API.patch b/patches/server/Shoulder-Entities-Release-API.patch similarity index 96% rename from patches/server-remapped/Shoulder-Entities-Release-API.patch rename to patches/server/Shoulder-Entities-Release-API.patch index 1cae11e624..53a7ff4c6b 100644 --- a/patches/server-remapped/Shoulder-Entities-Release-API.patch +++ b/patches/server/Shoulder-Entities-Release-API.patch @@ -62,7 +62,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java @@ -0,0 +0,0 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { - getHandle().getCooldowns().addCooldown(CraftMagicNumbers.getItem(material), ticks); + this.getHandle().getCooldowns().addCooldown(CraftMagicNumbers.getItem(material), ticks); } + // Paper start @@ -93,4 +93,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + @Override public boolean discoverRecipe(NamespacedKey recipe) { - return discoverRecipes(Arrays.asList(recipe)) != 0; + return this.discoverRecipes(Arrays.asList(recipe)) != 0;