diff --git a/src/main/java/io/github/gaming32/worldhost/gui/screen/FriendsScreen.java b/src/main/java/io/github/gaming32/worldhost/gui/screen/FriendsScreen.java index 2f75f5b..ba393c9 100644 --- a/src/main/java/io/github/gaming32/worldhost/gui/screen/FriendsScreen.java +++ b/src/main/java/io/github/gaming32/worldhost/gui/screen/FriendsScreen.java @@ -8,6 +8,7 @@ import io.github.gaming32.worldhost.plugin.InfoTextsCategory; import io.github.gaming32.worldhost.plugin.ProfileInfo; import io.github.gaming32.worldhost.versions.Components; +import net.minecraft.Util; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.components.Button; import net.minecraft.client.gui.components.ObjectSelectionList; @@ -170,6 +171,8 @@ public class FriendsEntry extends ObjectSelectionList.Entry { private final FriendListFriend friend; private ProfileInfo profile; + private long clickTime; + public FriendsEntry(FriendListFriend friend) { minecraft = Minecraft.getInstance(); this.friend = friend; @@ -225,6 +228,12 @@ public void maybeRemove() { @Override public boolean mouseClicked(double mouseX, double mouseY, int button) { FriendsScreen.this.list.setSelected(this); + if (Util.getMillis() - clickTime < 250L) { + friend.showFriendInfo(FriendsScreen.this); + clickTime = Util.getMillis(); + return true; + } + clickTime = Util.getMillis(); return false; } } diff --git a/src/main/java/io/github/gaming32/worldhost/gui/screen/OnlineFriendsScreen.java b/src/main/java/io/github/gaming32/worldhost/gui/screen/OnlineFriendsScreen.java index 12d1765..46a1641 100644 --- a/src/main/java/io/github/gaming32/worldhost/gui/screen/OnlineFriendsScreen.java +++ b/src/main/java/io/github/gaming32/worldhost/gui/screen/OnlineFriendsScreen.java @@ -635,6 +635,7 @@ public boolean mouseClicked(double mouseX, double mouseY, int button) { final double relX = mouseX - OnlineFriendsScreen.this.list.getRowLeft(); if (relX < 32.0 && relX > 16.0) { connect(); + clickTime = Util.getMillis(); return true; }