Merge remote-tracking branch 'origin/main'

This commit is contained in:
RaphiMC 2023-12-28 16:38:55 +01:00
commit f555b465fc
No known key found for this signature in database
GPG Key ID: 0F6BB0657A03AC94
6 changed files with 20 additions and 12 deletions

View File

@ -65,7 +65,7 @@ if (ItemRegistryDiff.contains(Items.STONE, VersionRange.andOlder(VersionEnum.r1_
```java ```java
public class ExampleSettingGroup extends SettingGroup { 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); public final BooleanSetting test = new BooleanSetting(this, Text.of("Test"), false);
@ -74,7 +74,7 @@ public class ExampleSettingGroup extends SettingGroup {
} }
public static ExampleSettingGroup global() { public static ExampleSettingGroup global() {
return instance; return INSTANCE;
} }
} }

View File

@ -9,7 +9,7 @@ loader_version=0.15.3
fabric_api_version=0.91.3+1.20.4 fabric_api_version=0.91.3+1.20.4
# Project Details # Project Details
mod_version=3.0.3-SNAPSHOT mod_version=3.0.4-SNAPSHOT
maven_group=de.florianmichael maven_group=de.florianmichael
archives_base_name=viafabricplus archives_base_name=viafabricplus

View File

@ -51,7 +51,7 @@ import java.util.concurrent.CompletableFuture;
*/ */
public class ViaFabricPlus { 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 Logger logger = LogManager.getLogger("ViaFabricPlus");
private final File directory = FabricLoader.getInstance().getConfigDir().resolve("viafabricplus").toFile(); private final File directory = FabricLoader.getInstance().getConfigDir().resolve("viafabricplus").toFile();
@ -77,7 +77,7 @@ public class ViaFabricPlus {
} }
public static ViaFabricPlus global() { public static ViaFabricPlus global() {
return instance; return INSTANCE;
} }
public Logger getLogger() { public Logger getLogger() {

View File

@ -189,8 +189,8 @@ public class EntityDimensionReplacements {
VersionEnum closestVersion = null; VersionEnum closestVersion = null;
for (Map.Entry<VersionEnum, EntityDimensions> entry : dimensionMap.entrySet()) { for (Map.Entry<VersionEnum, EntityDimensions> entry : dimensionMap.entrySet()) {
VersionEnum currentVersion = entry.getKey(); final var currentVersion = entry.getKey();
EntityDimensions currentDimensions = entry.getValue(); final var currentDimensions = entry.getValue();
if (currentVersion == version) { // If the version is exactly the same, return the dimensions if (currentVersion == version) { // If the version is exactly the same, return the dimensions
return currentDimensions; return currentDimensions;

View File

@ -59,14 +59,18 @@ public abstract class MixinChatInputSuggestor {
@Inject(method = "provideRenderText", at = @At(value = "HEAD"), cancellable = true) @Inject(method = "provideRenderText", at = @At(value = "HEAD"), cancellable = true)
private void disableTextFieldColors(String original, int firstCharacterIndex, CallbackInfoReturnable<OrderedText> cir) { private void disableTextFieldColors(String original, int firstCharacterIndex, CallbackInfoReturnable<OrderedText> cir) {
if (!this.viaFabricPlus$cancelTabComplete()) return; if (!this.viaFabricPlus$cancelTabComplete()) {
return;
}
cir.setReturnValue(OrderedText.styledForwardsVisitedString(original, Style.EMPTY)); cir.setReturnValue(OrderedText.styledForwardsVisitedString(original, Style.EMPTY));
} }
@Inject(method = "keyPressed", at = @At("HEAD"), cancellable = true) @Inject(method = "keyPressed", at = @At("HEAD"), cancellable = true)
private void handle1_12_2KeyPressed(int keyCode, int scanCode, int modifiers, CallbackInfoReturnable<Boolean> cir) { private void handle1_12_2KeyPressed(int keyCode, int scanCode, int modifiers, CallbackInfoReturnable<Boolean> cir) {
if (!this.viaFabricPlus$cancelTabComplete()) return; if (!this.viaFabricPlus$cancelTabComplete()) {
return;
}
if (keyCode == GLFW.GLFW_KEY_TAB && this.window == null) { if (keyCode == GLFW.GLFW_KEY_TAB && this.window == null) {
this.refresh(); this.refresh();
@ -82,7 +86,9 @@ public abstract class MixinChatInputSuggestor {
@Inject(method = "render", at = @At("HEAD")) @Inject(method = "render", at = @At("HEAD"))
private void clearMessages(DrawContext drawContext, int mouseX, int mouseY, CallbackInfo ci) { private void clearMessages(DrawContext drawContext, int mouseX, int mouseY, CallbackInfo ci) {
if (!this.viaFabricPlus$cancelTabComplete()) return; if (!this.viaFabricPlus$cancelTabComplete()) {
return;
}
this.messages.clear(); this.messages.clear();
} }

View File

@ -97,16 +97,18 @@ public abstract class MixinFontStorage {
private FontStorage.GlyphPair viaFabricPlus$getBlankGlyphPair() { private FontStorage.GlyphPair viaFabricPlus$getBlankGlyphPair() {
if (VisualSettings.global().changeFontRendererBehaviour.isEnabled()) { if (VisualSettings.global().changeFontRendererBehaviour.isEnabled()) {
return new FontStorage.GlyphPair(BuiltinEmptyGlyph1_12_2.INSTANCE, BuiltinEmptyGlyph1_12_2.INSTANCE); return new FontStorage.GlyphPair(BuiltinEmptyGlyph1_12_2.INSTANCE, BuiltinEmptyGlyph1_12_2.INSTANCE);
} } else {
return FontStorage.GlyphPair.MISSING; return FontStorage.GlyphPair.MISSING;
} }
}
@Unique @Unique
private GlyphRenderer viaFabricPlus$getBlankGlyphRenderer() { private GlyphRenderer viaFabricPlus$getBlankGlyphRenderer() {
if (VisualSettings.global().changeFontRendererBehaviour.isEnabled()) { if (VisualSettings.global().changeFontRendererBehaviour.isEnabled()) {
return this.viaFabricPlus$blankGlyphRenderer1_12_2; return this.viaFabricPlus$blankGlyphRenderer1_12_2;
} } else {
return this.blankGlyphRenderer; return this.blankGlyphRenderer;
} }
}
} }