Skip to content

Commit

Permalink
fixed warden boots' tooltip
Browse files Browse the repository at this point in the history
  • Loading branch information
NewJumper committed Jul 17, 2024
1 parent 4d9cdb8 commit 8ea0c18
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ public abstract class ItemStackMixin {
@Inject(method = "getTooltipLines", at = @At("RETURN"))
public void getTooltipLines(Item.TooltipContext tooltipContext, @Nullable Player player, TooltipFlag tooltipFlag, CallbackInfoReturnable<List<Component>> cir) {
List<Component> components = cir.getReturnValue();
if(this.is(DDTags.Items.DAMPENS_VIBRATIONS)) components.add(Component.translatable("item." + DeeperDarker.MOD_ID + ".dampens_vibrations").withStyle(ChatFormatting.BLUE));
if(this.is(DDTags.Items.DAMPENS_VIBRATIONS)) {
int index = 0;
for(Component component : components) {
if(component.getString().contains("Durability")) break;
if(component.getString().contains("warden_boots")) break;
index++;
}
components.add(index, Component.translatable("item." + DeeperDarker.MOD_ID + ".dampens_vibrations").withStyle(ChatFormatting.BLUE));
}
}
}

0 comments on commit 8ea0c18

Please sign in to comment.