diff options
Diffstat (limited to 'src/main/java/me')
-rw-r--r-- | src/main/java/me/xmrvizzy/skyblocker/mixin/DrawContextMixin.java | 45 |
1 files changed, 22 insertions, 23 deletions
diff --git a/src/main/java/me/xmrvizzy/skyblocker/mixin/DrawContextMixin.java b/src/main/java/me/xmrvizzy/skyblocker/mixin/DrawContextMixin.java index 8cde4973..f35cc169 100644 --- a/src/main/java/me/xmrvizzy/skyblocker/mixin/DrawContextMixin.java +++ b/src/main/java/me/xmrvizzy/skyblocker/mixin/DrawContextMixin.java @@ -73,8 +73,7 @@ public abstract class DrawContextMixin { max = Integer.parseInt(split[1]) * 1000; } break; - } - else if (line.contains("uses.")) { + } else if (line.contains("uses.")) { if (clearFormatting != null) { int startIndex = clearFormatting.lastIndexOf("after") + 6; int endIndex = clearFormatting.indexOf("uses", startIndex); @@ -100,36 +99,36 @@ public abstract class DrawContextMixin { @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; + if (!SkyblockerConfig.get().general.itemInfoDisplay.attributeShardInfo) return; - NbtCompound nbt = stack.getNbt(); + NbtCompound nbt = stack.getNbt(); - if (Utils.isOnSkyblock() && nbt != null && nbt.contains("ExtraAttributes")) { - NbtCompound extraAttributes = nbt.getCompound("ExtraAttributes"); + 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 (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); + if (attributes.length != 0) { + String attributeId = attributes[0]; + int attributeLevel = attributesTag.getInt(attributeId); - //Set item count - countOverride.set(Integer.toString(attributeLevel)); + //Set item count + countOverride.set(Integer.toString(attributeLevel)); - //Draw the attribute name - this.matrices.push(); - this.matrices.translate(0f, 0f, 200f); + //Draw the attribute name + this.matrices.push(); + this.matrices.translate(0f, 0f, 200f); - String attributeInitials = AttributeShards.getShortName(attributeId); + String attributeInitials = AttributeShards.getShortName(attributeId); - this.drawText(textRenderer, attributeInitials, x, y, Formatting.AQUA.getColorValue(), true); + this.drawText(textRenderer, attributeInitials, x, y, Formatting.AQUA.getColorValue(), true); - this.matrices.pop(); - } - } - } + this.matrices.pop(); + } + } + } } @ModifyExpressionValue(method = "drawItemInSlot(Lnet/minecraft/client/font/TextRenderer;Lnet/minecraft/item/ItemStack;IILjava/lang/String;)V", |