3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-12-24 15:20:15 +01:00
Fixes #1431
(also trying the awesome GitHub auto-closing)
Dieser Commit ist enthalten in:
KennyTV 2019-08-31 09:28:56 +02:00
Ursprung 5b403da966
Commit 91c2987cfe

Datei anzeigen

@ -39,13 +39,13 @@ public class PlayerSneakListener extends ViaBukkitListener {
final String packageName = plugin.getServer().getClass().getPackage().getName();
getHandle = Class.forName(packageName + ".entity.CraftPlayer").getMethod("getHandle");
final Class<?> entityPlayerClass = Class.forName(packageName
.replace("org.bukkit.craftbukkit", "net.minecraft.server") + ".EntityPlayer");
try {
setSize = Class.forName(packageName
.replace("org.bukkit.craftbukkit", "net.minecraft.server") + ".EntityPlayer").getMethod("setSize", Float.TYPE, Float.TYPE);
} catch (ClassNotFoundException | NoSuchMethodException e) {
setSize = entityPlayerClass.getMethod("setSize", Float.TYPE, Float.TYPE);
} catch (NoSuchMethodException e) {
// Don't catch this one
setSize = Class.forName(packageName
.replace("org.bukkit.craftbukkit", "net.minecraft.server") + ".EntityPlayer").getMethod("a", Float.TYPE, Float.TYPE);
setSize = entityPlayerClass.getMethod("a", Float.TYPE, Float.TYPE);
}