From a576525ca40441ca534d2420d2bcd6b52bab98c6 Mon Sep 17 00:00:00 2001 From: Auxilor Date: Fri, 24 Sep 2021 09:37:05 +0100 Subject: [PATCH] Don't look into this commit --- .../paper/enchantments/EnchantmentRarity.java | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 eco-core/core-stub/src/main/java/io/papermc/paper/enchantments/EnchantmentRarity.java diff --git a/eco-core/core-stub/src/main/java/io/papermc/paper/enchantments/EnchantmentRarity.java b/eco-core/core-stub/src/main/java/io/papermc/paper/enchantments/EnchantmentRarity.java new file mode 100644 index 00000000..6ea30dd8 --- /dev/null +++ b/eco-core/core-stub/src/main/java/io/papermc/paper/enchantments/EnchantmentRarity.java @@ -0,0 +1,32 @@ +package io.papermc.paper.enchantments; + +/** + * This right here is the worst workaround I have ever seen in my entire life. + *

+ * I hate the fact that I've done it, I hate everything that made me have to + * do this, and I hate the fact that there's an issue here in the first place. + *

+ * Spigot rules prevent you from having a hard dependency on papermc. Already, + * that's extremely infuriating, but it is what it is, I guess. + *

+ * However, I want to use the paper API if paper is installed, and also provide + * paper API support for anyone who uses it. + *

+ * Unfortunately, because EcoEnchant is both an Enchantment and a listener, + * spigot can't register the listener because it throws a ClassDefNotFound error + * when getting the methods - the solution to this for me is to load a stub class + * that exists, the actual method signature shouldn't be any different and I don't + * depend on this module in core-plugin, so I won't have any bugs on my end. + *

+ * I really hope this solution works because if it doesn't then I have a lot of + * work to do. A potential (and janky) workaround would be to load asm and then + * remove this class from existence if the server is running paper. + *

+ * This class here will be loaded after paper so it shouldn't cause any + * issues there, and the class will always then be present on the classpath. + *

+ * I will write this once and then never look at it again. + */ +public enum EnchantmentRarity { + +}