From c6c95d2d42d8d3ec9361a7c5200f632c8ece1aef Mon Sep 17 00:00:00 2001 From: Gu_ZT Date: Thu, 16 Feb 2023 14:51:18 +0800 Subject: [PATCH] Revert "Merge branch '1.18.x' into 1.19.x" This reverts commit a419d4664a999ce687b901f6a32fe7485fb26a7d, reversing changes made to 41872b372f528c4067beea049255d2bc6e778e96. --- gradle.properties | 4 ++-- .../dubhe/bugjump/mixin/FontStorageMixin.java | 17 ++++------------- src/main/resources/bugjump.accesswidener | 2 ++ 3 files changed, 8 insertions(+), 15 deletions(-) diff --git a/gradle.properties b/gradle.properties index 3260545..c77eac8 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,8 +2,8 @@ org.gradle.jvmargs=-Xmx1G # Fabric Properties # check these on https://modmuss50.me/fabric.html -minecraft_version=1.18.2 -yarn_mappings=1.18.2+build.4 +minecraft_version=1.19.2 +yarn_mappings=1.19.2+build.4 loader_version=0.14.13 # Mod Properties mod_version=1.0.0 diff --git a/src/main/java/dev/dubhe/bugjump/mixin/FontStorageMixin.java b/src/main/java/dev/dubhe/bugjump/mixin/FontStorageMixin.java index a81cf0f..910964a 100644 --- a/src/main/java/dev/dubhe/bugjump/mixin/FontStorageMixin.java +++ b/src/main/java/dev/dubhe/bugjump/mixin/FontStorageMixin.java @@ -3,8 +3,6 @@ import it.unimi.dsi.fastutil.ints.Int2ObjectMap; import net.minecraft.client.font.FontStorage; import net.minecraft.client.font.Glyph; -import net.minecraft.client.font.RenderableGlyph; -import org.jetbrains.annotations.Nullable; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; @@ -16,22 +14,15 @@ public abstract class FontStorageMixin { @Shadow @Final - private Int2ObjectMap glyphCache; + private Int2ObjectMap glyphCache; @Shadow - @Nullable - protected abstract Glyph getEmptyGlyph(int codePoint); - - @Shadow - protected abstract RenderableGlyph getRenderableGlyph(int codePoint); + protected abstract FontStorage.GlyphPair findGlyph(int codePoint); @Inject(method = "getGlyph", at = @At("HEAD"), cancellable = true) - private synchronized void getGlyph(int codePoint, CallbackInfoReturnable cir) { + private synchronized void getGlyph(int codePoint, boolean validateAdvance, CallbackInfoReturnable cir) { cir.setReturnValue( - this.glyphCache.computeIfAbsent(codePoint, (codePointx) -> { - Glyph glyph = this.getEmptyGlyph(codePointx); - return (Glyph) (glyph == null ? this.getRenderableGlyph(codePointx) : glyph); - }) + this.glyphCache.computeIfAbsent(codePoint, this::findGlyph).getGlyph(validateAdvance) ); } } diff --git a/src/main/resources/bugjump.accesswidener b/src/main/resources/bugjump.accesswidener index c739d57..69ab10f 100644 --- a/src/main/resources/bugjump.accesswidener +++ b/src/main/resources/bugjump.accesswidener @@ -1,2 +1,4 @@ accessWidener v1 named +accessible class net/minecraft/client/font/FontStorage$GlyphPair +accessible method net/minecraft/client/font/FontStorage$GlyphPair getGlyph (Z)Lnet/minecraft/client/font/Glyph; accessible method net/minecraft/client/gui/DrawableHelper drawTexturedQuad (Lnet/minecraft/util/math/Matrix4f;IIIIIFFFF)V