Quellcode durchsuchen

Rename hide enum

Lortseam vor 4 Jahren
Ursprung
Commit
822cc10ff5

+ 3 - 3
src/main/java/me/lortseam/uglyscoreboardfix/Config.java

@@ -16,7 +16,7 @@ public final class Config implements ConfigCategory {
 
     private State state = State.AUTO;
     @ConfigEntry("hide")
-    private HideType hideType = HideType.SCORES;
+    private HidePart hidePart = HidePart.SCORES;
     @Getter
     private SidebarPosition position = SidebarPosition.RIGHT;
 
@@ -25,8 +25,8 @@ public final class Config implements ConfigCategory {
         return true;
     }
 
-    public boolean shouldHide(HideType hideType, ScoreboardObjective objective) {
-        return hideType == this.hideType && state.test(objective);
+    public boolean shouldHide(HidePart hidePart, ScoreboardObjective objective) {
+        return hidePart == this.hidePart && state.test(objective);
     }
 
     private enum State {

+ 1 - 1
src/main/java/me/lortseam/uglyscoreboardfix/HideType.java → src/main/java/me/lortseam/uglyscoreboardfix/HidePart.java

@@ -1,6 +1,6 @@
 package me.lortseam.uglyscoreboardfix;
 
-public enum HideType {
+public enum HidePart {
 
     SIDEBAR, SCORES
 

+ 5 - 5
src/main/java/me/lortseam/uglyscoreboardfix/mixin/InGameHudMixin.java

@@ -1,7 +1,7 @@
 package me.lortseam.uglyscoreboardfix.mixin;
 
 import me.lortseam.uglyscoreboardfix.Config;
-import me.lortseam.uglyscoreboardfix.HideType;
+import me.lortseam.uglyscoreboardfix.HidePart;
 import me.lortseam.uglyscoreboardfix.SidebarPosition;
 import net.minecraft.client.font.TextRenderer;
 import net.minecraft.client.gui.hud.InGameHud;
@@ -23,24 +23,24 @@ public abstract class InGameHudMixin {
 
     @Inject(method = "renderScoreboardSidebar", at = @At("HEAD"), cancellable = true)
     private void uglyscoreboardfix$modifySidebar(MatrixStack matrices, ScoreboardObjective objective, CallbackInfo ci) {
-        if (Config.getInstance().shouldHide(HideType.SIDEBAR, objective)) {
+        if (Config.getInstance().shouldHide(HidePart.SIDEBAR, objective)) {
             ci.cancel();
         }
     }
 
     @ModifyVariable(method = "renderScoreboardSidebar", at = @At("STORE"))
     private String uglyscoreboardfix$modifyScore(String score, MatrixStack matrices, ScoreboardObjective objective) {
-        return Config.getInstance().shouldHide(HideType.SCORES, objective) ? "" : score;
+        return Config.getInstance().shouldHide(HidePart.SCORES, objective) ? "" : score;
     }
 
     @ModifyVariable(method = "renderScoreboardSidebar", at = @At("STORE"), ordinal = 2)
     private int uglyscoreboardfix$modifySeperatorWidth(int seperatorWidth, MatrixStack matrices, ScoreboardObjective objective) {
-        return Config.getInstance().shouldHide(HideType.SCORES, objective) ? 0 : seperatorWidth;
+        return Config.getInstance().shouldHide(HidePart.SCORES, objective) ? 0 : seperatorWidth;
     }
 
     @Redirect(method = "renderScoreboardSidebar", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/font/TextRenderer;getWidth(Ljava/lang/String;)I", ordinal = 1))
     private int uglyscoreboardfix$modifyScoreWidth(TextRenderer textRenderer, String score, MatrixStack matrices, ScoreboardObjective objective) {
-        return Config.getInstance().shouldHide(HideType.SCORES, objective) ? 0 : textRenderer.getWidth(score);
+        return Config.getInstance().shouldHide(HidePart.SCORES, objective) ? 0 : textRenderer.getWidth(score);
     }
 
     @ModifyVariable(method = "renderScoreboardSidebar", at = @At("STORE"), ordinal = 5)