Dieser Commit ist enthalten in:
Ursprung
afef1a6a22
Commit
9d04c2049c
@ -1,6 +1,7 @@
|
||||
package com.comphenix.tinyprotocol;
|
||||
|
||||
import de.steamwar.core.Core;
|
||||
import jdk.internal.misc.Unsafe;
|
||||
import org.bukkit.Bukkit;
|
||||
|
||||
import java.lang.reflect.Constructor;
|
||||
@ -367,7 +368,11 @@ public final class Reflection {
|
||||
@SuppressWarnings("deprecation")
|
||||
public static Object newInstance(Class<?> clazz) {
|
||||
try {
|
||||
if (Core.getVersion() > 15) {
|
||||
return Unsafe.getUnsafe().allocateInstance(clazz);
|
||||
} else {
|
||||
return clazz.newInstance();
|
||||
}
|
||||
} catch (InstantiationException | IllegalAccessException e) {
|
||||
throw new SecurityException("Could not create object", e);
|
||||
}
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren