Skip to content

Commit

Permalink
Fixes for nicknamed classes, quest book tracking
Browse files Browse the repository at this point in the history
  • Loading branch information
P0keDev committed Jan 23, 2021
1 parent 4692703 commit 38545b1
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

public class TabManager {

public static final String DEFAULT_GUILD_REGEX = "(^&3\\[(&r&b★{0,4})?&r&3[\\w ]*?\\])(?<!&3\\[Parkour\\])|(^&3You were not in the territory)";
public static final String DEFAULT_GUILD_REGEX = "(^&3\\[(&r&b★{0,5})?&r&3(&x)?[\\w ]*?(&r&3)?\\])(?<!&3\\[Parkour\\])|(^&3You were not in the territory)";
public static final String DEFAULT_PARTY_REGEX = "(^&7\\[&r&e(.*?)\\])|(^&eYou are not in a party!)";

private static List<ChatTab> availableTabs;
Expand All @@ -37,6 +37,9 @@ public static void startTabs() {
if (chatTab.getRegex().contains("(^&3\\[(&r&b★{0,4})?&r&3[\\w ]*?\\])(?<!&3\\[Parkour\\])|(^&3You were not in the territory)")) {
chatTab.setRegex(chatTab.getRegex().replace("(^&3\\[(&r&b★{0,4})?&r&3\\w*?\\])(?<!&3\\[Parkour\\])|(^&3You were not in the territory)", "(^&3\\[(&r&b★{0,4})?&r&3(&o)?[\\w ]*?(&r&3)?\\])(?<!&3\\[Parkour\\])|(^&3You were not in the territory)"));
}
if (chatTab.getRegex().contains("(^&3\\[(&r&b★{0,4})?&r&3(&o)?[\\w ]*?(&r&3)?\\])(?<!&3\\[Parkour\\])|(^&3You were not in the territory)")) {
chatTab.setRegex(chatTab.getRegex().replace("(^&3\\[(&r&b★{0,4})?&r&3(&o)?[\\w ]*?(&r&3)?\\])(?<!&3\\[Parkour\\])|(^&3You were not in the territory)", "(^&3\\[(&r&b★{0,5})?&r&3(&o)?[\\w ]*?(&r&3)?\\])(?<!&3\\[Parkour\\])|(^&3You were not in the territory)"));
}
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public QuestInfo(ItemStack originalStack, boolean isMiniQuest) {
this.isMiniQuest = isMiniQuest;

lore = ItemUtils.getLore(originalStack);
name = StringUtils.normalizeBadString(getTextWithoutFormattingCodes(originalStack.getDisplayName()));
name = StringUtils.normalizeBadString(getTextWithoutFormattingCodes(originalStack.getDisplayName())).replace(" [Tracked]", "");

Iterator<String> loreIterator = lore.iterator();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,8 @@ public void drawScreen(int mouseX, int mouseY, float partialTicks) {
lore.remove(lore.size() - 1);
lore.remove(lore.size() - 1);
} else if (selected.getStatus() == QuestStatus.CAN_START) {
lore.remove(lore.size() - 2);
if(!lore.remove(lore.size() - 2).isEmpty()) lore.remove(lore.size() - 2); // quest is tracked, has extra line
if (selected.isMiniQuest()) {
render.drawRect(Textures.UIs.quest_book, x + 14, y - 95 + currentY, 272, 245, 11, 7);
} else {
Expand All @@ -207,6 +209,8 @@ public void drawScreen(int mouseX, int mouseY, float partialTicks) {
lore.add(TextFormatting.GREEN + (TextFormatting.BOLD + "Left click to pin it!"));
}
} else if (selected.getStatus() == QuestStatus.STARTED) {
lore.remove(lore.size() - 2);
if(!lore.remove(lore.size() - 2).isEmpty()) lore.remove(lore.size() - 2); // quest is tracked, has extra line
render.drawRect(Textures.UIs.quest_book, x + 14, y - 95 + currentY, 245, 245, 8, 7);
if (QuestManager.getTrackedQuest() != null && QuestManager.getTrackedQuest().getName().equals(selected.getName())) {
lore.add(TextFormatting.RED + (TextFormatting.BOLD + "Left click to unpin it!"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ private void updateItems() {
continue;
}

if (!TextFormatting.getTextWithoutFormattingCodes(displayName).matches("\\[>\\] Select [a-zA-Z0-9 ]{1,19}") && !displayName.contains("Deleting")) continue;
if (!TextFormatting.getTextWithoutFormattingCodes(displayName).matches("\\[>\\] Select [a-zA-Z0-9_ ]{1,19}") && !displayName.contains("Deleting")) continue;

receivedItems = true;
availableCharacters.add(new CharacterProfile(stack, s.slotNumber));
Expand Down

0 comments on commit 38545b1

Please sign in to comment.