(jitpack build does NOT contain the examples and the plugin.yml, don't worry)
made for fun
grabbed main classes from Revxrsal/EventBus (GeneratedClassDefiner, GeneratorAdapter, Method)
spaghetti code, i know.
accessing entity player example:
import me.acablade.nmsasm.NMS;
@NMS
public interface CraftPlayer {
@NMS("getHandle")
public Object getHandle();
@NMS("sendMessage")
public void sendMessage(String message);
}
And then you use it as:
CraftPlayer craftPlayer = NMSAsm.get(CraftPlayer.class, player);
Object entityPlayer = craftPlayer.getHandle();
craftPlayer.sendMessage("Hi there!!");
Dont forget to register the classes such as
NMSAsm.registerNMSClass(CraftPlayer.class);
in onEnable.
See more examples in me/acablade/nmsasm/testplugin