From 32f6355c8c7fc1611140bfcce6afe8b25cea5697 Mon Sep 17 00:00:00 2001 From: Luck Date: Mon, 13 May 2019 10:57:06 +0100 Subject: Activity log improvements --- .../main/java/me/lucko/spark/forge/ForgeCommandSender.java | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'spark-forge/src') diff --git a/spark-forge/src/main/java/me/lucko/spark/forge/ForgeCommandSender.java b/spark-forge/src/main/java/me/lucko/spark/forge/ForgeCommandSender.java index 4b71d86..f7b2122 100644 --- a/spark-forge/src/main/java/me/lucko/spark/forge/ForgeCommandSender.java +++ b/spark-forge/src/main/java/me/lucko/spark/forge/ForgeCommandSender.java @@ -24,8 +24,11 @@ import me.lucko.spark.common.CommandSender; import net.kyori.text.Component; import net.kyori.text.serializer.gson.GsonComponentSerializer; import net.minecraft.command.ICommandSender; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.text.ITextComponent; +import java.util.UUID; + public class ForgeCommandSender implements CommandSender { private final ICommandSender sender; private final ForgeSparkPlugin plugin; @@ -40,6 +43,14 @@ public class ForgeCommandSender implements CommandSender { return this.sender.getName(); } + @Override + public UUID getUniqueId() { + if (this.sender instanceof EntityPlayer) { + return ((EntityPlayer) this.sender).getUniqueID(); + } + return null; + } + @Override public void sendMessage(Component message) { ITextComponent component = ITextComponent.Serializer.jsonToComponent(GsonComponentSerializer.INSTANCE.serialize(message)); -- cgit