|
@@ -511,8 +511,8 @@ public class Main extends JavaPlugin {
|
|
private void sendSingleActionbarMessage(final Player player, final String message) {
|
|
private void sendSingleActionbarMessage(final Player player, final String message) {
|
|
String packageName = this.getServer().getClass().getPackage().getName();
|
|
String packageName = this.getServer().getClass().getPackage().getName();
|
|
int version = Integer.parseInt(packageName.substring(packageName.lastIndexOf('.') + 1).split("_")[1]);
|
|
int version = Integer.parseInt(packageName.substring(packageName.lastIndexOf('.') + 1).split("_")[1]);
|
|
- if(version == 8) {
|
|
|
|
- // 1_8_R*
|
|
|
|
|
|
+ if(version == 8 || version == 9) {
|
|
|
|
+ // 1_8 -> 1_9
|
|
sendActionbarReflect(player, message);
|
|
sendActionbarReflect(player, message);
|
|
return;
|
|
return;
|
|
} else if (version < 8) {
|
|
} else if (version < 8) {
|
|
@@ -528,7 +528,7 @@ public class Main extends JavaPlugin {
|
|
String version = packageName.substring(packageName.lastIndexOf('.') + 1);
|
|
String version = packageName.substring(packageName.lastIndexOf('.') + 1);
|
|
|
|
|
|
try {
|
|
try {
|
|
- Object ichatbasecomponent = Class.forName("net.minecraft.server." + version + ".IChatBaseComponent.ChatSerializer").getDeclaredMethod("a", String.class).invoke(null, "{\"text\": \"" + CC(message) + "\"}");
|
|
|
|
|
|
+ Object ichatbasecomponent = Class.forName("net.minecraft.server." + version + ".IChatBaseComponent$ChatSerializer").getDeclaredMethod("a", String.class).invoke(null, "{\"text\": \"" + CC(message) + "\"}");
|
|
Object packet = Class.forName("net.minecraft.server." + version + ".PacketPlayOutChat").getConstructor(Class.forName("net.minecraft.server." + version + ".IChatBaseComponent"), byte.class).newInstance(ichatbasecomponent, (byte) 2);
|
|
Object packet = Class.forName("net.minecraft.server." + version + ".PacketPlayOutChat").getConstructor(Class.forName("net.minecraft.server." + version + ".IChatBaseComponent"), byte.class).newInstance(ichatbasecomponent, (byte) 2);
|
|
|
|
|
|
Object craftPlayer = Class.forName("org.bukkit.craftbukkit." + version + ".entity.CraftPlayer").cast(player);
|
|
Object craftPlayer = Class.forName("org.bukkit.craftbukkit." + version + ".entity.CraftPlayer").cast(player);
|