mirror of
https://github.com/ViaVersion/ViaFabricPlus.git
synced 2024-11-04 09:19:33 +01:00
Use Formatting class file in MixinDrawContext
This commit is contained in:
parent
610ae09d69
commit
52a4d2c5f6
@ -22,6 +22,7 @@ package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft.item;
|
||||
import de.florianmichael.viafabricplus.injection.access.IItemStack;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Formatting;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
@ -40,7 +41,7 @@ public abstract class MixinDrawContext {
|
||||
@Redirect(method = "drawItemInSlot(Lnet/minecraft/client/font/TextRenderer;Lnet/minecraft/item/ItemStack;IILjava/lang/String;)V", at = @At(value = "INVOKE", target = "Ljava/lang/String;valueOf(I)Ljava/lang/String;", remap = false))
|
||||
private String makeTextRed(int count) {
|
||||
if (count <= 0) {
|
||||
return "§c" + count;
|
||||
return Formatting.RED.toString() + count;
|
||||
}
|
||||
return String.valueOf(count);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user