mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-01 14:38:48 +00:00
Fix compilation and improve some features
This commit is contained in:
1 parent
ad8089855c
commit
2fb1eb0eb5
14 files changed
+45
-116
No files matched your search
@@ -30,19 +30,17 @@ import java.lang.reflect.Method;
|
||||
|
||||
public final class ItemStackUtils {
|
||||
|
||||
private final Class<?> craftItemStackClass;
|
||||
private final Method asNMSCopyMethod;
|
||||
private final Class<?> itemStackClass;
|
||||
private final Method cMethod;
|
||||
|
||||
public ItemStackUtils() throws NoSuchMethodException, ClassNotFoundException {
|
||||
final String version = Bukkit.getServer().getClass().getPackage().getName()
|
||||
.substring("org.bukkit.craftbukkit.".length());
|
||||
|
||||
this.craftItemStackClass = Class.forName("org.bukkit.craftbukkit." + version + ".inventory.CraftItemStack");
|
||||
this.asNMSCopyMethod = this.craftItemStackClass.getMethod("asNMSCopy", ItemStack.class);
|
||||
this.itemStackClass = Class.forName("net.minecraft.server." + version + ".ItemStack");
|
||||
this.cMethod = this.itemStackClass.getMethod("C");
|
||||
Class<?> craftItemStackClass = Class.forName("org.bukkit.craftbukkit." + version + ".inventory.CraftItemStack");
|
||||
this.asNMSCopyMethod = craftItemStackClass.getMethod("asNMSCopy", ItemStack.class);
|
||||
Class<?> itemStackClass = Class.forName("net.minecraft.server." + version + ".ItemStack");
|
||||
this.cMethod = itemStackClass.getMethod("C");
|
||||
}
|
||||
|
||||
public Component createComponent(final Player player) {
|
||||
|
||||
Reference in new issue
Block a user