From bbf1de17e7b8f90248fac27997aab58afa5b1ce3 Mon Sep 17 00:00:00 2001 From: Prototik Date: Mon, 25 May 2015 20:20:04 +0700 Subject: [PATCH] Fix incompability with obfuscated plugins (like SurvivalGames) --- .../plugin/java/PluginClassLoader.java.patch | 2 +- .../java/kcauldron/KCauldronRemapper.java | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 src/main/java/kcauldron/KCauldronRemapper.java diff --git a/patches/org/bukkit/plugin/java/PluginClassLoader.java.patch b/patches/org/bukkit/plugin/java/PluginClassLoader.java.patch index cb028a5..bebbc59 100644 --- a/patches/org/bukkit/plugin/java/PluginClassLoader.java.patch +++ b/patches/org/bukkit/plugin/java/PluginClassLoader.java.patch @@ -164,7 +164,7 @@ + jarMapping.setFallbackInheritanceProvider(new ClassLoaderProvider(this)); + } + -+ remapper = new JarRemapper(jarMapping); ++ remapper = new kcauldron.KCauldronRemapper(jarMapping); + + if (pluginInherit || reflectFields || reflectClass) { + remapperProcessor = new RemapperProcessor( diff --git a/src/main/java/kcauldron/KCauldronRemapper.java b/src/main/java/kcauldron/KCauldronRemapper.java new file mode 100644 index 0000000..c2a29ef --- /dev/null +++ b/src/main/java/kcauldron/KCauldronRemapper.java @@ -0,0 +1,19 @@ +package kcauldron; + +import net.md_5.specialsource.JarMapping; +import net.md_5.specialsource.JarRemapper; + +public class KCauldronRemapper extends JarRemapper { + public KCauldronRemapper(JarMapping jarMapping) { + super(jarMapping); + } + + @Override + public String mapSignature(String signature, boolean typeSignature) { + try { + return super.mapSignature(signature, typeSignature); + } catch (Exception e) { + return signature; + } + } +}