diff options
Diffstat (limited to 'src/main/java/me/xmrvizzy/skyblocker/mixin/DrawContextMixin.java')
-rw-r--r-- | src/main/java/me/xmrvizzy/skyblocker/mixin/DrawContextMixin.java | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/main/java/me/xmrvizzy/skyblocker/mixin/DrawContextMixin.java b/src/main/java/me/xmrvizzy/skyblocker/mixin/DrawContextMixin.java index 0a1084cf..cfe979d0 100644 --- a/src/main/java/me/xmrvizzy/skyblocker/mixin/DrawContextMixin.java +++ b/src/main/java/me/xmrvizzy/skyblocker/mixin/DrawContextMixin.java @@ -36,7 +36,7 @@ public abstract class DrawContextMixin { @Shadow public abstract void fill(RenderLayer layer, int x1, int x2, int y1, int y2, int color); - + @Shadow public abstract int drawText(TextRenderer textRenderer, @Nullable String text, int x, int y, int color, boolean shadow); @@ -96,35 +96,35 @@ public abstract class DrawContextMixin { matrices.pop(); RenderSystem.enableDepthTest(); } - + @Inject(method = "drawItemInSlot(Lnet/minecraft/client/font/TextRenderer;Lnet/minecraft/item/ItemStack;IILjava/lang/String;)V", at = @At("HEAD")) private void skyblocker$renderAttributeShardDisplay(@Arg TextRenderer textRenderer, @Arg ItemStack stack, @Arg(ordinal = 0) int x, @Arg(ordinal = 1) int y, @Local(argsOnly = true) LocalRef<String> countOverride) { if (!SkyblockerConfig.get().general.itemInfoDisplay.attributeShardInfo) return; - + NbtCompound nbt = stack.getNbt(); - + if (Utils.isOnSkyblock() && nbt != null && nbt.contains("ExtraAttributes")) { NbtCompound extraAttributes = nbt.getCompound("ExtraAttributes"); - + if (extraAttributes.getString("id").equals("ATTRIBUTE_SHARD")) { NbtCompound attributesTag = extraAttributes.getCompound("attributes"); String[] attributes = attributesTag.getKeys().toArray(String[]::new); - + if (attributes.length != 0) { String attributeId = attributes[0]; int attributeLevel = attributesTag.getInt(attributeId); - + //Set item count countOverride.set(Integer.toString(attributeLevel)); - + //Draw the attribute name this.matrices.push(); this.matrices.translate(0f, 0f, 200f); - + String attributeInitials = AttributeShards.getShortName(attributeId); - + this.drawText(textRenderer, attributeInitials, x, y, Formatting.AQUA.getColorValue(), true); - + this.matrices.pop(); } } |