Skip to content

access nms through automatically generated asm classes

Notifications You must be signed in to change notification settings

oguzcanyilmazlar/NMS-ASM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

(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:

CraftPlayer.java
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

About

access nms through automatically generated asm classes

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages