Skip to content

Commit

Permalink
Merge pull request #288 from kaitlinclarson/main
Browse files Browse the repository at this point in the history
Fix descriptions on pushing/pulling/collector/redstone upgrades
  • Loading branch information
Buuz135 authored Aug 21, 2024
2 parents b6d4d56 + c086637 commit 1ea08eb
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions src/main/java/com/buuz135/functionalstorage/item/UpgradeItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,19 +93,16 @@ public void addTooltipDetails(@Nullable BasicItem.Key key, ItemStack stack, List
super.addTooltipDetails(key, stack, tooltip, advanced);
tooltip.add(Component.translatable("upgrade.type").withStyle(ChatFormatting.YELLOW).append(Component.translatable("upgrade.type." + getType().name().toLowerCase(Locale.ROOT)).withStyle(ChatFormatting.WHITE)));
Item item = stack.getItem();
if (stack.hasTag()) {
if (item.equals(FunctionalStorage.PULLING_UPGRADE.get()) || item.equals(FunctionalStorage.PUSHING_UPGRADE.get()) || item.equals(FunctionalStorage.COLLECTOR_UPGRADE.get())) {
tooltip.add(Component.translatable("item.utility.direction").withStyle(ChatFormatting.YELLOW).append(Component.translatable(WordUtils.capitalize(getDirection(stack).getName().toLowerCase(Locale.ROOT))).withStyle(ChatFormatting.WHITE)));
tooltip.add(Component.literal(""));
tooltip.add(Component.translatable("item.utility.direction.desc").withStyle(ChatFormatting.GRAY));
}
if (item.equals(FunctionalStorage.REDSTONE_UPGRADE.get())) {
tooltip.add(Component.translatable("item.utility.slot").withStyle(ChatFormatting.YELLOW).append(Component.literal(stack.getOrCreateTag().getInt("Slot") + "").withStyle(ChatFormatting.WHITE)));
tooltip.add(Component.literal(""));
tooltip.add(Component.translatable("item.utility.direction.desc").withStyle(ChatFormatting.GRAY));
}
if (item.equals(FunctionalStorage.PULLING_UPGRADE.get()) || item.equals(FunctionalStorage.PUSHING_UPGRADE.get()) || item.equals(FunctionalStorage.COLLECTOR_UPGRADE.get())) {
tooltip.add(Component.translatable("item.utility.direction").withStyle(ChatFormatting.YELLOW).append(Component.translatable(WordUtils.capitalize(getDirection(stack).getName().toLowerCase(Locale.ROOT))).withStyle(ChatFormatting.WHITE)));
tooltip.add(Component.literal(""));
tooltip.add(Component.translatable("item.utility.direction.desc").withStyle(ChatFormatting.GRAY));
}
if (item.equals(FunctionalStorage.REDSTONE_UPGRADE.get())) {
tooltip.add(Component.translatable("item.utility.slot").withStyle(ChatFormatting.YELLOW).append(Component.literal(stack.getOrCreateTag().getInt("Slot") + "").withStyle(ChatFormatting.WHITE)));
tooltip.add(Component.literal(""));
tooltip.add(Component.translatable("item.utility.slot.desc").withStyle(ChatFormatting.GRAY));
}

}

@Override
Expand Down

0 comments on commit 1ea08eb

Please sign in to comment.