Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Remove Armorstand Nametags does not fully work when Patcher's entity culling is enabled #55

Merged
merged 5 commits into from
Jan 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,53 +32,53 @@ public class LanguageData {
/**
* GSON deserialization fields which are loaded in when the file is parsed.
*/
public String autoQueuePrefixGlobal = "^(?:You died! .+|YOU DIED! .+|You have been eliminated!|You won! .+|YOU WON! .+)$";
private String autoQueuePrefixGlobal = "^(?:You died! .+|YOU DIED! .+|You have been eliminated!|You won! .+|YOU WON! .+)$";

public String autoFriendPattern = "\u00A7m----------------------------------------------------Friend request from (?<name>.+)\\[ACCEPT\\] - \\[DENY\\] - \\[IGNORE\\].*";
private String autoFriendPattern = "Friend request from (?<name>.+)\\[ACCEPT] - \\[DENY] - \\[IGNORE].*";

private String chatCleanerJoin = "(?:sled into|slid into|joined|spooked into) the lobby";
private String chatCleanerMysteryBoxFind = "^.+ (?<player>(?!You)\\w{1,16}) found (?:a|an) (?:.{5} Mystery Box!|.+ in a .+!)$";
private String chatCleanerMysteryBoxFind = "^.+ (?<player>(?!You )\\w{1,16} )found (?:a|an) (?:.{5} Mystery Box!|.+ in a .+!)$";
private String chatCleanerSoulWellFind = "^.+ has found .+ in the Soul Well!$";
private String chatCleanerGameAnnouncement = "^\u27A4 A .+ game is (?:available to join|starting in .+ seconds)! CLICK HERE to join!$";
private String chatCleanerGameAnnouncement = "^\u27a4 A .+ game is (?:available to join|starting in .+ seconds)! CLICK HERE to join!$";
private String chatCleanerBedwarsPartyAdvertisement = "(?!.+: )(([1-8]/[1-8]|[1-8]v[1-8]|[2-8]s)|(any|rbw|ranked))";
private String chatCleanerConnectionStatus = "^(?:Friend|F|Guild|G) > (?<player>\\w{1,16}) (?:joined|left)\\.$";
private String chatCleanerMvpEmotes = "\u00a7r\u00a7(?:c\u2764|6\u272e|a\u2714|c\u2716|b\u2615|e\u279c|e\u00af\\\\_\\(\u30c4\\)_/\u00af|c\\(\u256F\u00B0\u25A1\u00B0\uFF09\u256F\u00a7r\u00a7f\uFE35\u00a7r\u00a77 \u253B\u2501\u253B|d\\( \uFF9F\u25E1\uFF9F\\)/|a1\u00a7r\u00a7e2\u00a7r\u00a7c3|b\u2609\u00a7r\u00a7e_\u00a7r\u00a7b\u2609|e\u270E\u00a7r\u00a76\\.\\.\\.|a\u221A\u00a7r\u00a7e\u00a7l\\(\u00a7r\u00a7a\u03C0\u00a7r\u00a7a\u00a7l\\+x\u00a7r\u00a7e\u00a7l\\)\u00a7r\u00a7a\u00a7l=\u00a7r\u00a7c\u00a7lL|e@\u00a7r\u00a7a'\u00a7r\u00a7e-\u00a7r\u00a7a'|6\\(\u00a7r\u00a7a0\u00a7r\u00a76\\.\u00a7r\u00a7ao\u00a7r\u00a7c\\?\u00a7r\u00a76\\)|b\u0F3C\u3064\u25D5_\u25D5\u0F3D\u3064|e\\(\u00a7r\u00a7b'\u00a7r\u00a7e-\u00a7r\u00a7b'\u00a7r\u00a7e\\)\u2283\u00a7r\u00a7c\u2501\u00a7r\u00a7d\u2606\uFF9F\\.\\*\uFF65\uFF61\uFF9F|e\u2694|a\u270C|c\u00a7lOOF|e\u00a7l<\\('O'\\)>)\u00a7r";
public String chatCleanerHypeLimit = " \u27A4 You have reached your Hype limit!";
private String chatCleanerMvpEmotes = "\u00a7r\u00a7(?:c\u2764|6\u272e|a\u2714|c\u2716|b\u2615|e\u279c|e\u00af\\\\_\\(\u30c4\\)_/\u00af|c\\(\u256f\u00b0\u25a1\u00b0\uff09\u256f\u00a7r\u00a7f\ufe35\u00a7r\u00a77 \u253b\u2501\u253b|d\\( \uff9f\u25e1\uff9f\\)/|a1\u00a7r\u00a7e2\u00a7r\u00a7c3|b\u2609\u00a7r\u00a7e_\u00a7r\u00a7b\u2609|e\u270e\u00a7r\u00a76\\.\\.\\.|a\u221a\u00a7r\u00a7e\u00a7l\\(\u00a7r\u00a7a\u03c0\u00a7r\u00a7a\u00a7l\\+x\u00a7r\u00a7e\u00a7l\\)\u00a7r\u00a7a\u00a7l=\u00a7r\u00a7c\u00a7lL|e@\u00a7r\u00a7a'\u00a7r\u00a7e-\u00a7r\u00a7a'|6\\(\u00a7r\u00a7a0\u00a7r\u00a76\\.\u00a7r\u00a7ao\u00a7r\u00a7c\\?\u00a7r\u00a76\\)|b\u0f3c\u3064\u25d5_\u25d5\u0f3d\u3064|e\\(\u00a7r\u00a7b'\u00a7r\u00a7e-\u00a7r\u00a7b'\u00a7r\u00a7e\\)\u2283\u00a7r\u00a7c\u2501\u00a7r\u00a7d\u2606\uff9f\\.\\*\uff65\uff61\uff9f|e\u2694|a\u270c|c\u00a7lOOF|e\u00a7l<\\('O'\\)>)\u00a7r";
public String chatCleanerHypeLimit = " \u27a4 You have reached your Hype limit!";
private String chatGiftBlocker = "They have gifted \\d+ (?:rank|ranks) so far!";
private String chatCommonAdvertisements = "(?!.+: )(/?(((party join|join party)|p join|(guild join)|(join guild)|g join) \\w{1,16})|/?(party me|visit me|duel me|my ah|my smp)|(twitch.tv)|(youtube.com|youtu.be)|(/(visit|ah) \\w{1,16}|(visit /\\w{1,16})|(/gift)|(gilde)|(lowballing|lowbaling|lowvaling|lowvaluing|lowballer)))";
private String chatRankBegging = "(?!.+: )([^\\[](vip|mvp|mpv|vpi)|(please|pls|plz|give|giving)|(rank|buy me|upgrade me)|(gift|gifting|gifters)|(beg|begging|beggers))";
private String chatRankBegging = "(?!.+: )([^\\[](vip|mvp|mpv|vpi)|(please|pls|plz|rank ?up|rank ?upgrade)|(buy|upgrade|gift|give) (rank|me)|(gifting|gifters)|( beg |begging|beggers))";
private String chatCleanerGrinchPresents = "(?:You found (?:an egg|a gift|a candy)! .\\d{1,3} total.|^\\W{0,3}\\w{0,}\\S{0,3}\\s{0,1}\\w{1,16} has reached \\d{2,3} (?:gifts|eggs|candy)!)";
private String chatCleanerEarnedCoinsAndExp = "^(?:\\W\\d+ .* Experience.*|\\W\\d+ coins!.*|You earned \\d+ GEXP from playing.+!|.+ just earned .+ as a Guild Level Reward!)"; //.* at the end for modifiers
public String chatCleanerReplayRecorded = "This game has been recorded. Click here to watch the Replay!";
private String connectedServerConnectMessage = "^(You are currently connected to server \\S+)|(Sending you to \\S+!)|(Sending you to \\S+)|(Sending to server \\S+)|(SERVER FOUND! Sending to \\S+!)|(Warping you to your SkyBlock island\\.{3})|(Warping\\.{3})|(Sending a visit request\\.{3})|(Finding player\\.{3})|(Request join for (?:Hub|Dungeon Hub) (?:.{2,4} \\S+|\\S+))|(Found an in-progress .+ game! Teleporting you to \\S+)|(Returning you to the lobby!)$";
private String chatCleanerEarnedCoinsAndExp = "^(?:\\W\\d+ .* Experience.*|\\W\\d+ Soul.*|\\W\\d+ coins.*|.*\\W\\d+ Event EXP.*|You earned \\d+ GEXP from playing.+!|.+ just earned .+ as a Guild Level Reward!)"; //.* at the end for modifiers
private String chatCleanerReplayRecorded = "This game has been recorded\\. Click here to watch the Replay!";
private String chatCleanerTip = "(?:You (?:tipped|\\(anonymously\\) tipped) (\\d+ (?:player|players)(?: in \\d+ (?:game|different games)!)|\\w{1,16} in .+!|\\d+ (?:player|players)!)|You were tipped by \\d+ (?:player|players) in the last \\S+!|You already tipped everyone that has boosters active, so there isn't anybody to be tipped right now!|You've already tipped that person today in .+! Try another user!|You've already tipped someone in the past hour in .+! Wait a bit and try again!)";
private String chatCleanerOnlineStatus = "REMINDER: Your Online Status is currently set to (?:Appear Offline|Busy|Away)";
private String chatCleanerGameTips = "^(?:If you get disconnected use /rejoin to join back in the game\\.|You may use /mmreport <skin name> to chat report in this mode!|Teaming with the .+ is not allowed!|Teaming is not allowed.+|Cross Teaming / Teaming with other teams is not allowed!|Cross-teaming is not allowed! Report cross-teamers using /report\\.|Cages opened! FIGHT!|Queued! Use the bed to return to lobby!|Queued! Use the bed to cancel!|You can use /ic <message> to communicate with your fellow infected!|To leave .+, type /lobby|Consider sharing some of your resources with your team mates by clicking the Banker NPC at your base\\.|You didn't pick up any more \\S+ because you have too much on you!|As a Spectator, you can talk in chat with fellow Spectators\\.|Contents of .+ Ender Chest have been dropped into their fountain\\.|Alive players cannot see dead players' chat\\.|The game has started!|You have 15s to spread out before it starts!|You will respawn next round!)";
private String chatCleanerGameTips = "^(?:If you get disconnected use /rejoin to join back in the game\\.|You may use /mmreport <skin name> to chat report in this mode!|Teaming with the .+ is not allowed!|Teaming is not allowed.+|Cross Teaming / Teaming with other teams is not allowed!|Cross-teaming is not allowed! Report cross-teamers using /report\\.|Cages opened! FIGHT!|Queued! Use the bed to return to lobby!|Queued! Use the bed to cancel!|You can use /ic <message> to communicate with your fellow infected!|To leave .+, type /lobby|Consider sharing some of your resources with your team mates by clicking the Banker NPC at your base\\.|You didn't pick up any more \\S+ because you have too much on you!|As a Spectator, you can talk in chat with fellow Spectators\\.|Contents of .+ Ender Chest have been dropped into their fountain\\.|Alive players cannot see dead players' chat\\.|The game has started!|You have 15s to spread out before it starts!|You will respawn next round!|Jumping before dropping can sometimes give you an advantage!|You can skip the level if you fail too many times on easy or medium difficulties!|DROP!|Reset location!|Dropper is currently in the Prototype Lobby, please report bugs at https:\\/\\/hypixel\\.net\\/bugs!)";
private String chatCleanerStats = "Click to view the stats of your .* game!";

private String connectedServerConnectMessage = "^(You are currently connected to server \\S+)|(Sending you to \\S+.{3}!)|(Sending you to \\S+.{3})|(Sending to server \\S+.{3})|(SERVER FOUND! Sending to \\S+.{3}!)|(Warping you to your SkyBlock island...)|(Warping...)|(Sending a visit request...)|(Finding player...)|(Request join for (?:Hub|Dungeon Hub) .{2,4} \\S+.{3})|(Found an in-progress .+ game! Teleporting you to \\S+.{3}...)|(Returning you to the lobby!)$";

private String achievementPattern = "a>> {3}Achievement Unlocked: (?<achievement>.+) {3}<<a";
private String levelUpPattern = "You are now Hypixel Level (?<level>\\d+)!";
private String guildPlayerJoinPattern = "^(?:\\[.*] )?(?<player>\\S{1,16}) joined the guild!$";

private String chatRestylerGameJoinStyle = "^§r§e§r§(?<color>[\\da-f])(?:§k)?(?<player>\\w{1,16})§r§r§r§e has joined (?<amount>.+)!§r§e§r$";
private String chatRestylerGameLeaveStyle = "^§r§e§r§(?<color>[\\da-f])(?:§k)?(?<player>\\w{1,16})§r§r§r§e has quit!§r§e§r$";
private String chatRestylerGameStartCounterStyle = "^(?<title>(The game starts in|Cages open in:|You will respawn in|The Murderer gets their sword in|You get your sword in|The alpha infected will be chosen in|Kill contracts will be issued in|The Murderers get their swords in|You can start shooting in)) (?<time>\\d{1,3}) (?<unit>(seconds?!))$"; // TODO: translate "Cages open in:" to french (also translate to chatRestylerGameStartCounterOutputStyle)
private String chatRestylerGameStartCounterOutputStyle = "^\u00a7e\u00a7l\\* \u00a7a(The game starts in|Cages open in:|You will respawn in|The Murderer gets their sword in|You get your sword in|The alpha infected will be chosen in|Kill contracts will be issued in|The Murderers get their swords in|You can start shooting in) \u00a7b\u00a7l\\d{1,3} \u00a7aseconds?!\u00a7r$";
private String chatRestylerFormattedPaddingPattern = "\\(§r§b(\\d{1,2})§r§r§r§e/§r§b(\\d{1,3})§r§r§r§e\\)";
private String chatRestylerPartyPattern = "^((?:\\u00a7r)?\\u00a7\\w)(Party )(\\u00a7\\w>)";
private String chatRestylerGuildPattern = "^((?:\\u00a7r)?\\u00a7\\w)(Guild >)";
private String chatRestylerFriendPattern = "^((?:\\u00a7r)?\\u00a7\\w)(Friend >)";
private String chatRestylerOfficerPattern = "^((?:\\u00a7r)?\\u00a7\\w)(Officer >)";
private String chatRestylerStatusPattern = "^(?<type>(?:§aFriend|§a§aF|§2Guild|§2§2G)) > (§r|§r§r){1,2}(?<player>§[\\da-f]\\w{1,16}) §r§e(?<status>(?:joined|left))\\.§r$";

private String autoChatSwapperPartyStatus = "^(?:You have been kicked from the party by (?:\\[.+] )?\\w{1,16}|(?:\\[.+] )?\\w{1,16} has disbanded the party!|You left the party(?:\\[.+] )?\\w{0,16}|(?:\\[.+] )?\\w{1,100}The party was disbanded(?:\\[.+] )?\\w{1,100}.)$";
private String chatRestylerGameJoinStyle = "^\u00a7r\u00a7e\u00a7r\u00a7(?<color>[\\da-f])(?:\u00a7k)?(?<player>\\w{1,16})\u00a7r\u00a7r\u00a7r\u00a7e has joined (?<amount>.+)!\u00a7r\u00a7e\u00a7r$";
private String chatRestylerGameLeaveStyle = "^\u00a7r\u00a7e\u00a7r\u00a7(?<color>[\\da-f])(?:\u00a7k)?(?<player>\\w{1,16})\u00a7r\u00a7r\u00a7r\u00a7e has quit!\u00a7r\u00a7e\u00a7r$";
private String chatRestylerGameStartCounterStyle = "^(?<title>(The game starts in|Cages open in:|You will respawn in|The Murderer gets their sword in|You get your sword in|The alpha infected will be chosen in|Kill contracts will be issued in|The Murderers get their swords in|You can start shooting in|The door opens in)) (?<time>\\d{1,3}) (?<unit>(seconds?!))(?: .\\d+.|)$";
private String chatRestylerGameStartCounterOutputStyle = "^\u00a7e\u00a7l\\* \u00a7a(The game starts in|Cages open in:|You will respawn in|The Murderer gets their sword in|You get your sword in|The alpha infected will be chosen in|Kill contracts will be issued in|The Murderers get their swords in|You can start shooting in|The door opens in) \u00a7b\u00a7l\\d{1,3} \u00a7aseconds?!\u00a7r$";
private String chatRestylerFormattedPaddingPattern = "\\(\u00a7r\u00a7b(\\d{1,2})\u00a7r\u00a7r\u00a7r\u00a7e/\u00a7r\u00a7b(\\d{1,3})\u00a7r\u00a7r\u00a7r\u00a7e\\)";
private String chatRestylerPartyPattern = "^((?:\u00a7r)?\u00a7\\w)(Party )(\\u00a7\\w>)";
private String chatRestylerGuildPattern = "^((?:\u00a7r)?\u00a7\\w)(Guild >)";
private String chatRestylerFriendPattern = "^((?:\u00a7r)?\u00a7\\w)(Friend >)";
private String chatRestylerOfficerPattern = "^((?:\u00a7r)?\u00a7\\w)(Officer >)";
private String chatRestylerStatusPattern = "^(?<type>(?:\u00a7aFriend|\u00a7a\u00a7aF|\u00a72Guild|\u00a72\u00a72G)) > (\u00a7r|\u00a7r\u00a7r){1,2}(?<player>\u00a7[\\da-f]\\w{1,16}) \u00a7r\u00a7e(?<status>(?:joined|left))\\.\u00a7r$";

private String autoChatSwapperPartyStatus = "^(?:You have been kicked from the party by (?:\\[.+] )?\\w{1,16}|(?:\\[.+] )?\\w{1,16} has disbanded the party!|You left the party.)$";
private String autoChatSwapperPartyStatus2 = "^(?:You have joined (?:\\[.+] )?(?:.*)|Party Members(?:\\[.+] )?\\w{1,100}|(?:\\[.+] )?\\w{1,100} joined the(?:.*) party(?:.*))$";
private String autoChatSwapperChannelSwap = "^You are now in the (?<channel>ALL|GUILD|OFFICER|PARTY) channel$";
private String autoChatSwapperChannelSwap = "^You are now in the (?<channel>ALL|GUILD|OFFICER) channel$";
public String autoChatSwapperAlreadyInChannel = "You're already in this channel!";

private String whiteChatNonMessage = "(?<prefix>.+)§7: (?<message>.*)";
private String privateMessageWhiteChat = "^(?<type>§dTo|§dFrom) (?<prefix>.+): §r(?<message>§7.*)(?:§r)?$";
private String whiteChatNonMessage = "(?<prefix>.+)\u00a77: (?<message>.*)";
private String privateMessageWhiteChat = "^(?<type>\u00a7dTo|\u00a7dFrom) (?<prefix>.+): \u00a7r(?<message>\u00a77.*)(?:\u00a7r)?$";

private String silentRemovalLeaveMessage = "(?:Friend|Guild) > (?<player>\\w{1,16}) left\\.";

Expand All @@ -88,10 +88,10 @@ public class LanguageData {
public String cannotShoutBeforeGame = "You can't use /shout before the game has started.";
public String cannotShoutAfterGame = "You can't use /shout after the game has finished.";

public String cancelGlMessages = "(?!.+: )(gl|glhf|good luck|have a good game|autogl by sk1er)";

private String hypixelLevelUp = "You are now Hypixel Level (?<level>\\d+)!";

private String cancelGlMessages = "(?!.+: )(gl|glhf|good luck|have a good game|autogl by sk1er)";

/**
* Cached values which use the messages read from the config file.
* Particularly Regexes.
Expand All @@ -111,15 +111,14 @@ public class LanguageData {
public Pattern chatCommonAdvertisementsRegex;
public Pattern chatRankBeggingRegex;
public Pattern chatCleanerGrinchPresentsRegex;
public Pattern connectedServerConnectMessageRegex;
public Pattern chatCleanerEarnedCoinsAndExpRegex;
public Pattern chatCleanerReplayRecordedRegex;
public Pattern chatCleanerTipRegex;
public Pattern chatCleanerOnlineStatusRegex;
public Pattern chatCleanerGameTipsRegex;
public Pattern chatCleanerStatsRegex;

public Pattern connectedServerConnectMessageRegex;

public Pattern achievementRegex;
public Pattern levelUpRegex;
public Pattern guildPlayerJoinRegex;
Expand All @@ -143,10 +142,10 @@ public class LanguageData {
public Pattern privateMessageWhiteChatRegex;
public Pattern silentRemovalLeaveMessageRegex;

public Pattern cancelGlMessagesRegex;

public Pattern hypixelLevelUpRegex;

public Pattern cancelGlMessagesRegex;

/**
* Compiles all the required patterns and caches them for later use.
*/
Expand All @@ -169,15 +168,14 @@ public void initialize() {
chatCommonAdvertisementsRegex = Pattern.compile(chatCommonAdvertisements, Pattern.CASE_INSENSITIVE);
chatRankBeggingRegex = Pattern.compile(chatRankBegging, Pattern.CASE_INSENSITIVE);
chatCleanerGrinchPresentsRegex = Pattern.compile(chatCleanerGrinchPresents);
connectedServerConnectMessageRegex = Pattern.compile(connectedServerConnectMessage);
chatCleanerEarnedCoinsAndExpRegex = Pattern.compile(chatCleanerEarnedCoinsAndExp);
chatCleanerReplayRecordedRegex = Pattern.compile(chatCleanerReplayRecorded);
chatCleanerTipRegex = Pattern.compile(chatCleanerTip);
chatCleanerOnlineStatusRegex = Pattern.compile(chatCleanerOnlineStatus);
chatCleanerGameTipsRegex = Pattern.compile(chatCleanerGameTips);
chatCleanerStatsRegex = Pattern.compile(chatCleanerStats);

connectedServerConnectMessageRegex = Pattern.compile(connectedServerConnectMessage);

achievementRegex = Pattern.compile(achievementPattern);
levelUpRegex = Pattern.compile(levelUpPattern);
guildPlayerJoinRegex = Pattern.compile(guildPlayerJoinPattern);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityArmorStand;
import net.minecraftforge.client.event.RenderLivingEvent;
import net.minecraftforge.fml.common.eventhandler.EventPriority;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;

public class ArmorStandHider {
@SubscribeEvent
@SubscribeEvent(priority = EventPriority.HIGHEST)
public void onEntityRenderer(RenderLivingEvent.Pre<EntityLivingBase> event) {
final LocrawInfo locraw = LocrawUtil.INSTANCE.getLocrawInfo();
if (HypixelUtils.INSTANCE.isHypixel() && locraw != null && (HytilsReborn.INSTANCE.getLobbyChecker().playerIsInLobby() && HytilsConfig.hideUselessArmorStands || HytilsConfig.hideUselessArmorStandsGame && (locraw.getGameType() == LocrawInfo.GameType.SKYBLOCK || locraw.getGameType() == LocrawInfo.GameType.BEDWARS || locraw.getGameType() == LocrawInfo.GameType.SKYWARS || locraw.getGameMode().contains("BRIDGE")))) {
Expand Down