Skip to content
This repository was archived by the owner on Sep 1, 2025. It is now read-only.
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import org.gradle.jvm.tasks.Jar

plugins {
id("fabric-loom") version "1.8-SNAPSHOT"
id("fabric-loom") version "1.9-SNAPSHOT"
id("maven-publish")
id("dev.morazzer.cookies.internal.classified-jars")
}
Expand Down
3 changes: 2 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ org.gradle.parallel=true
minecraft_version=1.21.3
yarn_mappings=1.21.3+build.2
loader_version=0.16.9

# Mod Properties
mod_version=1.3.4-beta.5
maven_group=cookiesmod
archives_base_name=cookies-mod

# Dependencies
fabric_version=0.106.1+1.21.3
fabric_version=0.110.0+1.21.3
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Fri May 31 16:57:55 CEST 2024
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,7 @@ private void addMiningConfig(CookiesTranslationBuilder translationBuilder) {
private void addMiscConfig(CookiesTranslationBuilder translationBuilder) {
translationBuilder.addConfig(CONFIG_MISC, "Misc Config", "Miscellaneous settings");
translationBuilder.addConfig(CONFIG_MISC_EDIT_HUD, "To edit hud", "Opens a screen where you can edit the hud elements!");
translationBuilder.addConfig(CONFIG_MISC_REFORGE_TOOLTIP, "Show reforge tooltip", "Shows the current reforge on the tooltip of an item in the reforge menu");
translationBuilder.addConfig(CONFIG_MISC_SHOW_MUSEUM_ARMOR_SETS, "Show museum armor sets", "Shows the components of an armor set in the description.");
translationBuilder.addConfig(CONFIG_MISC_ENABLE_SCROLL_TOOLTIPS, "Scrollable Tooltips", """
Allows you to scroll through tooltips
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// 1.21.3 2024-12-07T10:30:22.914149 cookies-mod/Language (en_us)
e7b7bab76739a378cb9b6e48a0534029ba9d04d3 assets/cookies-mod/lang/en_us.json
// 1.21.3 2024-12-12T08:59:32.4246417 cookies-mod/Language (en_us)
b38b189b066d12ab0c2d533a84fa00f9718ed60c assets\cookies-mod\lang\en_us.json
2 changes: 2 additions & 0 deletions src/main/generated/assets/cookies-mod/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,8 @@
"cookies.config.misc.notifications.sound.tooltip": "Plays a sound when sending the notification",
"cookies.config.misc.notifications.type.name": "Notification type",
"cookies.config.misc.notifications.type.tooltip": "Changes how you get the notifications.\n\nChat -> Simple chat message\nToast -> Popup in the top right of your screen\nBoth -> Chat message + popup",
"cookies.config.misc.reforge_tooltip.name": "Show reforge tooltip",
"cookies.config.misc.reforge_tooltip.tooltip": "Shows the current reforge on the tooltip of an item in the reforge menu",
"cookies.config.misc.scroll_tooltips.name": "Scrollable Tooltips",
"cookies.config.misc.scroll_tooltips.tooltip": "Allows you to scroll through tooltips\n\nCTRL + Scroll -> move horizontal\nSHIFT + Scroll -> chop tooltips",
"cookies.config.misc.show_dye_armor.name": "Show armor if dyed",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public class MiscConfig extends Category {
@Expose
public BooleanOption enableScrollableTooltips = new BooleanOption(CONFIG_MISC_ENABLE_SCROLL_TOOLTIPS, true);


@Expose
public BooleanOption signEditEnterSubmits = new BooleanOption(CONFIG_MISC_SIGN_EDIT_ENTER_SUBMITS, false);

Expand All @@ -41,6 +42,9 @@ public class MiscConfig extends Category {
@Expose
public BooleanOption showPing = new BooleanOption(CONFIG_MISC_SHOW_PING, false);

@Expose
public BooleanOption enableReforgeTooltip = new BooleanOption(CONFIG_MISC_REFORGE_TOOLTIP, true);

@Expose
public BooleanOption showMuseumArmorSets = new BooleanOption(CONFIG_MISC_SHOW_MUSEUM_ARMOR_SETS, true);

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
package codes.cookies.mod.features.misc.utils;

import codes.cookies.mod.config.ConfigManager;
import codes.cookies.mod.events.InventoryEvents;
import codes.cookies.mod.events.api.InventoryContentUpdateEvent;
import codes.cookies.mod.utils.cookies.CookiesUtils;
import codes.cookies.mod.utils.exceptions.ExceptionHandler;
import codes.cookies.mod.utils.items.CookiesDataComponentTypes;

import codes.cookies.mod.utils.items.ItemTooltipComponent;

import codes.cookies.mod.utils.items.ItemUtils;

import net.minecraft.client.gui.screen.ingame.HandledScreen;
import net.minecraft.component.DataComponentTypes;
import net.minecraft.text.Style;
import net.minecraft.text.Text;
import net.minecraft.util.Formatting;

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

public class ReforgeHelper {
public ReforgeHelper(HandledScreen<?> handledScreen) {

InventoryContentUpdateEvent.register(handledScreen.getScreenHandler(), (slotIndex, itemStack) -> {
try {
if (slotIndex == 13) {
if (itemStack == null || itemStack.isEmpty() || itemStack.get(DataComponentTypes.CUSTOM_DATA) == null) {
return;
}
var reforgeButton = handledScreen.getScreenHandler().getSlot(22).getStack();
if (reforgeButton == null || reforgeButton.isEmpty()) {
return;
}

var name = reforgeButton.getName();
if (name == null) {
return;
}

var lore = new ArrayList<Text>();
lore.add(Text.literal("Last Reforge: " + itemStack.get(CookiesDataComponentTypes.MODIFIER)).setStyle(Style.EMPTY.withColor(Formatting.GOLD)));
lore.addAll(reforgeButton.get(DataComponentTypes.LORE).styledLines());

reforgeButton.set(CookiesDataComponentTypes.CUSTOM_LORE, lore);
}
}
catch (Exception e) {
ExceptionHandler.handleException(e);
}
});
}

public static void init() {
InventoryEvents.afterInit("Reforge Item", inv -> ConfigManager.getConfig().miscConfig.enableReforgeTooltip.getValue(), ReforgeHelper::new);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public static void load() {
Loader.load("AnvilHelper", AnvilHelper::new);
Loader.load("ForgeRecipes", ForgeRecipes::new);
Loader.load("StatsTracker", StatsTracker::init);
Loader.load("ReforgeHelper", ReforgeHelper::init);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ public interface TranslationKeys {
String CONFIG_MISC = CONFIG + ".misc";

String CONFIG_MISC_EDIT_HUD = CONFIG_MISC + ".edit_hud";
String CONFIG_MISC_REFORGE_TOOLTIP = CONFIG_MISC + ".reforge_tooltip";
String CONFIG_MISC_SHOW_MUSEUM_ARMOR_SETS = CONFIG_MISC + ".show_museum_armor_sets";
String CONFIG_MISC_ENABLE_SCROLL_TOOLTIPS = CONFIG_MISC + ".scroll_tooltips";
String CONFIG_MISC_SIGN_EDIT_ENTER_SUBMITS = CONFIG_MISC + ".sign_edit_enter_submits";
Expand Down