1
0
mirror of https://github.com/Zrips/Jobs.git synced 2024-11-26 04:25:15 +01:00

GUI title length is limited in older versions.

This commit is contained in:
Zrips 2021-03-17 12:46:31 +02:00
parent 7af223f878
commit 26d57c107e

View File

@ -20,6 +20,7 @@ import com.gamingmesh.jobs.CMIGUI.GUIManager.GUIRows;
import com.gamingmesh.jobs.CMIGUI.GUIManager.InvType;
import com.gamingmesh.jobs.CMILib.CMIChatColor;
import com.gamingmesh.jobs.CMILib.CMIMaterial;
import com.gamingmesh.jobs.CMILib.Version;
import com.gamingmesh.jobs.commands.JobsCommands;
import com.gamingmesh.jobs.stuff.PageInfo;
@ -159,8 +160,18 @@ public class CMIGui {
}
public void setTitle(String title) {
if (Version.isCurrentEqualOrHigher(Version.v1_16_R1)) {
if (CMIChatColor.stripColor(title).length() > 64) {
title = title.substring(0, 63) + "~";
}
} else {
if (title.length() > 32) {
title = title.substring(0, 31) + "~";
}
}
this.title = title;
}
public HashMap<Integer, CMIGuiButton> getButtons() {
combineButtons();