Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
RaphiMC committed Dec 28, 2023
2 parents f2570ea + 5c07c00 commit f555b46
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 12 deletions.
4 changes: 2 additions & 2 deletions docs/DEVELOPER_API.md
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -74,7 +74,7 @@ public class ExampleSettingGroup extends SettingGroup {
}

public static ExampleSettingGroup global() {
return instance;
return INSTANCE;
}

}
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
*/
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();
Expand All @@ -77,7 +77,7 @@ public void bootstrap() {
}

public static ViaFabricPlus global() {
return instance;
return INSTANCE;
}

public Logger getLogger() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,8 @@ public static EntityDimensions getEntityDimensions(final EntityType<?> entityTyp
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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -82,7 +86,9 @@ private void handle1_12_2KeyPressed(int keyCode, int scanCode, int modifiers, Ca

@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();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,16 +97,18 @@ private GlyphRenderer fixBlankGlyphRenderer1_12_2(FontStorage instance) {
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;
}

}

0 comments on commit f555b46

Please sign in to comment.