Merge pull request #68 from rexlManu/master

Fixed labymod emote
This commit is contained in:
Jitse Boonstra 2020-04-13 12:51:40 +02:00 committed by GitHub
commit a9d2e090a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -98,7 +98,7 @@ public abstract class NPCBase implements NPC, NPCPacketHandler {
forcedEmote.addProperty("uuid", uuid.toString());
forcedEmote.addProperty("emote_id", emoteId);
array.add(forcedEmote);
LMCUtils.sendLMCMessage(receiver, "emote_api", array.getAsJsonObject());
LMCUtils.sendLMCMessage(receiver, "emote_api", array);
}
public void disableFOV() {

View File

@ -1,6 +1,7 @@
package net.labymod.utilities;
import com.comphenix.tinyprotocol.Reflection;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
@ -30,9 +31,9 @@ public class LMCUtils {
*
* @param player Minecraft Client
* @param key LMC message key
* @param messageContent json object content
* @param messageContent json element
*/
public static void sendLMCMessage(Player player, String key, JsonObject messageContent) {
public static void sendLMCMessage(Player player, String key, JsonElement messageContent) {
byte[] bytes = LMCUtils.getBytesToSend(key, messageContent.toString());
// 12/4/20, JMB: Converted into reflections for multi-version support: