Skip to content

Commit

Permalink
more lore, drop fabric loader req
Browse files Browse the repository at this point in the history
  • Loading branch information
JustAHuman-xD committed Jul 11, 2024
1 parent 9206340 commit d220630
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 8 deletions.
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ org.gradle.jvmargs=-Xmx1G

minecraft_version=1.20.1
yarn_mappings=1.20.1+build.10
loader_version=0.16.0
loader_version=0.15.11

mod_version = 0.1.0
mod_version = 0.1.1
maven_group = me.justahuman
archives_base_name = DystorianTweaks

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package me.justahuman.dystoriantweaks.mixins;

import me.justahuman.dystoriantweaks.Utils;
import net.fabricmc.loader.impl.util.StringUtil;
import net.minecraft.client.item.TooltipContext;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.Item;
Expand Down Expand Up @@ -46,7 +47,7 @@ public void changeTooltip(PlayerEntity player, TooltipContext context, CallbackI
Text name = lore.get(0);
final boolean shiny = Utils.get(customData, "Shiny", false);
if (shiny) {
name = name.copy().append(Text.literal(" ★").formatted(YELLOW, BOLD));
name = Text.literal("").formatted(GOLD).append(name.copy().append(Text.literal(" ★").formatted(YELLOW, BOLD)));
}
final String gender = Utils.get(customData, "Gender", "NONE");
if (gender.equals("MALE") || gender.equals("FEMALE")) {
Expand All @@ -61,18 +62,43 @@ public void changeTooltip(PlayerEntity player, TooltipContext context, CallbackI
final List<Text> additionalLore = new ArrayList<>();
boolean spacer = false;

if (shiny) {
additionalLore.add(Text.literal("Shiny").formatted(GOLD));
spacer = true;
}
if (cycles != -1) {
additionalLore.add(Text.literal("Egg Cycles Remaining: ").formatted(GREEN)
.append(Text.literal(String.valueOf(cycles)).formatted(WHITE)));
spacer = true;
}
if (steps != -1) {
additionalLore.add(Text.literal("Steps Left: ").formatted(AQUA)
.append(Text.literal(String.valueOf(steps)).formatted(WHITE)));
.append(Text.literal(String.valueOf(Math.round(steps))).formatted(WHITE)));
spacer = true;
}

String nature = Utils.get(customData, "Nature", "");
String ability = Utils.get(customData, "AbilityName", "");
String form = Utils.get(customData, "FormId", "");
if ((!nature.isBlank() || !ability.isBlank() || !form.isBlank()) && spacer) {
additionalLore.add(Text.literal(" "));
spacer = false;
}

if (!nature.isBlank()) {
if (nature.contains(":")) {
nature = StringUtil.capitalize(nature.substring(nature.indexOf(':') + 1));
}
additionalLore.add(Text.literal("Nature: ").formatted(YELLOW)
.append(Text.literal(nature).formatted(WHITE)));
spacer = true;
}

if (!ability.isBlank()) {
additionalLore.add(Text.literal("Ability: ").formatted(GOLD)
.append(Text.literal(StringUtil.capitalize(ability)).formatted(WHITE)));
spacer = true;
}

if (!form.isBlank()) {
additionalLore.add(Text.literal("Form: ").formatted(WHITE)
.append(Text.literal(StringUtil.capitalize(form))));
spacer = true;
}

Expand Down

0 comments on commit d220630

Please sign in to comment.