clanchat: Add player name to kick message (#11555)

This commit is contained in:
MarbleTurtle
2020-05-31 21:57:22 -07:00
committed by GitHub
parent 2a174e7a8d
commit 41a041972a
3 changed files with 36 additions and 2 deletions

View File

@@ -150,11 +150,22 @@ public interface ClanChatConfig extends Config
return false;
}
@ConfigItem(
keyName = "kickWithName",
name = "Show kicked player",
description = "Changes kick message to say who was kicked",
position = 10
)
default boolean kickWithName()
{
return true;
}
@ConfigItem(
keyName = "showIgnores",
name = "Recolor ignored players",
description = "Recolors players that are on your ignore list",
position = 10
position = 11
)
default boolean showIgnores()
{
@@ -165,7 +176,7 @@ public interface ClanChatConfig extends Config
keyName = "showIgnoresColor",
name = "Ignored color",
description = "Allows you to change the color of the ignored players in your clan chat",
position = 11
position = 12
)
default Color showIgnoresColor()
{

View File

@@ -555,6 +555,22 @@ public class ClanChatPlugin extends Plugin
clientThread.invokeLater(() -> confirmKickPlayer(kickPlayerName));
break;
}
case "sendKickName":
{
if (!config.kickWithName())
{
break;
}
// Get name of the player we are kicking
final String[] stringStack = client.getStringStack();
final int stringSize = client.getStringStackSize();
final String kickPlayerName = stringStack[stringSize - 1];
// Sets the kick message based on players name
stringStack[stringSize - 2] = "-Attempting to kick " + kickPlayerName + " from friends chat...";
break;
}
}
}