Skip to content

Commit

Permalink
Revert "Merge branch '1.18.x' into 1.19.x"
Browse files Browse the repository at this point in the history
This reverts commit a419d46, reversing
changes made to 41872b3.
  • Loading branch information
Gu-ZT committed Feb 16, 2023
1 parent a419d46 commit c6c95d2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 15 deletions.
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 4 additions & 13 deletions src/main/java/dev/dubhe/bugjump/mixin/FontStorageMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -16,22 +14,15 @@
public abstract class FontStorageMixin {
@Shadow
@Final
private Int2ObjectMap<Glyph> glyphCache;
private Int2ObjectMap<FontStorage.GlyphPair> 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<Glyph> cir) {
private synchronized void getGlyph(int codePoint, boolean validateAdvance, CallbackInfoReturnable<Glyph> 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)
);
}
}
2 changes: 2 additions & 0 deletions src/main/resources/bugjump.accesswidener
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit c6c95d2

Please sign in to comment.