mirror of
https://github.com/ViaVersion/ViaFabricPlus.git
synced 2024-09-06 01:07:59 +02:00
Completely disable all Font rendering changes in case DashLoader is installed
This commit is contained in:
parent
2fcf59bfa3
commit
51538b6fc7
@ -28,10 +28,14 @@ ViaFabricPlus is intended to replace [multiconnect](https://github.com/Earthcomp
|
|||||||
### If you encounter any issues, please report them on the [issue tracker](https://github.com/ViaVersion/ViaFabricPlus/issues) or on the ViaVersion [Discord](https://discord.gg/viaversion)
|
### If you encounter any issues, please report them on the [issue tracker](https://github.com/ViaVersion/ViaFabricPlus/issues) or on the ViaVersion [Discord](https://discord.gg/viaversion)
|
||||||
|
|
||||||
## Known incompatibilities
|
## Known incompatibilities
|
||||||
|
### Breaks
|
||||||
- ***[ViaFabric (*)](https://github.com/ViaVersion/ViaFabric)***
|
- ***[ViaFabric (*)](https://github.com/ViaVersion/ViaFabric)***
|
||||||
- ***[krypton (<= 0.2.2)](https://github.com/astei/krypton)***
|
- ***[krypton (<= 0.2.2)](https://github.com/astei/krypton)***
|
||||||
- ***[MemoryLeakFix (<= 1.1.0)](https://github.com/astei/krypton)***
|
- ***[MemoryLeakFix (<= 1.1.0)](https://github.com/astei/krypton)***
|
||||||
|
|
||||||
|
### Conflicts
|
||||||
|
- ***[DashLoader (*)](https://github.com/alphaqu/DashLoader/tree/fabric-1.20)*** - Font rendering related fixes aren't working
|
||||||
|
|
||||||
## List of all clientside related fixes and TODO
|
## List of all clientside related fixes and TODO
|
||||||
<details>
|
<details>
|
||||||
<summary>Click to open</summary>
|
<summary>Click to open</summary>
|
||||||
|
@ -35,16 +35,15 @@ public class FontRenderer1_12_2 {
|
|||||||
public static void init() {
|
public static void init() {
|
||||||
if (DASH_LOADER) return;
|
if (DASH_LOADER) return;
|
||||||
|
|
||||||
|
// Reload all font renderer storage
|
||||||
ChangeProtocolVersionCallback.EVENT.register(protocolVersion ->
|
ChangeProtocolVersionCallback.EVENT.register(protocolVersion ->
|
||||||
MinecraftClient.getInstance().fontManager.fontStorages.values().forEach(fontStorage ->
|
MinecraftClient.getInstance().fontManager.fontStorages.values().
|
||||||
RenderSystem.recordRenderCall(() -> ((IFontStorage) fontStorage).viafabricplus_clearCaches())));
|
forEach(fontStorage -> RenderSystem.recordRenderCall(() -> ((IFontStorage) fontStorage).viafabricplus_clearCaches())));
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean shouldReplaceFontRenderer() {
|
|
||||||
if (DASH_LOADER) return false;
|
|
||||||
return VisualSettings.INSTANCE.changeFontRendererBehaviour.isEnabled();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Implementation of a "Very Missing" Glyph which doesn't have any rendering at all ("Missing" in <= 1.12.2)
|
||||||
|
*/
|
||||||
public enum BuiltinEmptyGlyph1_12_2 implements Glyph {
|
public enum BuiltinEmptyGlyph1_12_2 implements Glyph {
|
||||||
|
|
||||||
VERY_MISSING;
|
VERY_MISSING;
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft;
|
package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft;
|
||||||
|
|
||||||
|
import de.florianmichael.viafabricplus.base.settings.groups.VisualSettings;
|
||||||
import de.florianmichael.viafabricplus.definition.FontRenderer1_12_2;
|
import de.florianmichael.viafabricplus.definition.FontRenderer1_12_2;
|
||||||
import de.florianmichael.viafabricplus.injection.access.IFontStorage;
|
import de.florianmichael.viafabricplus.injection.access.IFontStorage;
|
||||||
import de.florianmichael.viafabricplus.mappings.CharacterMappings;
|
import de.florianmichael.viafabricplus.mappings.CharacterMappings;
|
||||||
@ -81,10 +82,12 @@ public abstract class MixinFontStorage implements IFontStorage {
|
|||||||
|
|
||||||
@Inject(method = "findGlyph", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/font/Font;getGlyph(I)Lnet/minecraft/client/font/Glyph;"), locals = LocalCapture.CAPTURE_FAILHARD, cancellable = true)
|
@Inject(method = "findGlyph", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/font/Font;getGlyph(I)Lnet/minecraft/client/font/Glyph;"), locals = LocalCapture.CAPTURE_FAILHARD, cancellable = true)
|
||||||
public void injectFindGlyph(int codePoint, CallbackInfoReturnable<FontStorage.GlyphPair> cir, Glyph glyph, Iterator var3, Font font) {
|
public void injectFindGlyph(int codePoint, CallbackInfoReturnable<FontStorage.GlyphPair> cir, Glyph glyph, Iterator var3, Font font) {
|
||||||
if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_19_4) && this.id.getNamespace().equals("minecraft")) {
|
if (FontRenderer1_12_2.DASH_LOADER || !this.id.getNamespace().equals("minecraft")) return;
|
||||||
|
|
||||||
|
if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_19_4)) {
|
||||||
if (viafabricplus_isForbiddenCharacter(font, codePoint)) cir.setReturnValue(FontStorage.GlyphPair.MISSING);
|
if (viafabricplus_isForbiddenCharacter(font, codePoint)) cir.setReturnValue(FontStorage.GlyphPair.MISSING);
|
||||||
|
|
||||||
if (FontRenderer1_12_2.shouldReplaceFontRenderer() && cir.getReturnValue() == FontStorage.GlyphPair.MISSING) {
|
if (VisualSettings.INSTANCE.changeFontRendererBehaviour.isEnabled() && cir.getReturnValue() == FontStorage.GlyphPair.MISSING) {
|
||||||
cir.setReturnValue(new FontStorage.GlyphPair(FontRenderer1_12_2.BuiltinEmptyGlyph1_12_2.VERY_MISSING, FontRenderer1_12_2.BuiltinEmptyGlyph1_12_2.VERY_MISSING));
|
cir.setReturnValue(new FontStorage.GlyphPair(FontRenderer1_12_2.BuiltinEmptyGlyph1_12_2.VERY_MISSING, FontRenderer1_12_2.BuiltinEmptyGlyph1_12_2.VERY_MISSING));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -92,10 +95,12 @@ public abstract class MixinFontStorage implements IFontStorage {
|
|||||||
|
|
||||||
@Inject(method = "findGlyphRenderer", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/font/Font;getGlyph(I)Lnet/minecraft/client/font/Glyph;"), locals = LocalCapture.CAPTURE_FAILHARD, cancellable = true)
|
@Inject(method = "findGlyphRenderer", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/font/Font;getGlyph(I)Lnet/minecraft/client/font/Glyph;"), locals = LocalCapture.CAPTURE_FAILHARD, cancellable = true)
|
||||||
public void injectFindGlyphRenderer(int codePoint, CallbackInfoReturnable<GlyphRenderer> cir, Iterator var2, Font font) {
|
public void injectFindGlyphRenderer(int codePoint, CallbackInfoReturnable<GlyphRenderer> cir, Iterator var2, Font font) {
|
||||||
if (!viafabricplus_obfuscation && ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_19_4) && this.id.getNamespace().equals("minecraft")) {
|
if (FontRenderer1_12_2.DASH_LOADER || !this.id.getNamespace().equals("minecraft")) return;
|
||||||
|
|
||||||
|
if (!viafabricplus_obfuscation && ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_19_4)) {
|
||||||
if (viafabricplus_isForbiddenCharacter(font, codePoint)) cir.setReturnValue(this.blankGlyphRenderer);
|
if (viafabricplus_isForbiddenCharacter(font, codePoint)) cir.setReturnValue(this.blankGlyphRenderer);
|
||||||
|
|
||||||
if (FontRenderer1_12_2.shouldReplaceFontRenderer() && cir.getReturnValue() == this.blankGlyphRenderer) {
|
if (VisualSettings.INSTANCE.changeFontRendererBehaviour.isEnabled() && cir.getReturnValue() == this.blankGlyphRenderer) {
|
||||||
cir.setReturnValue(FontRenderer1_12_2.BuiltinEmptyGlyph1_12_2.VERY_MISSING.bake(this::getGlyphRenderer));
|
cir.setReturnValue(FontRenderer1_12_2.BuiltinEmptyGlyph1_12_2.VERY_MISSING.bake(this::getGlyphRenderer));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -42,5 +42,8 @@
|
|||||||
"viafabric": "*",
|
"viafabric": "*",
|
||||||
"memoryleakfix": "<=1.1.0",
|
"memoryleakfix": "<=1.1.0",
|
||||||
"krypton": "<=0.2.2"
|
"krypton": "<=0.2.2"
|
||||||
|
},
|
||||||
|
"conflicts": {
|
||||||
|
"dashloader": "*"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user