public abstract class VersionAdapter<R> extends Object
Modifier and Type | Field and Description |
---|---|
protected HashMap<PacketType,BiFunction<R,NPacket,Object>> |
negativityToPlatform |
protected HashMap<String,BiFunction<R,Object,NPacketHandshake>> |
packetsHandshake |
protected HashMap<String,BiFunction<R,Object,NPacketPlayIn>> |
packetsPlayIn |
protected HashMap<String,BiFunction<R,Object,NPacketPlayOut>> |
packetsPlayOut |
protected HashMap<String,BiFunction<R,Object,NPacketStatus>> |
packetsStatus |
protected List<String> |
unknownPacket |
protected String |
version |
Constructor and Description |
---|
VersionAdapter(String version) |
Modifier and Type | Method and Description |
---|---|
protected Object |
callFirstConstructor(Class<?> clazz,
Object... args) |
protected <T> T |
get(Class<?> clazz,
Object obj,
String name) |
protected <T> T |
get(Object obj,
Class<?> clazz,
String name) |
protected <T> T |
get(Object obj,
String name) |
protected <T> T |
getFromMethod(Class<?> clazz,
Object obj,
String methodName) |
protected <T> T |
getFromMethod(Object obj,
String methodName) |
String |
getNameOfPacket(Object nms) |
NPacket |
getPacket(Player pl,
PacketDirection dir,
Object nms) |
NPacket |
getPacket(R player,
PacketDirection dir,
Object nms) |
NPacket |
getPacket(R player,
PacketDirection dir,
Object nms,
String packetName) |
protected Object |
getSafe(Object obj,
String name) |
protected String |
getStr(Object obj,
String name) |
String |
getVersion() |
protected void |
log() |
void |
queuePacket(Player pl,
NPacket packet) |
abstract void |
queuePacket(R p,
Object basicPacket) |
void |
sendPacket(Player pl,
NPacket packet) |
abstract void |
sendPacket(R p,
Object basicPacket) |
protected final HashMap<String,BiFunction<R,Object,NPacketPlayOut>> packetsPlayOut
protected final HashMap<String,BiFunction<R,Object,NPacketPlayIn>> packetsPlayIn
protected final HashMap<String,BiFunction<R,Object,NPacketHandshake>> packetsHandshake
protected final HashMap<String,BiFunction<R,Object,NPacketStatus>> packetsStatus
protected final HashMap<PacketType,BiFunction<R,NPacket,Object>> negativityToPlatform
protected final String version
public VersionAdapter(String version)
public String getVersion()
protected void log()
public NPacket getPacket(Player pl, PacketDirection dir, Object nms)
public NPacket getPacket(R player, PacketDirection dir, Object nms)
public NPacket getPacket(R player, PacketDirection dir, Object nms, String packetName)