23 lines
1014 B
Java
23 lines
1014 B
Java
package fr.pandacube.lib.paper.reflect.wrapper.minecraft.server;
|
|
|
|
import fr.pandacube.lib.core.util.Reflect;
|
|
import fr.pandacube.lib.paper.reflect.NMSReflect;
|
|
import fr.pandacube.lib.paper.reflect.wrapper.ReflectWrapper;
|
|
import fr.pandacube.lib.paper.reflect.wrapper.minecraft.commands.Commands;
|
|
|
|
import static fr.pandacube.lib.core.util.ThrowableUtil.wrapEx;
|
|
import static fr.pandacube.lib.core.util.ThrowableUtil.wrapReflectEx;
|
|
|
|
public class MinecraftServer extends ReflectWrapper {
|
|
public static final NMSReflect.ClassMapping MAPPING = wrapEx(() -> NMSReflect.mojClass("net.minecraft.server.MinecraftServer"));
|
|
private static final Reflect.ReflectField<?> vanillaCommandDispatcher = wrapEx(() -> MAPPING.runtimeReflect().field("vanillaCommandDispatcher"));
|
|
|
|
public Commands vanillaCommandDispatcher() {
|
|
return wrap(wrapReflectEx(() -> vanillaCommandDispatcher.getValue(__getRuntimeInstance())), Commands.class);
|
|
}
|
|
|
|
protected MinecraftServer(Object obj) {
|
|
super(obj);
|
|
}
|
|
}
|