Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
anastarawneh committed Jul 5, 2023
1 parent ed0ae8e commit 3844ae3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ public class MCCINametagMod implements ModInitializer {
public static String RANK = "";
public static TextColor COLOR = TextColor.fromFormatting(Formatting.DARK_GRAY);
public static int GAME_STAGE = 0;
public static TextColor TEAM_COLOR = TextColor.fromFormatting(Formatting.GRAY);
public static TextColor FACTION_COLOR = TextColor.fromFormatting(Formatting.GRAY);

@Override
Expand All @@ -30,6 +29,7 @@ public static Config getConfig() {
return AutoConfig.getConfigHolder(Config.class).getConfig();
}

@SuppressWarnings("BooleanMethodIsAlwaysInverted")
public static boolean modEnabled() {
Config config = getConfig();
return config.enabled &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ else if (header.contains("BATTLE BOX")) {
if (MCCINametagMod.GAME_STAGE == 0) {
topLabel = Text.literal("");
bottomLabel = Text.literal(playerName).setStyle(Style.EMPTY.withColor(style.getColor()));
MCCINametagMod.TEAM_COLOR = style.getColor();
}
else if (MCCINametagMod.GAME_STAGE == 1) {
topLabel = Text.literal(UnicodeChars.TeamFlagBig).setStyle(Style.EMPTY.withColor(style.getColor()).withFont(new Identifier("mcc:icon")))
Expand Down Expand Up @@ -152,7 +151,6 @@ else if (header.contains("SKY BATTLE")) {
if (MCCINametagMod.GAME_STAGE == 0) {
topLabel = Text.literal("");
bottomLabel = Text.literal(playerName).setStyle(Style.EMPTY.withColor(style.getColor()));
MCCINametagMod.TEAM_COLOR = style.getColor();
}
else if (MCCINametagMod.GAME_STAGE == 1) {
topLabel = Text.literal(UnicodeChars.TeamFlagBig).setStyle(Style.EMPTY.withColor(style.getColor()).withFont(new Identifier("mcc:icon")))
Expand Down Expand Up @@ -441,7 +439,7 @@ else if (MCCINametagMod.GAME_STAGE == 1) {
topLabel = Text.literal(playerName).setStyle(Style.EMPTY.withColor(MCCINametagMod.COLOR));
Text actionBar = ((IngameHudAccessor) MinecraftClient.getInstance().inGameHud).getOverlayMessage();
int factionLevel = player.experienceLevel;
achievementPoints = Integer.parseInt(actionBar.getSiblings().get(5).getSiblings().get(1).getSiblings().get(1).getSiblings().get(1).getString());
achievementPoints = Integer.parseInt(actionBar.getSiblings().get(3).getSiblings().get(1).getSiblings().get(1).getSiblings().get(1).getString());
bottomLabel = Text.literal(MCCINametagMod.TEAM).setStyle(Style.EMPTY.withFont(new Identifier("mcc:icon")))
.append(Text.literal(factionLevel + " ").setStyle(Style.EMPTY.withFont(new Identifier("minecraft:default"))))
.append(Text.literal(UnicodeChars.ChampionScoreUnicode).setStyle(Style.EMPTY.withFont(new Identifier("mcc:icon"))))
Expand Down Expand Up @@ -469,7 +467,7 @@ else if (MCCINametagMod.GAME_STAGE == 1) {
float f = entity.getHeight() + 0.55F;
int i = "deadmau5".equals(bottomLabel.getString()) ? -10 : 0;
matrices.push();
matrices.translate(0.0, (double)f, 0.0);
matrices.translate(0.0, f, 0.0);
matrices.multiply(this.dispatcher.getRotation());
matrices.scale(-0.025F, -0.025F, 0.025F);
Matrix4f matrix4f = matrices.peek().getPositionMatrix();
Expand All @@ -488,7 +486,7 @@ else if (MCCINametagMod.GAME_STAGE == 1) {
f = entity.getHeight() + 0.92F;
i = "deadmau5".equals(topLabel.getString()) ? -10 : 0;
matrices.push();
matrices.translate(0.0, (double) f, 0.0);
matrices.translate(0.0, f, 0.0);
matrices.multiply(getDispatcher().getRotation());
matrices.scale(-0.025F, -0.025F, 0.025F);
matrix4f = matrices.peek().getPositionMatrix();
Expand Down

0 comments on commit 3844ae3

Please sign in to comment.