diff --git a/docs/DEVELOPER_API.md b/docs/DEVELOPER_API.md index 33ecf621..13ad6162 100644 --- a/docs/DEVELOPER_API.md +++ b/docs/DEVELOPER_API.md @@ -65,7 +65,7 @@ if (ItemRegistryDiff.contains(Items.STONE, VersionRange.andOlder(VersionEnum.r1_ ```java public class ExampleSettingGroup extends SettingGroup { - private static final ExampleSettingGroup instance = new ExampleSettingGroup(); + private static final ExampleSettingGroup INSTANCE = new ExampleSettingGroup(); public final BooleanSetting test = new BooleanSetting(this, Text.of("Test"), false); @@ -74,7 +74,7 @@ public class ExampleSettingGroup extends SettingGroup { } public static ExampleSettingGroup global() { - return instance; + return INSTANCE; } } diff --git a/src/main/java/de/florianmichael/viafabricplus/ViaFabricPlus.java b/src/main/java/de/florianmichael/viafabricplus/ViaFabricPlus.java index 31460213..ab4e4002 100644 --- a/src/main/java/de/florianmichael/viafabricplus/ViaFabricPlus.java +++ b/src/main/java/de/florianmichael/viafabricplus/ViaFabricPlus.java @@ -51,7 +51,7 @@ import java.util.concurrent.CompletableFuture; */ public class ViaFabricPlus { - private static final ViaFabricPlus instance = new ViaFabricPlus(); + private static final ViaFabricPlus INSTANCE = new ViaFabricPlus(); private final Logger logger = LogManager.getLogger("ViaFabricPlus"); private final File directory = FabricLoader.getInstance().getConfigDir().resolve("viafabricplus").toFile(); @@ -77,7 +77,7 @@ public class ViaFabricPlus { } public static ViaFabricPlus global() { - return instance; + return INSTANCE; } public Logger getLogger() { diff --git a/src/main/java/de/florianmichael/viafabricplus/fixes/entity/EntityDimensionReplacements.java b/src/main/java/de/florianmichael/viafabricplus/fixes/entity/EntityDimensionReplacements.java index ed802a21..cd3fa83c 100644 --- a/src/main/java/de/florianmichael/viafabricplus/fixes/entity/EntityDimensionReplacements.java +++ b/src/main/java/de/florianmichael/viafabricplus/fixes/entity/EntityDimensionReplacements.java @@ -189,8 +189,8 @@ public class EntityDimensionReplacements { VersionEnum closestVersion = null; for (Map.Entry entry : dimensionMap.entrySet()) { - VersionEnum currentVersion = entry.getKey(); - EntityDimensions currentDimensions = entry.getValue(); + final var currentVersion = entry.getKey(); + final var currentDimensions = entry.getValue(); if (currentVersion == version) { // If the version is exactly the same, return the dimensions return currentDimensions; diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/MixinChatInputSuggestor.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/MixinChatInputSuggestor.java index 13fe74d4..0617af24 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/MixinChatInputSuggestor.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/MixinChatInputSuggestor.java @@ -59,14 +59,18 @@ public abstract class MixinChatInputSuggestor { @Inject(method = "provideRenderText", at = @At(value = "HEAD"), cancellable = true) private void disableTextFieldColors(String original, int firstCharacterIndex, CallbackInfoReturnable cir) { - if (!this.viaFabricPlus$cancelTabComplete()) return; + if (!this.viaFabricPlus$cancelTabComplete()) { + return; + } cir.setReturnValue(OrderedText.styledForwardsVisitedString(original, Style.EMPTY)); } @Inject(method = "keyPressed", at = @At("HEAD"), cancellable = true) private void handle1_12_2KeyPressed(int keyCode, int scanCode, int modifiers, CallbackInfoReturnable cir) { - if (!this.viaFabricPlus$cancelTabComplete()) return; + if (!this.viaFabricPlus$cancelTabComplete()) { + return; + } if (keyCode == GLFW.GLFW_KEY_TAB && this.window == null) { this.refresh(); @@ -82,7 +86,9 @@ public abstract class MixinChatInputSuggestor { @Inject(method = "render", at = @At("HEAD")) private void clearMessages(DrawContext drawContext, int mouseX, int mouseY, CallbackInfo ci) { - if (!this.viaFabricPlus$cancelTabComplete()) return; + if (!this.viaFabricPlus$cancelTabComplete()) { + return; + } this.messages.clear(); } diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/MixinFontStorage.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/MixinFontStorage.java index 5d76ad67..c64533a5 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/MixinFontStorage.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/MixinFontStorage.java @@ -97,16 +97,18 @@ public abstract class MixinFontStorage { private FontStorage.GlyphPair viaFabricPlus$getBlankGlyphPair() { if (VisualSettings.global().changeFontRendererBehaviour.isEnabled()) { return new FontStorage.GlyphPair(BuiltinEmptyGlyph1_12_2.INSTANCE, BuiltinEmptyGlyph1_12_2.INSTANCE); + } else { + return FontStorage.GlyphPair.MISSING; } - return FontStorage.GlyphPair.MISSING; } @Unique private GlyphRenderer viaFabricPlus$getBlankGlyphRenderer() { if (VisualSettings.global().changeFontRendererBehaviour.isEnabled()) { return this.viaFabricPlus$blankGlyphRenderer1_12_2; + } else { + return this.blankGlyphRenderer; } - return this.blankGlyphRenderer; } }