aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/de/hysky/skyblocker/SkyblockerMod.java10
-rw-r--r--src/main/java/de/hysky/skyblocker/compatibility/emi/SkyblockEmiRecipe.java2
-rw-r--r--src/main/java/de/hysky/skyblocker/compatibility/emi/SkyblockerEMIPlugin.java6
-rw-r--r--src/main/java/de/hysky/skyblocker/compatibility/rei/SkyblockCraftingDisplayGenerator.java6
-rw-r--r--src/main/java/de/hysky/skyblocker/compatibility/rei/SkyblockerREIClientPlugin.java4
-rw-r--r--src/main/java/de/hysky/skyblocker/config/SkyblockerConfig.java263
-rw-r--r--src/main/java/de/hysky/skyblocker/config/categories/DungeonsCategory.java16
-rw-r--r--src/main/java/de/hysky/skyblocker/config/categories/GeneralCategory.java42
-rw-r--r--src/main/java/de/hysky/skyblocker/config/categories/QuickNavigationCategory.java168
-rw-r--r--src/main/java/de/hysky/skyblocker/mixin/HandledScreenMixin.java2
-rw-r--r--src/main/java/de/hysky/skyblocker/mixin/InGameOverlayRendererMixin.java22
-rw-r--r--src/main/java/de/hysky/skyblocker/mixin/ItemMixin.java13
-rw-r--r--src/main/java/de/hysky/skyblocker/mixin/ItemStackMixin.java70
-rw-r--r--src/main/java/de/hysky/skyblocker/skyblock/FairySouls.java33
-rw-r--r--src/main/java/de/hysky/skyblocker/skyblock/dungeon/CreeperBeams.java8
-rw-r--r--src/main/java/de/hysky/skyblocker/skyblock/dungeon/DungeonBlaze.java4
-rw-r--r--src/main/java/de/hysky/skyblocker/skyblock/dungeon/TicTacToe.java2
-rw-r--r--src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/DungeonSecrets.java5
-rw-r--r--src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/SecretWaypoint.java32
-rw-r--r--src/main/java/de/hysky/skyblocker/skyblock/item/CompactorDeletorPreview.java4
-rw-r--r--src/main/java/de/hysky/skyblocker/skyblock/item/CustomArmorDyeColors.java15
-rw-r--r--src/main/java/de/hysky/skyblocker/skyblock/item/CustomArmorTrims.java23
-rw-r--r--src/main/java/de/hysky/skyblocker/skyblock/item/CustomItemNames.java11
-rw-r--r--src/main/java/de/hysky/skyblocker/skyblock/item/ItemProtection.java9
-rw-r--r--src/main/java/de/hysky/skyblocker/skyblock/item/PriceInfoTooltip.java3
-rw-r--r--src/main/java/de/hysky/skyblocker/skyblock/item/WikiLookup.java30
-rw-r--r--src/main/java/de/hysky/skyblocker/skyblock/itemlist/ItemListWidget.java10
-rw-r--r--src/main/java/de/hysky/skyblocker/skyblock/itemlist/ItemRegistry.java129
-rw-r--r--src/main/java/de/hysky/skyblocker/skyblock/itemlist/ItemRepository.java137
-rw-r--r--src/main/java/de/hysky/skyblocker/skyblock/itemlist/ItemStackBuilder.java94
-rw-r--r--src/main/java/de/hysky/skyblocker/skyblock/itemlist/SearchResultsWidget.java28
-rw-r--r--src/main/java/de/hysky/skyblocker/skyblock/itemlist/SkyblockCraftingRecipe.java51
-rw-r--r--src/main/java/de/hysky/skyblocker/skyblock/spidersden/Relics.java5
-rw-r--r--src/main/java/de/hysky/skyblocker/utils/Constants.java23
-rw-r--r--src/main/java/de/hysky/skyblocker/utils/ItemUtils.java26
-rw-r--r--src/main/java/de/hysky/skyblocker/utils/NEURepoManager.java (renamed from src/main/java/de/hysky/skyblocker/utils/NEURepo.java)32
-rw-r--r--src/main/java/de/hysky/skyblocker/utils/render/RenderHelper.java4
37 files changed, 778 insertions, 564 deletions
diff --git a/src/main/java/de/hysky/skyblocker/SkyblockerMod.java b/src/main/java/de/hysky/skyblocker/SkyblockerMod.java
index bd1cd5bd..115f90ec 100644
--- a/src/main/java/de/hysky/skyblocker/SkyblockerMod.java
+++ b/src/main/java/de/hysky/skyblocker/SkyblockerMod.java
@@ -9,7 +9,7 @@ import de.hysky.skyblocker.skyblock.item.*;
import de.hysky.skyblocker.skyblock.tabhud.screenbuilder.ScreenMaster;
import de.hysky.skyblocker.config.SkyblockerConfigManager;
import de.hysky.skyblocker.skyblock.dwarven.DwarvenHud;
-import de.hysky.skyblocker.skyblock.itemlist.ItemRegistry;
+import de.hysky.skyblocker.skyblock.itemlist.ItemRepository;
import de.hysky.skyblocker.skyblock.quicknav.QuickNav;
import de.hysky.skyblocker.skyblock.rift.TheRift;
import de.hysky.skyblocker.skyblock.shortcut.Shortcuts;
@@ -17,7 +17,7 @@ import de.hysky.skyblocker.skyblock.special.SpecialEffects;
import de.hysky.skyblocker.skyblock.spidersden.Relics;
import de.hysky.skyblocker.skyblock.tabhud.TabHud;
import de.hysky.skyblocker.skyblock.tabhud.util.PlayerListMgr;
-import de.hysky.skyblocker.utils.NEURepo;
+import de.hysky.skyblocker.utils.NEURepoManager;
import de.hysky.skyblocker.utils.Utils;
import de.hysky.skyblocker.utils.chat.ChatMessageListener;
import de.hysky.skyblocker.utils.discord.DiscordRPCManager;
@@ -68,12 +68,12 @@ public class SkyblockerMod implements ClientModInitializer {
public void onInitializeClient() {
ClientTickEvents.END_CLIENT_TICK.register(this::tick);
Utils.init();
- HotbarSlotLock.init();
SkyblockerConfigManager.init();
+ NEURepoManager.init();
+ ItemRepository.init();
+ HotbarSlotLock.init();
PriceInfoTooltip.init();
WikiLookup.init();
- ItemRegistry.init();
- NEURepo.init();
FairySouls.init();
Relics.init();
BackpackPreview.init();
diff --git a/src/main/java/de/hysky/skyblocker/compatibility/emi/SkyblockEmiRecipe.java b/src/main/java/de/hysky/skyblocker/compatibility/emi/SkyblockEmiRecipe.java
index 191da283..b52d6ff5 100644
--- a/src/main/java/de/hysky/skyblocker/compatibility/emi/SkyblockEmiRecipe.java
+++ b/src/main/java/de/hysky/skyblocker/compatibility/emi/SkyblockEmiRecipe.java
@@ -16,7 +16,7 @@ public class SkyblockEmiRecipe extends EmiCraftingRecipe {
private final String craftText;
public SkyblockEmiRecipe(SkyblockCraftingRecipe recipe) {
- super(recipe.getGrid().stream().map(EmiStack::of).map(EmiIngredient.class::cast).toList(), EmiStack.of(recipe.getResult()).comparison(Comparison.compareNbt()), Identifier.of("skyblock", ItemUtils.getItemId(recipe.getResult()).toLowerCase().replace(';', '_')));
+ super(recipe.getGrid().stream().map(EmiStack::of).map(EmiIngredient.class::cast).toList(), EmiStack.of(recipe.getResult()).comparison(Comparison.compareNbt()), Identifier.of("skyblock", ItemUtils.getItemId(recipe.getResult()).toLowerCase().replace(';', '_') + "_" + recipe.getResult().getCount()));
this.craftText = recipe.getCraftText();
}
diff --git a/src/main/java/de/hysky/skyblocker/compatibility/emi/SkyblockerEMIPlugin.java b/src/main/java/de/hysky/skyblocker/compatibility/emi/SkyblockerEMIPlugin.java
index c6147016..6ed6a32a 100644
--- a/src/main/java/de/hysky/skyblocker/compatibility/emi/SkyblockerEMIPlugin.java
+++ b/src/main/java/de/hysky/skyblocker/compatibility/emi/SkyblockerEMIPlugin.java
@@ -1,7 +1,7 @@
package de.hysky.skyblocker.compatibility.emi;
import de.hysky.skyblocker.SkyblockerMod;
-import de.hysky.skyblocker.skyblock.itemlist.ItemRegistry;
+import de.hysky.skyblocker.skyblock.itemlist.ItemRepository;
import de.hysky.skyblocker.utils.ItemUtils;
import dev.emi.emi.api.EmiPlugin;
import dev.emi.emi.api.EmiRegistry;
@@ -21,9 +21,9 @@ public class SkyblockerEMIPlugin implements EmiPlugin {
@Override
public void register(EmiRegistry registry) {
- ItemRegistry.getItemsStream().map(EmiStack::of).forEach(registry::addEmiStack);
+ ItemRepository.getItemsStream().map(EmiStack::of).forEach(registry::addEmiStack);
registry.addCategory(SKYBLOCK);
registry.addWorkstation(SKYBLOCK, EmiStack.of(Items.CRAFTING_TABLE));
- ItemRegistry.getRecipesStream().map(SkyblockEmiRecipe::new).forEach(registry::addRecipe);
+ ItemRepository.getRecipesStream().map(SkyblockEmiRecipe::new).forEach(registry::addRecipe);
}
}
diff --git a/src/main/java/de/hysky/skyblocker/compatibility/rei/SkyblockCraftingDisplayGenerator.java b/src/main/java/de/hysky/skyblocker/compatibility/rei/SkyblockCraftingDisplayGenerator.java
index 60e39b79..33cee20b 100644
--- a/src/main/java/de/hysky/skyblocker/compatibility/rei/SkyblockCraftingDisplayGenerator.java
+++ b/src/main/java/de/hysky/skyblocker/compatibility/rei/SkyblockCraftingDisplayGenerator.java
@@ -1,6 +1,6 @@
package de.hysky.skyblocker.compatibility.rei;
-import de.hysky.skyblocker.skyblock.itemlist.ItemRegistry;
+import de.hysky.skyblocker.skyblock.itemlist.ItemRepository;
import de.hysky.skyblocker.skyblock.itemlist.SkyblockCraftingRecipe;
import de.hysky.skyblocker.utils.ItemUtils;
import me.shedaniel.rei.api.client.registry.display.DynamicDisplayGenerator;
@@ -19,7 +19,7 @@ public class SkyblockCraftingDisplayGenerator implements DynamicDisplayGenerator
public Optional<List<SkyblockCraftingDisplay>> getRecipeFor(EntryStack<?> entry) {
if (!(entry.getValue() instanceof ItemStack)) return Optional.empty();
EntryStack<ItemStack> inputItem = EntryStacks.of((ItemStack) entry.getValue());
- List<SkyblockCraftingRecipe> filteredRecipes = ItemRegistry.getRecipesStream()
+ List<SkyblockCraftingRecipe> filteredRecipes = ItemRepository.getRecipesStream()
.filter(recipe -> {
ItemStack itemStack = inputItem.getValue();
ItemStack itemStack1 = recipe.getResult();
@@ -34,7 +34,7 @@ public class SkyblockCraftingDisplayGenerator implements DynamicDisplayGenerator
public Optional<List<SkyblockCraftingDisplay>> getUsageFor(EntryStack<?> entry) {
if (!(entry.getValue() instanceof ItemStack)) return Optional.empty();
EntryStack<ItemStack> inputItem = EntryStacks.of((ItemStack) entry.getValue());
- List<SkyblockCraftingRecipe> filteredRecipes = ItemRegistry.getRecipesStream()
+ List<SkyblockCraftingRecipe> filteredRecipes = ItemRepository.getRecipesStream()
.filter(recipe -> {
for (ItemStack item : recipe.getGrid()) {
if(!ItemUtils.getItemId(item).isEmpty()) {
diff --git a/src/main/java/de/hysky/skyblocker/compatibility/rei/SkyblockerREIClientPlugin.java b/src/main/java/de/hysky/skyblocker/compatibility/rei/SkyblockerREIClientPlugin.java
index 97651718..7ed322a0 100644
--- a/src/main/java/de/hysky/skyblocker/compatibility/rei/SkyblockerREIClientPlugin.java
+++ b/src/main/java/de/hysky/skyblocker/compatibility/rei/SkyblockerREIClientPlugin.java
@@ -1,7 +1,7 @@
package de.hysky.skyblocker.compatibility.rei;
import de.hysky.skyblocker.SkyblockerMod;
-import de.hysky.skyblocker.skyblock.itemlist.ItemRegistry;
+import de.hysky.skyblocker.skyblock.itemlist.ItemRepository;
import me.shedaniel.rei.api.client.plugins.REIClientPlugin;
import me.shedaniel.rei.api.client.registry.category.CategoryRegistry;
import me.shedaniel.rei.api.client.registry.display.DisplayRegistry;
@@ -29,6 +29,6 @@ public class SkyblockerREIClientPlugin implements REIClientPlugin {
@Override
public void registerEntries(EntryRegistry entryRegistry) {
- entryRegistry.addEntries(ItemRegistry.getItemsStream().map(EntryStacks::of).toList());
+ entryRegistry.addEntries(ItemRepository.getItemsStream().map(EntryStacks::of).toList());
}
}
diff --git a/src/main/java/de/hysky/skyblocker/config/SkyblockerConfig.java b/src/main/java/de/hysky/skyblocker/config/SkyblockerConfig.java
index 189c6af7..d7279bc8 100644
--- a/src/main/java/de/hysky/skyblocker/config/SkyblockerConfig.java
+++ b/src/main/java/de/hysky/skyblocker/config/SkyblockerConfig.java
@@ -16,7 +16,7 @@ import java.util.List;
public class SkyblockerConfig {
@SerialEntry
public int version = 1;
-
+
@SerialEntry
public General general = new General();
@@ -117,7 +117,7 @@ public class SkyblockerConfig {
@SerialEntry
public String uiTitle;
-
+
@SerialEntry
public String clickEvent;
}
@@ -137,10 +137,10 @@ public class SkyblockerConfig {
@SerialEntry
public String itemName;
-
+
@SerialEntry
public int count;
-
+
@SerialEntry
public String nbt;
}
@@ -148,16 +148,16 @@ public class SkyblockerConfig {
public static class General {
@SerialEntry
public boolean acceptReparty = true;
-
+
@SerialEntry
public boolean backpackPreviewWithoutShift = false;
-
+
@SerialEntry
public boolean compactorDeletorPreview = true;
-
+
@SerialEntry
public boolean hideEmptyTooltips = true;
-
+
@SerialEntry
public boolean hideStatusEffectOverlay = false;
@@ -181,7 +181,7 @@ public class SkyblockerConfig {
@SerialEntry
public Shortcuts shortcuts = new Shortcuts();
-
+
@SerialEntry
public QuiverWarning quiverWarning = new QuiverWarning();
@@ -193,7 +193,10 @@ public class SkyblockerConfig {
@SerialEntry
public ItemInfoDisplay itemInfoDisplay = new ItemInfoDisplay();
-
+
+ @SerialEntry
+ public WikiLookup wikiLookup = new WikiLookup();
+
@SerialEntry
public SpecialEffects specialEffects = new SpecialEffects();
@@ -207,8 +210,11 @@ public class SkyblockerConfig {
public TeleportOverlay teleportOverlay = new TeleportOverlay();
@SerialEntry
+ public FlameOverlay flameOverlay = new FlameOverlay();
+
+ @SerialEntry
public List<Integer> lockedSlots = new ArrayList<>();
-
+
@SerialEntry
public ObjectOpenHashSet<String> protectedItems = new ObjectOpenHashSet<>();
@@ -228,10 +234,10 @@ public class SkyblockerConfig {
@SerialEntry
public int tabHudScale = 100;
-
+
@SerialEntry
public boolean plainPlayerNames = false;
-
+
@SerialEntry
public NameSorting nameSorting = NameSorting.DEFAULT;
}
@@ -259,13 +265,13 @@ public class SkyblockerConfig {
public static class BarPositions {
@SerialEntry
public BarPosition healthBarPosition = BarPosition.LAYER1;
-
+
@SerialEntry
public BarPosition manaBarPosition = BarPosition.LAYER1;
-
+
@SerialEntry
public BarPosition defenceBarPosition = BarPosition.LAYER1;
-
+
@SerialEntry
public BarPosition experienceBarPosition = BarPosition.LAYER1;
@@ -292,10 +298,10 @@ public class SkyblockerConfig {
public static class Experiments {
@SerialEntry
public boolean enableChronomatronSolver = true;
-
+
@SerialEntry
public boolean enableSuperpairsSolver = true;
-
+
@SerialEntry
public boolean enableUltrasequencerSolver = true;
}
@@ -308,10 +314,10 @@ public class SkyblockerConfig {
public static class FairySouls {
@SerialEntry
public boolean enableFairySoulsHelper = false;
-
+
@SerialEntry
public boolean highlightFoundSouls = true;
-
+
@SerialEntry
public boolean highlightOnlyNearbySouls = false;
}
@@ -324,14 +330,14 @@ public class SkyblockerConfig {
public static class Shortcuts {
@SerialEntry
public boolean enableShortcuts = true;
-
+
@SerialEntry
public boolean enableCommandShortcuts = true;
-
+
@SerialEntry
public boolean enableCommandArgShortcuts = true;
}
-
+
public static class QuiverWarning {
@SerialEntry
public boolean enableQuiverWarning = true;
@@ -346,7 +352,7 @@ public class SkyblockerConfig {
public static class Hitbox {
@SerialEntry
public boolean oldFarmlandHitbox = true;
-
+
@SerialEntry
public boolean oldLeverHitbox = false;
}
@@ -354,16 +360,16 @@ public class SkyblockerConfig {
public static class TitleContainer {
@SerialEntry
public float titleContainerScale = 100;
-
+
@SerialEntry
public int x = 540;
-
+
@SerialEntry
public int y = 10;
-
+
@SerialEntry
public Direction direction = Direction.HORIZONTAL;
-
+
@SerialEntry
public Alignment alignment = Alignment.MIDDLE;
}
@@ -371,23 +377,31 @@ public class SkyblockerConfig {
public static class TeleportOverlay {
@SerialEntry
public boolean enableTeleportOverlays = true;
-
+
@SerialEntry
public boolean enableWeirdTransmission = true;
-
+
@SerialEntry
public boolean enableInstantTransmission = true;
-
+
@SerialEntry
public boolean enableEtherTransmission = true;
-
+
@SerialEntry
public boolean enableSinrecallTransmission = true;
-
+
@SerialEntry
public boolean enableWitherImpact = true;
}
+ public static class FlameOverlay {
+ @SerialEntry
+ public float flameHeight = 0f;
+
+ @SerialEntry
+ public float flameOpacity = 0f;
+ }
+
public enum Direction {
HORIZONTAL, VERTICAL;
@@ -419,10 +433,10 @@ public class SkyblockerConfig {
@SerialEntry
public Info info = Info.LOCATION;
-
+
@SerialEntry
public boolean cycleMode = false;
-
+
@SerialEntry
public String customMessage = "Playing Skyblock";
}
@@ -444,22 +458,22 @@ public class SkyblockerConfig {
public static class ItemTooltip {
@SerialEntry
public boolean enableNPCPrice = true;
-
+
@SerialEntry
public boolean enableMotesPrice = true;
-
+
@SerialEntry
public boolean enableAvgBIN = true;
-
+
@SerialEntry
public Average avg = Average.THREE_DAY;
-
+
@SerialEntry
public boolean enableLowestBIN = true;
-
+
@SerialEntry
public boolean enableBazaarPrice = true;
-
+
@SerialEntry
public boolean enableMuseumDate = true;
}
@@ -467,14 +481,22 @@ public class SkyblockerConfig {
public static class ItemInfoDisplay {
@SerialEntry
public boolean attributeShardInfo = true;
-
+
@SerialEntry
public boolean itemRarityBackgrounds = false;
@SerialEntry
public float itemRarityBackgroundsOpacity = 1f;
}
-
+
+ public static class WikiLookup {
+ @SerialEntry
+ public boolean enableWikiLookup = true;
+
+ @SerialEntry
+ public boolean officialWiki = false;
+ }
+
public static class SpecialEffects {
@SerialEntry
public boolean rareDungeonDropEffects = true;
@@ -492,7 +514,7 @@ public class SkyblockerConfig {
@SerialEntry
public Rift rift = new Rift();
-
+
@SerialEntry
public SpidersDen spidersDen = new SpidersDen();
}
@@ -500,46 +522,46 @@ public class SkyblockerConfig {
public static class Dungeons {
@SerialEntry
public SecretWaypoints secretWaypoints = new SecretWaypoints();
-
+
@SerialEntry
public DungeonChestProfit dungeonChestProfit = new DungeonChestProfit();
-
+
@SerialEntry
public boolean croesusHelper = true;
-
+
@SerialEntry
public boolean enableMap = true;
-
+
@SerialEntry
public float mapScaling = 1f;
-
+
@SerialEntry
public int mapX = 2;
-
+
@SerialEntry
public int mapY = 2;
-
+
@SerialEntry
public boolean starredMobGlow = true;
-
+
@SerialEntry
public boolean solveThreeWeirdos = true;
-
+
@SerialEntry
public boolean blazeSolver = true;
@SerialEntry
public boolean creeperSolver = true;
-
+
@SerialEntry
public boolean solveTrivia = true;
-
+
@SerialEntry
public boolean solveTicTacToe = true;
-
+
@SerialEntry
public LividColor lividColor = new LividColor();
-
+
@SerialEntry
public Terminals terminals = new Terminals();
}
@@ -547,72 +569,97 @@ public class SkyblockerConfig {
public static class SecretWaypoints {
@SerialEntry
public boolean enableSecretWaypoints = true;
-
+
@SerialEntry
public boolean noInitSecretWaypoints = false;
@SerialEntry
- public boolean enableEntranceWaypoints = true;
+ public WaypointType waypointType = WaypointType.WAYPOINT;
@SerialEntry
+ public boolean showSecretText = true;
+
+ @SerialEntry
+ public boolean enableEntranceWaypoints = true;
+
+ @SerialEntry
public boolean enableSuperboomWaypoints = true;
-
+
@SerialEntry
public boolean enableChestWaypoints = true;
-
+
@SerialEntry
public boolean enableItemWaypoints = true;
-
+
@SerialEntry
public boolean enableBatWaypoints = true;
-
+
@SerialEntry
public boolean enableWitherWaypoints = true;
-
+
@SerialEntry
public boolean enableLeverWaypoints = true;
-
+
@SerialEntry
public boolean enableFairySoulWaypoints = true;
-
+
@SerialEntry
public boolean enableStonkWaypoints = true;
-
+
@SerialEntry
public boolean enableDefaultWaypoints = true;
}
+ public enum WaypointType {
+ WAYPOINT,
+ OUTLINED_WAYPOINT,
+ HIGHLIGHT,
+ OUTLINED_HIGHLIGHT,
+ OUTLINE;
+
+ @Override
+ public String toString() {
+ return switch (this) {
+ case WAYPOINT -> "Waypoint";
+ case OUTLINED_WAYPOINT -> "Outlined Waypoint";
+ case HIGHLIGHT -> "Highlight";
+ case OUTLINED_HIGHLIGHT -> "Outlined Highlight";
+ case OUTLINE -> "Outline";
+ };
+ }
+ }
+
public static class DungeonChestProfit {
@SerialEntry
public boolean enableProfitCalculator = true;
-
+
@SerialEntry
public boolean includeKismet = false;
-
+
@SerialEntry
public boolean includeEssence = true;
-
+
@SerialEntry
public int neutralThreshold = 1000;
-
+
@SerialEntry
public Formatting neutralColor = Formatting.DARK_GRAY;
-
+
@SerialEntry
public Formatting profitColor = Formatting.DARK_GREEN;
-
+
@SerialEntry
public Formatting lossColor = Formatting.RED;
-
+
@SerialEntry
public Formatting incompleteColor = Formatting.BLUE;
-
+
}
public static class LividColor {
@SerialEntry
public boolean enableLividColor = true;
-
+
@SerialEntry
public String lividColorText = "The livid color is [color]";
}
@@ -620,10 +667,10 @@ public class SkyblockerConfig {
public static class Terminals {
@SerialEntry
public boolean solveColor = true;
-
+
@SerialEntry
public boolean solveOrder = true;
-
+
@SerialEntry
public boolean solveStartsWith = true;
}
@@ -631,13 +678,13 @@ public class SkyblockerConfig {
public static class DwarvenMines {
@SerialEntry
public boolean enableDrillFuel = true;
-
+
@SerialEntry
public boolean solveFetchur = true;
-
+
@SerialEntry
public boolean solvePuzzler = true;
-
+
@SerialEntry
public DwarvenHud dwarvenHud = new DwarvenHud();
}
@@ -645,16 +692,16 @@ public class SkyblockerConfig {
public static class DwarvenHud {
@SerialEntry
public boolean enabled = true;
-
+
@SerialEntry
public DwarvenHudStyle style = DwarvenHudStyle.SIMPLE;
-
+
@SerialEntry
public boolean enableBackground = true;
-
+
@SerialEntry
public int x = 10;
-
+
@SerialEntry
public int y = 10;
}
@@ -675,7 +722,7 @@ public class SkyblockerConfig {
public static class Barn {
@SerialEntry
public boolean solveHungryHiker = true;
-
+
@SerialEntry
public boolean solveTreasureHunter = true;
}
@@ -683,20 +730,20 @@ public class SkyblockerConfig {
public static class Rift {
@SerialEntry
public boolean mirrorverseWaypoints = true;
-
+
@SerialEntry
public int mcGrubberStacks = 0;
}
-
+
public static class SpidersDen {
@SerialEntry
public Relics relics = new Relics();
}
-
+
public static class Relics {
@SerialEntry
public boolean enableRelicsHelper = false;
-
+
@SerialEntry
public boolean highlightFoundRelics = true;
}
@@ -709,34 +756,34 @@ public class SkyblockerConfig {
public static class VampireSlayer {
@SerialEntry
public boolean enableEffigyWaypoints = true;
-
+
@SerialEntry
public boolean compactEffigyWaypoints;
-
+
@SerialEntry
public int effigyUpdateFrequency = 5;
-
+
@SerialEntry
public boolean enableHolyIceIndicator = true;
-
+
@SerialEntry
public int holyIceIndicatorTickDelay = 10;
@SerialEntry
public int holyIceUpdateFrequency = 5;
-
+
@SerialEntry
public boolean enableHealingMelonIndicator = true;
-
+
@SerialEntry
public float healingMelonHealthThreshold = 4f;
-
+
@SerialEntry
public boolean enableSteakStakeIndicator = true;
@SerialEntry
public int steakStakeUpdateFrequency = 5;
-
+
@SerialEntry
public boolean enableManiaIndicator = true;
@@ -747,34 +794,34 @@ public class SkyblockerConfig {
public static class Messages {
@SerialEntry
public ChatFilterResult hideAbility = ChatFilterResult.PASS;
-
+
@SerialEntry
public ChatFilterResult hideHeal = ChatFilterResult.PASS;
-
+
@SerialEntry
public ChatFilterResult hideAOTE = ChatFilterResult.PASS;
-
+
@SerialEntry
public ChatFilterResult hideImplosion = ChatFilterResult.PASS;
-
+
@SerialEntry
public ChatFilterResult hideMoltenWave = ChatFilterResult.PASS;
-
+
@SerialEntry
public ChatFilterResult hideAds = ChatFilterResult.PASS;
-
+
@SerialEntry
public ChatFilterResult hideTeleportPad = ChatFilterResult.PASS;
-
+
@SerialEntry
public ChatFilterResult hideCombo = ChatFilterResult.PASS;
-
+
@SerialEntry
public ChatFilterResult hideAutopet = ChatFilterResult.PASS;
-
+
@SerialEntry
public ChatFilterResult hideShowOff = ChatFilterResult.PASS;
-
+
@SerialEntry
public boolean hideMana = false;
}
diff --git a/src/main/java/de/hysky/skyblocker/config/categories/DungeonsCategory.java b/src/main/java/de/hysky/skyblocker/config/categories/DungeonsCategory.java
index 1fb30afe..c3f54d4d 100644
--- a/src/main/java/de/hysky/skyblocker/config/categories/DungeonsCategory.java
+++ b/src/main/java/de/hysky/skyblocker/config/categories/DungeonsCategory.java
@@ -2,6 +2,7 @@ package de.hysky.skyblocker.config.categories;
import de.hysky.skyblocker.config.ConfigUtils;
import de.hysky.skyblocker.config.SkyblockerConfig;
+import de.hysky.skyblocker.config.SkyblockerConfig.WaypointType;
import dev.isxander.yacl3.api.ButtonOption;
import dev.isxander.yacl3.api.ConfigCategory;
import dev.isxander.yacl3.api.Option;
@@ -43,6 +44,21 @@ public class DungeonsCategory {
.controller(ConfigUtils::createBooleanController)
.flag(OptionFlag.GAME_RESTART)
.build())
+ .option(Option.<WaypointType>createBuilder()
+ .name(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.waypointType"))
+ .description(OptionDescription.of(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.waypointType.@Tooltip")))
+ .binding(defaults.locations.dungeons.secretWaypoints.waypointType,
+ () -> config.locations.dungeons.secretWaypoints.waypointType,
+ newValue -> config.locations.dungeons.secretWaypoints.waypointType = newValue)
+ .controller(ConfigUtils::createEnumCyclingListController)
+ .build())
+ .option(Option.<Boolean>createBuilder()
+ .name(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.showSecretText"))
+ .binding(defaults.locations.dungeons.secretWaypoints.showSecretText,
+ () -> config.locations.dungeons.secretWaypoints.showSecretText,
+ newValue -> config.locations.dungeons.secretWaypoints.showSecretText = newValue)
+ .controller(ConfigUtils::createBooleanController)
+ .build())
.option(Option.<Boolean>createBuilder()
.name(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.enableEntranceWaypoints"))
.binding(defaults.locations.dungeons.secretWaypoints.enableEntranceWaypoints,
diff --git a/src/main/java/de/hysky/skyblocker/config/categories/GeneralCategory.java b/src/main/java/de/hysky/skyblocker/config/categories/GeneralCategory.java
index b4f61c36..30bdbd3f 100644
--- a/src/main/java/de/hysky/skyblocker/config/categories/GeneralCategory.java
+++ b/src/main/java/de/hysky/skyblocker/config/categories/GeneralCategory.java
@@ -374,6 +374,28 @@ public class GeneralCategory {
.build())
.build())
+ //Wiki Lookup
+ .group(OptionGroup.createBuilder()
+ .name(Text.translatable("text.autoconfig.skyblocker.option.general.wikiLookup"))
+ .collapsed(true)
+ .option(Option.<Boolean>createBuilder()
+ .name(Text.translatable("text.autoconfig.skyblocker.option.general.wikiLookup.enableWikiLookup"))
+ .description(OptionDescription.of(Text.translatable("text.autoconfig.skyblocker.option.general.wikiLookup.enableWikiLookup.@Tooltip")))
+ .binding(defaults.general.wikiLookup.enableWikiLookup,
+ () -> config.general.wikiLookup.enableWikiLookup,
+ newValue -> config.general.wikiLookup.enableWikiLookup = newValue)
+ .controller(ConfigUtils::createBooleanController)
+ .build())
+ .option(Option.<Boolean>createBuilder()
+ .name(Text.translatable("text.autoconfig.skyblocker.option.general.wikiLookup.officialWiki"))
+ .description(OptionDescription.of(Text.translatable("text.autoconfig.skyblocker.option.general.wikiLookup.officialWiki.@Tooltip")))
+ .binding(defaults.general.wikiLookup.officialWiki,
+ () -> config.general.wikiLookup.officialWiki,
+ newValue -> config.general.wikiLookup.officialWiki = newValue)
+ .controller(ConfigUtils::createBooleanController)
+ .build())
+ .build())
+
//Special Effects
.group(OptionGroup.createBuilder()
.name(Text.translatable("text.autoconfig.skyblocker.option.general.specialEffects"))
@@ -474,6 +496,26 @@ public class GeneralCategory {
.controller(ConfigUtils::createBooleanController)
.build())
.build())
+
+ //Flame Overlay
+ .group(OptionGroup.createBuilder()
+ .name(Text.translatable("text.autoconfig.skyblocker.option.general.flameOverlay"))
+ .collapsed(true)
+ .option(Option.<Float>createBuilder()
+ .name(Text.translatable("text.autoconfig.skyblocker.option.general.flameOverlay.flameHeight"))
+ .binding(defaults.general.flameOverlay.flameHeight,
+ () -> config.general.flameOverlay.flameHeight,
+ newValue -> config.general.flameOverlay.flameHeight = newValue)
+ .controller(opt -> FloatSliderControllerBuilder.create(opt).range(0.0f, 0.5f).step(0.01f))
+ .build())
+ .option(Option.<Float>createBuilder()
+ .name(Text.translatable("text.autoconfig.skyblocker.option.general.flameOverlay.flameOpacity"))
+ .binding(defaults.general.flameOverlay.flameOpacity,
+ () -> config.general.flameOverlay.flameOpacity,
+ newValue -> config.general.flameOverlay.flameOpacity = newValue)
+ .controller(opt -> FloatSliderControllerBuilder.create(opt).range(0.0f, 0.8f).step(0.1f))
+ .build())
+ .build())
.build();
}
}
diff --git a/src/main/java/de/hysky/skyblocker/config/categories/QuickNavigationCategory.java b/src/main/java/de/hysky/skyblocker/config/categories/QuickNavigationCategory.java
index b17fed23..775a0ae1 100644
--- a/src/main/java/de/hysky/skyblocker/config/categories/QuickNavigationCategory.java
+++ b/src/main/java/de/hysky/skyblocker/config/categories/QuickNavigationCategory.java
@@ -26,45 +26,45 @@ public class QuickNavigationCategory {
//Button 1
.group(OptionGroup.createBuilder()
- .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button1"))
+ .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button", 1))
.collapsed(true)
.option(Option.<Boolean>createBuilder()
- .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button1.render"))
+ .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button.render"))
.binding(defaults.quickNav.button1.render,
() -> config.quickNav.button1.render,
newValue -> config.quickNav.button1.render = newValue)
.controller(ConfigUtils::createBooleanController)
.build())
.option(Option.<String>createBuilder()
- .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button1.item.itemName"))
+ .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button.item.itemName"))
.binding(defaults.quickNav.button1.item.itemName,
() -> config.quickNav.button1.item.itemName,
newValue -> config.quickNav.button1.item.itemName = newValue)
.controller(StringControllerBuilder::create)
.build())
.option(Option.<Integer>createBuilder()
- .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button1.item.count"))
+ .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button.item.count"))
.binding(defaults.quickNav.button1.item.count,
() -> config.quickNav.button1.item.count,
newValue -> config.quickNav.button1.item.count = newValue)
.controller(opt -> IntegerFieldControllerBuilder.create(opt).range(1, 64))
.build())
.option(Option.<String>createBuilder()
- .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button1.item.nbt"))
+ .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button.item.nbt"))
.binding(defaults.quickNav.button1.item.nbt,
() -> config.quickNav.button1.item.nbt,
newValue -> config.quickNav.button1.item.nbt = newValue)
.controller(StringControllerBuilder::create)
.build())
.option(Option.<String>createBuilder()
- .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button1.uiTitle"))
+ .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button.uiTitle"))
.binding(defaults.quickNav.button1.uiTitle,
() -> config.quickNav.button1.uiTitle,
newValue -> config.quickNav.button1.uiTitle = newValue)
.controller(StringControllerBuilder::create)
.build())
.option(Option.<String>createBuilder()
- .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button1.clickEvent"))
+ .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button.clickEvent"))
.binding(defaults.quickNav.button1.clickEvent,
() -> config.quickNav.button1.clickEvent,
newValue -> config.quickNav.button1.clickEvent = newValue)
@@ -74,45 +74,45 @@ public class QuickNavigationCategory {
//Button 2
.group(OptionGroup.createBuilder()
- .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button2"))
+ .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button", 2))
.collapsed(true)
.option(Option.<Boolean>createBuilder()
- .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button1.render"))
+ .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button.render"))
.binding(defaults.quickNav.button2.render,
() -> config.quickNav.button2.render,
newValue -> config.quickNav.button2.render = newValue)
.controller(ConfigUtils::createBooleanController)
.build())
.option(Option.<String>createBuilder()
- .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button1.item.itemName"))
+ .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button.item.itemName"))
.binding(defaults.quickNav.button2.item.itemName,
() -> config.quickNav.button2.item.itemName,
newValue -> config.quickNav.button2.item.itemName = newValue)
.controller(StringControllerBuilder::create)
.build())
.option(Option.<Integer>createBuilder()
- .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button1.item.count"))
+ .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button.item.count"))
.binding(defaults.quickNav.button2.item.count,
() -> config.quickNav.button2.item.count,
newValue -> config.quickNav.button2.item.count = newValue)
.controller(opt -> IntegerFieldControllerBuilder.create(opt).range(1, 64))
.build())
.option(Option.<String>createBuilder()
- .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button1.item.nbt"))
+ .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button.item.nbt"))
.binding(defaults.quickNav.button2.item.nbt,
() -> config.quickNav.button2.item.nbt,
newValue -> config.quickNav.button2.item.nbt = newValue)
.controller(StringControllerBuilder::create)
.build())
.option(Option.<String>createBuilder()
- .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button1.uiTitle"))
+ .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button.uiTitle"))
.binding(defaults.quickNav.button2.uiTitle,
() -> config.quickNav.button2.uiTitle,
newValue -> config.quickNav.button2.uiTitle = newValue)
.controller(StringControllerBuilder::create)
.build())
.option(Option.<String>createBuilder()
- .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button1.clickEvent"))
+ .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button.clickEvent"))
.binding(defaults.quickNav.button2.clickEvent,
() -> config.quickNav.button2.clickEvent,
newValue -> config.quickNav.button2.clickEvent = newValue)
@@ -122,45 +122,45 @@ public class QuickNavigationCategory {
//Button 3
.group(OptionGroup.createBuilder()
- .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button3"))
+ .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button", 3))
.collapsed(true)
.option(Option.<Boolean>createBuilder()
- .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button1.render"))
+ .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button.render"))
.binding(defaults.quickNav.button3.render,
() -> config.quickNav.button3.render,
newValue -> config.quickNav.button3.render = newValue)
.controller(ConfigUtils::createBooleanController)
.build())
.option(Option.<String>createBuilder()
- .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button1.item.itemName"))
+ .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button.item.itemName"))
.binding(defaults.quickNav.button3.item.itemName,
() -> config.quickNav.button3.item.itemName,
newValue -> config.quickNav.button3.item.itemName = newValue)
.controller(StringControllerBuilder::create)
.build())
.option(Option.<Integer>createBuilder()
- .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button1.item.count"))
+ .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button.item.count"))
.binding(defaults.quickNav.button3.item.count,
() -> config.quickNav.button3.item.count,
newValue -> config.quickNav.button3.item.count = newValue)
.controller(opt -> IntegerFieldControllerBuilder.create(opt).range(1, 64))
.build())
.option(Option.<String>createBuilder()
- .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button1.item.nbt"))
+ .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button.item.nbt"))
.binding(defaults.quickNav.button3.item.nbt,
() -> config.quickNav.button3.item.nbt,
newValue -> config.quickNav.button3.item.nbt = newValue)
.controller(StringControllerBuilder::create)
.build())
.option(Option.<String>createBuilder()
- .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button1.uiTitle"))
+ .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button.uiTitle"))
.binding(defaults.quickNav.button3.uiTitle,
() -> config.quickNav.button3.uiTitle,
newValue -> config.quickNav.button3.uiTitle = newValue)
.controller(StringControllerBuilder::create)
.build())
.option(Option.<String>createBuilder()
- .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button1.clickEvent"))
+ .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button.clickEvent"))
.binding(defaults.quickNav.button3.clickEvent,
() -> config.quickNav.button3.clickEvent,
newValue -> config.quickNav.button3.clickEvent = newValue)
@@ -170,45 +170,45 @@ public class QuickNavigationCategory {
//Button 4
.group(OptionGroup.createBuilder()
- .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button4"))
+ .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button", 4))
.collapsed(true)
.option(Option.<Boolean>createBuilder()
- .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button1.render"))
+ .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button.render"))
.binding(defaults.quickNav.button4.render,
() -> config.quickNav.button4.render,
newValue -> config.quickNav.button4.render = newValue)
.controller(ConfigUtils::createBooleanController)
.build())
.option(Option.<String>createBuilder()
- .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button1.item.itemName"))
+ .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button.item.itemName"))
.binding(defaults.quickNav.button4.item.itemName,
() -> config.quickNav.button4.item.itemName,
newValue -> config.quickNav.button4.item.itemName = newValue)
.controller(StringControllerBuilder::create)
.build())
.option(Option.<Integer>createBuilder()
- .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button1.item.count"))
+ .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button.item.count"))
.binding(defaults.quickNav.button4.item.count,
() -> config.quickNav.button4.item.count,
newValue -> config.quickNav.button4.item.count = newValue)
.controller(opt -> IntegerFieldControllerBuilder.create(opt).range(1, 64))
.build())
.option(Option.<String>createBuilder()
- .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button1.item.nbt"))
+ .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button.item.nbt"))
.binding(defaults.quickNav.button4.item.nbt,
() -> config.quickNav.button4.item.nbt,
newValue -> config.quickNav.button4.item.nbt = newValue)
.controller(StringControllerBuilder::create)
.build())
.option(Option.<String>createBuilder()
- .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button1.uiTitle"))
+ .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button.uiTitle"))
.binding(defaults.quickNav.button4.uiTitle,
() -> config.quickNav.button4.uiTitle,
newValue -> config.quickNav.button4.uiTitle = newValue)
.controller(StringControllerBuilder::create)
.build())
.option(Option.<String>createBuilder()
- .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button1.clickEvent"))
+ .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button.clickEvent"))
.binding(defaults.quickNav.button4.clickEvent,
() -> config.quickNav.button4.clickEvent,
newValue -> config.quickNav.button4.clickEvent = newValue)
@@ -218,45 +218,45 @@ public class QuickNavigationCategory {
//Button 5
.group(OptionGroup.createBuilder()
- .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button5"))
+ .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button", 5))
.collapsed(true)
.option(Option.<Boolean>createBuilder()
- .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button1.render"))
+ .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button.render"))
.binding(defaults.quickNav.button5.render,
() -> config.quickNav.button5.render,
newValue -> config.quickNav.button5.render = newValue)
.controller(ConfigUtils::createBooleanController)
.build())
.option(Option.<String>createBuilder()
- .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button1.item.itemName"))
+ .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button.item.itemName"))
.binding(defaults.quickNav.button5.item.itemName,
() -> config.quickNav.button5.item.itemName,
newValue -> config.quickNav.button5.item.itemName = newValue)
.controller(StringControllerBuilder::create)
.build())
.option(Option.<Integer>createBuilder()
- .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button1.item.count"))
+ .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button.item.count"))
.binding(defaults.quickNav.button5.item.count,
() -> config.quickNav.button5.item.count,
newValue -> config.quickNav.button5.item.count = newValue)
.controller(opt -> IntegerFieldControllerBuilder.create(opt).range(1, 64))
.build())
.option(Option.<String>createBuilder()
- .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button1.item.nbt"))
+ .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button.item.nbt"))
.binding(defaults.quickNav.button5.item.nbt,
() -> config.quickNav.button5.item.nbt,
newValue -> config.quickNav.button5.item.nbt = newValue)
.controller(StringControllerBuilder::create)
.build())
.option(Option.<String>createBuilder()
- .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button1.uiTitle"))
+ .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button.uiTitle"))
.binding(defaults.quickNav.button5.uiTitle,
() -> config.quickNav.button5.uiTitle,
newValue -> config.quickNav.button5.uiTitle = newValue)
.controller(StringControllerBuilder::create)
.build())
.option(Option.<String>createBuilder()
- .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button1.clickEvent"))
+ .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button.clickEvent"))
.binding(defaults.quickNav.button5.clickEvent,
() -> config.quickNav.button5.clickEvent,
newValue -> config.quickNav.button5.clickEvent = newValue)
@@ -266,45 +266,45 @@ public class QuickNavigationCategory {
//Button 6
.group(OptionGroup.createBuilder()
- .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button6"))
+ .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button", 6))
.collapsed(true)
.option(Option.<Boolean>createBuilder()
- .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button1.render"))
+ .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button.render"))
.binding(defaults.quickNav.button6.render,
() -> config.quickNav.button6.render,
newValue -> config.quickNav.button6.render = newValue)
.controller(ConfigUtils::createBooleanController)
.build())
.option(Option.<String>createBuilder()
- .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button1.item.itemName"))
+ .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button.item.itemName"))
.binding(defaults.quickNav.button6.item.itemName,
() -> config.quickNav.button6.item.itemName,
newValue -> config.quickNav.button6.item.itemName = newValue)
.controller(StringControllerBuilder::create)
.build())
.option(Option.<Integer>createBuilder()
- .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button1.item.count"))
+ .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button.item.count"))
.binding(defaults.quickNav.button6.item.count,
() -> config.quickNav.button6.item.count,
newValue -> config.quickNav.button6.item.count = newValue)
.controller(opt -> IntegerFieldControllerBuilder.create(opt).range(1, 64))
.build())
.option(Option.<String>createBuilder()
- .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button1.item.nbt"))
+ .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button.item.nbt"))
.binding(defaults.quickNav.button6.item.nbt,
() -> config.quickNav.button6.item.nbt,
newValue -> config.quickNav.button6.item.nbt = newValue)
.controller(StringControllerBuilder::create)
.build())
.option(Option.<String>createBuilder()
- .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button1.uiTitle"))
+ .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button.uiTitle"))
.binding(defaults.quickNav.button6.uiTitle,
() -> config.quickNav.button6.uiTitle,
newValue -> config.quickNav.button6.uiTitle = newValue)
.controller(StringControllerBuilder::create)
.build())
.option(Option.<String>createBuilder()
- .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button1.clickEvent"))
+ .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button.clickEvent"))
.binding(defaults.quickNav.button6.clickEvent,
() -> config.quickNav.button6.clickEvent,
newValue -> config.quickNav.button6.clickEvent = newValue)
@@ -314,45 +314,45 @@ public class QuickNavigationCategory {
//Button 7
.group(OptionGroup.createBuilder()
- .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button7"))
+ .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button", 7))
.collapsed(true)
.option(Option.<Boolean>createBuilder()
- .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button1.render"))
+ .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button.render"))
.binding(defaults.quickNav.button7.render,
() -> config.quickNav.button7.render,
newValue -> config.quickNav.button7.render = newValue)
.controller(ConfigUtils::createBooleanController)
.build())
.option(Option.<String>createBuilder()
- .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button1.item.itemName"))
+ .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button.item.itemName"))
.binding(defaults.quickNav.button7.item.itemName,
() -> config.quickNav.button7.item.itemName,
newValue -> config.quickNav.button7.item.itemName = newValue)
.controller(StringControllerBuilder::create)
.build())
.option(Option.<Integer>createBuilder()
- .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button1.item.count"))
+ .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button.item.count"))
.binding(defaults.quickNav.button7.item.count,
() -> config.quickNav.button7.item.count,
newValue -> config.quickNav.button7.item.count = newValue)
.controller(opt -> IntegerFieldControllerBuilder.create(opt).range(1, 64))
.build())
.option(Option.<String>createBuilder()
- .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button1.item.nbt"))
+ .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button.item.nbt"))
.binding(defaults.quickNav.button7.item.nbt,
() -> config.quickNav.button7.item.nbt,
newValue -> config.quickNav.button7.item.nbt = newValue)
.controller(StringControllerBuilder::create)
.build())
.option(Option.<String>createBuilder()
- .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button1.uiTitle"))
+ .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button.uiTitle"))
.binding(defaults.quickNav.button7.uiTitle,
() -> config.quickNav.button7.uiTitle,
newValue -> config.quickNav.button7.uiTitle = newValue)
.controller(StringControllerBuilder::create)
.build())
.option(Option.<String>createBuilder()
- .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button1.clickEvent"))
+ .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button.clickEvent"))
.binding(defaults.quickNav.button7.clickEvent,
() -> config.quickNav.button7.clickEvent,
newValue -> config.quickNav.button7.clickEvent = newValue)
@@ -362,45 +362,45 @@ public class QuickNavigationCategory {
//Button 8
.group(OptionGroup.createBuilder()
- .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button8"))
+ .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button", 8))
.collapsed(true)
.option(Option.<Boolean>createBuilder()
- .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button1.render"))
+ .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button.render"))
.binding(defaults.quickNav.button8.render,
() -> config.quickNav.button8.render,
newValue -> config.quickNav.button8.render = newValue)
.controller(ConfigUtils::createBooleanController)
.build())
.option(Option.<String>createBuilder()
- .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button1.item.itemName"))
+ .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button.item.itemName"))
.binding(defaults.quickNav.button8.item.itemName,
() -> config.quickNav.button8.item.itemName,
newValue -> config.quickNav.button8.item.itemName = newValue)
.controller(StringControllerBuilder::create)
.build())
.option(Option.<Integer>createBuilder()
- .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button1.item.count"))
+ .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button.item.count"))
.binding(defaults.quickNav.button8.item.count,
() -> config.quickNav.button8.item.count,
newValue -> config.quickNav.button8.item.count = newValue)
.controller(opt -> IntegerFieldControllerBuilder.create(opt).range(1, 64))
.build())
.option(Option.<String>createBuilder()
- .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button1.item.nbt"))
+ .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button.item.nbt"))
.binding(defaults.quickNav.button8.item.nbt,
() -> config.quickNav.button8.item.nbt,
newValue -> config.quickNav.button8.item.nbt = newValue)
.controller(StringControllerBuilder::create)
.build())
.option(Option.<String>createBuilder()
- .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button1.uiTitle"))
+ .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button.uiTitle"))
.binding(defaults.quickNav.button8.uiTitle,
() -> config.quickNav.button8.uiTitle,
newValue -> config.quickNav.button8.uiTitle = newValue)
.controller(StringControllerBuilder::create)
.build())
.option(Option.<String>createBuilder()
- .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button1.clickEvent"))
+ .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button.clickEvent"))
.binding(defaults.quickNav.button8.clickEvent,
() -> config.quickNav.button8.clickEvent,
newValue -> config.quickNav.button8.clickEvent = newValue)
@@ -410,45 +410,45 @@ public class QuickNavigationCategory {
//Button 9
.group(OptionGroup.createBuilder()
- .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button9"))
+ .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button", 9))
.collapsed(true)
.option(Option.<Boolean>createBuilder()
- .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button1.render"))
+ .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button.render"))
.binding(defaults.quickNav.button9.render,
() -> config.quickNav.button9.render,
newValue -> config.quickNav.button9.render = newValue)
.controller(ConfigUtils::createBooleanController)
.build())
.option(Option.<String>createBuilder()
- .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button1.item.itemName"))
+ .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button.item.itemName"))
.binding(defaults.quickNav.button9.item.itemName,
() -> config.quickNav.button9.item.itemName,
newValue -> config.quickNav.button9.item.itemName = newValue)
.controller(StringControllerBuilder::create)
.build())
.option(Option.<Integer>createBuilder()
- .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button1.item.count"))
+ .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button.item.count"))
.binding(defaults.quickNav.button9.item.count,
() -> config.quickNav.button9.item.count,
newValue -> config.quickNav.button9.item.count = newValue)
.controller(opt -> IntegerFieldControllerBuilder.create(opt).range(1, 64))
.build())
.option(Option.<String>createBuilder()
- .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button1.item.nbt"))
+ .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button.item.nbt"))
.binding(defaults.quickNav.button9.item.nbt,
() -> config.quickNav.button9.item.nbt,
newValue -> config.quickNav.button9.item.nbt = newValue)
.controller(StringControllerBuilder::create)
.build())
.option(Option.<String>createBuilder()
- .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button1.uiTitle"))
+ .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button.uiTitle"))
.binding(defaults.quickNav.button9.uiTitle,
() -> config.quickNav.button9.uiTitle,
newValue -> config.quickNav.button9.uiTitle = newValue)
.controller(StringControllerBuilder::create)
.build())
.option(Option.<String>createBuilder()
- .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button1.clickEvent"))
+ .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button.clickEvent"))
.binding(defaults.quickNav.button9.clickEvent,
() -> config.quickNav.button9.clickEvent,
newValue -> config.quickNav.button9.clickEvent = newValue)
@@ -458,45 +458,45 @@ public class QuickNavigationCategory {
//Button 10
.group(OptionGroup.createBuilder()
- .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button10"))
+ .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button", 10))
.collapsed(true)
.option(Option.<Boolean>createBuilder()
- .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button1.render"))
+ .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button.render"))
.binding(defaults.quickNav.button10.render,
() -> config.quickNav.button10.render,
newValue -> config.quickNav.button10.render = newValue)
.controller(ConfigUtils::createBooleanController)
.build())
.option(Option.<String>createBuilder()
- .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button1.item.itemName"))
+ .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button.item.itemName"))
.binding(defaults.quickNav.button10.item.itemName,
() -> config.quickNav.button10.item.itemName,
newValue -> config.quickNav.button10.item.itemName = newValue)
.controller(StringControllerBuilder::create)
.build())
.option(Option.<Integer>createBuilder()
- .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button1.item.count"))
+ .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button.item.count"))
.binding(defaults.quickNav.button10.item.count,
() -> config.quickNav.button10.item.count,
newValue -> config.quickNav.button10.item.count = newValue)
.controller(opt -> IntegerFieldControllerBuilder.create(opt).range(1, 64))
.build())
.option(Option.<String>createBuilder()
- .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button1.item.nbt"))
+ .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button.item.nbt"))
.binding(defaults.quickNav.button10.item.nbt,
() -> config.quickNav.button10.item.nbt,
newValue -> config.quickNav.button10.item.nbt = newValue)
.controller(StringControllerBuilder::create)
.build())
.option(Option.<String>createBuilder()
- .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button1.uiTitle"))
+ .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button.uiTitle"))
.binding(defaults.quickNav.button10.uiTitle,
() -> config.quickNav.button10.uiTitle,
newValue -> config.quickNav.button10.uiTitle = newValue)
.controller(StringControllerBuilder::create)
.build())
.option(Option.<String>createBuilder()
- .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button1.clickEvent"))
+ .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button.clickEvent"))
.binding(defaults.quickNav.button10.clickEvent,
() -> config.quickNav.button10.clickEvent,
newValue -> config.quickNav.button10.clickEvent = newValue)
@@ -506,45 +506,45 @@ public class QuickNavigationCategory {
//Button 11
.group(OptionGroup.createBuilder()
- .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button11"))
+ .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button", 11))
.collapsed(true)
.option(Option.<Boolean>createBuilder()
- .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button1.render"))
+ .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button.render"))
.binding(defaults.quickNav.button11.render,
() -> config.quickNav.button11.render,
newValue -> config.quickNav.button11.render = newValue)
.controller(ConfigUtils::createBooleanController)
.build())
.option(Option.<String>createBuilder()
- .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button1.item.itemName"))
+ .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button.item.itemName"))
.binding(defaults.quickNav.button11.item.itemName,
() -> config.quickNav.button11.item.itemName,
newValue -> config.quickNav.button11.item.itemName = newValue)
.controller(StringControllerBuilder::create)
.build())
.option(Option.<Integer>createBuilder()
- .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button1.item.count"))
+ .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button.item.count"))
.binding(defaults.quickNav.button11.item.count,
() -> config.quickNav.button11.item.count,
newValue -> config.quickNav.button11.item.count = newValue)
.controller(opt -> IntegerFieldControllerBuilder.create(opt).range(1, 64))
.build())
.option(Option.<String>createBuilder()
- .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button1.item.nbt"))
+ .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button.item.nbt"))
.binding(defaults.quickNav.button11.item.nbt,
() -> config.quickNav.button11.item.nbt,
newValue -> config.quickNav.button11.item.nbt = newValue)
.controller(StringControllerBuilder::create)
.build())
.option(Option.<String>createBuilder()
- .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button1.uiTitle"))
+ .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button.uiTitle"))
.binding(defaults.quickNav.button11.uiTitle,
() -> config.quickNav.button11.uiTitle,
newValue -> config.quickNav.button11.uiTitle = newValue)
.controller(StringControllerBuilder::create)
.build())
.option(Option.<String>createBuilder()
- .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button1.clickEvent"))
+ .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button.clickEvent"))
.binding(defaults.quickNav.button11.clickEvent,
() -> config.quickNav.button11.clickEvent,
newValue -> config.quickNav.button11.clickEvent = newValue)
@@ -554,45 +554,45 @@ public class QuickNavigationCategory {
//Button 12
.group(OptionGroup.createBuilder()
- .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button12"))
+ .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button", 12))
.collapsed(true)
.option(Option.<Boolean>createBuilder()
- .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button1.render"))
+ .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button.render"))
.binding(defaults.quickNav.button12.render,
() -> config.quickNav.button12.render,
newValue -> config.quickNav.button12.render = newValue)
.controller(ConfigUtils::createBooleanController)
.build())
.option(Option.<String>createBuilder()
- .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button1.item.itemName"))
+ .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button.item.itemName"))
.binding(defaults.quickNav.button12.item.itemName,
() -> config.quickNav.button12.item.itemName,
newValue -> config.quickNav.button12.item.itemName = newValue)
.controller(StringControllerBuilder::create)
.build())
.option(Option.<Integer>createBuilder()
- .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button1.item.count"))
+ .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button.item.count"))
.binding(defaults.quickNav.button12.item.count,
() -> config.quickNav.button12.item.count,
newValue -> config.quickNav.button12.item.count = newValue)
.controller(opt -> IntegerFieldControllerBuilder.create(opt).range(1, 64))
.build())
.option(Option.<String>createBuilder()
- .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button1.item.nbt"))
+ .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button.item.nbt"))
.binding(defaults.quickNav.button12.item.nbt,
() -> config.quickNav.button12.item.nbt,
newValue -> config.quickNav.button12.item.nbt = newValue)
.controller(StringControllerBuilder::create)
.build())
.option(Option.<String>createBuilder()
- .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button1.uiTitle"))
+ .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button.uiTitle"))
.binding(defaults.quickNav.button12.uiTitle,
() -> config.quickNav.button12.uiTitle,
newValue -> config.quickNav.button12.uiTitle = newValue)
.controller(StringControllerBuilder::create)
.build())
.option(Option.<String>createBuilder()
- .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button1.clickEvent"))
+ .name(Text.translatable("text.autoconfig.skyblocker.option.quickNav.button.clickEvent"))
.binding(defaults.quickNav.button12.clickEvent,
() -> config.quickNav.button12.clickEvent,
newValue -> config.quickNav.button12.clickEvent = newValue)
diff --git a/src/main/java/de/hysky/skyblocker/mixin/HandledScreenMixin.java b/src/main/java/de/hysky/skyblocker/mixin/HandledScreenMixin.java
index b037d45a..e65bc576 100644
--- a/src/main/java/de/hysky/skyblocker/mixin/HandledScreenMixin.java
+++ b/src/main/java/de/hysky/skyblocker/mixin/HandledScreenMixin.java
@@ -61,7 +61,7 @@ public abstract class HandledScreenMixin<T extends ScreenHandler> extends Screen
@Inject(at = @At("HEAD"), method = "keyPressed")
public void skyblocker$keyPressed(int keyCode, int scanCode, int modifiers, CallbackInfoReturnable<Boolean> cir) {
if (this.client != null && this.focusedSlot != null && keyCode != 256 && !this.client.options.inventoryKey.matchesKey(keyCode, scanCode) && WikiLookup.wikiLookup.matchesKey(keyCode, scanCode)) {
- WikiLookup.openWiki(this.focusedSlot);
+ WikiLookup.openWiki(this.focusedSlot, client.player);
}
}
diff --git a/src/main/java/de/hysky/skyblocker/mixin/InGameOverlayRendererMixin.java b/src/main/java/de/hysky/skyblocker/mixin/InGameOverlayRendererMixin.java
new file mode 100644
index 00000000..b957603a
--- /dev/null
+++ b/src/main/java/de/hysky/skyblocker/mixin/InGameOverlayRendererMixin.java
@@ -0,0 +1,22 @@
+package de.hysky.skyblocker.mixin;
+
+import de.hysky.skyblocker.config.SkyblockerConfigManager;
+import net.minecraft.client.gui.hud.InGameOverlayRenderer;
+import org.spongepowered.asm.mixin.Mixin;
+import org.spongepowered.asm.mixin.injection.At;
+import org.spongepowered.asm.mixin.injection.ModifyArg;
+
+@Mixin(InGameOverlayRenderer.class)
+public class InGameOverlayRendererMixin {
+
+ @ModifyArg(method = "renderFireOverlay", index = 2, at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/BufferBuilder;vertex(Lorg/joml/Matrix4f;FFF)Lnet/minecraft/client/render/VertexConsumer;"))
+ private static float configureFlameHeight(float y) {
+ return y - SkyblockerConfigManager.get().general.flameOverlay.flameHeight;
+ }
+
+ @ModifyArg(method = "renderFireOverlay", index = 3, at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/VertexConsumer;color(FFFF)Lnet/minecraft/client/render/VertexConsumer;"))
+ private static float configureFlameOpacity(float opacity) {
+ return opacity - SkyblockerConfigManager.get().general.flameOverlay.flameOpacity;
+ }
+
+}
diff --git a/src/main/java/de/hysky/skyblocker/mixin/ItemMixin.java b/src/main/java/de/hysky/skyblocker/mixin/ItemMixin.java
index 98bea52b..6b49220b 100644
--- a/src/main/java/de/hysky/skyblocker/mixin/ItemMixin.java
+++ b/src/main/java/de/hysky/skyblocker/mixin/ItemMixin.java
@@ -1,22 +1,19 @@
package de.hysky.skyblocker.mixin;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
import org.objectweb.asm.Opcodes;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
-
-import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
-import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
-
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
+import org.spongepowered.asm.mixin.injection.Redirect;
@Mixin(Item.class)
public abstract class ItemMixin {
- @WrapOperation(
+ @Redirect(
method = {"getItemBarColor", "getItemBarStep"},
at = @At(value = "FIELD", target = "Lnet/minecraft/item/Item;maxDamage:I", opcode = Opcodes.GETFIELD)
)
- private int skyblocker$handlePickoDrillBar(Item item, Operation<Integer> original, ItemStack stack) {
+ private int skyblocker$handlePickoDrillBar(Item item, ItemStack stack) {
return stack.getMaxDamage();
}
}
diff --git a/src/main/java/de/hysky/skyblocker/mixin/ItemStackMixin.java b/src/main/java/de/hysky/skyblocker/mixin/ItemStackMixin.java
index 79a37d68..c5b2438a 100644
--- a/src/main/java/de/hysky/skyblocker/mixin/ItemStackMixin.java
+++ b/src/main/java/de/hysky/skyblocker/mixin/ItemStackMixin.java
@@ -4,48 +4,90 @@ package de.hysky.skyblocker.mixin;
import com.llamalad7.mixinextras.injector.ModifyReturnValue;
import de.hysky.skyblocker.config.SkyblockerConfigManager;
import de.hysky.skyblocker.utils.ItemUtils;
-import de.hysky.skyblocker.utils.ItemUtils.Durability;
import de.hysky.skyblocker.utils.Utils;
+import dev.cbyrne.betterinject.annotations.Inject;
+import it.unimi.dsi.fastutil.ints.IntIntPair;
import net.minecraft.item.ItemStack;
import net.minecraft.text.Text;
import org.spongepowered.asm.mixin.Mixin;
+import org.spongepowered.asm.mixin.Shadow;
+import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At;
@Mixin(ItemStack.class)
public abstract class ItemStackMixin {
+
+ @Shadow
+ public abstract int getDamage();
+
+ @Shadow
+ public abstract void setDamage(int damage);
+
+ @Unique
+ private int maxDamage;
+
@ModifyReturnValue(method = "getName", at = @At("RETURN"))
private Text skyblocker$customItemNames(Text original) {
- if (Utils.isOnSkyblock()) {
+ if (Utils.isOnSkyblock()) {
return SkyblockerConfigManager.get().general.customItemNames.getOrDefault(ItemUtils.getItemUuid((ItemStack) (Object) this), original);
}
return original;
}
+ /**
+ * Updates the durability of this item stack every tick when in the inventory.
+ */
+ @Inject(method = "inventoryTick", at = @At("TAIL"))
+ private void skyblocker$updateDamage() {
+ if (!skyblocker$shouldProcess()) {
+ return;
+ }
+ skyblocker$getAndCacheDurability();
+ }
+
@ModifyReturnValue(method = "getDamage", at = @At("RETURN"))
private int skyblocker$handleDamage(int original) {
- Durability dur = ItemUtils.getDurability((ItemStack) (Object) this);
- if (dur != null) {
- return dur.max() - dur.current();
+ // If the durability is already calculated, the original value should be the damage
+ if (!skyblocker$shouldProcess() || maxDamage != 0) {
+ return original;
}
- return original;
+ return skyblocker$getAndCacheDurability() ? getDamage() : original;
}
@ModifyReturnValue(method = "getMaxDamage", at = @At("RETURN"))
private int skyblocker$handleMaxDamage(int original) {
- Durability dur = ItemUtils.getDurability((ItemStack) (Object) this);
- if (dur != null) {
- return dur.max();
+ if (!skyblocker$shouldProcess()) {
+ return original;
}
- return original;
+ // If the max damage is already calculated, return it
+ if (maxDamage != 0) {
+ return maxDamage;
+ }
+ return skyblocker$getAndCacheDurability() ? maxDamage : original;
}
@ModifyReturnValue(method = "isDamageable", at = @At("RETURN"))
private boolean skyblocker$handleDamageable(boolean original) {
- Durability dur = ItemUtils.getDurability((ItemStack) (Object) this);
- if (dur != null) {
- return true;
+ return skyblocker$shouldProcess() || original;
+ }
+
+ @Unique
+ private boolean skyblocker$shouldProcess() {
+ return Utils.isOnSkyblock() && SkyblockerConfigManager.get().locations.dwarvenMines.enableDrillFuel && ItemUtils.hasCustomDurability((ItemStack) (Object) this);
+ }
+
+ @Unique
+ private boolean skyblocker$getAndCacheDurability() {
+ // Calculate the durability
+ IntIntPair durability = ItemUtils.getDurability((ItemStack) (Object) this);
+ // Return if calculating the durability failed
+ if (durability == null) {
+ return false;
}
- return original;
+ // Saves the calculated durability
+ maxDamage = durability.rightInt();
+ setDamage(durability.rightInt() - durability.leftInt());
+ return true;
}
}
diff --git a/src/main/java/de/hysky/skyblocker/skyblock/FairySouls.java b/src/main/java/de/hysky/skyblocker/skyblock/FairySouls.java
index 24465e06..cef17d8e 100644
--- a/src/main/java/de/hysky/skyblocker/skyblock/FairySouls.java
+++ b/src/main/java/de/hysky/skyblocker/skyblock/FairySouls.java
@@ -1,6 +1,5 @@
package de.hysky.skyblocker.skyblock;
-import com.google.common.collect.ImmutableSet;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
@@ -9,7 +8,8 @@ import com.mojang.brigadier.CommandDispatcher;
import de.hysky.skyblocker.SkyblockerMod;
import de.hysky.skyblocker.config.SkyblockerConfig;
import de.hysky.skyblocker.config.SkyblockerConfigManager;
-import de.hysky.skyblocker.utils.NEURepo;
+import de.hysky.skyblocker.utils.Constants;
+import de.hysky.skyblocker.utils.NEURepoManager;
import de.hysky.skyblocker.utils.PosUtils;
import de.hysky.skyblocker.utils.Utils;
import de.hysky.skyblocker.utils.render.RenderHelper;
@@ -32,6 +32,7 @@ import org.slf4j.LoggerFactory;
import java.io.*;
import java.util.*;
import java.util.concurrent.CompletableFuture;
+import java.util.stream.Collectors;
import static net.fabricmc.fabric.api.client.command.v2.ClientCommandManager.literal;
@@ -64,25 +65,10 @@ public class FairySouls {
}
private static void loadFairySouls() {
- fairySoulsLoaded = NEURepo.runAsyncAfterLoad(() -> {
- try (BufferedReader reader = new BufferedReader(new FileReader(NEURepo.LOCAL_REPO_DIR.resolve("constants").resolve("fairy_souls.json").toFile()))) {
- for (Map.Entry<String, JsonElement> fairySoulJson : JsonParser.parseReader(reader).getAsJsonObject().asMap().entrySet()) {
- if (fairySoulJson.getKey().equals("//") || fairySoulJson.getKey().equals("Max Souls")) {
- if (fairySoulJson.getKey().equals("Max Souls")) {
- maxSouls = fairySoulJson.getValue().getAsInt();
- }
- continue;
- }
- ImmutableSet.Builder<BlockPos> fairySoulsForLocation = ImmutableSet.builder();
- for (JsonElement fairySoul : fairySoulJson.getValue().getAsJsonArray().asList()) {
- fairySoulsForLocation.add(PosUtils.parsePosString(fairySoul.getAsString()));
- }
- fairySouls.put(fairySoulJson.getKey(), fairySoulsForLocation.build());
- }
- LOGGER.debug("[Skyblocker] Loaded fairy soul locations");
- } catch (IOException e) {
- LOGGER.error("[Skyblocker] Failed to load fairy soul locations", e);
- }
+ fairySoulsLoaded = NEURepoManager.runAsyncAfterLoad(() -> {
+ maxSouls = NEURepoManager.NEU_REPO.getConstants().getFairySouls().getMaxSouls();
+ NEURepoManager.NEU_REPO.getConstants().getFairySouls().getSoulLocations().forEach((location, fairySoulsForLocation) -> fairySouls.put(location, fairySoulsForLocation.stream().map(coordinate -> new BlockPos(coordinate.getX(), coordinate.getY(), coordinate.getZ())).collect(Collectors.toUnmodifiableSet())));
+ LOGGER.debug("[Skyblocker] Loaded {} fairy souls across {} locations", fairySouls.values().stream().mapToInt(Set::size).sum(), fairySouls.size());
try (BufferedReader reader = new BufferedReader(new FileReader(SkyblockerMod.CONFIG_DIR.resolve("found_fairy_souls.json").toFile()))) {
for (Map.Entry<String, JsonElement> foundFairiesForProfileJson : JsonParser.parseReader(reader).getAsJsonObject().asMap().entrySet()) {
@@ -101,6 +87,7 @@ public class FairySouls {
} catch (IOException e) {
LOGGER.error("[Skyblocker] Failed to load found fairy souls", e);
}
+ LOGGER.info("[Skyblocker] Loaded {} fairy souls across {} locations and {} found fairy souls across {} locations in {} profiles", fairySouls.values().stream().mapToInt(Set::size).sum(), fairySouls.size(), foundFairies.values().stream().map(Map::values).flatMap(Collection::stream).mapToInt(Set::size).sum(), foundFairies.values().stream().mapToInt(Map::size).sum(), foundFairies.size());
});
}
@@ -131,12 +118,12 @@ public class FairySouls {
.then(literal("fairySouls")
.then(literal("markAllInCurrentIslandFound").executes(context -> {
FairySouls.markAllFairiesOnCurrentIslandFound();
- context.getSource().sendFeedback(Text.translatable("skyblocker.fairySouls.markAllFound"));
+ context.getSource().sendFeedback(Constants.PREFIX.get().append(Text.translatable("skyblocker.fairySouls.markAllFound")));
return 1;
}))
.then(literal("markAllInCurrentIslandMissing").executes(context -> {
FairySouls.markAllFairiesOnCurrentIslandMissing();
- context.getSource().sendFeedback(Text.translatable("skyblocker.fairySouls.markAllMissing"));
+ context.getSource().sendFeedback(Constants.PREFIX.get().append(Text.translatable("skyblocker.fairySouls.markAllMissing")));
return 1;
}))));
}
diff --git a/src/main/java/de/hysky/skyblocker/skyblock/dungeon/CreeperBeams.java b/src/main/java/de/hysky/skyblocker/skyblock/dungeon/CreeperBeams.java
index 5356658e..08c22b27 100644
--- a/src/main/java/de/hysky/skyblocker/skyblock/dungeon/CreeperBeams.java
+++ b/src/main/java/de/hysky/skyblocker/skyblock/dungeon/CreeperBeams.java
@@ -238,12 +238,12 @@ public class CreeperBeams {
// render either in a color if not created or faintly green if created
public void render(WorldRenderContext wrc, float[] color) {
if (toDo) {
- RenderHelper.renderOutline(wrc, outlineOne, color, 3);
- RenderHelper.renderOutline(wrc, outlineTwo, color, 3);
+ RenderHelper.renderOutline(wrc, outlineOne, color, 3, false);
+ RenderHelper.renderOutline(wrc, outlineTwo, color, 3, false);
RenderHelper.renderLinesFromPoints(wrc, line, color, 1, 2);
} else {
- RenderHelper.renderOutline(wrc, outlineOne, LIME_COLOR_COMPONENTS, 1);
- RenderHelper.renderOutline(wrc, outlineTwo, LIME_COLOR_COMPONENTS, 1);
+ RenderHelper.renderOutline(wrc, outlineOne, LIME_COLOR_COMPONENTS, 1, false);
+ RenderHelper.renderOutline(wrc, outlineTwo, LIME_COLOR_COMPONENTS, 1, false);
RenderHelper.renderLinesFromPoints(wrc, line, LIME_COLOR_COMPONENTS, 0.75f, 1);
}
}
diff --git a/src/main/java/de/hysky/skyblocker/skyblock/dungeon/DungeonBlaze.java b/src/main/java/de/hysky/skyblocker/skyblock/dungeon/DungeonBlaze.java
index cfb16b4d..f49a2f2e 100644
--- a/src/main/java/de/hysky/skyblocker/skyblock/dungeon/DungeonBlaze.java
+++ b/src/main/java/de/hysky/skyblocker/skyblock/dungeon/DungeonBlaze.java
@@ -128,11 +128,11 @@ public class DungeonBlaze {
*/
private static void renderBlazeOutline(ArmorStandEntity blaze, ArmorStandEntity nextBlaze, WorldRenderContext wrc) {
Box blazeBox = blaze.getBoundingBox().expand(0.3, 0.9, 0.3).offset(0, -1.1, 0);
- RenderHelper.renderOutline(wrc, blazeBox, GREEN_COLOR_COMPONENTS, 5f);
+ RenderHelper.renderOutline(wrc, blazeBox, GREEN_COLOR_COMPONENTS, 5f, false);
if (nextBlaze != null && nextBlaze.isAlive() && nextBlaze != blaze) {
Box nextBlazeBox = nextBlaze.getBoundingBox().expand(0.3, 0.9, 0.3).offset(0, -1.1, 0);
- RenderHelper.renderOutline(wrc, nextBlazeBox, WHITE_COLOR_COMPONENTS, 5f);
+ RenderHelper.renderOutline(wrc, nextBlazeBox, WHITE_COLOR_COMPONENTS, 5f, false);
Vec3d blazeCenter = blazeBox.getCenter();
Vec3d nextBlazeCenter = nextBlazeBox.getCenter();
diff --git a/src/main/java/de/hysky/skyblocker/skyblock/dungeon/TicTacToe.java b/src/main/java/de/hysky/skyblocker/skyblock/dungeon/TicTacToe.java
index 2d56c8a0..7f249e7d 100644
--- a/src/main/java/de/hysky/skyblocker/skyblock/dungeon/TicTacToe.java
+++ b/src/main/java/de/hysky/skyblocker/skyblock/dungeon/TicTacToe.java
@@ -127,7 +127,7 @@ public class TicTacToe {
private static void solutionRenderer(WorldRenderContext context) {
try {
if (SkyblockerConfigManager.get().locations.dungeons.solveTicTacToe && nextBestMoveToMake != null) {
- RenderHelper.renderOutline(context, nextBestMoveToMake, RED_COLOR_COMPONENTS, 5);
+ RenderHelper.renderOutline(context, nextBestMoveToMake, RED_COLOR_COMPONENTS, 5, false);
}
} catch (Exception e) {
LOGGER.error("[Skyblocker Tic Tac Toe] Encountered an exception while rendering the tic tac toe solution!", e);
diff --git a/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/DungeonSecrets.java b/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/DungeonSecrets.java
index c2358689..cb9615fb 100644
--- a/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/DungeonSecrets.java
+++ b/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/DungeonSecrets.java
@@ -12,6 +12,7 @@ import it.unimi.dsi.fastutil.objects.Object2ByteOpenHashMap;
import it.unimi.dsi.fastutil.objects.ObjectIntPair;
import de.hysky.skyblocker.SkyblockerMod;
import de.hysky.skyblocker.config.SkyblockerConfigManager;
+import de.hysky.skyblocker.utils.Constants;
import de.hysky.skyblocker.utils.Utils;
import de.hysky.skyblocker.utils.scheduler.Scheduler;
import net.fabricmc.fabric.api.client.command.v2.ClientCommandRegistrationCallback;
@@ -214,9 +215,9 @@ public class DungeonSecrets {
return argument("secret", IntegerArgumentType.integer()).executes(context -> {
int secretIndex = IntegerArgumentType.getInteger(context, "secret");
if (markSecrets(secretIndex, found)) {
- context.getSource().sendFeedback(Text.translatable(found ? "skyblocker.dungeons.secrets.markSecretFound" : "skyblocker.dungeons.secrets.markSecretMissing", secretIndex));
+ context.getSource().sendFeedback(Constants.PREFIX.get().append(Text.translatable(found ? "skyblocker.dungeons.secrets.markSecretFound" : "skyblocker.dungeons.secrets.markSecretMissing", secretIndex)));
} else {
- context.getSource().sendError(Text.translatable(found ? "skyblocker.dungeons.secrets.markSecretFoundUnable" : "skyblocker.dungeons.secrets.markSecretMissingUnable", secretIndex));
+ context.getSource().sendError(Constants.PREFIX.get().append(Text.translatable(found ? "skyblocker.dungeons.secrets.markSecretFoundUnable" : "skyblocker.dungeons.secrets.markSecretMissingUnable", secretIndex)));
}
return Command.SINGLE_SUCCESS;
});
diff --git a/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/SecretWaypoint.java b/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/SecretWaypoint.java
index d2a31ea3..0d9bdff1 100644
--- a/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/SecretWaypoint.java
+++ b/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/SecretWaypoint.java
@@ -1,7 +1,6 @@
package de.hysky.skyblocker.skyblock.dungeon.secrets;
import com.google.gson.JsonObject;
-
import de.hysky.skyblocker.config.SkyblockerConfig;
import de.hysky.skyblocker.config.SkyblockerConfigManager;
import de.hysky.skyblocker.utils.render.RenderHelper;
@@ -11,6 +10,7 @@ import net.minecraft.entity.Entity;
import net.minecraft.text.Text;
import net.minecraft.util.Formatting;
import net.minecraft.util.math.BlockPos;
+import net.minecraft.util.math.Box;
import net.minecraft.util.math.Vec3d;
import java.util.List;
@@ -18,6 +18,8 @@ import java.util.function.Predicate;
import java.util.function.ToDoubleFunction;
public class SecretWaypoint {
+ private static final float HIGHLIGHT_ALPHA = 0.5f;
+ private static final float LINE_WIDTH = 5f;
static final List<String> SECRET_ITEMS = List.of("Decoy", "Defuse Kit", "Dungeon Chest Key", "Healing VIII", "Inflatable Jerry", "Spirit Leap", "Training Weights", "Trap", "Treasure Talisman");
final int secretIndex;
final Category category;
@@ -75,11 +77,29 @@ public class SecretWaypoint {
* Renders the secret waypoint, including a filled cube, a beacon beam, the name, and the distance from the player.
*/
void render(WorldRenderContext context) {
- RenderHelper.renderFilledThroughWallsWithBeaconBeam(context, pos, category.colorComponents, 0.5F);
- Vec3d posUp = centerPos.add(0, 1, 0);
- RenderHelper.renderText(context, name, posUp, true);
- double distance = context.camera().getPos().distanceTo(centerPos);
- RenderHelper.renderText(context, Text.literal(Math.round(distance) + "m").formatted(Formatting.YELLOW), posUp, 1, MinecraftClient.getInstance().textRenderer.fontHeight + 1, true);
+ SkyblockerConfig.SecretWaypoints config = SkyblockerConfigManager.get().locations.dungeons.secretWaypoints;
+
+ switch (config.waypointType) {
+ case WAYPOINT -> RenderHelper.renderFilledThroughWallsWithBeaconBeam(context, pos, category.colorComponents, HIGHLIGHT_ALPHA);
+ case OUTLINED_WAYPOINT -> {
+ RenderHelper.renderFilledThroughWallsWithBeaconBeam(context, pos, category.colorComponents, HIGHLIGHT_ALPHA);
+ RenderHelper.renderOutline(context, new Box(pos), category.colorComponents, LINE_WIDTH, true);
+ }
+ case HIGHLIGHT -> RenderHelper.renderFilledThroughWalls(context, pos, category.colorComponents, HIGHLIGHT_ALPHA);
+ case OUTLINED_HIGHLIGHT -> {
+ RenderHelper.renderFilledThroughWalls(context, pos, category.colorComponents, HIGHLIGHT_ALPHA);
+ RenderHelper.renderOutline(context, new Box(pos), category.colorComponents, LINE_WIDTH, true);
+ }
+ //TODO In the future, shrink the box for wither essence and items so its more realistic
+ case OUTLINE -> RenderHelper.renderOutline(context, new Box(pos), category.colorComponents, LINE_WIDTH, true);
+ }
+
+ if (config.showSecretText) {
+ Vec3d posUp = centerPos.add(0, 1, 0);
+ RenderHelper.renderText(context, name, posUp, true);
+ double distance = context.camera().getPos().distanceTo(centerPos);
+ RenderHelper.renderText(context, Text.literal(Math.round(distance) + "m").formatted(Formatting.YELLOW), posUp, 1, MinecraftClient.getInstance().textRenderer.fontHeight + 1, true);
+ }
}
enum Category {
diff --git a/src/main/java/de/hysky/skyblocker/skyblock/item/CompactorDeletorPreview.java b/src/main/java/de/hysky/skyblocker/skyblock/item/CompactorDeletorPreview.java
index 7f5b96b9..1e3dd7d2 100644
--- a/src/main/java/de/hysky/skyblocker/skyblock/item/CompactorDeletorPreview.java
+++ b/src/main/java/de/hysky/skyblocker/skyblock/item/CompactorDeletorPreview.java
@@ -1,7 +1,7 @@
package de.hysky.skyblocker.skyblock.item;
import de.hysky.skyblocker.mixin.accessor.DrawContextInvoker;
-import de.hysky.skyblocker.skyblock.itemlist.ItemRegistry;
+import de.hysky.skyblocker.skyblock.itemlist.ItemRepository;
import de.hysky.skyblocker.utils.ItemUtils;
import it.unimi.dsi.fastutil.ints.IntIntPair;
import it.unimi.dsi.fastutil.ints.IntObjectPair;
@@ -43,7 +43,7 @@ public class CompactorDeletorPreview {
NbtCompound extraAttributes = ItemUtils.getExtraAttributes(stack);
if (extraAttributes == null) return false;
// Get the slots and their items from the nbt, which is in the format personal_compact_<slot_number> or personal_deletor_<slot_number>
- List<IntObjectPair<ItemStack>> slots = extraAttributes.getKeys().stream().filter(slot -> slot.contains(type.toLowerCase().substring(0, 7))).map(slot -> IntObjectPair.of(Integer.parseInt(slot.substring(17)), ItemRegistry.getItemStack(extraAttributes.getString(slot)))).toList();
+ List<IntObjectPair<ItemStack>> slots = extraAttributes.getKeys().stream().filter(slot -> slot.contains(type.toLowerCase().substring(0, 7))).map(slot -> IntObjectPair.of(Integer.parseInt(slot.substring(17)), ItemRepository.getItemStack(extraAttributes.getString(slot)))).toList();
List<TooltipComponent> components = tooltips.stream().map(Text::asOrderedText).map(TooltipComponent::of).collect(Collectors.toList());
IntIntPair dimensions = DIMENSIONS.getOrDefault(size, DEFAULT_DIMENSION);
diff --git a/src/main/java/de/hysky/skyblocker/skyblock/item/CustomArmorDyeColors.java b/src/main/java/de/hysky/skyblocker/skyblock/item/CustomArmorDyeColors.java
index 1496c90f..509f79b7 100644
--- a/src/main/java/de/hysky/skyblocker/skyblock/item/CustomArmorDyeColors.java
+++ b/src/main/java/de/hysky/skyblocker/skyblock/item/CustomArmorDyeColors.java
@@ -4,6 +4,7 @@ import com.mojang.brigadier.Command;
import com.mojang.brigadier.CommandDispatcher;
import com.mojang.brigadier.arguments.StringArgumentType;
import de.hysky.skyblocker.config.SkyblockerConfigManager;
+import de.hysky.skyblocker.utils.Constants;
import de.hysky.skyblocker.utils.ItemUtils;
import de.hysky.skyblocker.utils.Utils;
import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap;
@@ -34,7 +35,7 @@ public class CustomArmorDyeColors {
ItemStack heldItem = source.getPlayer().getMainHandStack();
if (hex != null && !isHexadecimalColor(hex)) {
- source.sendError(Text.translatable("skyblocker.customDyeColors.invalidHex"));
+ source.sendError(Constants.PREFIX.get().append(Text.translatable("skyblocker.customDyeColors.invalidHex")));
return Command.SINGLE_SUCCESS;
}
@@ -49,24 +50,24 @@ public class CustomArmorDyeColors {
if (customDyeColors.containsKey(itemUuid)) {
customDyeColors.removeInt(itemUuid);
SkyblockerConfigManager.save();
- source.sendFeedback(Text.translatable("skyblocker.customDyeColors.removed"));
+ source.sendFeedback(Constants.PREFIX.get().append(Text.translatable("skyblocker.customDyeColors.removed")));
} else {
- source.sendFeedback(Text.translatable("skyblocker.customDyeColors.neverHad"));
+ source.sendFeedback(Constants.PREFIX.get().append(Text.translatable("skyblocker.customDyeColors.neverHad")));
}
} else {
customDyeColors.put(itemUuid, Integer.decode("0x" + hex.replace("#", "")).intValue());
SkyblockerConfigManager.save();
- source.sendFeedback(Text.translatable("skyblocker.customDyeColors.added"));
+ source.sendFeedback(Constants.PREFIX.get().append(Text.translatable("skyblocker.customDyeColors.added")));
}
} else {
- source.sendError(Text.translatable("skyblocker.customDyeColors.noItemUuid"));
+ source.sendError(Constants.PREFIX.get().append(Text.translatable("skyblocker.customDyeColors.noItemUuid")));
}
} else {
- source.sendError(Text.translatable("skyblocker.customDyeColors.notDyeable"));
+ source.sendError(Constants.PREFIX.get().append(Text.translatable("skyblocker.customDyeColors.notDyeable")));
return Command.SINGLE_SUCCESS;
}
} else {
- source.sendError(Text.translatable("skyblocker.customDyeColors.unableToSetColor"));
+ source.sendError(Constants.PREFIX.get().append(Text.translatable("skyblocker.customDyeColors.unableToSetColor")));
}
return Command.SINGLE_SUCCESS;
diff --git a/src/main/java/de/hysky/skyblocker/skyblock/item/CustomArmorTrims.java b/src/main/java/de/hysky/skyblocker/skyblock/item/CustomArmorTrims.java
index 9242d47b..cec84b38 100644
--- a/src/main/java/de/hysky/skyblocker/skyblock/item/CustomArmorTrims.java
+++ b/src/main/java/de/hysky/skyblocker/skyblock/item/CustomArmorTrims.java
@@ -3,8 +3,12 @@ package de.hysky.skyblocker.skyblock.item;
import com.mojang.brigadier.Command;
import com.mojang.brigadier.CommandDispatcher;
import com.mojang.brigadier.suggestion.SuggestionProvider;
+import com.mojang.serialization.Codec;
+import com.mojang.serialization.codecs.RecordCodecBuilder;
+
import de.hysky.skyblocker.config.SkyblockerConfigManager;
import de.hysky.skyblocker.events.SkyblockEvents;
+import de.hysky.skyblocker.utils.Constants;
import de.hysky.skyblocker.utils.ItemUtils;
import de.hysky.skyblocker.utils.Utils;
import dev.isxander.yacl3.config.v2.api.SerialEntry;
@@ -105,38 +109,43 @@ public class CustomArmorTrims {
if (customArmorTrims.containsKey(itemUuid)) {
customArmorTrims.remove(itemUuid);
SkyblockerConfigManager.save();
- source.sendFeedback(Text.translatable("skyblocker.customArmorTrims.removed"));
+ source.sendFeedback(Constants.PREFIX.get().append(Text.translatable("skyblocker.customArmorTrims.removed")));
} else {
- source.sendFeedback(Text.translatable("skyblocker.customArmorTrims.neverHad"));
+ source.sendFeedback(Constants.PREFIX.get().append(Text.translatable("skyblocker.customArmorTrims.neverHad")));
}
} else {
// Ensure that the material & trim are valid
ArmorTrimId trimId = new ArmorTrimId(material, pattern);
if (TRIMS_CACHE.get(trimId) == null) {
- source.sendError(Text.translatable("skyblocker.customArmorTrims.invalidMaterialOrPattern"));
+ source.sendError(Constants.PREFIX.get().append(Text.translatable("skyblocker.customArmorTrims.invalidMaterialOrPattern")));
return Command.SINGLE_SUCCESS;
}
customArmorTrims.put(itemUuid, trimId);
SkyblockerConfigManager.save();
- source.sendFeedback(Text.translatable("skyblocker.customArmorTrims.added"));
+ source.sendFeedback(Constants.PREFIX.get().append(Text.translatable("skyblocker.customArmorTrims.added")));
}
} else {
- source.sendError(Text.translatable("skyblocker.customArmorTrims.noItemUuid"));
+ source.sendError(Constants.PREFIX.get().append(Text.translatable("skyblocker.customArmorTrims.noItemUuid")));
}
} else {
- source.sendError(Text.translatable("skyblocker.customArmorTrims.notAnArmorPiece"));
+ source.sendError(Constants.PREFIX.get().append(Text.translatable("skyblocker.customArmorTrims.notAnArmorPiece")));
return Command.SINGLE_SUCCESS;
}
} else {
- source.sendError(Text.translatable("skyblocker.customArmorTrims.unableToSetTrim"));
+ source.sendError(Constants.PREFIX.get().append(Text.translatable("skyblocker.customArmorTrims.unableToSetTrim")));
}
return Command.SINGLE_SUCCESS;
}
public record ArmorTrimId(@SerialEntry Identifier material, @SerialEntry Identifier pattern) implements Pair<Identifier, Identifier> {
+ public static final Codec<ArmorTrimId> CODEC = RecordCodecBuilder.create(instance -> instance.group(
+ Identifier.CODEC.fieldOf("material").forGetter(ArmorTrimId::material),
+ Identifier.CODEC.fieldOf("pattern").forGetter(ArmorTrimId::pattern))
+ .apply(instance, ArmorTrimId::new));
+
@Override
public Identifier left() {
return material();
diff --git a/src/main/java/de/hysky/skyblocker/skyblock/item/CustomItemNames.java b/src/main/java/de/hysky/skyblocker/skyblock/item/CustomItemNames.java
index b6213eb6..e47444cf 100644
--- a/src/main/java/de/hysky/skyblocker/skyblock/item/CustomItemNames.java
+++ b/src/main/java/de/hysky/skyblocker/skyblock/item/CustomItemNames.java
@@ -3,6 +3,7 @@ package de.hysky.skyblocker.skyblock.item;
import com.mojang.brigadier.Command;
import com.mojang.brigadier.CommandDispatcher;
import de.hysky.skyblocker.config.SkyblockerConfigManager;
+import de.hysky.skyblocker.utils.Constants;
import de.hysky.skyblocker.utils.ItemUtils;
import de.hysky.skyblocker.utils.Utils;
import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap;
@@ -42,9 +43,9 @@ public class CustomItemNames {
//Remove custom item name when the text argument isn't passed
customItemNames.remove(itemUuid);
SkyblockerConfigManager.save();
- source.sendFeedback(Text.translatable("skyblocker.customItemNames.removed"));
+ source.sendFeedback(Constants.PREFIX.get().append(Text.translatable("skyblocker.customItemNames.removed")));
} else {
- source.sendFeedback(Text.translatable("skyblocker.customItemNames.neverHad"));
+ source.sendFeedback(Constants.PREFIX.get().append(Text.translatable("skyblocker.customItemNames.neverHad")));
}
} else {
//If the text is provided then set the item's custom name to it
@@ -55,13 +56,13 @@ public class CustomItemNames {
customItemNames.put(itemUuid, text);
SkyblockerConfigManager.save();
- source.sendFeedback(Text.translatable("skyblocker.customItemNames.added"));
+ source.sendFeedback(Constants.PREFIX.get().append(Text.translatable("skyblocker.customItemNames.added")));
}
} else {
- source.sendError(Text.translatable("skyblocker.customItemNames.noItemUuid"));
+ source.sendError(Constants.PREFIX.get().append(Text.translatable("skyblocker.customItemNames.noItemUuid")));
}
} else {
- source.sendError(Text.translatable("skyblocker.customItemNames.unableToSetName"));
+ source.sendError(Constants.PREFIX.get().append(Text.translatable("skyblocker.customItemNames.unableToSetName")));
}
return Command.SINGLE_SUCCESS;
diff --git a/src/main/java/de/hysky/skyblocker/skyblock/item/ItemProtection.java b/src/main/java/de/hysky/skyblocker/skyblock/item/ItemProtection.java
index ff88ef8d..2d929c28 100644
--- a/src/main/java/de/hysky/skyblocker/skyblock/item/ItemProtection.java
+++ b/src/main/java/de/hysky/skyblocker/skyblock/item/ItemProtection.java
@@ -3,6 +3,7 @@ package de.hysky.skyblocker.skyblock.item;
import com.mojang.brigadier.Command;
import com.mojang.brigadier.CommandDispatcher;
import de.hysky.skyblocker.config.SkyblockerConfigManager;
+import de.hysky.skyblocker.utils.Constants;
import de.hysky.skyblocker.utils.ItemUtils;
import de.hysky.skyblocker.utils.Utils;
import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet;
@@ -44,18 +45,18 @@ public class ItemProtection {
protectedItems.add(itemUuid);
SkyblockerConfigManager.save();
- source.sendFeedback(Text.translatable("skyblocker.itemProtection.added", heldItem.getName()));
+ source.sendFeedback(Constants.PREFIX.get().append(Text.translatable("skyblocker.itemProtection.added", heldItem.getName())));
} else {
protectedItems.remove(itemUuid);
SkyblockerConfigManager.save();
- source.sendFeedback(Text.translatable("skyblocker.itemProtection.removed", heldItem.getName()));
+ source.sendFeedback(Constants.PREFIX.get().append(Text.translatable("skyblocker.itemProtection.removed", heldItem.getName())));
}
} else {
- source.sendFeedback(Text.translatable("skyblocker.itemProtection.noItemUuid"));
+ source.sendFeedback(Constants.PREFIX.get().append(Text.translatable("skyblocker.itemProtection.noItemUuid")));
}
} else {
- source.sendFeedback(Text.translatable("skyblocker.itemProtection.unableToProtect"));
+ source.sendFeedback(Constants.PREFIX.get().append(Text.translatable("skyblocker.itemProtection.unableToProtect")));
}
return Command.SINGLE_SUCCESS;
diff --git a/src/main/java/de/hysky/skyblocker/skyblock/item/PriceInfoTooltip.java b/src/main/java/de/hysky/skyblocker/skyblock/item/PriceInfoTooltip.java
index 0f84deea..0885ae6b 100644
--- a/src/main/java/de/hysky/skyblocker/skyblock/item/PriceInfoTooltip.java
+++ b/src/main/java/de/hysky/skyblocker/skyblock/item/PriceInfoTooltip.java
@@ -4,6 +4,7 @@ import com.google.gson.Gson;
import com.google.gson.JsonObject;
import de.hysky.skyblocker.config.SkyblockerConfig;
import de.hysky.skyblocker.config.SkyblockerConfigManager;
+import de.hysky.skyblocker.utils.Constants;
import de.hysky.skyblocker.utils.Http;
import de.hysky.skyblocker.utils.ItemUtils;
import de.hysky.skyblocker.utils.Utils;
@@ -196,7 +197,7 @@ public class PriceInfoTooltip {
private static void nullWarning() {
if (!nullMsgSend && client.player != null) {
- client.player.sendMessage(Text.translatable("skyblocker.itemTooltip.nullMessage"), false);
+ client.player.sendMessage(Constants.PREFIX.get().append(Text.translatable("skyblocker.itemTooltip.nullMessage")), false);
nullMsgSend = true;
}
}
diff --git a/src/main/java/de/hysky/skyblocker/skyblock/item/WikiLookup.java b/src/main/java/de/hysky/skyblocker/skyblock/item/WikiLookup.java
index d4e6a0df..38121ea3 100644
--- a/src/main/java/de/hysky/skyblocker/skyblock/item/WikiLookup.java
+++ b/src/main/java/de/hysky/skyblocker/skyblock/item/WikiLookup.java
@@ -1,23 +1,25 @@
package de.hysky.skyblocker.skyblock.item;
-import de.hysky.skyblocker.skyblock.itemlist.ItemRegistry;
+import de.hysky.skyblocker.config.SkyblockerConfigManager;
+import de.hysky.skyblocker.skyblock.itemlist.ItemRepository;
import de.hysky.skyblocker.utils.ItemUtils;
-import de.hysky.skyblocker.utils.Utils;
import net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper;
-import net.minecraft.client.MinecraftClient;
import net.minecraft.client.option.KeyBinding;
import net.minecraft.client.util.InputUtil;
+import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.screen.slot.Slot;
import net.minecraft.text.Text;
import net.minecraft.util.Util;
import org.lwjgl.glfw.GLFW;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import java.util.concurrent.CompletableFuture;
public class WikiLookup {
+ private static final Logger LOGGER = LoggerFactory.getLogger(WikiLookup.class);
public static KeyBinding wikiLookup;
- static final MinecraftClient client = MinecraftClient.getInstance();
- static String id;
+ private static String id;
public static void init() {
wikiLookup = KeyBindingHelper.registerKeyBinding(new KeyBinding(
@@ -28,22 +30,22 @@ public class WikiLookup {
));
}
- public static String getSkyblockId(Slot slot) {
+ public static void getSkyblockId(Slot slot) {
//Grabbing the skyblock NBT data
ItemUtils.getItemIdOptional(slot.getStack()).ifPresent(newId -> id = newId);
- return id;
}
- public static void openWiki(Slot slot) {
- if (Utils.isOnSkyblock()) {
- id = getSkyblockId(slot);
+ public static void openWiki(Slot slot, PlayerEntity player) {
+ if (SkyblockerConfigManager.get().general.wikiLookup.enableWikiLookup) {
+ getSkyblockId(slot);
try {
- String wikiLink = ItemRegistry.getWikiLink(id);
+ String wikiLink = ItemRepository.getWikiLink(id, player);
CompletableFuture.runAsync(() -> Util.getOperatingSystem().open(wikiLink));
} catch (IndexOutOfBoundsException | IllegalStateException e) {
- e.printStackTrace();
- if (client.player != null)
- client.player.sendMessage(Text.of("Error while retrieving wiki article..."), false);
+ LOGGER.error("[Skyblocker] Error while retrieving wiki article...", e);
+ if (player != null) {
+ player.sendMessage(Text.of("[Skyblocker] Error while retrieving wiki article, see logs..."), false);
+ }
}
}
}
diff --git a/src/main/java/de/hysky/skyblocker/skyblock/itemlist/ItemListWidget.java b/src/main/java/de/hysky/skyblocker/skyblock/itemlist/ItemListWidget.java
index afdcaca8..5570c4f7 100644
--- a/src/main/java/de/hysky/skyblocker/skyblock/itemlist/ItemListWidget.java
+++ b/src/main/java/de/hysky/skyblocker/skyblock/itemlist/ItemListWidget.java
@@ -38,7 +38,7 @@ public class ItemListWidget extends RecipeBookWidget {
this.searchField = ((RecipeBookWidgetAccessor) this).getSearchField();
int x = (this.parentWidth - 147) / 2 - this.leftOffset;
int y = (this.parentHeight - 166) / 2;
- if (ItemRegistry.filesImported) {
+ if (ItemRepository.filesImported()) {
this.results = new SearchResultsWidget(this.client, x, y);
this.updateSearchResult();
}
@@ -57,7 +57,7 @@ public class ItemListWidget extends RecipeBookWidget {
context.drawTexture(TEXTURE, i, j, 1, 1, 147, 166);
this.searchField = ((RecipeBookWidgetAccessor) this).getSearchField();
- if (!ItemRegistry.filesImported && !this.searchField.isFocused() && this.searchField.getText().isEmpty()) {
+ if (!ItemRepository.filesImported() && !this.searchField.isFocused() && this.searchField.getText().isEmpty()) {
Text hintText = (Text.literal("Loading...")).formatted(Formatting.ITALIC).formatted(Formatting.GRAY);
context.drawTextWithShadow(this.client.textRenderer, hintText, i + 25, j + 14, -1);
} else if (!this.searchField.isFocused() && this.searchField.getText().isEmpty()) {
@@ -66,7 +66,7 @@ public class ItemListWidget extends RecipeBookWidget {
} else {
this.searchField.render(context, mouseX, mouseY, delta);
}
- if (ItemRegistry.filesImported) {
+ if (ItemRepository.filesImported()) {
if (results == null) {
int x = (this.parentWidth - 147) / 2 - this.leftOffset;
int y = (this.parentHeight - 166) / 2;
@@ -81,14 +81,14 @@ public class ItemListWidget extends RecipeBookWidget {
@Override
public void drawTooltip(DrawContext context, int x, int y, int mouseX, int mouseY) {
- if (this.isOpen() && ItemRegistry.filesImported && results != null) {
+ if (this.isOpen() && ItemRepository.filesImported() && results != null) {
this.results.drawTooltip(context, mouseX, mouseY);
}
}
@Override
public boolean mouseClicked(double mouseX, double mouseY, int button) {
- if (this.isOpen() && this.client.player != null && !this.client.player.isSpectator() && ItemRegistry.filesImported && this.searchField != null && results != null) {
+ if (this.isOpen() && this.client.player != null && !this.client.player.isSpectator() && ItemRepository.filesImported() && this.searchField != null && results != null) {
if (this.searchField.mouseClicked(mouseX, mouseY, button)) {
this.results.closeRecipeView();
this.searchField.setFocused(true);
diff --git a/src/main/java/de/hysky/skyblocker/skyblock/itemlist/ItemRegistry.java b/src/main/java/de/hysky/skyblocker/skyblock/itemlist/ItemRegistry.java
deleted file mode 100644
index b958a85d..00000000
--- a/src/main/java/de/hysky/skyblocker/skyblock/itemlist/ItemRegistry.java
+++ /dev/null
@@ -1,129 +0,0 @@
-package de.hysky.skyblocker.skyblock.itemlist;
-
-import com.google.gson.JsonObject;
-import com.google.gson.JsonParser;
-import de.hysky.skyblocker.utils.ItemUtils;
-import de.hysky.skyblocker.utils.NEURepo;
-import net.minecraft.client.MinecraftClient;
-import net.minecraft.item.ItemStack;
-import net.minecraft.item.Items;
-import net.minecraft.text.Text;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.File;
-import java.io.IOException;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Stream;
-
-public class ItemRegistry {
- protected static final Logger LOGGER = LoggerFactory.getLogger(ItemRegistry.class);
- protected static final Path ITEM_LIST_DIR = NEURepo.LOCAL_REPO_DIR.resolve("items");
-
- protected static final List<ItemStack> items = new ArrayList<>();
- protected static final Map<String, ItemStack> itemsMap = new HashMap<>();
- protected static final List<SkyblockCraftingRecipe> recipes = new ArrayList<>();
- public static final MinecraftClient client = MinecraftClient.getInstance();
- public static boolean filesImported = false;
-
- public static void init() {
- NEURepo.runAsyncAfterLoad(ItemStackBuilder::loadPetNums);
- NEURepo.runAsyncAfterLoad(ItemRegistry::importItemFiles);
- }
-
- private static void importItemFiles() {
- List<JsonObject> jsonObjs = new ArrayList<>();
-
- File dir = ITEM_LIST_DIR.toFile();
- File[] files = dir.listFiles();
- if (files == null) {
- return;
- }
- for (File file : files) {
- Path path = ITEM_LIST_DIR.resolve(file.getName());
- try {
- String fileContent = Files.readString(path);
- jsonObjs.add(JsonParser.parseString(fileContent).getAsJsonObject());
- } catch (Exception e) {
- LOGGER.error("Failed to read file " + path, e);
- }
- }
-
- for (JsonObject jsonObj : jsonObjs) {
- String internalName = jsonObj.get("internalname").getAsString();
- ItemStack itemStack = ItemStackBuilder.parseJsonObj(jsonObj);
- items.add(itemStack);
- itemsMap.put(internalName, itemStack);
- }
- for (JsonObject jsonObj : jsonObjs)
- if (jsonObj.has("recipe")) {
- recipes.add(SkyblockCraftingRecipe.fromJsonObject(jsonObj));
- }
-
- items.sort((lhs, rhs) -> {
- String lhsInternalName = ItemUtils.getItemId(lhs);
- String lhsFamilyName = lhsInternalName.replaceAll(".\\d+$", "");
- String rhsInternalName = ItemUtils.getItemId(rhs);
- String rhsFamilyName = rhsInternalName.replaceAll(".\\d+$", "");
- if (lhsFamilyName.equals(rhsFamilyName)) {
- if (lhsInternalName.length() != rhsInternalName.length())
- return lhsInternalName.length() - rhsInternalName.length();
- else return lhsInternalName.compareTo(rhsInternalName);
- }
- return lhsFamilyName.compareTo(rhsFamilyName);
- });
- filesImported = true;
- }
-
- public static String getWikiLink(String internalName) {
- try {
- String fileContent = Files.readString(ITEM_LIST_DIR.resolve(internalName + ".json"));
- JsonObject fileJson = JsonParser.parseString(fileContent).getAsJsonObject();
- //TODO optional official or unofficial wiki link
- try {
- return fileJson.get("info").getAsJsonArray().get(1).getAsString();
- } catch (IndexOutOfBoundsException e) {
- return fileJson.get("info").getAsJsonArray().get(0).getAsString();
- }
- } catch (IOException | NullPointerException e) {
- LOGGER.error("Failed to read item file " + internalName + ".json", e);
- if (client.player != null) {
- client.player.sendMessage(Text.of("Can't locate a wiki article for this item..."), false);
- }
- return null;
- }
- }
-
- public static List<SkyblockCraftingRecipe> getRecipes(String internalName) {
- List<SkyblockCraftingRecipe> result = new ArrayList<>();
- for (SkyblockCraftingRecipe recipe : recipes) {
- if (ItemUtils.getItemId(recipe.result).equals(internalName)) result.add(recipe);
- }
- for (SkyblockCraftingRecipe recipe : recipes)
- for (ItemStack ingredient : recipe.grid) {
- if (!ingredient.getItem().equals(Items.AIR) && ItemUtils.getItemId(ingredient).equals(internalName)) {
- result.add(recipe);
- break;
- }
- }
- return result;
- }
-
- public static Stream<SkyblockCraftingRecipe> getRecipesStream() {
- return recipes.stream();
- }
-
- public static Stream<ItemStack> getItemsStream() {
- return items.stream();
- }
-
- public static ItemStack getItemStack(String internalName) {
- return itemsMap.get(internalName);
- }
-}
-
diff --git a/src/main/java/de/hysky/skyblocker/skyblock/itemlist/ItemRepository.java b/src/main/java/de/hysky/skyblocker/skyblock/itemlist/ItemRepository.java
new file mode 100644
index 00000000..bd2ac27a
--- /dev/null
+++ b/src/main/java/de/hysky/skyblocker/skyblock/itemlist/ItemRepository.java
@@ -0,0 +1,137 @@
+package de.hysky.skyblocker.skyblock.itemlist;
+
+import de.hysky.skyblocker.config.SkyblockerConfigManager;
+import de.hysky.skyblocker.utils.Constants;
+import de.hysky.skyblocker.utils.ItemUtils;
+import de.hysky.skyblocker.utils.NEURepoManager;
+import io.github.moulberry.repo.data.NEUCraftingRecipe;
+import io.github.moulberry.repo.data.NEUItem;
+import io.github.moulberry.repo.data.NEURecipe;
+import net.minecraft.entity.player.PlayerEntity;
+import net.minecraft.item.ItemStack;
+import net.minecraft.item.Items;
+import net.minecraft.text.Text;
+import org.jetbrains.annotations.Nullable;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Stream;
+
+public class ItemRepository {
+ protected static final Logger LOGGER = LoggerFactory.getLogger(ItemRepository.class);
+
+ private static final List<ItemStack> items = new ArrayList<>();
+ private static final Map<String, ItemStack> itemsMap = new HashMap<>();
+ private static final List<SkyblockCraftingRecipe> recipes = new ArrayList<>();
+ private static boolean filesImported = false;
+
+ public static void init() {
+ NEURepoManager.runAsyncAfterLoad(ItemStackBuilder::loadPetNums);
+ NEURepoManager.runAsyncAfterLoad(ItemRepository::importItemFiles);
+ }
+
+ private static void importItemFiles() {
+ NEURepoManager.NEU_REPO.getItems().getItems().values().forEach(ItemRepository::loadItem);
+ NEURepoManager.NEU_REPO.getItems().getItems().values().forEach(ItemRepository::loadRecipes);
+
+ items.sort((lhs, rhs) -> {
+ String lhsInternalName = ItemUtils.getItemId(lhs);
+ String lhsFamilyName = lhsInternalName.replaceAll(".\\d+$", "");
+ String rhsInternalName = ItemUtils.getItemId(rhs);
+ String rhsFamilyName = rhsInternalName.replaceAll(".\\d+$", "");
+ if (lhsFamilyName.equals(rhsFamilyName)) {
+ if (lhsInternalName.length() != rhsInternalName.length())
+ return lhsInternalName.length() - rhsInternalName.length();
+ else return lhsInternalName.compareTo(rhsInternalName);
+ }
+ return lhsFamilyName.compareTo(rhsFamilyName);
+ });
+ filesImported = true;
+ }
+
+ private static void loadItem(NEUItem item) {
+ ItemStack stack = ItemStackBuilder.fromNEUItem(item);
+ items.add(stack);
+ itemsMap.put(item.getSkyblockItemId(), stack);
+ }
+
+ private static void loadRecipes(NEUItem item) {
+ for (NEURecipe recipe : item.getRecipes()) {
+ if (recipe instanceof NEUCraftingRecipe neuCraftingRecipe) {
+ recipes.add(SkyblockCraftingRecipe.fromNEURecipe(neuCraftingRecipe));
+ }
+ }
+ }
+
+ public static String getWikiLink(String internalName, PlayerEntity player) {
+ NEUItem item = NEURepoManager.NEU_REPO.getItems().getItemBySkyblockId(internalName);
+ if (item == null || item.getInfo().isEmpty()) {
+ warnNoWikiLink(player);
+ return null;
+ }
+
+ List<String> info = item.getInfo();
+ String wikiLink0 = info.get(0);
+ String wikiLink1 = info.size() > 1 ? info.get(1) : "";
+ String wikiDomain = SkyblockerConfigManager.get().general.wikiLookup.officialWiki ? "https://wiki.hypixel.net" : "https://hypixel-skyblock.fandom.com";
+ if (wikiLink0.startsWith(wikiDomain)) {
+ return wikiLink0;
+ } else if (wikiLink1.startsWith(wikiDomain)) {
+ return wikiLink1;
+ }
+ warnNoWikiLink(player);
+ return null;
+ }
+
+ private static void warnNoWikiLink(PlayerEntity player) {
+ if (player != null) {
+ player.sendMessage(Constants.PREFIX.get().append(Text.translatable("skyblocker.wikiLookup.noArticleFound")), false);
+ }
+ }
+
+ public static List<SkyblockCraftingRecipe> getRecipes(String internalName) {
+ List<SkyblockCraftingRecipe> result = new ArrayList<>();
+ for (SkyblockCraftingRecipe recipe : recipes) {
+ if (ItemUtils.getItemId(recipe.getResult()).equals(internalName)) result.add(recipe);
+ }
+ for (SkyblockCraftingRecipe recipe : recipes) {
+ for (ItemStack ingredient : recipe.getGrid()) {
+ if (!ingredient.getItem().equals(Items.AIR) && ItemUtils.getItemId(ingredient).equals(internalName)) {
+ result.add(recipe);
+ break;
+ }
+ }
+ }
+ return result;
+ }
+
+ public static boolean filesImported() {
+ return filesImported;
+ }
+
+ public static void setFilesImported(boolean filesImported) {
+ ItemRepository.filesImported = filesImported;
+ }
+
+ public static List<ItemStack> getItems() {
+ return items;
+ }
+
+ public static Stream<ItemStack> getItemsStream() {
+ return items.stream();
+ }
+
+ @Nullable
+ public static ItemStack getItemStack(String internalName) {
+ return itemsMap.get(internalName);
+ }
+
+ public static Stream<SkyblockCraftingRecipe> getRecipesStream() {
+ return recipes.stream();
+ }
+}
+
diff --git a/src/main/java/de/hysky/skyblocker/skyblock/itemlist/ItemStackBuilder.java b/src/main/java/de/hysky/skyblocker/skyblock/itemlist/ItemStackBuilder.java
index 4a6d3474..cc7c0bc1 100644
--- a/src/main/java/de/hysky/skyblocker/skyblock/itemlist/ItemStackBuilder.java
+++ b/src/main/java/de/hysky/skyblocker/skyblock/itemlist/ItemStackBuilder.java
@@ -1,45 +1,41 @@
package de.hysky.skyblocker.skyblock.itemlist;
-import com.google.gson.JsonArray;
-import com.google.gson.JsonElement;
-import com.google.gson.JsonObject;
-import com.google.gson.JsonParser;
import de.hysky.skyblocker.utils.ItemUtils;
-import de.hysky.skyblocker.utils.NEURepo;
+import de.hysky.skyblocker.utils.NEURepoManager;
+import io.github.moulberry.repo.constants.PetNumbers;
+import io.github.moulberry.repo.data.NEUItem;
+import io.github.moulberry.repo.data.Rarity;
import net.minecraft.item.FireworkRocketItem;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.*;
import net.minecraft.text.Text;
import net.minecraft.util.Pair;
-import java.nio.file.Files;
-import java.nio.file.Path;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class ItemStackBuilder {
- private final static Path PETNUMS_PATH = NEURepo.LOCAL_REPO_DIR.resolve("constants/petnums.json");
- private static JsonObject petNums;
+ private static Map<String, Map<Rarity, PetNumbers>> petNums;
public static void loadPetNums() {
try {
- petNums = JsonParser.parseString(Files.readString(PETNUMS_PATH)).getAsJsonObject();
+ petNums = NEURepoManager.NEU_REPO.getConstants().getPetNumbers();
} catch (Exception e) {
- ItemRegistry.LOGGER.error("Failed to load petnums.json");
+ ItemRepository.LOGGER.error("Failed to load petnums.json");
}
}
- public static ItemStack parseJsonObj(JsonObject obj) {
- String internalName = obj.get("internalname").getAsString();
+ public static ItemStack fromNEUItem(NEUItem item) {
+ String internalName = item.getSkyblockItemId();
List<Pair<String, String>> injectors = new ArrayList<>(petData(internalName));
NbtCompound root = new NbtCompound();
- root.put("Count", NbtByte.of((byte)1));
+ root.put("Count", NbtByte.of((byte) 1));
- String id = obj.get("itemid").getAsString();
- int damage = obj.get("damage").getAsInt();
+ String id = item.getMinecraftItemId();
+ int damage = item.getDamage();
root.put("id", NbtString.of(ItemFixerUpper.convertItemId(id, damage)));
NbtCompound tag = new NbtCompound();
@@ -52,16 +48,14 @@ public class ItemStackBuilder {
NbtCompound display = new NbtCompound();
tag.put("display", display);
- String name = injectData(obj.get("displayname").getAsString(), injectors);
+ String name = injectData(item.getDisplayName(), injectors);
display.put("Name", NbtString.of(Text.Serializer.toJson(Text.of(name))));
NbtList lore = new NbtList();
display.put("Lore", lore);
- obj.get("lore").getAsJsonArray().forEach(el ->
- lore.add(NbtString.of(Text.Serializer.toJson(Text.of(injectData(el.getAsString(), injectors)))))
- );
+ item.getLore().forEach(el -> lore.add(NbtString.of(Text.Serializer.toJson(Text.of(injectData(el, injectors))))));
- String nbttag = obj.get("nbttag").getAsString();
+ String nbttag = item.getNbttag();
// add skull texture
Matcher skullUuid = Pattern.compile("(?<=SkullOwner:\\{)Id:\"(.{36})\"").matcher(nbttag);
Matcher skullTexture = Pattern.compile("(?<=Properties:\\{textures:\\[0:\\{Value:)\"(.+?)\"").matcher(nbttag);
@@ -92,55 +86,56 @@ public class ItemStackBuilder {
enchantments.add(new NbtCompound());
tag.put("Enchantments", enchantments);
}
-
+
// Add firework star color
- Matcher explosionColorMatcher = Pattern.compile("\\{Explosion:\\{(?:Type:[0-9a-z]+,)?Colors:\\[(?<color>[0-9]+)\\]\\}").matcher(nbttag);
+ Matcher explosionColorMatcher = Pattern.compile("\\{Explosion:\\{(?:Type:[0-9a-z]+,)?Colors:\\[(?<color>[0-9]+)]\\}").matcher(nbttag);
if (explosionColorMatcher.find()) {
NbtCompound explosion = new NbtCompound();
-
+
explosion.putInt("Type", FireworkRocketItem.Type.SMALL_BALL.getId()); //Forget about the actual ball type because it probably doesn't matter
- explosion.putIntArray("Colors", new int[] { Integer.parseInt(explosionColorMatcher.group("color")) });
+ explosion.putIntArray("Colors", new int[]{Integer.parseInt(explosionColorMatcher.group("color"))});
tag.put("Explosion", explosion);
}
return ItemStack.fromNbt(root);
}
- // TODO: fix stats for GOLDEN_DRAGON (lv1 -> lv200)
private static List<Pair<String, String>> petData(String internalName) {
List<Pair<String, String>> list = new ArrayList<>();
String petName = internalName.split(";")[0];
- if (!internalName.contains(";") || !petNums.has(petName)) return list;
-
- list.add(new Pair<>("\\{LVL\\}", "1 ➡ 100"));
-
- final String[] rarities = {
- "COMMON",
- "UNCOMMON",
- "RARE",
- "EPIC",
- "LEGENDARY",
- "MYTHIC"
+ if (!internalName.contains(";") || !petNums.containsKey(petName)) return list;
+
+ final Rarity[] rarities = {
+ Rarity.COMMON,
+ Rarity.UNCOMMON,
+ Rarity.RARE,
+ Rarity.EPIC,
+ Rarity.LEGENDARY,
+ Rarity.MYTHIC,
};
- String rarity = rarities[Integer.parseInt(internalName.split(";")[1])];
- JsonObject data = petNums.get(petName).getAsJsonObject().get(rarity).getAsJsonObject();
+ Rarity rarity = rarities[Integer.parseInt(internalName.split(";")[1])];
+ PetNumbers data = petNums.get(petName).get(rarity);
+
+ int minLevel = data.getLowLevel();
+ int maxLevel = data.getHighLevel();
+ list.add(new Pair<>("\\{LVL\\}", minLevel + " ➡ " + maxLevel));
- JsonObject statNumsMin = data.get("1").getAsJsonObject().get("statNums").getAsJsonObject();
- JsonObject statNumsMax = data.get("100").getAsJsonObject().get("statNums").getAsJsonObject();
- Set<Map.Entry<String, JsonElement>> entrySet = statNumsMin.entrySet();
- for (Map.Entry<String, JsonElement> entry : entrySet) {
+ Map<String, Double> statNumsMin = data.getStatsAtLowLevel().getStatNumbers();
+ Map<String, Double> statNumsMax = data.getStatsAtHighLevel().getStatNumbers();
+ Set<Map.Entry<String, Double>> entrySet = statNumsMin.entrySet();
+ for (Map.Entry<String, Double> entry : entrySet) {
String key = entry.getKey();
- String left = "\\{" + key+ "\\}";
- String right = statNumsMin.get(key).getAsString() + " ➡ " + statNumsMax.get(key).getAsString();
+ String left = "\\{" + key + "\\}";
+ String right = statNumsMin.get(key) + " ➡ " + statNumsMax.get(key);
list.add(new Pair<>(left, right));
}
- JsonArray otherNumsMin = data.get("1").getAsJsonObject().get("otherNums").getAsJsonArray();
- JsonArray otherNumsMax = data.get("100").getAsJsonObject().get("otherNums").getAsJsonArray();
+ List<Double> otherNumsMin = data.getStatsAtLowLevel().getOtherNumbers();
+ List<Double> otherNumsMax = data.getStatsAtHighLevel().getOtherNumbers();
for (int i = 0; i < otherNumsMin.size(); ++i) {
String left = "\\{" + i + "\\}";
- String right = otherNumsMin.get(i).getAsString() + " ➡ " + otherNumsMax.get(i).getAsString();
+ String right = otherNumsMin.get(i) + " ➡ " + otherNumsMax.get(i);
list.add(new Pair<>(left, right));
}
@@ -148,8 +143,9 @@ public class ItemStackBuilder {
}
private static String injectData(String string, List<Pair<String, String>> injectors) {
- for (Pair<String, String> injector : injectors)
+ for (Pair<String, String> injector : injectors) {
string = string.replaceAll(injector.getLeft(), injector.getRight());
+ }
return string;
}
}
diff --git a/src/main/java/de/hysky/skyblocker/skyblock/itemlist/SearchResultsWidget.java b/src/main/java/de/hysky/skyblocker/skyblock/itemlist/SearchResultsWidget.java
index 8a266d65..44e336d9 100644
--- a/src/main/java/de/hysky/skyblocker/skyblock/itemlist/SearchResultsWidget.java
+++ b/src/main/java/de/hysky/skyblocker/skyblock/itemlist/SearchResultsWidget.java
@@ -72,7 +72,7 @@ public class SearchResultsWidget implements Drawable {
if (!searchText.equals(this.searchText)) {
this.searchText = searchText;
this.searchResults.clear();
- for (ItemStack entry : ItemRegistry.items) {
+ for (ItemStack entry : ItemRepository.getItems()) {
String name = entry.getName().toString().toLowerCase(Locale.ENGLISH);
if (entry.getNbt() == null) {
continue;
@@ -93,16 +93,16 @@ public class SearchResultsWidget implements Drawable {
SkyblockCraftingRecipe recipe = this.recipeResults.get(this.currentPage);
for (ResultButtonWidget button : resultButtons)
button.clearItemStack();
- resultButtons.get(5).setItemStack(recipe.grid.get(0));
- resultButtons.get(6).setItemStack(recipe.grid.get(1));
- resultButtons.get(7).setItemStack(recipe.grid.get(2));
- resultButtons.get(10).setItemStack(recipe.grid.get(3));
- resultButtons.get(11).setItemStack(recipe.grid.get(4));
- resultButtons.get(12).setItemStack(recipe.grid.get(5));
- resultButtons.get(15).setItemStack(recipe.grid.get(6));
- resultButtons.get(16).setItemStack(recipe.grid.get(7));
- resultButtons.get(17).setItemStack(recipe.grid.get(8));
- resultButtons.get(14).setItemStack(recipe.result);
+ resultButtons.get(5).setItemStack(recipe.getGrid().get(0));
+ resultButtons.get(6).setItemStack(recipe.getGrid().get(1));
+ resultButtons.get(7).setItemStack(recipe.getGrid().get(2));
+ resultButtons.get(10).setItemStack(recipe.getGrid().get(3));
+ resultButtons.get(11).setItemStack(recipe.getGrid().get(4));
+ resultButtons.get(12).setItemStack(recipe.getGrid().get(5));
+ resultButtons.get(15).setItemStack(recipe.getGrid().get(6));
+ resultButtons.get(16).setItemStack(recipe.getGrid().get(7));
+ resultButtons.get(17).setItemStack(recipe.getGrid().get(8));
+ resultButtons.get(14).setItemStack(recipe.getResult());
} else {
for (int i = 0; i < resultButtons.size(); ++i) {
int index = this.currentPage * resultButtons.size() + i;
@@ -122,7 +122,7 @@ public class SearchResultsWidget implements Drawable {
RenderSystem.disableDepthTest();
if (this.displayRecipes) {
//Craft text - usually a requirement for the recipe
- String craftText = this.recipeResults.get(this.currentPage).craftText;
+ String craftText = this.recipeResults.get(this.currentPage).getCraftText();
if (textRenderer.getWidth(craftText) > MAX_TEXT_WIDTH) {
drawTooltip(textRenderer, context, craftText, this.parentX + 11, this.parentY + 31, mouseX, mouseY);
craftText = textRenderer.trimToWidth(craftText, MAX_TEXT_WIDTH) + ELLIPSIS;
@@ -130,7 +130,7 @@ public class SearchResultsWidget implements Drawable {
context.drawTextWithShadow(textRenderer, craftText, this.parentX + 11, this.parentY + 31, 0xffffffff);
//Item name
- Text resultText = this.recipeResults.get(this.currentPage).result.getName();
+ Text resultText = this.recipeResults.get(this.currentPage).getResult().getName();
if (textRenderer.getWidth(Formatting.strip(resultText.getString())) > MAX_TEXT_WIDTH) {
drawTooltip(textRenderer, context, resultText, this.parentX + 11, this.parentY + 43, mouseX, mouseY);
resultText = Text.literal(getLegacyFormatting(resultText.getString()) + textRenderer.trimToWidth(Formatting.strip(resultText.getString()), MAX_TEXT_WIDTH) + ELLIPSIS).setStyle(resultText.getStyle());
@@ -202,7 +202,7 @@ public class SearchResultsWidget implements Drawable {
if (internalName.isEmpty()) {
continue;
}
- List<SkyblockCraftingRecipe> recipes = ItemRegistry.getRecipes(internalName);
+ List<SkyblockCraftingRecipe> recipes = ItemRepository.getRecipes(internalName);
if (!recipes.isEmpty()) {
this.recipeResults = recipes;
this.currentPage = 0;
diff --git a/src/main/java/de/hysky/skyblocker/skyblock/itemlist/SkyblockCraftingRecipe.java b/src/main/java/de/hysky/skyblocker/skyblock/itemlist/SkyblockCraftingRecipe.java
index b738dfef..f5b379dc 100644
--- a/src/main/java/de/hysky/skyblocker/skyblock/itemlist/SkyblockCraftingRecipe.java
+++ b/src/main/java/de/hysky/skyblocker/skyblock/itemlist/SkyblockCraftingRecipe.java
@@ -1,6 +1,7 @@
package de.hysky.skyblocker.skyblock.itemlist;
-import com.google.gson.JsonObject;
+import io.github.moulberry.repo.data.NEUCraftingRecipe;
+import io.github.moulberry.repo.data.NEUIngredient;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import org.slf4j.Logger;
@@ -11,37 +12,31 @@ import java.util.List;
public class SkyblockCraftingRecipe {
private static final Logger LOGGER = LoggerFactory.getLogger(SkyblockCraftingRecipe.class);
- String craftText = "";
- final List<ItemStack> grid = new ArrayList<>(9);
- ItemStack result;
-
- public static SkyblockCraftingRecipe fromJsonObject(JsonObject jsonObj) {
- SkyblockCraftingRecipe recipe = new SkyblockCraftingRecipe();
- if (jsonObj.has("crafttext")) recipe.craftText = jsonObj.get("crafttext").getAsString();
- recipe.grid.add(getItemStack(jsonObj.getAsJsonObject("recipe").get("A1").getAsString()));
- recipe.grid.add(getItemStack(jsonObj.getAsJsonObject("recipe").get("A2").getAsString()));
- recipe.grid.add(getItemStack(jsonObj.getAsJsonObject("recipe").get("A3").getAsString()));
- recipe.grid.add(getItemStack(jsonObj.getAsJsonObject("recipe").get("B1").getAsString()));
- recipe.grid.add(getItemStack(jsonObj.getAsJsonObject("recipe").get("B2").getAsString()));
- recipe.grid.add(getItemStack(jsonObj.getAsJsonObject("recipe").get("B3").getAsString()));
- recipe.grid.add(getItemStack(jsonObj.getAsJsonObject("recipe").get("C1").getAsString()));
- recipe.grid.add(getItemStack(jsonObj.getAsJsonObject("recipe").get("C2").getAsString()));
- recipe.grid.add(getItemStack(jsonObj.getAsJsonObject("recipe").get("C3").getAsString()));
- recipe.result = ItemRegistry.itemsMap.get(jsonObj.get("internalname").getAsString());
+ private final String craftText;
+ private final List<ItemStack> grid = new ArrayList<>(9);
+ private ItemStack result;
+
+ public SkyblockCraftingRecipe(String craftText) {
+ this.craftText = craftText;
+ }
+
+ public static SkyblockCraftingRecipe fromNEURecipe(NEUCraftingRecipe neuCraftingRecipe) {
+ SkyblockCraftingRecipe recipe = new SkyblockCraftingRecipe(neuCraftingRecipe.getExtraText() != null ? neuCraftingRecipe.getExtraText() : "");
+ for (NEUIngredient input : neuCraftingRecipe.getInputs()) {
+ recipe.grid.add(getItemStack(input));
+ }
+ recipe.result = getItemStack(neuCraftingRecipe.getOutput());
return recipe;
}
- private static ItemStack getItemStack(String internalName) {
- try {
- if (internalName.length() > 0) {
- int count = internalName.split(":").length == 1 ? 1 : Integer.parseInt(internalName.split(":")[1]);
- internalName = internalName.split(":")[0];
- ItemStack itemStack = ItemRegistry.itemsMap.get(internalName).copy();
- itemStack.setCount(count);
- return itemStack;
+ private static ItemStack getItemStack(NEUIngredient input) {
+ if (input != NEUIngredient.SENTINEL_EMPTY) {
+ ItemStack stack = ItemRepository.getItemStack(input.getItemId());
+ if (stack != null) {
+ return stack.copyWithCount((int) input.getAmount());
+ } else {
+ LOGGER.warn("[Skyblocker Recipe] Unable to find item {}", input.getItemId());
}
- } catch (Exception e) {
- LOGGER.error("[Skyblocker-Recipe] " + internalName, e);
}
return Items.AIR.getDefaultStack();
}
diff --git a/src/main/java/de/hysky/skyblocker/skyblock/spidersden/Relics.java b/src/main/java/de/hysky/skyblocker/skyblock/spidersden/Relics.java
index e5223874..aaf4d77c 100644
--- a/src/main/java/de/hysky/skyblocker/skyblock/spidersden/Relics.java
+++ b/src/main/java/de/hysky/skyblocker/skyblock/spidersden/Relics.java
@@ -8,6 +8,7 @@ import com.mojang.brigadier.CommandDispatcher;
import de.hysky.skyblocker.SkyblockerMod;
import de.hysky.skyblocker.config.SkyblockerConfig;
import de.hysky.skyblocker.config.SkyblockerConfigManager;
+import de.hysky.skyblocker.utils.Constants;
import de.hysky.skyblocker.utils.PosUtils;
import de.hysky.skyblocker.utils.Utils;
import de.hysky.skyblocker.utils.render.RenderHelper;
@@ -105,12 +106,12 @@ public class Relics {
.then(literal("relics")
.then(literal("markAllFound").executes(context -> {
Relics.markAllFound();
- context.getSource().sendFeedback(Text.translatable("skyblocker.relics.markAllFound"));
+ context.getSource().sendFeedback(Constants.PREFIX.get().append(Text.translatable("skyblocker.relics.markAllFound")));
return 1;
}))
.then(literal("markAllMissing").executes(context -> {
Relics.markAllMissing();
- context.getSource().sendFeedback(Text.translatable("skyblocker.relics.markAllMissing"));
+ context.getSource().sendFeedback(Constants.PREFIX.get().append(Text.translatable("skyblocker.relics.markAllMissing")));
return 1;
}))));
}
diff --git a/src/main/java/de/hysky/skyblocker/utils/Constants.java b/src/main/java/de/hysky/skyblocker/utils/Constants.java
index fbeb448c..f144b519 100644
--- a/src/main/java/de/hysky/skyblocker/utils/Constants.java
+++ b/src/main/java/de/hysky/skyblocker/utils/Constants.java
@@ -1,8 +1,31 @@
package de.hysky.skyblocker.utils;
+import java.util.function.IntFunction;
+import java.util.function.Supplier;
+import java.util.function.UnaryOperator;
+
+import net.minecraft.text.MutableText;
+import net.minecraft.text.Style;
+import net.minecraft.text.Text;
+import net.minecraft.util.Formatting;
+
/**
* Holds generic static constants
*/
public interface Constants {
String LEVEL_EMBLEMS = "\u2E15\u273F\u2741\u2E19\u03B1\u270E\u2615\u2616\u2663\u213B\u2694\u27B6\u26A1\u2604\u269A\u2693\u2620\u269B\u2666\u2660\u2764\u2727\u238A\u1360\u262C\u269D\u29C9\uA214\u32D6\u2E0E\u26A0\uA541\u3020\u30C4\u2948\u2622\u2623\u273E\u269C\u0BD0\u0A6D\u2742\u16C3\u3023\u10F6\u0444\u266A\u266B\u04C3\u26C1\u26C3\u16DD\uA03E\u1C6A\u03A3\u09EB\u2603\u2654\u26C2\u12DE";
+ IntFunction<UnaryOperator<Style>> WITH_COLOR = color -> style -> style.withColor(color);
+ Supplier<MutableText> PREFIX = () -> Text.empty()
+ .append(Text.literal("[").formatted(Formatting.GRAY))
+ .append(Text.literal("S").styled(WITH_COLOR.apply(0x00ff4c)))
+ .append(Text.literal("k").styled(WITH_COLOR.apply(0x02fa60)))
+ .append(Text.literal("y").styled(WITH_COLOR.apply(0x04f574)))
+ .append(Text.literal("b").styled(WITH_COLOR.apply(0x07ef88)))
+ .append(Text.literal("l").styled(WITH_COLOR.apply(0x09ea9c)))
+ .append(Text.literal("o").styled(WITH_COLOR.apply(0x0be5af)))
+ .append(Text.literal("c").styled(WITH_COLOR.apply(0x0de0c3)))
+ .append(Text.literal("k").styled(WITH_COLOR.apply(0x10dad7)))
+ .append(Text.literal("e").styled(WITH_COLOR.apply(0x12d5eb)))
+ .append(Text.literal("r").styled(WITH_COLOR.apply(0x14d0ff)))
+ .append(Text.literal("] ").formatted(Formatting.GRAY));
}
diff --git a/src/main/java/de/hysky/skyblocker/utils/ItemUtils.java b/src/main/java/de/hysky/skyblocker/utils/ItemUtils.java
index fa04acf8..50a9bcd1 100644
--- a/src/main/java/de/hysky/skyblocker/utils/ItemUtils.java
+++ b/src/main/java/de/hysky/skyblocker/utils/ItemUtils.java
@@ -1,7 +1,7 @@
package de.hysky.skyblocker.utils;
import com.mojang.brigadier.exceptions.CommandSyntaxException;
-import de.hysky.skyblocker.config.SkyblockerConfigManager;
+import it.unimi.dsi.fastutil.ints.IntIntPair;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.item.TooltipContext;
import net.minecraft.item.ItemStack;
@@ -105,21 +105,18 @@ public class ItemUtils {
return extraAttributes != null ? extraAttributes.getString(UUID) : "";
}
- @Nullable
- public static Durability getDurability(@NotNull ItemStack stack) {
- if (!Utils.isOnSkyblock() || !SkyblockerConfigManager.get().locations.dwarvenMines.enableDrillFuel || stack.isEmpty()) {
- return null;
- }
-
- if (getExtraAttributesOptional(stack).filter(extraAttributes -> extraAttributes.contains("drill_fuel") || extraAttributes.getString(ItemUtils.ID).equals("PICKONIMBUS")).isEmpty()) {
- return null;
- }
+ public static boolean hasCustomDurability(@NotNull ItemStack stack) {
+ NbtCompound extraAttributes = getExtraAttributes(stack);
+ return extraAttributes != null && (extraAttributes.contains("drill_fuel") || extraAttributes.getString(ID).equals("PICKONIMBUS"));
+ }
+ @Nullable
+ public static IntIntPair getDurability(@NotNull ItemStack stack) {
int current = 0;
int max = 0;
String clearFormatting;
- for (String line : ItemUtils.getTooltipStrings(stack)) {
+ for (String line : getTooltipStrings(stack)) {
clearFormatting = Formatting.strip(line);
if (line.contains("Fuel: ")) {
if (clearFormatting != null) {
@@ -127,7 +124,7 @@ public class ItemUtils {
String[] split = clear.split("/");
current = Integer.parseInt(split[0]);
max = Integer.parseInt(split[1]) * 1000;
- return new Durability(current, max);
+ return IntIntPair.of(current, max);
}
} else if (line.contains("uses.")) {
if (clearFormatting != null) {
@@ -138,7 +135,7 @@ public class ItemUtils {
current = Integer.parseInt(usesString);
max = 5000;
}
- return new Durability(current, max);
+ return IntIntPair.of(current, max);
}
}
}
@@ -153,7 +150,4 @@ public class ItemUtils {
throw new RuntimeException(e);
}
}
-
- public record Durability(int current, int max) {
- }
}
diff --git a/src/main/java/de/hysky/skyblocker/utils/NEURepo.java b/src/main/java/de/hysky/skyblocker/utils/NEURepoManager.java
index 9bc6b245..6d78b3f3 100644
--- a/src/main/java/de/hysky/skyblocker/utils/NEURepo.java
+++ b/src/main/java/de/hysky/skyblocker/utils/NEURepoManager.java
@@ -1,7 +1,8 @@
package de.hysky.skyblocker.utils;
import de.hysky.skyblocker.SkyblockerMod;
-import de.hysky.skyblocker.skyblock.itemlist.ItemRegistry;
+import de.hysky.skyblocker.skyblock.itemlist.ItemRepository;
+import io.github.moulberry.repo.NEURepository;
import net.fabricmc.fabric.api.client.command.v2.ClientCommandManager;
import net.fabricmc.fabric.api.client.command.v2.ClientCommandRegistrationCallback;
import net.minecraft.client.MinecraftClient;
@@ -21,11 +22,15 @@ import java.util.concurrent.CompletableFuture;
/**
* Initializes the NEU repo, which contains item metadata and fairy souls location data. Clones the repo if it does not exist and checks for updates. Use {@link #runAsyncAfterLoad(Runnable)} to run code after the repo is initialized.
*/
-public class NEURepo {
- private static final Logger LOGGER = LoggerFactory.getLogger(NEURepo.class);
+public class NEURepoManager {
+ private static final Logger LOGGER = LoggerFactory.getLogger(NEURepoManager.class);
public static final String REMOTE_REPO_URL = "https://github.com/NotEnoughUpdates/NotEnoughUpdates-REPO.git";
- public static final Path LOCAL_REPO_DIR = SkyblockerMod.CONFIG_DIR.resolve("item-repo");
- private static final CompletableFuture<Void> REPO_INITIALIZED = initRepository();
+ /**
+ * Use {@link #NEU_REPO}.
+ */
+ private static final Path LOCAL_REPO_DIR = SkyblockerMod.CONFIG_DIR.resolve("item-repo"); // TODO rename to NotEnoughUpdates-REPO
+ private static final CompletableFuture<Void> REPO_INITIALIZED = loadRepository();
+ public static final NEURepository NEU_REPO = NEURepository.of(LOCAL_REPO_DIR);
/**
* Adds command to update repository manually from ingame.
@@ -41,18 +46,19 @@ public class NEURepo {
}))));
}
- private static CompletableFuture<Void> initRepository() {
+ private static CompletableFuture<Void> loadRepository() {
return CompletableFuture.runAsync(() -> {
try {
- if (Files.isDirectory(NEURepo.LOCAL_REPO_DIR)) {
- try (Git localRepo = Git.open(NEURepo.LOCAL_REPO_DIR.toFile())) {
+ if (Files.isDirectory(NEURepoManager.LOCAL_REPO_DIR)) {
+ try (Git localRepo = Git.open(NEURepoManager.LOCAL_REPO_DIR.toFile())) {
localRepo.pull().setRebase(true).call();
LOGGER.info("[Skyblocker] NEU Repository Updated");
}
} else {
- Git.cloneRepository().setURI(REMOTE_REPO_URL).setDirectory(NEURepo.LOCAL_REPO_DIR.toFile()).setBranchesToClone(List.of("refs/heads/master")).setBranch("refs/heads/master").call().close();
+ Git.cloneRepository().setURI(REMOTE_REPO_URL).setDirectory(NEURepoManager.LOCAL_REPO_DIR.toFile()).setBranchesToClone(List.of("refs/heads/master")).setBranch("refs/heads/master").call().close();
LOGGER.info("[Skyblocker] NEU Repository Downloaded");
}
+ NEU_REPO.reload();
} catch (TransportException e){
LOGGER.error("[Skyblocker] Transport operation failed. Most likely unable to connect to the remote NEU repo on github", e);
} catch (RepositoryNotFoundException e) {
@@ -67,15 +73,15 @@ public class NEURepo {
private static void deleteAndDownloadRepository() {
CompletableFuture.runAsync(() -> {
try {
- ItemRegistry.filesImported = false;
- File dir = NEURepo.LOCAL_REPO_DIR.toFile();
+ ItemRepository.setFilesImported(false);
+ File dir = NEURepoManager.LOCAL_REPO_DIR.toFile();
recursiveDelete(dir);
} catch (Exception ex) {
if (MinecraftClient.getInstance().player != null)
- MinecraftClient.getInstance().player.sendMessage(Text.translatable("skyblocker.updaterepository.failed"), false);
+ MinecraftClient.getInstance().player.sendMessage(Constants.PREFIX.get().append(Text.translatable("skyblocker.updaterepository.failed")), false);
return;
}
- initRepository();
+ loadRepository();
});
}
diff --git a/src/main/java/de/hysky/skyblocker/utils/render/RenderHelper.java b/src/main/java/de/hysky/skyblocker/utils/render/RenderHelper.java
index 4630149c..5ab698a7 100644
--- a/src/main/java/de/hysky/skyblocker/utils/render/RenderHelper.java
+++ b/src/main/java/de/hysky/skyblocker/utils/render/RenderHelper.java
@@ -78,7 +78,7 @@ public class RenderHelper {
* Renders the outline of a box with the specified color components and line width.
* This does not use renderer since renderer draws outline using debug lines with a fixed width.
*/
- public static void renderOutline(WorldRenderContext context, Box box, float[] colorComponents, float lineWidth) {
+ public static void renderOutline(WorldRenderContext context, Box box, float[] colorComponents, float lineWidth, boolean throughWalls) {
if (FrustumUtils.isVisible(box)) {
MatrixStack matrices = context.matrixStack();
Vec3d camera = context.camera().getPos();
@@ -90,6 +90,7 @@ public class RenderHelper {
RenderSystem.lineWidth(lineWidth);
RenderSystem.disableCull();
RenderSystem.enableDepthTest();
+ RenderSystem.depthFunc(throughWalls ? GL11.GL_ALWAYS : GL11.GL_LEQUAL);
matrices.push();
matrices.translate(-camera.getX(), -camera.getY(), -camera.getZ());
@@ -102,6 +103,7 @@ public class RenderHelper {
RenderSystem.lineWidth(1f);
RenderSystem.enableCull();
RenderSystem.disableDepthTest();
+ RenderSystem.depthFunc(GL11.GL_LEQUAL);
}
}