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
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;
}
}

View File

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

View File

@ -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() {

View File

@ -189,8 +189,8 @@ public class EntityDimensionReplacements {
VersionEnum closestVersion = null;
for (Map.Entry<VersionEnum, EntityDimensions> 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;

View File

@ -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<OrderedText> 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<Boolean> 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();
}

View File

@ -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;
}
}