116 lines
4 KiB
Java
116 lines
4 KiB
Java
package defpackage;
|
|
|
|
import com.mojang.blaze3d.systems.RenderSystem;
|
|
import it.unimi.dsi.fastutil.ints.Int2FloatMap;
|
|
import it.unimi.dsi.fastutil.ints.Int2FloatOpenHashMap;
|
|
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
|
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
|
|
import net.minecraft.client.renderer.texture.AbstractTexture;
|
|
import net.minecraft.resources.Identifier;
|
|
|
|
public class gq {
|
|
private String name = "?";
|
|
private Identifier dataIdentifer;
|
|
private Identifier atlasIdentifier;
|
|
|
|
gq() {
|
|
}
|
|
|
|
public gq name(String var1) {
|
|
this.name = var1;
|
|
return this;
|
|
}
|
|
|
|
public gq data(String var1) {
|
|
this.dataIdentifer = bz.id("fonts/msdf/" + var1 + ".json");
|
|
return this;
|
|
}
|
|
|
|
public gq atlas(String var1) {
|
|
this.atlasIdentifier = bz.id("fonts/msdf/" + var1 + ".png");
|
|
return this;
|
|
}
|
|
|
|
public gr build() {
|
|
gk var1 = null;
|
|
AbstractTexture var2 = null;
|
|
float var3 = 0.0F;
|
|
float var4 = 0.0F;
|
|
Int2ObjectMap var5 = null;
|
|
Int2ObjectMap var6 = null;
|
|
int var7 = 356199447;
|
|
|
|
while (true) {
|
|
switch (var7) {
|
|
case 356199447:
|
|
default:
|
|
var1 = gu.fromJsonToInstance(this.dataIdentifer, gk.class);
|
|
var2 = aqg.mc.getTextureManager().getTexture(this.atlasIdentifier);
|
|
if (var1 == null) {
|
|
var7 = 2056558849;
|
|
} else {
|
|
var7 = 1698492294;
|
|
}
|
|
break;
|
|
case 1698492294:
|
|
RenderSystem.queueFencedTask(() -> {});
|
|
var3 = var1.atlas().width();
|
|
var4 = var1.atlas().height();
|
|
var5 = new Int2ObjectOpenHashMap(var1.glyphs().size());
|
|
var1.glyphs().forEach(var4x -> {
|
|
int var5x = -1960445927;
|
|
|
|
while (true) {
|
|
switch (var5x) {
|
|
case -2075873208:
|
|
throw new IllegalStateException("Duplicate glyph for codepoint " + var4x.unicode() + " in font data file: " + this.dataIdentifer);
|
|
case -1960445927:
|
|
default:
|
|
if (var5.put(var4x.unicode(), new gs(var4x, var3, var4)) != null) {
|
|
var5x = -2075873208;
|
|
} else {
|
|
var5x = -512376672;
|
|
}
|
|
break;
|
|
case -512376672:
|
|
return;
|
|
}
|
|
}
|
|
});
|
|
var6 = new Int2ObjectOpenHashMap();
|
|
var1.kernings().forEach(var1x -> {
|
|
Int2FloatMap var2x = null;
|
|
int var3x = 1404889885;
|
|
|
|
while (true) {
|
|
switch (var3x) {
|
|
case -1962218833:
|
|
var2x.put(var1x.rightChar(), var1x.advance());
|
|
return;
|
|
case 1404889885:
|
|
default:
|
|
var2x = (Int2FloatMap)var6.get(var1x.leftChar());
|
|
if (var2x == null) {
|
|
var3x = 1773977768;
|
|
} else {
|
|
var3x = -1962218833;
|
|
}
|
|
break;
|
|
case 1773977768:
|
|
var2x = new Int2FloatOpenHashMap();
|
|
var6.put(var1x.leftChar(), var2x);
|
|
var3x = -1962218833;
|
|
}
|
|
}
|
|
});
|
|
return new gr(this.name, this.atlasIdentifier, var2, var1.atlas(), var1.metrics(), var5, var6);
|
|
case 2056558849:
|
|
throw new RuntimeException(
|
|
"Failed to read font data file: "
|
|
+ this.dataIdentifer.toString()
|
|
+ "; Are you sure this is json file? Try to check the correctness of its syntax."
|
|
);
|
|
}
|
|
}
|
|
}
|
|
}
|