Skip to content
Merged
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
9 changes: 5 additions & 4 deletions src/main/java/wtf/cheeze/sbt/config/ConfigImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,9 @@
import wtf.cheeze.sbt.config.categories.General;
import wtf.cheeze.sbt.config.categories.Huds;
import wtf.cheeze.sbt.config.categories.Mining;
import wtf.cheeze.sbt.features.overlay.BrewingStandOverlay;
import wtf.cheeze.sbt.features.overlay.MenuHighlights;
import wtf.cheeze.sbt.features.overlay.MinionExp;
import wtf.cheeze.sbt.features.overlay.*;
import wtf.cheeze.sbt.features.chat.ChatProtections;
import wtf.cheeze.sbt.features.chat.PartyFeatures;
import wtf.cheeze.sbt.features.overlay.ReforgeOverlay;
import wtf.cheeze.sbt.utils.actionbar.ActionBarTransformer;
import wtf.cheeze.sbt.utils.constants.loader.ConstantLoader;
import wtf.cheeze.sbt.utils.version.UpdateChecker;
Expand Down Expand Up @@ -76,6 +73,10 @@ public class ConfigImpl extends VersionedObject {
@SerialEntry
public ChatProtections.Config chatProtections = new ChatProtections.Config();

@SerialEntry

public TooltipColors.Config tooltipColors = new TooltipColors.Config();

@SerialEntry
public Huds huds = new Huds();

Expand Down
6 changes: 2 additions & 4 deletions src/main/java/wtf/cheeze/sbt/config/categories/General.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@
import net.minecraft.network.chat.Component;
import wtf.cheeze.sbt.config.ConfigImpl;
import wtf.cheeze.sbt.config.SBTConfig;
import wtf.cheeze.sbt.features.overlay.BrewingStandOverlay;
import wtf.cheeze.sbt.features.overlay.MenuHighlights;
import wtf.cheeze.sbt.features.overlay.MinionExp;
import wtf.cheeze.sbt.features.overlay.ReforgeOverlay;
import wtf.cheeze.sbt.features.overlay.*;
import wtf.cheeze.sbt.utils.actionbar.ActionBarTransformer;
import wtf.cheeze.sbt.utils.constants.loader.ConstantLoader;
import wtf.cheeze.sbt.utils.errors.ErrorHandler;
Expand All @@ -32,6 +29,7 @@ public static ConfigCategory getCategory(ConfigImpl defaults, ConfigImpl config)
.group(BrewingStandOverlay.Config.getGroup(defaults, config))
.group(MinionExp.Config.getGroup(defaults, config))
.group(ReforgeOverlay.Config.getGroup(defaults, config))
.group(TooltipColors.Config.getGroup(defaults, config))
.group(HudTweaks.getGroup(defaults, config))
.group(ActionBarTransformer.Config.getGroup(defaults, config))
.group(ConstantLoader.Config.getGroup(defaults, config))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,12 @@
import wtf.cheeze.sbt.config.SBTConfig;
import wtf.cheeze.sbt.features.mining.FetchurFeatures;
import wtf.cheeze.sbt.features.mining.MiningTitles;
import wtf.cheeze.sbt.features.overlay.BrewingStandOverlay;
import wtf.cheeze.sbt.features.overlay.MenuHighlights;
import wtf.cheeze.sbt.features.overlay.*;
import wtf.cheeze.sbt.features.chat.ChatProtections;
import wtf.cheeze.sbt.features.chat.PartyFeatures;
import wtf.cheeze.sbt.features.huds.*;
import wtf.cheeze.sbt.features.mining.EventTimerHud;
import wtf.cheeze.sbt.features.mining.MiningHud;
import wtf.cheeze.sbt.features.overlay.MinionExp;
import wtf.cheeze.sbt.features.overlay.ReforgeOverlay;
import wtf.cheeze.sbt.mixin.accessors.YACLScreenAccessor;
import wtf.cheeze.sbt.utils.actionbar.ActionBarTransformer;
import wtf.cheeze.sbt.utils.constants.loader.ConstantLoader;
Expand All @@ -57,6 +54,7 @@ public static ConfigCategory getCategory(ConfigImpl defaults, ConfigImpl config)
.group(BrewingStandOverlay.Config.getGroup(defaults, config))
.group(MinionExp.Config.getGroup(defaults, config))
.group(ReforgeOverlay.Config.getGroup(defaults, config))
.group(TooltipColors.Config.getGroup(defaults, config))
.group(General.HudTweaks.getGroup(defaults, config))
.group(ActionBarTransformer.Config.getGroup(defaults, config))
.group(ConstantLoader.Config.getGroup(defaults, config))
Expand Down
68 changes: 68 additions & 0 deletions src/main/java/wtf/cheeze/sbt/features/overlay/TooltipColors.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/*
* Copyright (C) 2026 MisterCheezeCake
*
* This file is part of SkyblockTweaks.
*
* SkyblockTweaks is free software: you can redistribute it
* and/or modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* SkyblockTweaks is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with SkyblockTweaks. If not, see <https://www.gnu.org/licenses/>.
*/
package wtf.cheeze.sbt.features.overlay;

import dev.isxander.yacl3.api.Option;
import dev.isxander.yacl3.api.OptionGroup;
import dev.isxander.yacl3.config.v2.api.SerialEntry;
import net.minecraft.resources.Identifier;
import net.minecraft.world.item.ItemStack;
import wtf.cheeze.sbt.config.ConfigImpl;
import wtf.cheeze.sbt.config.SBTConfig;
import wtf.cheeze.sbt.config.categories.General;
import wtf.cheeze.sbt.utils.enums.Rarity;
import wtf.cheeze.sbt.utils.skyblock.ItemUtils;

public class TooltipColors {


public static Identifier getReplacementFrame(ItemStack item) {
Rarity rarity = ItemUtils.getRarity(item);
if (rarity == null) return null;
return Identifier.fromNamespaceAndPath("skyblocktweaks", rarity.tooltipId);
}


public static class Config {
@SerialEntry
public boolean enabled = false;

public static OptionGroup getGroup(ConfigImpl defaults, ConfigImpl config) {
var enabled = Option.<Boolean>createBuilder()
.name(General.key("tooltipColors.enabled"))
.description(General.keyD("tooltipColors.enabled"))
.controller(SBTConfig::generateBooleanController)
.binding(
defaults.tooltipColors.enabled,
() -> config.tooltipColors.enabled,
value -> config.tooltipColors.enabled = value
)
.build();

return OptionGroup.createBuilder()
.name(General.key("tooltipColors"))
.description(General.keyD("tooltipColors"))
.option(enabled)
.build();


}
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* Copyright (C) 2026 MisterCheezeCake
*
* This file is part of SkyblockTweaks.
*
* SkyblockTweaks is free software: you can redistribute it
* and/or modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* SkyblockTweaks is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with SkyblockTweaks. If not, see <https://www.gnu.org/licenses/>.
*/
package wtf.cheeze.sbt.mixin.features;

import com.llamalad7.mixinextras.sugar.Local;
import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen;
import net.minecraft.resources.Identifier;
import net.minecraft.world.item.ItemStack;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.ModifyArg;
import wtf.cheeze.sbt.config.SBTConfig;
import wtf.cheeze.sbt.features.overlay.TooltipColors;
import wtf.cheeze.sbt.utils.skyblock.SkyblockData;

@Mixin(AbstractContainerScreen.class)
public abstract class TooltipColorsMixin {

@ModifyArg(method = "renderTooltip", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/GuiGraphics;setTooltipForNextFrame(Lnet/minecraft/client/gui/Font;Ljava/util/List;Ljava/util/Optional;IILnet/minecraft/resources/Identifier;)V"), index = 5)
public Identifier sbt$modifyIdentifier(Identifier original, @Local ItemStack item) {
if (!SkyblockData.inSB || !SBTConfig.get().tooltipColors.enabled) return original;
Identifier replacement = TooltipColors.getReplacementFrame(item);
return replacement == null ? original : replacement;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
* Copyright (C) 2026 MisterCheezeCake
*
* This file is part of SkyblockTweaks.
*
* SkyblockTweaks is free software: you can redistribute it
* and/or modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* SkyblockTweaks is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with SkyblockTweaks. If not, see <https://www.gnu.org/licenses/>.
*/
package wtf.cheeze.sbt.mixin.hooks;

import com.llamalad7.mixinextras.injector.ModifyReturnValue;
import com.llamalad7.mixinextras.injector.wrapmethod.WrapMethod;
import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
import net.minecraft.client.gui.screens.inventory.tooltip.TooltipRenderUtil;
import net.minecraft.resources.Identifier;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;

/**
* This mixin allows SBT to only have to provide the custom tooltip frames for rarity colored tooltips and not also a duplicate
* of the Minecraft background for each, this also ensures that changes to the default texture are reflected
*/
@Mixin(TooltipRenderUtil.class)
public abstract class TooltipRenderUtilMixin {

@Shadow @Final private static Identifier BACKGROUND_SPRITE;

@ModifyReturnValue(method = "getBackgroundSprite", at = @At("RETURN"))
private static Identifier sbt$wrapGetBgSprite(Identifier original){
return original.getNamespace().equals("skyblocktweaks") ? BACKGROUND_SPRITE : original;
}
}
57 changes: 47 additions & 10 deletions src/main/java/wtf/cheeze/sbt/utils/enums/Rarity.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,52 @@
*/
package wtf.cheeze.sbt.utils.enums;

import org.jetbrains.annotations.Nullable;

import java.util.HashMap;
import java.util.Map;

public enum Rarity {
COMMON,
UNCOMMON,
RARE,
EPIC,
LEGENDARY,
MYTHIC,
DIVINE,
SPECIAL,
VERY_SPECIAL,
ULTIMATE
COMMON(16777215, "common", true),
UNCOMMON(5635925, "uncommon", true),
RARE(5592575, "rare", true),
EPIC(11141290, "epic", true),
LEGENDARY(16755200, "legendary", true),
MYTHIC(16733695, "mythic", true),
DIVINE(5636095, "divine", false),
SPECIAL(16733525, "special", false),
// This is called VERY rather than VERY_SPECIAL because of how rarity on items is parsed
VERY(16733525, "special", false),
ULTIMATE(16733525, "ultimate", false),
ADMIN(16733525, "ultimate", false);

public final String tooltipId;
public final int color;
public final boolean hasPets;

Rarity(int color, String toolTipId, boolean hasPets) {
this.color = color;
this.tooltipId = toolTipId;
this.hasPets = hasPets;
}


private static final Map<String, Rarity> STRING_RARITY_MAP;

static {
STRING_RARITY_MAP = new HashMap<>();
for (Rarity rarity : values()) {
STRING_RARITY_MAP.put(rarity.name(), rarity);
}
}

/**
* Parses Rarity from string
* @param str must be uppercase and align with name in enum
*/
public static @Nullable Rarity parse(String str) {
return STRING_RARITY_MAP.get(str);
}


}
21 changes: 20 additions & 1 deletion src/main/java/wtf/cheeze/sbt/utils/skyblock/ItemUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@

import com.google.gson.JsonParser;
import com.mojang.authlib.GameProfile;
import com.mojang.authlib.properties.Property;
import com.mojang.authlib.properties.PropertyMap;
import com.mojang.serialization.JsonOps;
import net.minecraft.core.component.DataComponentPatch;
import net.minecraft.core.component.DataComponents;
import net.minecraft.util.ExtraCodecs;
import net.minecraft.world.item.component.CustomData;
import net.minecraft.world.item.component.ItemLore;
import net.minecraft.world.item.component.ResolvableProfile;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
Expand All @@ -35,7 +35,9 @@
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.core.Holder;
import net.minecraft.resources.Identifier;
import org.jetbrains.annotations.Nullable;
import wtf.cheeze.sbt.SkyblockTweaks;
import wtf.cheeze.sbt.utils.enums.Rarity;
import wtf.cheeze.sbt.utils.errors.ErrorHandler;
import wtf.cheeze.sbt.utils.errors.ErrorLevel;

Expand Down Expand Up @@ -76,6 +78,23 @@ public static String getReforge(ItemStack stack) {
}


public static @Nullable Rarity getRarity(ItemStack stack) {
var data = stack.get(DataComponents.CUSTOM_DATA);
if (data == null) return null;
var idTag = data.tag.get("id");
if (idTag == null) return null; // We don't want to have to parse through text if we know it has no ID
var lines = stack.getOrDefault(DataComponents.LORE, ItemLore.EMPTY).lines();
if (lines.isEmpty()) return null;

String[] last = lines.getLast().getString().split(" ");
String possibleRarity = last[0];
// Handle recoms
if (possibleRarity.length() == 1 && last.length > 1) possibleRarity = last[1];

return Rarity.parse(possibleRarity);
}


public static ItemStack getVanilla(String minecraftID) {
return getVanilla(minecraftID, 1);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public static Rarity castStringToRarity(String input) {
};
}


public static Slayer castStringToSlayerType(String input) {
input = input.toLowerCase();
return switch (input) {
Expand Down
7 changes: 5 additions & 2 deletions src/main/resources/assets/skyblocktweaks/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,9 @@
"sbt.config.general.reforgeOverlay.filterOverlayShadow": "Shadow Text",
"sbt.config.general.reforgeOverlay.filterOverlayShadow.desc": "Whether to render the text in the Reforge Filter Overlay with a shadow",
"sbt.config.general.reforgeOverlay.filterOverlaySide": "Filter Overlay Position",
"sbt.config.general.reforgeOverlay.filterOverlaySide.desc": "Whether to render the Reforge Filter Overlay on the left or right side of the screen"

"sbt.config.general.reforgeOverlay.filterOverlaySide.desc": "Whether to render the Reforge Filter Overlay on the left or right side of the screen",
"sbt.config.general.tooltipColors": "Tooltip Border Colors",
"sbt.config.general.tooltipColors.desc": "Options for Coloring Tooltip Borders",
"sbt.config.general.tooltipColors.enabled": "Enable Rarity Colored Borders",
"sbt.config.general.tooltipColors.enabled.desc": "Whether to replace an item's tooltip border with one colored based on the item rarity"
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"gui":{"scaling":{"type":"nine_slice","width":100,"height":100,"border":10,"stretch_inner":true}}}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"gui":{"scaling":{"type":"nine_slice","width":100,"height":100,"border":10,"stretch_inner":true}}}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"gui":{"scaling":{"type":"nine_slice","width":100,"height":100,"border":10,"stretch_inner":true}}}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"gui":{"scaling":{"type":"nine_slice","width":100,"height":100,"border":10,"stretch_inner":true}}}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"gui":{"scaling":{"type":"nine_slice","width":100,"height":100,"border":10,"stretch_inner":true}}}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"gui":{"scaling":{"type":"nine_slice","width":100,"height":100,"border":10,"stretch_inner":true}}}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"gui":{"scaling":{"type":"nine_slice","width":100,"height":100,"border":10,"stretch_inner":true}}}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"gui":{"scaling":{"type":"nine_slice","width":100,"height":100,"border":10,"stretch_inner":true}}}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"gui":{"scaling":{"type":"nine_slice","width":100,"height":100,"border":10,"stretch_inner":true}}}
Loading
Loading