3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-12-24 23:30: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(); final String packageName = plugin.getServer().getClass().getPackage().getName();
getHandle = Class.forName(packageName + ".entity.CraftPlayer").getMethod("getHandle"); getHandle = Class.forName(packageName + ".entity.CraftPlayer").getMethod("getHandle");
final Class<?> entityPlayerClass = Class.forName(packageName
.replace("org.bukkit.craftbukkit", "net.minecraft.server") + ".EntityPlayer");
try { try {
setSize = Class.forName(packageName setSize = entityPlayerClass.getMethod("setSize", Float.TYPE, Float.TYPE);
.replace("org.bukkit.craftbukkit", "net.minecraft.server") + ".EntityPlayer").getMethod("setSize", Float.TYPE, Float.TYPE); } catch (NoSuchMethodException e) {
} catch (ClassNotFoundException | NoSuchMethodException e) {
// Don't catch this one // Don't catch this one
setSize = Class.forName(packageName setSize = entityPlayerClass.getMethod("a", Float.TYPE, Float.TYPE);
.replace("org.bukkit.craftbukkit", "net.minecraft.server") + ".EntityPlayer").getMethod("a", Float.TYPE, Float.TYPE);
} }