JustEnoughResources icon indicating copy to clipboard operation
JustEnoughResources copied to clipboard

JER doesn't support custom text fonts

Open Speiger opened this issue 2 years ago • 2 comments

o/

We use custom fonts to implement a icon system. Which is the best way to keep it compatible with minecraft mods. Sadly JER doesn't support or breaks custom fonts when used. Image

Could you be so nice to fix this issue?

Edit the issue is here: https://github.com/way2muchnoise/JustEnoughResources/blob/58b543c80024eeb59498b852eb821fed09f4cd4a/Common/src/main/java/jeresources/entry/EnchantmentEntry.java#L16 Potential Fix

	public Component getTranslatedWithLevels() {
		MutableComponent comp = Component.empty();
		comp.append(this.enchantment.getFullname(1));
		if (this.enchantment.getMinLevel() != this.enchantment.getMaxLevel())
			comp.append("-").append(Component.translatable("enchantment.level." + this.enchantment.getMaxLevel()));
		return comp;
	}

Speiger avatar Feb 17 '23 17:02 Speiger

Seems like a good fix, the raw string work is not current practice anyway. It needs to moved to use components. Will merge this is in :)

way2muchnoise avatar Feb 26 '23 13:02 way2muchnoise

@way2muchnoise fixed a small bug in the code provided. But in the sense that the Enchantment level was still a string instead of a component.

Speiger avatar Feb 26 '23 17:02 Speiger