first commit
Build AsminVoicechat / prepare-release (push) Successful in 14s
Build AsminVoicechat / build-and-test (17) (push) Canceled after 0s
Build AsminVoicechat / build-and-test (18) (push) Canceled after 0s
Build AsminVoicechat / build-and-test (19) (push) Canceled after 0s
Build AsminVoicechat / build-and-test (20) (push) Canceled after 0s
Build AsminVoicechat / build-and-test (21) (push) Canceled after 0s
Build AsminVoicechat / build-and-test (22) (push) Canceled after 0s
Build AsminVoicechat / build-and-test (23) (push) Canceled after 0s
Build AsminVoicechat / build-and-test (24) (push) Canceled after 0s
Build AsminVoicechat / build-and-test (25) (push) Canceled after 0s
Build AsminVoicechat / build-and-test (26) (push) Canceled after 0s
Build AsminVoicechat / build-and-test (27-ea) (push) Canceled after 0s
Build AsminVoicechat / build-and-test (16) (push) Canceled after 38s
Build AsminVoicechat / prepare-release (push) Successful in 14s
Build AsminVoicechat / build-and-test (17) (push) Canceled after 0s
Build AsminVoicechat / build-and-test (18) (push) Canceled after 0s
Build AsminVoicechat / build-and-test (19) (push) Canceled after 0s
Build AsminVoicechat / build-and-test (20) (push) Canceled after 0s
Build AsminVoicechat / build-and-test (21) (push) Canceled after 0s
Build AsminVoicechat / build-and-test (22) (push) Canceled after 0s
Build AsminVoicechat / build-and-test (23) (push) Canceled after 0s
Build AsminVoicechat / build-and-test (24) (push) Canceled after 0s
Build AsminVoicechat / build-and-test (25) (push) Canceled after 0s
Build AsminVoicechat / build-and-test (26) (push) Canceled after 0s
Build AsminVoicechat / build-and-test (27-ea) (push) Canceled after 0s
Build AsminVoicechat / build-and-test (16) (push) Canceled after 38s
This commit is contained in:
commit
bbccd4a815
454 files changed
+45050
No files matched your search
@@ -0,0 +1,67 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* com.mojang.brigadier.arguments.ArgumentType
|
||||
* org.bukkit.entity.Player
|
||||
*/
|
||||
package de.maxhenkel.voicechat.compatibility;
|
||||
|
||||
import com.mojang.brigadier.arguments.ArgumentType;
|
||||
import de.maxhenkel.voicechat.BukkitVersion;
|
||||
import de.maxhenkel.voicechat.compatibility.Compatibility1_8;
|
||||
import de.maxhenkel.voicechat.compatibility.JsonMessageBaseCompatibility;
|
||||
import de.maxhenkel.voicechat.compatibility.ReflectionUtils;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class Compatibility1_20_2
|
||||
extends JsonMessageBaseCompatibility {
|
||||
public static final BukkitVersion VERSION_1_20_2 = BukkitVersion.parseBukkitVersion("1.20.2-R0.1");
|
||||
public static final Compatibility1_20_2 INSTANCE = new Compatibility1_20_2();
|
||||
|
||||
@Override
|
||||
public void sendJsonMessage(Player player, String json) {
|
||||
this.send(player, json, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendJsonStatusMessage(Player player, String json) {
|
||||
this.send(player, json, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String createTranslationMessage(String key, String ... args) {
|
||||
return Compatibility1_8.constructTranslationMessage(key, args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendInviteMessage(Player player, Player commandSender, String groupName, String joinCommand) {
|
||||
this.sendJsonMessage(player, Compatibility1_8.constructInviteMessage(commandSender, groupName, joinCommand));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendIncompatibleMessage(Player player, String pluginVersion, String pluginName) {
|
||||
this.sendJsonMessage(player, Compatibility1_8.constructIncompatibleMessage(pluginVersion, pluginName));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArgumentType<?> playerArgument() {
|
||||
Class<?> argumentEntity = ReflectionUtils.getClazz("net.minecraft.commands.arguments.ArgumentEntity");
|
||||
return (ArgumentType)ReflectionUtils.callMethod(argumentEntity, "c");
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArgumentType<?> uuidArgument() {
|
||||
Class<?> argumentEntity = ReflectionUtils.getClazz("net.minecraft.commands.arguments.ArgumentUUID");
|
||||
return (ArgumentType)ReflectionUtils.callMethod(argumentEntity, "a");
|
||||
}
|
||||
|
||||
private void send(Player player, String json, boolean status) {
|
||||
Object entityPlayer = ReflectionUtils.callMethod((Object)player, "getHandle");
|
||||
Class<?> iChatBaseComponentClass = ReflectionUtils.getClazz("net.minecraft.network.chat.IChatBaseComponent");
|
||||
Class<?> craftChatMessage = this.getBukkitClass("util.CraftChatMessage");
|
||||
Object iChatBaseComponent = ReflectionUtils.callMethod(craftChatMessage, "fromJSON", new Class[]{String.class}, json);
|
||||
ReflectionUtils.callMethod(entityPlayer, "a", new Class[]{iChatBaseComponentClass, Boolean.TYPE}, iChatBaseComponent, status);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user