Inia is a framework for cross-version plugin support in Minecraft servers.
- Packets
- Playout
- Chat
- EntityDestroy
- EntityTeleport
- PlayerlistHeaderFooter
- SpawnEntityLiving
- Title
- Handshaking
- Login
- Playin
- Status
- Playout
- Entities
- ArmorStand
- EntityLiving
- Entity
- Player
- Components
- ChatBaseComponent
- ChatSerializer
- PlayerlistHeaderFooter
- Materials:
- Sounds, supports before and above 1.9 sound names
- Packet Gadgets
- Actionbar
- Utils
- Reflection, Server Package
- Version Utils
- Packet Utils
Relative short code, but version depended and repetive code.
import v1_8;
//...
int ping = ((CraftPlayer) player).getHandle().ping;
Version independed, but relative giant and repetive code.
try {
String bukkitversion = Bukkit.getServer()
.getClass()
.getPackage()
.getName()
.substring(23);
Class<?> craftPlayer = Class.forName("org.bukkit.craftbukkit."
+ bukkitversion + ".entity.CraftPlayer");
Object handle = craftPlayer.getMethod("getHandle")
.invoke(player);
Integer ping = (Integer) handle.getClass()
.getDeclaredField("ping")
.get(handle);
return ping.intValue();
} catch (ClassNotFoundException | IllegalAccessException
| IllegalArgumentException | InvocationTargetException
| NoSuchMethodException | SecurityException
| NoSuchFieldException e) {
return -1;
}
Repetitive code.
Short code and version independed.
import inia.ent.PlayerWrapper;
PlayerWrapper wPlayer = new PlayerWrapper(player);
int ping = wPlayer.getPing();
Server Version | Client Version | Features Supported | Features Not Supported |
---|---|---|---|
1.7.10 | " | mat | holo (natively), title (natively) |
1.8.4 | 1.8.9 | message, actionbar, holo, title | |
1.9.4 | " | actionbar, holo, mat | |
1.10.2 | " | actionbar, mat | |
1.11.2 | " | actionbar, mat | |
1.12.2 | " | mat | actionbar |
1.13.2 | " | not-tested | |
1.14.4 | " | not-tested | |
1.15.2 | " | not-tested | |
1.16.5 | " | not-tested | |
1.17.1 | " | not-tested | |
1.18.2 | " | mat |