If you wish to add your own chat icons via cache instead of RuneLite see my other thread: https://www.rune-server.ee/runescape...ml#post5731294
These crowns are found in the runelite client files, you can add your own crowns. Located in (runelite-clientsrcmainresourcesimgiconscrowns)
As you can see they are labeled with numbers.
Go to net.runelite.standalone > CustomUtils.java
Code:
for (int id = 16; id <= 25; id++) { //16-25 ids
//int id = Integer.parseInt(file.getName().replace(".png", "").trim());
byte[] data = resourceToBytes("img/icons/crowns/" + id + ".png");
if (data != null)
iconData.add(new IconData(id, data));
}
Looking at this code we can see the number 16 to 25
Code:
for (int id = 16; id <= 25; id++) { //16-25 ids
Change it to this so it can read up to 500 more png files: (You must do this to read new png files from the crowns folder)
Code:
for (int id = 16; id <= 500; id++) { //16-500 ids
Whenever you add another crown you must change the "25" number to the latest crown. Say you add 5 more crowns (26.png,27.png.. etc) You set that number to 30 if the last crown is 30.png (OR 31 if you use the 26 number)
Now in-game if you type <img=26> it will show the 26.png crown.
If you would like the crown to show up in chat next to your name you must add it to PlayerGroup.java in io.ruin.model.entity.player
Code:
public enum PlayerGroup {
OWNER(100, 2, 2, 100),
DEVELOPER(3, 6, 16, 100),
COMMUNITY_MANAGER(8, 7, 17, "Server Manager"),
ADMINISTRATOR(5, 2, 1, 0),
MODERATOR(4, 1, 0, 0),
FORUM_MODERATOR(7, 0, 0, 0),
SUPPORT(9, 8, 18, 0),
YOUTUBER(10, 27, 28, 0),
BETA_TESTER(6, 0, -1, 0),
ZENYTE(17, 15, 25, 100),
ONYX(16, 14, 24, 80),
DRAGONSTONE(15, 13, 23, 60),
DIAMOND(14, 12, 22, 40),
RUBY(13, 11, 21, 25),
EMERALD(12, 10, 20, 15),
SAPPHIRE(11, 9, 19, 10),
REGISTERED(2, 0, 0, 0),
BANNED(18, 0, -1, 0);
For example, our new crown 26.png:
Code:
RANK_26_NAME(1337, 26, 26, 0),
- 1337 can be any unused id not set by another group.
- 26 will be the id that the client sets the icon to. (Same as img icon (26 and 26) ONLY if you fix the bugs see at the bottom of this thread, otherwise they will be 2 different ids.
- 26 is the img icon.
- 16 is used for chat icons and 26 is used for <img> icons.
Lastly after completing this other snippet: https://www.rune-server.ee/runescape...nk-groups.html
Change your rank in your json file to RANK_26_NAME
Bugs to fix (Dcing when typing something)
THESE BUG FIXES ALSO FIXES CLIENT RANK IDS AND IMAGE IDS BEING DIFFERENT, now they will be the same.
DO THE BELOW IF YOU WANT IMAGE ICON IDS TO BE IDENTICAL TO THE FILE NAME AND IDENTICAL TO THE IMG ICON ID (Client image id and image icon id, 2 different ids will now be the same.)
For example: in the server files (io.ruin.model.entity.player > PlayerGroup.java)
You see these usergroups:
Code:
OWNER(100, 26, 26, 100),
DEVELOPER(3, 16, 16, 100),
COMMUNITY_MANAGER(8, 17, 17, "Server Manager"),
The layout is RANK(id, clientId, clientImageId, title/dropChance)
So if it's <img=26> (26.png) you want for the chat icon (Private message, clan chat, public chat)
OWNER(100, 26, 26, 100),
Normal chat message error:
Code:
java.lang.NullPointerException
at net.runelite.standalone.WorldMapManager.method630(WorldMapManager.java:688)
at net.runelite.standalone.Client.parsePacket(Client.java:7964)
at net.runelite.standalone.Client.method1654(Client.java:5680)
at net.runelite.standalone.Client.vmethod1937(Client.java:1677)
at net.runelite.standalone.GameShell.method976(GameShell.java:320)
at net.runelite.standalone.GameShell.run(GameShell.java:785)
at java.lang.Thread.run(Thread.java:748)
Go to net.runelite.standalone > WorldMapManager.java
Find
Code:
if((var6 & 128) != 0) {
Replace that whole if statement with:
Code:
if((var6 & 128) != 0) {
var8 = var0.readUnsignedShort();
int rank = var0.readUnsignedByte();
PlayerType playerType = (PlayerType) NetSocket.getEnumeratedTypeIndex(class210.getPlayerTypes(), rank);
boolean var18 = var0.method5525() == 1;
var11 = var0.method5525();
var12 = var0.offset;
if(var16.username != null && var16.appearance != null) {
boolean var13 = false;
if(playerType != null) {
if (playerType.isUser && Tiles.friendSystem.method897(var16.username)) {
var13 = true;
}
}
if(!var13 && Client.field842 == 0 && !var16.isHidden) {
Players.field1202.offset = 0;
var0.method5547(Players.field1202.array, 0, var11);
Players.field1202.offset = 0;
String var14 = AbstractFont.method5328(NetSocket.method3456(class65.method1308(Players.field1202)));
var16.overheadText = var14.trim();
var16.overheadTextChanged(-1);
var16.overheadTextColor = var8 >> 8;
var16.overheadTextEffect = var8 & 255;
var16.overheadTextCyclesRemaining = 150;
var16.isAutoChatting = var18;
if (playerType != null) {
var16.field682 = var16 != class215.localPlayer && playerType.isUser && "" != Client.field1115 && var14.toLowerCase().indexOf(Client.field1115) == -1;
}
if(playerType != null) {
if (playerType.isPrivileged) {
var15 = var18 ? 91 : 1;
} else {
var15 = var18 ? 90 : 2;
}
} else {
var15 = var18 ? 90 : 2;
}
//if(playerType.modIcon != -1) {
if(rank != 0) {
class217.sendGameMessage(var15, class256.method4655(rank) + var16.username.method5001(), var14);
} else {
class217.sendGameMessage(var15, var16.username.method5001(), var14);
}
}
}
var0.offset = var11 + var12;
}
Clan chat message error:
Code:
java.lang.NullPointerException
at net.runelite.standalone.Client.parsePacket(Client.java:6954)
at net.runelite.standalone.Client.method1654(Client.java:5680)
at net.runelite.standalone.Client.vmethod1937(Client.java:1677)
at net.runelite.standalone.GameShell.method976(GameShell.java:320)
at net.runelite.standalone.GameShell.run(GameShell.java:785)
at java.lang.Thread.run(Thread.java:748)
Go to net.runelite.standalone > Client.java
Find
Code:
if(ServerPacket.field2280 == var1.serverPacket) {
Replace that whole if statement with this:
Code:
if(ServerPacket.field2280 == var1.serverPacket) {
var36 = var3.readString();
String clanName = var3.readString();
//var21 = var3.method5502();
var23 = (long)var3.readUnsignedShort();
var9 = (long)var3.method5500();
int perm = var3.readUnsignedByte();
System.out.println(perm);
PlayerType var11 = (PlayerType)NetSocket.getEnumeratedTypeIndex(class210.getPlayerTypes(), perm);
var12 = var9 + (var23 << 32);
boolean var44 = false;
for(int var15 = 0; var15 < 100; ++var15) {
if(field1097[var15] == var12) {
var44 = true;
break;
}
}
if(var11 != null) {
if (var11.isUser && Tiles.friendSystem.method897(new Username(var36, WorldMapSection1.loginType))) {
var44 = true;
}
}
if(!var44 && field842 == 0) {
field1097[field1064] = var12;
field1064 = (field1064 + 1) % 100;
String var25 = AbstractFont.method5328(NetSocket.method3456(class65.method1308(var3)));
//if(var11.modIcon != -1) {
if(perm != -1) {
WorldMapData_1.method514(9, class256.method4655(perm) + var36, var25, clanName);
} else {
WorldMapData_1.method514(9, var36, var25, clanName);
}
}
var1.serverPacket = null;
var10000 = true;
return var10000;
}
Private chat error:
Code:
java.lang.NullPointerException
at net.runelite.standalone.Client.parsePacket(Client.java:7116)
at net.runelite.standalone.Client.method1654(Client.java:5680)
at net.runelite.standalone.Client.vmethod1937(Client.java:1677)
at net.runelite.standalone.GameShell.method976(GameShell.java:320)
at net.runelite.standalone.GameShell.run(GameShell.java:785)
at java.lang.Thread.run(Thread.java:748)
Go to net.runelite.standalone > Client.java
Find
Code:
if(ServerPacket.field2270 == var1.serverPacket) {
Replace whole if statement:
Code:
if(ServerPacket.field2270 == var1.serverPacket) {
var36 = var3.readString();
var21 = (long)var3.readUnsignedShort();
var23 = (long)var3.method5500();
int rank = var3.readUnsignedByte();
PlayerType var26 = (PlayerType)NetSocket.getEnumeratedTypeIndex(class210.getPlayerTypes(), rank);
long var27 = (var21 << 32) + var23;
boolean var29 = false;
for(int var13 = 0; var13 < 100; ++var13) {
if(field1097[var13] == var27) {
var29 = true;
break;
}
}
if(Tiles.friendSystem.method897(new Username(var36, WorldMapSection1.loginType))) {
var29 = true;
}
if(!var29 && field842 == 0) {
field1097[field1064] = var27;
field1064 = (field1064 + 1) % 100;
String var30 = AbstractFont.method5328(NetSocket.method3456(class65.method1308(var3)));
byte var14;
if(var26 != null) {
if (var26.isPrivileged) {
var14 = 7;
} else {
var14 = 3;
}
} else {
var14 = 3;
}
// if(var26.modIcon != -1) {
if(rank != -1) {
class217.sendGameMessage(var14, class256.method4655(rank) + var36, var30);
} else {
class217.sendGameMessage(var14, var36, var30);
}
}
var1.serverPacket = null;
var10000 = true;
return var10000;
}