Skip to content
Permalink
Browse files

Tablist 1.13.2

  • Loading branch information...
MarcinWieczorek committed Jan 12, 2019
1 parent cbea57e commit ee307f57771e5f7318cae012b377f926c89cb719
@@ -217,6 +217,8 @@ public void run() {
case MINECRAFT_1_10_R2:
case MINECRAFT_1_11_R1:
case MINECRAFT_1_12_R1:
case MINECRAFT_1_13_R1:
case MINECRAFT_1_13_R2:
default:
packetExtension = new co.marcin.novaguilds.impl.versionimpl.v1_8_R3.PacketExtensionImpl();
break;
@@ -247,6 +249,8 @@ public void run() {
case MINECRAFT_1_10_R2:
case MINECRAFT_1_11_R1:
case MINECRAFT_1_12_R1:
case MINECRAFT_1_13_R1:
case MINECRAFT_1_13_R2:
default:
signGUI = new co.marcin.novaguilds.impl.versionimpl.v1_9_R2.SignGUIImpl();
break;
@@ -266,6 +270,8 @@ public void run() {
tabListClassMap.put(ConfigManager.ServerVersion.MINECRAFT_1_10_R1, co.marcin.novaguilds.impl.versionimpl.v1_10_R1.TabListImpl.class);
tabListClassMap.put(ConfigManager.ServerVersion.MINECRAFT_1_11_R1, co.marcin.novaguilds.impl.versionimpl.v1_10_R1.TabListImpl.class);
tabListClassMap.put(ConfigManager.ServerVersion.MINECRAFT_1_12_R1, co.marcin.novaguilds.impl.versionimpl.v1_10_R1.TabListImpl.class);
tabListClassMap.put(ConfigManager.ServerVersion.MINECRAFT_1_13_R1, co.marcin.novaguilds.impl.versionimpl.v1_10_R1.TabListImpl.class);
tabListClassMap.put(ConfigManager.ServerVersion.MINECRAFT_1_13_R2, co.marcin.novaguilds.impl.versionimpl.v1_10_R1.TabListImpl.class);

for(ConfigManager.ServerVersion version : ConfigManager.ServerVersion.values()) {
Class<? extends TabList> tabListClass = tabListClassMap.get(version);
@@ -19,6 +19,7 @@
package co.marcin.novaguilds.impl.versionimpl.v1_8_R1.packet;

import co.marcin.novaguilds.impl.util.AbstractPacket;
import co.marcin.novaguilds.manager.ConfigManager;
import co.marcin.novaguilds.util.LoggerUtils;
import co.marcin.novaguilds.util.StringUtils;
import co.marcin.novaguilds.util.reflect.Reflections;
@@ -36,11 +37,21 @@

static {
try {
String headerField, footerField;
if(ConfigManager.getServerVersion().isNewerThan(ConfigManager.ServerVersion.MINECRAFT_1_12_R1)) {
headerField = "header";
footerField = "footer";
}
else {
headerField = "a";
footerField = "b";
}

craftChatMessageClass = Reflections.getBukkitClass("util.CraftChatMessage");
craftChatMessageFromStringMethod = Reflections.getMethod(craftChatMessageClass, "fromString", String.class);
PacketPlayOutPlayerListHeaderFooterClass = Reflections.getCraftClass("PacketPlayOutPlayerListHeaderFooter");
PacketPlayOutPlayerListHeaderFooterAField = Reflections.getPrivateField(PacketPlayOutPlayerListHeaderFooterClass, "a");
PacketPlayOutPlayerListHeaderFooterBField = Reflections.getPrivateField(PacketPlayOutPlayerListHeaderFooterClass, "b");
PacketPlayOutPlayerListHeaderFooterAField = Reflections.getPrivateField(PacketPlayOutPlayerListHeaderFooterClass, headerField);
PacketPlayOutPlayerListHeaderFooterBField = Reflections.getPrivateField(PacketPlayOutPlayerListHeaderFooterClass, footerField);
}
catch(ClassNotFoundException | NoSuchFieldException | NoSuchMethodException e) {
LoggerUtils.exception(e);

0 comments on commit ee307f5

Please sign in to comment.
You can’t perform that action at this time.