From 9f4bea1c181532b827b16fc50f9e03066c05c543 Mon Sep 17 00:00:00 2001 From: Aaron <51387595+AzureAaron@users.noreply.github.com> Date: Tue, 17 Oct 2023 01:16:57 -0400 Subject: Codec-based Test --- .../skyblocker/skyblock/item/CustomArmorTrims.java | 8 ++++++++ .../skyblock/item/ArmorTrimIdSerializationTest.java | 19 ++++++++++++------- 2 files changed, 20 insertions(+), 7 deletions(-) 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..21583190 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/item/CustomArmorTrims.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/item/CustomArmorTrims.java @@ -3,6 +3,9 @@ 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.ItemUtils; @@ -137,6 +140,11 @@ public class CustomArmorTrims { } public record ArmorTrimId(@SerialEntry Identifier material, @SerialEntry Identifier pattern) implements Pair { + public static final Codec 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/test/java/de/hysky/skyblocker/skyblock/item/ArmorTrimIdSerializationTest.java b/src/test/java/de/hysky/skyblocker/skyblock/item/ArmorTrimIdSerializationTest.java index 36b65cae..2709aba4 100644 --- a/src/test/java/de/hysky/skyblocker/skyblock/item/ArmorTrimIdSerializationTest.java +++ b/src/test/java/de/hysky/skyblocker/skyblock/item/ArmorTrimIdSerializationTest.java @@ -1,27 +1,32 @@ package de.hysky.skyblocker.skyblock.item; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; +import com.google.gson.JsonElement; +import com.mojang.serialization.JsonOps; + +import de.hysky.skyblocker.skyblock.item.CustomArmorTrims.ArmorTrimId; import net.minecraft.util.Identifier; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; public class ArmorTrimIdSerializationTest { - private final Gson gson = new GsonBuilder().registerTypeAdapter(Identifier.class, new Identifier.Serializer()).create(); + private final Gson gson = new Gson(); @Test void serialize() { - CustomArmorTrims.ArmorTrimId armorTrimId = new CustomArmorTrims.ArmorTrimId(new Identifier("material_id"), new Identifier("pattern_id")); - String json = gson.toJson(armorTrimId); + ArmorTrimId armorTrimId = new ArmorTrimId(new Identifier("material_id"), new Identifier("pattern_id")); + JsonElement json = ArmorTrimId.CODEC.encodeStart(JsonOps.INSTANCE, armorTrimId).result().orElseThrow(); String expectedJson = "{\"material\":\"minecraft:material_id\",\"pattern\":\"minecraft:pattern_id\"}"; - Assertions.assertEquals(expectedJson, json); + + Assertions.assertEquals(expectedJson, json.toString()); } @Test void deserialize() { String json = "{\"material\":\"minecraft:material_id\",\"pattern\":\"minecraft:pattern_id\"}"; - CustomArmorTrims.ArmorTrimId armorTrimId = gson.fromJson(json, CustomArmorTrims.ArmorTrimId.class); - CustomArmorTrims.ArmorTrimId expectedArmorTrimId = new CustomArmorTrims.ArmorTrimId(new Identifier("material_id"), new Identifier("pattern_id")); + ArmorTrimId armorTrimId = ArmorTrimId.CODEC.parse(JsonOps.INSTANCE, gson.fromJson(json, JsonElement.class)).result().orElseThrow(); + ArmorTrimId expectedArmorTrimId = new ArmorTrimId(new Identifier("material_id"), new Identifier("pattern_id")); + Assertions.assertEquals(expectedArmorTrimId, armorTrimId); } } -- cgit From 61b3fbd28b64cb103caaf19305e12164a80d6a40 Mon Sep 17 00:00:00 2001 From: Aaron <51387595+AzureAaron@users.noreply.github.com> Date: Tue, 17 Oct 2023 16:25:33 -0400 Subject: Move bracket --- src/main/java/de/hysky/skyblocker/skyblock/item/CustomArmorTrims.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 21583190..ff9e13c9 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/item/CustomArmorTrims.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/item/CustomArmorTrims.java @@ -142,8 +142,8 @@ public class CustomArmorTrims { public record ArmorTrimId(@SerialEntry Identifier material, @SerialEntry Identifier pattern) implements Pair { public static final Codec CODEC = RecordCodecBuilder.create(instance -> instance.group( Identifier.CODEC.fieldOf("material").forGetter(ArmorTrimId::material), - Identifier.CODEC.fieldOf("pattern").forGetter(ArmorTrimId::pattern) - ).apply(instance, ArmorTrimId::new)); + Identifier.CODEC.fieldOf("pattern").forGetter(ArmorTrimId::pattern)) + .apply(instance, ArmorTrimId::new)); @Override public Identifier left() { -- cgit From bf10b5a1337d887886f2490927951a5f82532b3a Mon Sep 17 00:00:00 2001 From: Kevin <92656833+kevinthegreat1@users.noreply.github.com> Date: Tue, 17 Oct 2023 18:15:19 -0400 Subject: Optimize drill fuel and picko durability with caching (#366) --- .../java/de/hysky/skyblocker/mixin/ItemMixin.java | 13 ++-- .../de/hysky/skyblocker/mixin/ItemStackMixin.java | 70 +++++++++++++++++----- .../java/de/hysky/skyblocker/utils/ItemUtils.java | 26 ++++---- 3 files changed, 71 insertions(+), 38 deletions(-) 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 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/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) { - } } -- cgit From e5679e02586d591c4c059b80b749809b60efe843 Mon Sep 17 00:00:00 2001 From: Yasin Date: Wed, 18 Oct 2023 00:16:27 +0200 Subject: fix issue_template (#369) --- .github/ISSUE_TEMPLATE/bug_report.yml | 2 +- .github/ISSUE_TEMPLATE/crash_report.yml | 2 +- .github/ISSUE_TEMPLATE/feature_request.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 13f9e756..72f0fc8c 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -37,7 +37,7 @@ body: options: - 1.20.2 - 1.20.1 - - 1.20.0 + - 1.20 validations: required: true - type: input diff --git a/.github/ISSUE_TEMPLATE/crash_report.yml b/.github/ISSUE_TEMPLATE/crash_report.yml index 31828e76..ae477210 100644 --- a/.github/ISSUE_TEMPLATE/crash_report.yml +++ b/.github/ISSUE_TEMPLATE/crash_report.yml @@ -18,7 +18,7 @@ body: options: - 1.20.2 - 1.20.1 - - 1.20.0 + - 1.20 validations: required: true - type: input diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml index cb42e124..4ec65bed 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.yml +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -1,6 +1,6 @@ name: Feature Request description: Ask for new feature -labels: [enhancement] +labels: [new feature] body: - type: markdown attributes: -- cgit From 9d8853474d3935bf6af0a86f3f374c114fb1e25a Mon Sep 17 00:00:00 2001 From: Aaron <51387595+AzureAaron@users.noreply.github.com> Date: Tue, 3 Oct 2023 03:05:25 -0400 Subject: Fix some HUD options resetting sometimes --- .../skyblock/dungeon/DungeonMapConfigScreen.java | 18 +++++++++++++ .../skyblock/dwarven/DwarvenHudConfigScreen.java | 18 +++++++++++++ .../render/title/TitleContainerConfigScreen.java | 31 ++++++++++++++++++++++ 3 files changed, 67 insertions(+) diff --git a/src/main/java/de/hysky/skyblocker/skyblock/dungeon/DungeonMapConfigScreen.java b/src/main/java/de/hysky/skyblocker/skyblock/dungeon/DungeonMapConfigScreen.java index 145ee2bc..d662e99a 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/dungeon/DungeonMapConfigScreen.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/dungeon/DungeonMapConfigScreen.java @@ -2,8 +2,13 @@ package de.hysky.skyblocker.skyblock.dungeon; import de.hysky.skyblocker.config.SkyblockerConfigManager; import de.hysky.skyblocker.utils.render.RenderHelper; +import dev.isxander.yacl3.api.ConfigCategory; +import dev.isxander.yacl3.api.Option; +import dev.isxander.yacl3.api.OptionGroup; +import dev.isxander.yacl3.gui.YACLScreen; import net.minecraft.client.gui.DrawContext; import net.minecraft.client.gui.screen.Screen; +import net.minecraft.client.resource.language.I18n; import net.minecraft.text.Text; import java.awt.*; @@ -56,6 +61,19 @@ public class DungeonMapConfigScreen extends Screen { public void close() { SkyblockerConfigManager.get().locations.dungeons.mapX = hudX; SkyblockerConfigManager.get().locations.dungeons.mapY = hudY; + + if (parent instanceof YACLScreen yaclScreen) { + ConfigCategory category = yaclScreen.config.categories().stream().filter(cat -> cat.name().getString().equals(I18n.translate("text.autoconfig.skyblocker.option.locations.dungeons"))).findFirst().orElseThrow(); + OptionGroup group = category.groups().get(0); // Internally index 0 is the group created for all ungrouped options + + Option xOpt = group.options().stream().filter(opt -> opt.name().getString().equals(I18n.translate("text.autoconfig.skyblocker.option.locations.dungeons.mapX"))).findFirst().orElseThrow(); + Option yOpt = group.options().stream().filter(opt -> opt.name().getString().equals(I18n.translate("text.autoconfig.skyblocker.option.locations.dungeons.mapY"))).findFirst().orElseThrow(); + + // Refresh the value in the config with the bound value + xOpt.forgetPendingValue(); + yOpt.forgetPendingValue(); + } + SkyblockerConfigManager.save(); this.client.setScreen(parent); } diff --git a/src/main/java/de/hysky/skyblocker/skyblock/dwarven/DwarvenHudConfigScreen.java b/src/main/java/de/hysky/skyblocker/skyblock/dwarven/DwarvenHudConfigScreen.java index 2bb21568..10a73236 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/dwarven/DwarvenHudConfigScreen.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/dwarven/DwarvenHudConfigScreen.java @@ -4,9 +4,14 @@ import de.hysky.skyblocker.config.SkyblockerConfigManager; import de.hysky.skyblocker.skyblock.dwarven.DwarvenHud.Commission; import de.hysky.skyblocker.skyblock.tabhud.widget.hud.HudCommsWidget; import de.hysky.skyblocker.utils.render.RenderHelper; +import dev.isxander.yacl3.api.ConfigCategory; +import dev.isxander.yacl3.api.Option; +import dev.isxander.yacl3.api.OptionGroup; +import dev.isxander.yacl3.gui.YACLScreen; import it.unimi.dsi.fastutil.ints.IntIntPair; import net.minecraft.client.gui.DrawContext; import net.minecraft.client.gui.screen.Screen; +import net.minecraft.client.resource.language.I18n; import net.minecraft.text.Text; import java.awt.*; @@ -61,6 +66,19 @@ public class DwarvenHudConfigScreen extends Screen { public void close() { SkyblockerConfigManager.get().locations.dwarvenMines.dwarvenHud.x = hudX; SkyblockerConfigManager.get().locations.dwarvenMines.dwarvenHud.y = hudY; + + if (parent instanceof YACLScreen yaclScreen) { + ConfigCategory category = yaclScreen.config.categories().stream().filter(cat -> cat.name().getString().equals(I18n.translate("text.autoconfig.skyblocker.option.locations.dwarvenMines"))).findFirst().orElseThrow(); + OptionGroup group = category.groups().stream().filter(grp -> grp.name().getString().equals(I18n.translate("text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud"))).findFirst().orElseThrow(); + + Option xOpt = group.options().get(4); + Option yOpt = group.options().get(5); + + // Refresh the value in the config with the bound value + xOpt.forgetPendingValue(); + yOpt.forgetPendingValue(); + } + SkyblockerConfigManager.save(); client.setScreen(parent); } diff --git a/src/main/java/de/hysky/skyblocker/utils/render/title/TitleContainerConfigScreen.java b/src/main/java/de/hysky/skyblocker/utils/render/title/TitleContainerConfigScreen.java index 5a42eeb4..599aa9f1 100644 --- a/src/main/java/de/hysky/skyblocker/utils/render/title/TitleContainerConfigScreen.java +++ b/src/main/java/de/hysky/skyblocker/utils/render/title/TitleContainerConfigScreen.java @@ -3,8 +3,13 @@ package de.hysky.skyblocker.utils.render.title; import de.hysky.skyblocker.config.SkyblockerConfig; import de.hysky.skyblocker.config.SkyblockerConfigManager; import de.hysky.skyblocker.utils.render.RenderHelper; +import dev.isxander.yacl3.api.ConfigCategory; +import dev.isxander.yacl3.api.Option; +import dev.isxander.yacl3.api.OptionGroup; +import dev.isxander.yacl3.gui.YACLScreen; import net.minecraft.client.gui.DrawContext; import net.minecraft.client.gui.screen.Screen; +import net.minecraft.client.resource.language.I18n; import net.minecraft.client.util.math.Vector2f; import net.minecraft.text.Text; import net.minecraft.util.Formatting; @@ -21,6 +26,7 @@ public class TitleContainerConfigScreen extends Screen { private float hudX = SkyblockerConfigManager.get().general.titleContainer.x; private float hudY = SkyblockerConfigManager.get().general.titleContainer.y; private final Screen parent; + private boolean changedScale, changedOrientation, changedAlignment; protected TitleContainerConfigScreen() { this(null); @@ -135,6 +141,7 @@ public class TitleContainerConfigScreen extends Screen { case MIDDLE -> SkyblockerConfig.Alignment.RIGHT; case RIGHT -> SkyblockerConfig.Alignment.LEFT; }; + changedAlignment = true; } if (keyCode == GLFW.GLFW_KEY_E) { SkyblockerConfig.Alignment current = SkyblockerConfigManager.get().general.titleContainer.alignment; @@ -143,6 +150,7 @@ public class TitleContainerConfigScreen extends Screen { case MIDDLE -> SkyblockerConfig.Alignment.LEFT; case RIGHT -> SkyblockerConfig.Alignment.MIDDLE; }; + changedAlignment = true; } if (keyCode == GLFW.GLFW_KEY_R) { SkyblockerConfig.Direction current = SkyblockerConfigManager.get().general.titleContainer.direction; @@ -150,20 +158,43 @@ public class TitleContainerConfigScreen extends Screen { case HORIZONTAL -> SkyblockerConfig.Direction.VERTICAL; case VERTICAL -> SkyblockerConfig.Direction.HORIZONTAL; }; + changedOrientation = true; } if (keyCode == GLFW.GLFW_KEY_EQUAL) { SkyblockerConfigManager.get().general.titleContainer.titleContainerScale += 10; + changedScale = true; } if (keyCode == GLFW.GLFW_KEY_MINUS) { SkyblockerConfigManager.get().general.titleContainer.titleContainerScale -= 10; + changedScale = true; } return super.keyPressed(keyCode, scanCode, modifiers); } + @Override public void close() { SkyblockerConfigManager.get().general.titleContainer.x = (int) hudX; SkyblockerConfigManager.get().general.titleContainer.y = (int) hudY; + + if (parent instanceof YACLScreen yaclScreen) { + ConfigCategory category = yaclScreen.config.categories().stream().filter(cat -> cat.name().getString().equals(I18n.translate("text.autoconfig.skyblocker.category.general"))).findFirst().orElseThrow(); + OptionGroup group = category.groups().stream().filter(grp -> grp.name().getString().equals(I18n.translate("text.autoconfig.skyblocker.option.general.titleContainer"))).findFirst().orElseThrow(); + + Option scaleOpt = group.options().get(0); + Option xOpt = group.options().get(1); + Option yOpt = group.options().get(2); + Option orientationOpt = group.options().get(3); + Option horizontalAlignmentOpt = group.options().get(4); + + // Refresh the value in the config with the bound value + if (changedScale) scaleOpt.forgetPendingValue(); + xOpt.forgetPendingValue(); + yOpt.forgetPendingValue(); + if (changedOrientation) orientationOpt.forgetPendingValue(); + if (changedAlignment) horizontalAlignmentOpt.forgetPendingValue(); + } + SkyblockerConfigManager.save(); this.client.setScreen(parent); } -- cgit From da9f6fb2ba0a2ecb8ef748e95853e2997b7e119e Mon Sep 17 00:00:00 2001 From: Aaron <51387595+AzureAaron@users.noreply.github.com> Date: Wed, 4 Oct 2023 13:26:09 -0400 Subject: Require YACL 3.2.1 3.2.0 will cause a game crash if you try to use it with the mod --- src/main/resources/fabric.mod.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 86481bf3..e5900e76 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -38,7 +38,7 @@ "depends": { "fabricloader": ">=0.14.22", "fabric-api": ">=0.89.1+1.20.2", - "yet_another_config_lib_v3": ">=3.2.0+1.20.2", + "yet_another_config_lib_v3": ">=3.2.1+1.20.2", "minecraft": "~1.20.2" }, "conflicts": { -- cgit From 4ac68ae960e9377c898e2af70089b5fbc27fd5e3 Mon Sep 17 00:00:00 2001 From: Aaron <51387595+AzureAaron@users.noreply.github.com> Date: Tue, 17 Oct 2023 19:07:57 -0400 Subject: Remove most antiquated hud config options --- .../config/categories/DungeonsCategory.java | 14 ----------- .../config/categories/DwarvenMinesCategory.java | 15 ----------- .../config/categories/GeneralCategory.java | 29 ---------------------- .../skyblock/dungeon/DungeonMapConfigScreen.java | 19 +------------- .../skyblock/dwarven/DwarvenHudConfigScreen.java | 19 +------------- .../render/title/TitleContainerConfigScreen.java | 13 +--------- .../resources/assets/skyblocker/lang/en_us.json | 8 ------ 7 files changed, 3 insertions(+), 114 deletions(-) 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 a9c0c26b..1fb30afe 100644 --- a/src/main/java/de/hysky/skyblocker/config/categories/DungeonsCategory.java +++ b/src/main/java/de/hysky/skyblocker/config/categories/DungeonsCategory.java @@ -210,20 +210,6 @@ public class DungeonsCategory { newValue -> config.locations.dungeons.mapScaling = newValue) .controller(FloatFieldControllerBuilder::create) .build()) - .option(Option.createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.mapX")) - .binding(defaults.locations.dungeons.mapX, - () -> config.locations.dungeons.mapX, - newValue -> config.locations.dungeons.mapX = newValue) - .controller(IntegerFieldControllerBuilder::create) - .build()) - .option(Option.createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.mapY")) - .binding(defaults.locations.dungeons.mapY, - () -> config.locations.dungeons.mapY, - newValue -> config.locations.dungeons.mapY = newValue) - .controller(IntegerFieldControllerBuilder::create) - .build()) .option(Option.createBuilder() .name(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.starredMobGlow")) .description(OptionDescription.of(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.starredMobGlow.@Tooltip"))) diff --git a/src/main/java/de/hysky/skyblocker/config/categories/DwarvenMinesCategory.java b/src/main/java/de/hysky/skyblocker/config/categories/DwarvenMinesCategory.java index 35c91d64..719cbd79 100644 --- a/src/main/java/de/hysky/skyblocker/config/categories/DwarvenMinesCategory.java +++ b/src/main/java/de/hysky/skyblocker/config/categories/DwarvenMinesCategory.java @@ -7,7 +7,6 @@ import dev.isxander.yacl3.api.ConfigCategory; import dev.isxander.yacl3.api.Option; import dev.isxander.yacl3.api.OptionDescription; import dev.isxander.yacl3.api.OptionGroup; -import dev.isxander.yacl3.api.controller.IntegerFieldControllerBuilder; import de.hysky.skyblocker.skyblock.dwarven.DwarvenHudConfigScreen; import net.minecraft.client.MinecraftClient; import net.minecraft.text.Text; @@ -74,20 +73,6 @@ public class DwarvenMinesCategory { newValue -> config.locations.dwarvenMines.dwarvenHud.enableBackground = newValue) .controller(ConfigUtils::createBooleanController) .build()) - .option(Option.createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.x")) - .binding(defaults.locations.dwarvenMines.dwarvenHud.x, - () -> config.locations.dwarvenMines.dwarvenHud.x, - newValue -> config.locations.dwarvenMines.dwarvenHud.x = newValue) - .controller(IntegerFieldControllerBuilder::create) - .build()) - .option(Option.createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.y")) - .binding(defaults.locations.dwarvenMines.dwarvenHud.y, - () -> config.locations.dwarvenMines.dwarvenHud.y, - newValue -> config.locations.dwarvenMines.dwarvenHud.y = newValue) - .controller(IntegerFieldControllerBuilder::create) - .build()) .build()) .build(); } 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 6a393868..b4f61c36 100644 --- a/src/main/java/de/hysky/skyblocker/config/categories/GeneralCategory.java +++ b/src/main/java/de/hysky/skyblocker/config/categories/GeneralCategory.java @@ -5,7 +5,6 @@ import de.hysky.skyblocker.config.SkyblockerConfig; import dev.isxander.yacl3.api.*; import dev.isxander.yacl3.api.controller.FloatFieldControllerBuilder; import dev.isxander.yacl3.api.controller.FloatSliderControllerBuilder; -import dev.isxander.yacl3.api.controller.IntegerFieldControllerBuilder; import dev.isxander.yacl3.api.controller.IntegerSliderControllerBuilder; import de.hysky.skyblocker.skyblock.shortcut.ShortcutsConfigScreen; import de.hysky.skyblocker.utils.render.title.TitleContainerConfigScreen; @@ -421,34 +420,6 @@ public class GeneralCategory { newValue -> config.general.titleContainer.titleContainerScale = newValue) .controller(opt -> FloatFieldControllerBuilder.create(opt).range(30f, 140f)) .build()) - .option(Option.createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.general.titleContainer.x")) - .binding(defaults.general.titleContainer.x, - () -> config.general.titleContainer.x, - newValue -> config.general.titleContainer.x = newValue) - .controller(IntegerFieldControllerBuilder::create) - .build()) - .option(Option.createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.general.titleContainer.y")) - .binding(defaults.general.titleContainer.y, - () -> config.general.titleContainer.y, - newValue -> config.general.titleContainer.y = newValue) - .controller(IntegerFieldControllerBuilder::create) - .build()) - .option(Option.createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.general.titleContainer.direction")) - .binding(defaults.general.titleContainer.direction, - () -> config.general.titleContainer.direction, - newValue -> config.general.titleContainer.direction = newValue) - .controller(ConfigUtils::createEnumCyclingListController) - .build()) - .option(Option.createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.general.titleContainer.alignment")) - .binding(defaults.general.titleContainer.alignment, - () -> config.general.titleContainer.alignment, - newValue -> config.general.titleContainer.alignment = newValue) - .controller(ConfigUtils::createEnumCyclingListController) - .build()) .option(ButtonOption.createBuilder() .name(Text.translatable("text.autoconfig.skyblocker.option.general.titleContainer.config")) .text(Text.translatable("text.skyblocker.open")) diff --git a/src/main/java/de/hysky/skyblocker/skyblock/dungeon/DungeonMapConfigScreen.java b/src/main/java/de/hysky/skyblocker/skyblock/dungeon/DungeonMapConfigScreen.java index d662e99a..df5f36ce 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/dungeon/DungeonMapConfigScreen.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/dungeon/DungeonMapConfigScreen.java @@ -2,13 +2,8 @@ package de.hysky.skyblocker.skyblock.dungeon; import de.hysky.skyblocker.config.SkyblockerConfigManager; import de.hysky.skyblocker.utils.render.RenderHelper; -import dev.isxander.yacl3.api.ConfigCategory; -import dev.isxander.yacl3.api.Option; -import dev.isxander.yacl3.api.OptionGroup; -import dev.isxander.yacl3.gui.YACLScreen; import net.minecraft.client.gui.DrawContext; import net.minecraft.client.gui.screen.Screen; -import net.minecraft.client.resource.language.I18n; import net.minecraft.text.Text; import java.awt.*; @@ -61,20 +56,8 @@ public class DungeonMapConfigScreen extends Screen { public void close() { SkyblockerConfigManager.get().locations.dungeons.mapX = hudX; SkyblockerConfigManager.get().locations.dungeons.mapY = hudY; - - if (parent instanceof YACLScreen yaclScreen) { - ConfigCategory category = yaclScreen.config.categories().stream().filter(cat -> cat.name().getString().equals(I18n.translate("text.autoconfig.skyblocker.option.locations.dungeons"))).findFirst().orElseThrow(); - OptionGroup group = category.groups().get(0); // Internally index 0 is the group created for all ungrouped options - - Option xOpt = group.options().stream().filter(opt -> opt.name().getString().equals(I18n.translate("text.autoconfig.skyblocker.option.locations.dungeons.mapX"))).findFirst().orElseThrow(); - Option yOpt = group.options().stream().filter(opt -> opt.name().getString().equals(I18n.translate("text.autoconfig.skyblocker.option.locations.dungeons.mapY"))).findFirst().orElseThrow(); - - // Refresh the value in the config with the bound value - xOpt.forgetPendingValue(); - yOpt.forgetPendingValue(); - } - SkyblockerConfigManager.save(); + this.client.setScreen(parent); } } diff --git a/src/main/java/de/hysky/skyblocker/skyblock/dwarven/DwarvenHudConfigScreen.java b/src/main/java/de/hysky/skyblocker/skyblock/dwarven/DwarvenHudConfigScreen.java index 10a73236..9bd6bef1 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/dwarven/DwarvenHudConfigScreen.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/dwarven/DwarvenHudConfigScreen.java @@ -4,14 +4,9 @@ import de.hysky.skyblocker.config.SkyblockerConfigManager; import de.hysky.skyblocker.skyblock.dwarven.DwarvenHud.Commission; import de.hysky.skyblocker.skyblock.tabhud.widget.hud.HudCommsWidget; import de.hysky.skyblocker.utils.render.RenderHelper; -import dev.isxander.yacl3.api.ConfigCategory; -import dev.isxander.yacl3.api.Option; -import dev.isxander.yacl3.api.OptionGroup; -import dev.isxander.yacl3.gui.YACLScreen; import it.unimi.dsi.fastutil.ints.IntIntPair; import net.minecraft.client.gui.DrawContext; import net.minecraft.client.gui.screen.Screen; -import net.minecraft.client.resource.language.I18n; import net.minecraft.text.Text; import java.awt.*; @@ -66,20 +61,8 @@ public class DwarvenHudConfigScreen extends Screen { public void close() { SkyblockerConfigManager.get().locations.dwarvenMines.dwarvenHud.x = hudX; SkyblockerConfigManager.get().locations.dwarvenMines.dwarvenHud.y = hudY; - - if (parent instanceof YACLScreen yaclScreen) { - ConfigCategory category = yaclScreen.config.categories().stream().filter(cat -> cat.name().getString().equals(I18n.translate("text.autoconfig.skyblocker.option.locations.dwarvenMines"))).findFirst().orElseThrow(); - OptionGroup group = category.groups().stream().filter(grp -> grp.name().getString().equals(I18n.translate("text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud"))).findFirst().orElseThrow(); - - Option xOpt = group.options().get(4); - Option yOpt = group.options().get(5); - - // Refresh the value in the config with the bound value - xOpt.forgetPendingValue(); - yOpt.forgetPendingValue(); - } - SkyblockerConfigManager.save(); + client.setScreen(parent); } } diff --git a/src/main/java/de/hysky/skyblocker/utils/render/title/TitleContainerConfigScreen.java b/src/main/java/de/hysky/skyblocker/utils/render/title/TitleContainerConfigScreen.java index 599aa9f1..7eca7444 100644 --- a/src/main/java/de/hysky/skyblocker/utils/render/title/TitleContainerConfigScreen.java +++ b/src/main/java/de/hysky/skyblocker/utils/render/title/TitleContainerConfigScreen.java @@ -26,7 +26,7 @@ public class TitleContainerConfigScreen extends Screen { private float hudX = SkyblockerConfigManager.get().general.titleContainer.x; private float hudY = SkyblockerConfigManager.get().general.titleContainer.y; private final Screen parent; - private boolean changedScale, changedOrientation, changedAlignment; + private boolean changedScale; protected TitleContainerConfigScreen() { this(null); @@ -141,7 +141,6 @@ public class TitleContainerConfigScreen extends Screen { case MIDDLE -> SkyblockerConfig.Alignment.RIGHT; case RIGHT -> SkyblockerConfig.Alignment.LEFT; }; - changedAlignment = true; } if (keyCode == GLFW.GLFW_KEY_E) { SkyblockerConfig.Alignment current = SkyblockerConfigManager.get().general.titleContainer.alignment; @@ -150,7 +149,6 @@ public class TitleContainerConfigScreen extends Screen { case MIDDLE -> SkyblockerConfig.Alignment.LEFT; case RIGHT -> SkyblockerConfig.Alignment.MIDDLE; }; - changedAlignment = true; } if (keyCode == GLFW.GLFW_KEY_R) { SkyblockerConfig.Direction current = SkyblockerConfigManager.get().general.titleContainer.direction; @@ -158,7 +156,6 @@ public class TitleContainerConfigScreen extends Screen { case HORIZONTAL -> SkyblockerConfig.Direction.VERTICAL; case VERTICAL -> SkyblockerConfig.Direction.HORIZONTAL; }; - changedOrientation = true; } if (keyCode == GLFW.GLFW_KEY_EQUAL) { SkyblockerConfigManager.get().general.titleContainer.titleContainerScale += 10; @@ -182,17 +179,9 @@ public class TitleContainerConfigScreen extends Screen { OptionGroup group = category.groups().stream().filter(grp -> grp.name().getString().equals(I18n.translate("text.autoconfig.skyblocker.option.general.titleContainer"))).findFirst().orElseThrow(); Option scaleOpt = group.options().get(0); - Option xOpt = group.options().get(1); - Option yOpt = group.options().get(2); - Option orientationOpt = group.options().get(3); - Option horizontalAlignmentOpt = group.options().get(4); // Refresh the value in the config with the bound value if (changedScale) scaleOpt.forgetPendingValue(); - xOpt.forgetPendingValue(); - yOpt.forgetPendingValue(); - if (changedOrientation) orientationOpt.forgetPendingValue(); - if (changedAlignment) horizontalAlignmentOpt.forgetPendingValue(); } SkyblockerConfigManager.save(); diff --git a/src/main/resources/assets/skyblocker/lang/en_us.json b/src/main/resources/assets/skyblocker/lang/en_us.json index 3d0c010f..cbe4541e 100644 --- a/src/main/resources/assets/skyblocker/lang/en_us.json +++ b/src/main/resources/assets/skyblocker/lang/en_us.json @@ -90,10 +90,6 @@ "text.autoconfig.skyblocker.option.general.titleContainer": "Title Container", "text.autoconfig.skyblocker.option.general.titleContainer.@Tooltip": "Used to display multiple titles at once, Example use: Vampire Slayer", "text.autoconfig.skyblocker.option.general.titleContainer.titleContainerScale": "Title Container Scale", - "text.autoconfig.skyblocker.option.general.titleContainer.x": "Title Container X Position", - "text.autoconfig.skyblocker.option.general.titleContainer.y": "Title Container Y Position", - "text.autoconfig.skyblocker.option.general.titleContainer.direction": "Title Container Orientation", - "text.autoconfig.skyblocker.option.general.titleContainer.alignment": "Title Container Horizontal Alignment", "text.autoconfig.skyblocker.option.general.titleContainer.config": "Title Container Placement Config...", "text.autoconfig.skyblocker.option.general.teleportOverlay": "Teleport Overlay", "text.autoconfig.skyblocker.option.general.teleportOverlay.enableTeleportOverlays": "Enable Teleport Overlays", @@ -260,8 +256,6 @@ "text.autoconfig.skyblocker.option.locations.dungeons.enableMap": "Enable Map", "text.autoconfig.skyblocker.option.locations.dungeons.mapScreen": "Dungeon Map Placement Config...", "text.autoconfig.skyblocker.option.locations.dungeons.mapScaling": "Map Scaling", - "text.autoconfig.skyblocker.option.locations.dungeons.mapX": "Map X", - "text.autoconfig.skyblocker.option.locations.dungeons.mapY": "Map Y", "text.autoconfig.skyblocker.option.locations.dungeons.starredMobGlow": "Starred Mob Glow", "text.autoconfig.skyblocker.option.locations.dungeons.starredMobGlow.@Tooltip": "Applies the glowing effect to starred mobs that are visible.", "text.autoconfig.skyblocker.option.locations.dungeons.solveThreeWeirdos": "Solve Three Weirdos Puzzle", @@ -293,8 +287,6 @@ "text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.style.@Tooltip[2]": "\nClassic: Shows name and percentage in a very simple box.", "text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.screen": "Dwarven HUD Config...", "text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.enableBackground": "Enable Background", - "text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.x": "X", - "text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.y": "Y", "text.autoconfig.skyblocker.option.locations.rift": "The Rift", "text.autoconfig.skyblocker.option.locations.rift.mirrorverseWaypoints": "Enable Mirrorverse Waypoints", -- cgit From 00340f5d7df495f7351159e9da86e74b1b5fd2a9 Mon Sep 17 00:00:00 2001 From: Kevin <92656833+kevinthegreat1@users.noreply.github.com> Date: Tue, 17 Oct 2023 19:53:55 -0400 Subject: Refactor NEU Repo (#364) Add RepoParser Fix Golden Dragon stats leveling Add wiki option Fix recipe output count --- build.gradle | 8 +- gradle.properties | 8 +- .../java/de/hysky/skyblocker/SkyblockerMod.java | 10 +- .../compatibility/emi/SkyblockEmiRecipe.java | 2 +- .../compatibility/emi/SkyblockerEMIPlugin.java | 6 +- .../rei/SkyblockCraftingDisplayGenerator.java | 6 +- .../rei/SkyblockerREIClientPlugin.java | 4 +- .../hysky/skyblocker/config/SkyblockerConfig.java | 231 +++++++++++---------- .../config/categories/GeneralCategory.java | 22 ++ .../hysky/skyblocker/mixin/HandledScreenMixin.java | 2 +- .../de/hysky/skyblocker/skyblock/FairySouls.java | 28 +-- .../skyblock/item/CompactorDeletorPreview.java | 4 +- .../hysky/skyblocker/skyblock/item/WikiLookup.java | 30 +-- .../skyblock/itemlist/ItemListWidget.java | 10 +- .../skyblocker/skyblock/itemlist/ItemRegistry.java | 129 ------------ .../skyblock/itemlist/ItemRepository.java | 136 ++++++++++++ .../skyblock/itemlist/ItemStackBuilder.java | 94 ++++----- .../skyblock/itemlist/SearchResultsWidget.java | 28 +-- .../skyblock/itemlist/SkyblockCraftingRecipe.java | 51 ++--- .../java/de/hysky/skyblocker/utils/NEURepo.java | 101 --------- .../de/hysky/skyblocker/utils/NEURepoManager.java | 107 ++++++++++ .../resources/assets/skyblocker/lang/en_us.json | 5 + 22 files changed, 525 insertions(+), 497 deletions(-) delete mode 100644 src/main/java/de/hysky/skyblocker/skyblock/itemlist/ItemRegistry.java create mode 100644 src/main/java/de/hysky/skyblocker/skyblock/itemlist/ItemRepository.java delete mode 100644 src/main/java/de/hysky/skyblocker/utils/NEURepo.java create mode 100644 src/main/java/de/hysky/skyblocker/utils/NEURepoManager.java diff --git a/build.gradle b/build.gradle index 3e4a13d3..66c56e21 100644 --- a/build.gradle +++ b/build.gradle @@ -4,8 +4,6 @@ plugins { id 'com.modrinth.minotaur' version '2.+' } -import com.modrinth.minotaur.dependencies.ModDependency - version = "${project.mod_version}+${project.minecraft_version}" group = project.maven_group @@ -59,7 +57,7 @@ dependencies { // EMI modCompileOnly "dev.emi:emi-fabric:${project.emi_version}:api" -// modLocalRuntime "dev.emi:emi-fabric:${project.emi_version}" TODO uncomment when EMI is updated + modLocalRuntime "dev.emi:emi-fabric:${project.emi_version}" // Renderer (https://github.com/0x3C50/Renderer) include modImplementation("com.github.0x3C50:Renderer:${project.renderer_version}") { @@ -80,8 +78,8 @@ dependencies { // Occlusion Culling (https://github.com/LogisticsCraft/OcclusionCulling) include implementation("com.logisticscraft:occlusionculling:${project.occlusionculling_version}") - // neu repoparser | implement it if this is being used - // include implementation("moe.nea:neurepoparser:${project.repoparser_version}") + // NEU RepoParser + include implementation("moe.nea:neurepoparser:${project.repoparser_version}") } loom { diff --git a/gradle.properties b/gradle.properties index 7b749d92..abe5d2f7 100644 --- a/gradle.properties +++ b/gradle.properties @@ -17,20 +17,20 @@ yacl_version=3.2.1+1.20.2 ## Mod Menu (https://modrinth.com/mod/modmenu/versions) mod_menu_version = 8.0.0 ## REI (https://modrinth.com/mod/rei/versions?l=fabric) -rei_version = 13.0.661 +rei_version = 13.0.666 ## EMI (https://modrinth.com/mod/emi/versions) -emi_version = 1.0.19+1.20.1 +emi_version = 1.0.22+1.20.2 ## Renderer (https://github.com/0x3C50/Renderer) renderer_version = master-SNAPSHOT ## Mixin Extras (https://github.com/LlamaLad7/MixinExtras) -mixin_extras_version = 0.2.0-rc.5 +mixin_extras_version = 0.2.0 ## Better Inject (https://github.com/caoimhebyrne/BetterInject) betterinject_version=0.1.3 ## Occlusion Culling (https://github.com/LogisticsCraft/OcclusionCulling) occlusionculling_version = 0.0.7-SNAPSHOT ## neu repoparser (https://repo.nea.moe/#/releases/moe/nea/neurepoparser/) -repoparser_version = 1.3.2 +repoparser_version = 1.4.0 # Mod Properties mod_version = 1.14.0 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> getRecipeFor(EntryStack entry) { if (!(entry.getValue() instanceof ItemStack)) return Optional.empty(); EntryStack inputItem = EntryStacks.of((ItemStack) entry.getValue()); - List filteredRecipes = ItemRegistry.getRecipesStream() + List filteredRecipes = ItemRepository.getRecipesStream() .filter(recipe -> { ItemStack itemStack = inputItem.getValue(); ItemStack itemStack1 = recipe.getResult(); @@ -34,7 +34,7 @@ public class SkyblockCraftingDisplayGenerator implements DynamicDisplayGenerator public Optional> getUsageFor(EntryStack entry) { if (!(entry.getValue() instanceof ItemStack)) return Optional.empty(); EntryStack inputItem = EntryStacks.of((ItemStack) entry.getValue()); - List filteredRecipes = ItemRegistry.getRecipesStream() + List 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..107fe26e 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(); @@ -208,7 +211,7 @@ public class SkyblockerConfig { @SerialEntry public List lockedSlots = new ArrayList<>(); - + @SerialEntry public ObjectOpenHashSet protectedItems = new ObjectOpenHashSet<>(); @@ -228,10 +231,10 @@ public class SkyblockerConfig { @SerialEntry public int tabHudScale = 100; - + @SerialEntry public boolean plainPlayerNames = false; - + @SerialEntry public NameSorting nameSorting = NameSorting.DEFAULT; } @@ -259,13 +262,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 +295,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 +311,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 +327,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 +349,7 @@ public class SkyblockerConfig { public static class Hitbox { @SerialEntry public boolean oldFarmlandHitbox = true; - + @SerialEntry public boolean oldLeverHitbox = false; } @@ -354,16 +357,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,19 +374,19 @@ 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; } @@ -419,10 +422,10 @@ public class SkyblockerConfig { @SerialEntry public Info info = Info.LOCATION; - + @SerialEntry public boolean cycleMode = false; - + @SerialEntry public String customMessage = "Playing Skyblock"; } @@ -444,22 +447,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 +470,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 +503,7 @@ public class SkyblockerConfig { @SerialEntry public Rift rift = new Rift(); - + @SerialEntry public SpidersDen spidersDen = new SpidersDen(); } @@ -500,46 +511,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 +558,72 @@ public class SkyblockerConfig { public static class SecretWaypoints { @SerialEntry public boolean enableSecretWaypoints = true; - + @SerialEntry public boolean noInitSecretWaypoints = false; - + @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 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 +631,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 +642,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 +656,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 +686,7 @@ public class SkyblockerConfig { public static class Barn { @SerialEntry public boolean solveHungryHiker = true; - + @SerialEntry public boolean solveTreasureHunter = true; } @@ -683,20 +694,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 +720,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 +758,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/GeneralCategory.java b/src/main/java/de/hysky/skyblocker/config/categories/GeneralCategory.java index 6a393868..80792ab9 100644 --- a/src/main/java/de/hysky/skyblocker/config/categories/GeneralCategory.java +++ b/src/main/java/de/hysky/skyblocker/config/categories/GeneralCategory.java @@ -375,6 +375,28 @@ public class GeneralCategory { .build()) .build()) + //Wiki Lookup + .group(OptionGroup.createBuilder() + .name(Text.translatable("text.autoconfig.skyblocker.option.general.wikiLookup")) + .collapsed(true) + .option(Option.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.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")) 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 extends Screen @Inject(at = @At("HEAD"), method = "keyPressed") public void skyblocker$keyPressed(int keyCode, int scanCode, int modifiers, CallbackInfoReturnable 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/skyblock/FairySouls.java b/src/main/java/de/hysky/skyblocker/skyblock/FairySouls.java index 24465e06..b2ea2b16 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,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.NEURepo; +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 +31,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 +64,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 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 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 foundFairiesForProfileJson : JsonParser.parseReader(reader).getAsJsonObject().asMap().entrySet()) { @@ -101,6 +86,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()); }); } 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_ or personal_deletor_ - List> 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> 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 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/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 items = new ArrayList<>(); - protected static final Map itemsMap = new HashMap<>(); - protected static final List 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 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 getRecipes(String internalName) { - List 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 getRecipesStream() { - return recipes.stream(); - } - - public static Stream 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..a8e92104 --- /dev/null +++ b/src/main/java/de/hysky/skyblocker/skyblock/itemlist/ItemRepository.java @@ -0,0 +1,136 @@ +package de.hysky.skyblocker.skyblock.itemlist; + +import de.hysky.skyblocker.config.SkyblockerConfigManager; +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 items = new ArrayList<>(); + private static final Map itemsMap = new HashMap<>(); + private static final List 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 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(Text.of("[Skyblocker] Unable to locate a wiki article for this item..."), false); + } + } + + public static List getRecipes(String internalName) { + List 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 getItems() { + return items; + } + + public static Stream getItemsStream() { + return items.stream(); + } + + @Nullable + public static ItemStack getItemStack(String internalName) { + return itemsMap.get(internalName); + } + + public static Stream 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> 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> 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:\\[(?[0-9]+)\\]\\}").matcher(nbttag); + Matcher explosionColorMatcher = Pattern.compile("\\{Explosion:\\{(?:Type:[0-9a-z]+,)?Colors:\\[(?[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> petData(String internalName) { List> 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> entrySet = statNumsMin.entrySet(); - for (Map.Entry entry : entrySet) { + Map statNumsMin = data.getStatsAtLowLevel().getStatNumbers(); + Map statNumsMax = data.getStatsAtHighLevel().getStatNumbers(); + Set> entrySet = statNumsMin.entrySet(); + for (Map.Entry 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 otherNumsMin = data.getStatsAtLowLevel().getOtherNumbers(); + List 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> injectors) { - for (Pair injector : injectors) + for (Pair 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 recipes = ItemRegistry.getRecipes(internalName); + List 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 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 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/utils/NEURepo.java b/src/main/java/de/hysky/skyblocker/utils/NEURepo.java deleted file mode 100644 index 9bc6b245..00000000 --- a/src/main/java/de/hysky/skyblocker/utils/NEURepo.java +++ /dev/null @@ -1,101 +0,0 @@ -package de.hysky.skyblocker.utils; - -import de.hysky.skyblocker.SkyblockerMod; -import de.hysky.skyblocker.skyblock.itemlist.ItemRegistry; -import net.fabricmc.fabric.api.client.command.v2.ClientCommandManager; -import net.fabricmc.fabric.api.client.command.v2.ClientCommandRegistrationCallback; -import net.minecraft.client.MinecraftClient; -import net.minecraft.text.Text; -import org.eclipse.jgit.api.Git; -import org.eclipse.jgit.api.errors.TransportException; -import org.eclipse.jgit.errors.RepositoryNotFoundException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.File; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.List; -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 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 REPO_INITIALIZED = initRepository(); - - /** - * Adds command to update repository manually from ingame. - *

- * TODO A button could be added to the settings menu that will trigger this command. - */ - public static void init() { - ClientCommandRegistrationCallback.EVENT.register((dispatcher, registryAccess) -> - dispatcher.register(ClientCommandManager.literal(SkyblockerMod.NAMESPACE) - .then(ClientCommandManager.literal("updaterepository").executes(context -> { - deleteAndDownloadRepository(); - return 1; - })))); - } - - private static CompletableFuture initRepository() { - return CompletableFuture.runAsync(() -> { - try { - if (Files.isDirectory(NEURepo.LOCAL_REPO_DIR)) { - try (Git localRepo = Git.open(NEURepo.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(); - LOGGER.info("[Skyblocker] NEU Repository Downloaded"); - } - } 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) { - LOGGER.warn("[Skyblocker] Local NEU Repository not found or corrupted, downloading new one", e); - deleteAndDownloadRepository(); - } catch (Exception e) { - LOGGER.error("[Skyblocker] Encountered unknown exception while initializing NEU Repository", e); - } - }); - } - - private static void deleteAndDownloadRepository() { - CompletableFuture.runAsync(() -> { - try { - ItemRegistry.filesImported = false; - File dir = NEURepo.LOCAL_REPO_DIR.toFile(); - recursiveDelete(dir); - } catch (Exception ex) { - if (MinecraftClient.getInstance().player != null) - MinecraftClient.getInstance().player.sendMessage(Text.translatable("skyblocker.updaterepository.failed"), false); - return; - } - initRepository(); - }); - } - - @SuppressWarnings("ResultOfMethodCallIgnored") - private static void recursiveDelete(File dir) { - File[] children; - if (dir.isDirectory() && !Files.isSymbolicLink(dir.toPath()) && (children = dir.listFiles()) != null) { - for (File child : children) { - recursiveDelete(child); - } - } - dir.delete(); - } - - /** - * Runs the given runnable after the NEU repo is initialized. - * @param runnable the runnable to run - * @return a completable future of the given runnable - */ - public static CompletableFuture runAsyncAfterLoad(Runnable runnable) { - return REPO_INITIALIZED.thenRunAsync(runnable); - } -} diff --git a/src/main/java/de/hysky/skyblocker/utils/NEURepoManager.java b/src/main/java/de/hysky/skyblocker/utils/NEURepoManager.java new file mode 100644 index 00000000..e6ede542 --- /dev/null +++ b/src/main/java/de/hysky/skyblocker/utils/NEURepoManager.java @@ -0,0 +1,107 @@ +package de.hysky.skyblocker.utils; + +import de.hysky.skyblocker.SkyblockerMod; +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; +import net.minecraft.text.Text; +import org.eclipse.jgit.api.Git; +import org.eclipse.jgit.api.errors.TransportException; +import org.eclipse.jgit.errors.RepositoryNotFoundException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.File; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.List; +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 NEURepoManager { + private static final Logger LOGGER = LoggerFactory.getLogger(NEURepoManager.class); + public static final String REMOTE_REPO_URL = "https://github.com/NotEnoughUpdates/NotEnoughUpdates-REPO.git"; + /** + * 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 REPO_INITIALIZED = loadRepository(); + public static final NEURepository NEU_REPO = NEURepository.of(LOCAL_REPO_DIR); + + /** + * Adds command to update repository manually from ingame. + *

+ * TODO A button could be added to the settings menu that will trigger this command. + */ + public static void init() { + ClientCommandRegistrationCallback.EVENT.register((dispatcher, registryAccess) -> + dispatcher.register(ClientCommandManager.literal(SkyblockerMod.NAMESPACE) + .then(ClientCommandManager.literal("updaterepository").executes(context -> { + deleteAndDownloadRepository(); + return 1; + })))); + } + + private static CompletableFuture loadRepository() { + return CompletableFuture.runAsync(() -> { + try { + 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(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) { + LOGGER.warn("[Skyblocker] Local NEU Repository not found or corrupted, downloading new one", e); + deleteAndDownloadRepository(); + } catch (Exception e) { + LOGGER.error("[Skyblocker] Encountered unknown exception while initializing NEU Repository", e); + } + }); + } + + private static void deleteAndDownloadRepository() { + CompletableFuture.runAsync(() -> { + try { + 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); + return; + } + loadRepository(); + }); + } + + @SuppressWarnings("ResultOfMethodCallIgnored") + private static void recursiveDelete(File dir) { + File[] children; + if (dir.isDirectory() && !Files.isSymbolicLink(dir.toPath()) && (children = dir.listFiles()) != null) { + for (File child : children) { + recursiveDelete(child); + } + } + dir.delete(); + } + + /** + * Runs the given runnable after the NEU repo is initialized. + * @param runnable the runnable to run + * @return a completable future of the given runnable + */ + public static CompletableFuture runAsyncAfterLoad(Runnable runnable) { + return REPO_INITIALIZED.thenRunAsync(runnable); + } +} diff --git a/src/main/resources/assets/skyblocker/lang/en_us.json b/src/main/resources/assets/skyblocker/lang/en_us.json index 3d0c010f..90805b31 100644 --- a/src/main/resources/assets/skyblocker/lang/en_us.json +++ b/src/main/resources/assets/skyblocker/lang/en_us.json @@ -81,6 +81,11 @@ "text.autoconfig.skyblocker.option.general.itemInfoDisplay.itemRarityBackgrounds": "Item Rarity Backgrounds", "text.autoconfig.skyblocker.option.general.itemInfoDisplay.itemRarityBackgrounds.@Tooltip": "Displays a colored background behind an item, the color represents the item's rarity.", "text.autoconfig.skyblocker.option.general.itemInfoDisplay.itemRarityBackgroundsOpacity": "Item Rarity Backgrounds Opacity", + "text.autoconfig.skyblocker.option.general.wikiLookup": "Wiki Lookup", + "text.autoconfig.skyblocker.option.general.wikiLookup.enableWikiLookup": "Enable Wiki Lookup", + "text.autoconfig.skyblocker.option.general.wikiLookup.enableWikiLookup.@Tooltip": "Opens the wiki page of the hovered item with the F4 key.", + "text.autoconfig.skyblocker.option.general.wikiLookup.officialWiki": "Use Official Wiki", + "text.autoconfig.skyblocker.option.general.wikiLookup.officialWiki.@Tooltip": "Use the official wiki instead of the Fandom wiki.", "text.autoconfig.skyblocker.option.general.specialEffects": "Special Effects", "text.autoconfig.skyblocker.option.general.specialEffects.rareDungeonDropEffects": "Rare Dungeon Drop Effects", "text.autoconfig.skyblocker.option.general.specialEffects.rareDungeonDropEffects.@Tooltip": "Adds a special visual effect triggered upon obtaining rare dungeon loot!", -- cgit From 38f3ec2348c0d02d3b2ef682bfbb62aa0a327cec Mon Sep 17 00:00:00 2001 From: Yasin Date: Wed, 18 Oct 2023 02:04:12 +0200 Subject: Change flame height (#370) --- .../hysky/skyblocker/config/SkyblockerConfig.java | 11 +++++++++++ .../config/categories/GeneralCategory.java | 20 ++++++++++++++++++++ .../mixin/InGameOverlayRendererMixin.java | 22 ++++++++++++++++++++++ .../resources/assets/skyblocker/lang/en_us.json | 3 +++ src/main/resources/skyblocker.mixins.json | 1 + 5 files changed, 57 insertions(+) create mode 100644 src/main/java/de/hysky/skyblocker/mixin/InGameOverlayRendererMixin.java diff --git a/src/main/java/de/hysky/skyblocker/config/SkyblockerConfig.java b/src/main/java/de/hysky/skyblocker/config/SkyblockerConfig.java index 107fe26e..4efcc1df 100644 --- a/src/main/java/de/hysky/skyblocker/config/SkyblockerConfig.java +++ b/src/main/java/de/hysky/skyblocker/config/SkyblockerConfig.java @@ -209,6 +209,9 @@ public class SkyblockerConfig { @SerialEntry public TeleportOverlay teleportOverlay = new TeleportOverlay(); + @SerialEntry + public FlameOverlay flameOverlay = new FlameOverlay(); + @SerialEntry public List lockedSlots = new ArrayList<>(); @@ -391,6 +394,14 @@ public class SkyblockerConfig { public boolean enableWitherImpact = true; } + public static class FlameOverlay { + @SerialEntry + public float flameHeight = 0f; + + @SerialEntry + public float flameOpacity = 0f; + } + public enum Direction { HORIZONTAL, VERTICAL; 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 80792ab9..635d192f 100644 --- a/src/main/java/de/hysky/skyblocker/config/categories/GeneralCategory.java +++ b/src/main/java/de/hysky/skyblocker/config/categories/GeneralCategory.java @@ -525,6 +525,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.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.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/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/resources/assets/skyblocker/lang/en_us.json b/src/main/resources/assets/skyblocker/lang/en_us.json index 90805b31..df58136c 100644 --- a/src/main/resources/assets/skyblocker/lang/en_us.json +++ b/src/main/resources/assets/skyblocker/lang/en_us.json @@ -107,6 +107,9 @@ "text.autoconfig.skyblocker.option.general.teleportOverlay.enableEtherTransmission": "Enable Ether Transmission Overlay", "text.autoconfig.skyblocker.option.general.teleportOverlay.enableSinrecallTransmission": "Enable Sinrecall Transmission Overlay", "text.autoconfig.skyblocker.option.general.teleportOverlay.enableWitherImpact": "Enable Wither Impact Overlay", + "text.autoconfig.skyblocker.option.general.flameOverlay": "Flame Overlay", + "text.autoconfig.skyblocker.option.general.flameOverlay.flameHeight": "Flame Height", + "text.autoconfig.skyblocker.option.general.flameOverlay.flameOpacity": "Flame Opacity", "skyblocker.itemTooltip.nullMessage": "§b[§6Skyblocker§b] §cItem price information on tooltip will renew in max 60 seconds. If not, check latest.log", "skyblocker.itemTooltip.noData": "§cNo Data", diff --git a/src/main/resources/skyblocker.mixins.json b/src/main/resources/skyblocker.mixins.json index efca46f7..4e7bfe16 100644 --- a/src/main/resources/skyblocker.mixins.json +++ b/src/main/resources/skyblocker.mixins.json @@ -16,6 +16,7 @@ "GenericContainerScreenHandlerMixin", "HandledScreenMixin", "InGameHudMixin", + "InGameOverlayRendererMixin", "InventoryScreenMixin", "ItemMixin", "ItemStackMixin", -- cgit From 65257e0a8631ad6bc7edd4e32ffe0ecbf082ccf6 Mon Sep 17 00:00:00 2001 From: Aaron <51387595+AzureAaron@users.noreply.github.com> Date: Tue, 17 Oct 2023 20:15:39 -0400 Subject: Add comment --- .../hysky/skyblocker/utils/render/title/TitleContainerConfigScreen.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/de/hysky/skyblocker/utils/render/title/TitleContainerConfigScreen.java b/src/main/java/de/hysky/skyblocker/utils/render/title/TitleContainerConfigScreen.java index 7eca7444..19d41c91 100644 --- a/src/main/java/de/hysky/skyblocker/utils/render/title/TitleContainerConfigScreen.java +++ b/src/main/java/de/hysky/skyblocker/utils/render/title/TitleContainerConfigScreen.java @@ -174,6 +174,7 @@ public class TitleContainerConfigScreen extends Screen { SkyblockerConfigManager.get().general.titleContainer.x = (int) hudX; SkyblockerConfigManager.get().general.titleContainer.y = (int) hudY; + //TODO Come up with a better, less hacky solution for this in the future (: if (parent instanceof YACLScreen yaclScreen) { ConfigCategory category = yaclScreen.config.categories().stream().filter(cat -> cat.name().getString().equals(I18n.translate("text.autoconfig.skyblocker.category.general"))).findFirst().orElseThrow(); OptionGroup group = category.groups().stream().filter(grp -> grp.name().getString().equals(I18n.translate("text.autoconfig.skyblocker.option.general.titleContainer"))).findFirst().orElseThrow(); -- cgit From 132c33af264df143bc3e02087c76be20d94aebf5 Mon Sep 17 00:00:00 2001 From: Aaron <51387595+AzureAaron@users.noreply.github.com> Date: Wed, 18 Oct 2023 00:45:58 -0400 Subject: Secret Waypoint Rendering Customization --- .../hysky/skyblocker/config/SkyblockerConfig.java | 18 ++++++++++++++++++ .../config/categories/DungeonsCategory.java | 9 +++++++++ .../skyblocker/skyblock/dungeon/CreeperBeams.java | 8 ++++---- .../skyblocker/skyblock/dungeon/DungeonBlaze.java | 4 ++-- .../skyblocker/skyblock/dungeon/TicTacToe.java | 2 +- .../skyblock/dungeon/secrets/SecretWaypoint.java | 21 ++++++++++++++++++++- .../hysky/skyblocker/utils/render/RenderHelper.java | 4 +++- .../resources/assets/skyblocker/lang/en_us.json | 2 ++ 8 files changed, 59 insertions(+), 9 deletions(-) diff --git a/src/main/java/de/hysky/skyblocker/config/SkyblockerConfig.java b/src/main/java/de/hysky/skyblocker/config/SkyblockerConfig.java index 4efcc1df..6622fa83 100644 --- a/src/main/java/de/hysky/skyblocker/config/SkyblockerConfig.java +++ b/src/main/java/de/hysky/skyblocker/config/SkyblockerConfig.java @@ -572,6 +572,9 @@ public class SkyblockerConfig { @SerialEntry public boolean noInitSecretWaypoints = false; + + @SerialEntry + public WaypointType waypointType = WaypointType.WAYPOINT; @SerialEntry public boolean enableEntranceWaypoints = true; @@ -603,6 +606,21 @@ public class SkyblockerConfig { @SerialEntry public boolean enableDefaultWaypoints = true; } + + public enum WaypointType { + WAYPOINT, + OUTLINE, + OUTLINED_WAYPOINT; + + @Override + public String toString() { + return switch (this) { + case WAYPOINT -> "Waypoint"; + case OUTLINE -> "Outline"; + case OUTLINED_WAYPOINT -> "Outlined Waypoint"; + }; + } + } public static class DungeonChestProfit { @SerialEntry 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 a9c0c26b..89ac6f8e 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,14 @@ public class DungeonsCategory { .controller(ConfigUtils::createBooleanController) .flag(OptionFlag.GAME_RESTART) .build()) + .option(Option.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.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/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/SecretWaypoint.java b/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/SecretWaypoint.java index d2a31ea3..eb3b7041 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 @@ -11,6 +11,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; @@ -75,7 +76,25 @@ 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); + switch (SkyblockerConfigManager.get().locations.dungeons.secretWaypoints.waypointType) { + case WAYPOINT: { + RenderHelper.renderFilledThroughWallsWithBeaconBeam(context, pos, category.colorComponents, 0.5F); + + break; + } + case OUTLINE: { + RenderHelper.renderOutline(context, new Box(pos), category.colorComponents, 5F, true); + + break; + } + case OUTLINED_WAYPOINT : { + RenderHelper.renderFilledThroughWallsWithBeaconBeam(context, pos, category.colorComponents, 0.5F); + RenderHelper.renderOutline(context, new Box(pos), category.colorComponents, 5F, true); + + break; + } + } + Vec3d posUp = centerPos.add(0, 1, 0); RenderHelper.renderText(context, name, posUp, true); double distance = context.camera().getPos().distanceTo(centerPos); 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); } } diff --git a/src/main/resources/assets/skyblocker/lang/en_us.json b/src/main/resources/assets/skyblocker/lang/en_us.json index df58136c..f39aa669 100644 --- a/src/main/resources/assets/skyblocker/lang/en_us.json +++ b/src/main/resources/assets/skyblocker/lang/en_us.json @@ -238,6 +238,8 @@ "text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.enableSecretWaypoints": "Enable Dungeon Secret Waypoints", "text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.noInitSecretWaypoints": "Do Not Initialize Secret Waypoints", "text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.noInitSecretWaypoints.@Tooltip": "This option can save around 20 MB of ram if enabled, but Secret Waypoint will require a restart after turning off this option to work.", + "text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.waypointType": "Waypoint Type", + "text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.waypointType.@Tooltip": "Waypoint: The standard waypoint.\n\nOutline: Outlines the secret in a box.\n\nOutlined Waypoint: Displays both a waypoint and an outline.", "text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.enableEntranceWaypoints" : "Enable Entrance Waypoints", "text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.enableSuperboomWaypoints" : "Enable Superboom Waypoints", "text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.enableChestWaypoints" : "Enable Chest Waypoints", -- cgit From 343984a38fca6c1015b7230a5109fb3aaa6c15ef Mon Sep 17 00:00:00 2001 From: Kevinthegreat <92656833+kevinthegreat1@users.noreply.github.com> Date: Wed, 18 Oct 2023 01:32:55 -0400 Subject: Refactor switch --- .../skyblock/dungeon/secrets/SecretWaypoint.java | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) 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 eb3b7041..9fc2e778 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; @@ -77,24 +76,14 @@ public class SecretWaypoint { */ void render(WorldRenderContext context) { switch (SkyblockerConfigManager.get().locations.dungeons.secretWaypoints.waypointType) { - case WAYPOINT: { - RenderHelper.renderFilledThroughWallsWithBeaconBeam(context, pos, category.colorComponents, 0.5F); - - break; - } - case OUTLINE: { - RenderHelper.renderOutline(context, new Box(pos), category.colorComponents, 5F, true); - - break; - } - case OUTLINED_WAYPOINT : { + case WAYPOINT -> RenderHelper.renderFilledThroughWallsWithBeaconBeam(context, pos, category.colorComponents, 0.5F); + case OUTLINE -> RenderHelper.renderOutline(context, new Box(pos), category.colorComponents, 5F, true); + case OUTLINED_WAYPOINT -> { RenderHelper.renderFilledThroughWallsWithBeaconBeam(context, pos, category.colorComponents, 0.5F); RenderHelper.renderOutline(context, new Box(pos), category.colorComponents, 5F, true); - - break; } } - + Vec3d posUp = centerPos.add(0, 1, 0); RenderHelper.renderText(context, name, posUp, true); double distance = context.camera().getPos().distanceTo(centerPos); -- cgit From 7773e425d3e2da1e4d4c0368be3067052f35139e Mon Sep 17 00:00:00 2001 From: Aaron <51387595+AzureAaron@users.noreply.github.com> Date: Wed, 18 Oct 2023 22:11:32 -0400 Subject: More Waypoint Customization --- .../hysky/skyblocker/config/SkyblockerConfig.java | 13 +++++++--- .../config/categories/DungeonsCategory.java | 7 +++++ .../skyblock/dungeon/secrets/SecretWaypoint.java | 30 +++++++++++++++------- .../resources/assets/skyblocker/lang/en_us.json | 3 ++- 4 files changed, 40 insertions(+), 13 deletions(-) diff --git a/src/main/java/de/hysky/skyblocker/config/SkyblockerConfig.java b/src/main/java/de/hysky/skyblocker/config/SkyblockerConfig.java index 6622fa83..d7279bc8 100644 --- a/src/main/java/de/hysky/skyblocker/config/SkyblockerConfig.java +++ b/src/main/java/de/hysky/skyblocker/config/SkyblockerConfig.java @@ -575,6 +575,9 @@ public class SkyblockerConfig { @SerialEntry public WaypointType waypointType = WaypointType.WAYPOINT; + + @SerialEntry + public boolean showSecretText = true; @SerialEntry public boolean enableEntranceWaypoints = true; @@ -609,15 +612,19 @@ public class SkyblockerConfig { public enum WaypointType { WAYPOINT, - OUTLINE, - OUTLINED_WAYPOINT; + OUTLINED_WAYPOINT, + HIGHLIGHT, + OUTLINED_HIGHLIGHT, + OUTLINE; @Override public String toString() { return switch (this) { case WAYPOINT -> "Waypoint"; - case OUTLINE -> "Outline"; case OUTLINED_WAYPOINT -> "Outlined Waypoint"; + case HIGHLIGHT -> "Highlight"; + case OUTLINED_HIGHLIGHT -> "Outlined Highlight"; + case OUTLINE -> "Outline"; }; } } 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 89ac6f8e..7b32cb78 100644 --- a/src/main/java/de/hysky/skyblocker/config/categories/DungeonsCategory.java +++ b/src/main/java/de/hysky/skyblocker/config/categories/DungeonsCategory.java @@ -52,6 +52,13 @@ public class DungeonsCategory { newValue -> config.locations.dungeons.secretWaypoints.waypointType = newValue) .controller(ConfigUtils::createEnumCyclingListController) .build()) + .option(Option.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.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/skyblock/dungeon/secrets/SecretWaypoint.java b/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/SecretWaypoint.java index 9fc2e778..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 @@ -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 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,19 +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) { - switch (SkyblockerConfigManager.get().locations.dungeons.secretWaypoints.waypointType) { - case WAYPOINT -> RenderHelper.renderFilledThroughWallsWithBeaconBeam(context, pos, category.colorComponents, 0.5F); - case OUTLINE -> RenderHelper.renderOutline(context, new Box(pos), category.colorComponents, 5F, 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, 0.5F); - RenderHelper.renderOutline(context, new Box(pos), category.colorComponents, 5F, true); + 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); } - 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); + 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/resources/assets/skyblocker/lang/en_us.json b/src/main/resources/assets/skyblocker/lang/en_us.json index f39aa669..552caf7c 100644 --- a/src/main/resources/assets/skyblocker/lang/en_us.json +++ b/src/main/resources/assets/skyblocker/lang/en_us.json @@ -239,7 +239,8 @@ "text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.noInitSecretWaypoints": "Do Not Initialize Secret Waypoints", "text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.noInitSecretWaypoints.@Tooltip": "This option can save around 20 MB of ram if enabled, but Secret Waypoint will require a restart after turning off this option to work.", "text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.waypointType": "Waypoint Type", - "text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.waypointType.@Tooltip": "Waypoint: The standard waypoint.\n\nOutline: Outlines the secret in a box.\n\nOutlined Waypoint: Displays both a waypoint and an outline.", + "text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.waypointType.@Tooltip": "Waypoint: Displays a highlight and beam.\n\nOutlined Waypoint: Displays both a waypoint and an outline.\n\nHighlight: Only displays a highlight.\n\nOutlined Highlight: Displays both a highlight and an outline.\n\nOutline: Outlines the secret in a box.", + "text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.showSecretText": "Show Secret Text", "text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.enableEntranceWaypoints" : "Enable Entrance Waypoints", "text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.enableSuperboomWaypoints" : "Enable Superboom Waypoints", "text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.enableChestWaypoints" : "Enable Chest Waypoints", -- cgit From 2bba37e4e048ef0c18c00c70896b9b121863e36e Mon Sep 17 00:00:00 2001 From: oreto Date: Fri, 22 Sep 2023 22:22:20 +0200 Subject: Added translation using Weblate (Portuguese (Brazil)) --- .../resources/assets/skyblocker/lang/pt_br.json | 366 +++++++++++++++++++++ 1 file changed, 366 insertions(+) create mode 100644 src/main/resources/assets/skyblocker/lang/pt_br.json diff --git a/src/main/resources/assets/skyblocker/lang/pt_br.json b/src/main/resources/assets/skyblocker/lang/pt_br.json new file mode 100644 index 00000000..95367382 --- /dev/null +++ b/src/main/resources/assets/skyblocker/lang/pt_br.json @@ -0,0 +1,366 @@ +{ + "key.categories.skyblocker": "", + "key.hotbarSlotLock": "", + "key.skyblocker.toggleB": "", + "key.skyblocker.defaultTgl": "", + "key.skyblocker.toggleA": "", + "key.wikiLookup": "", + "text.autoconfig.skyblocker.title": "", + "text.autoconfig.skyblocker.category.general": "", + "text.autoconfig.skyblocker.option.general.bars": "", + "text.autoconfig.skyblocker.option.general.bars.enableBars": "", + "text.autoconfig.skyblocker.option.general.bars.barpositions": "", + "text.autoconfig.skyblocker.option.general.bars.barpositions.LAYER1": "", + "text.autoconfig.skyblocker.option.general.bars.barpositions.LAYER2": "", + "text.autoconfig.skyblocker.option.general.bars.barpositions.RIGHT": "", + "text.autoconfig.skyblocker.option.general.bars.barpositions.NONE": "", + "text.autoconfig.skyblocker.option.general.bars.barpositions.healthBarPosition": "", + "text.autoconfig.skyblocker.option.general.bars.barpositions.manaBarPosition": "", + "text.autoconfig.skyblocker.option.general.bars.barpositions.defenceBarPosition": "", + "text.autoconfig.skyblocker.option.general.bars.barpositions.experienceBarPosition": "", + "text.autoconfig.skyblocker.option.general.experiments": "", + "text.autoconfig.skyblocker.option.general.experiments.enableChronomatronSolver": "", + "text.autoconfig.skyblocker.option.general.experiments.enableSuperpairsSolver": "", + "text.autoconfig.skyblocker.option.general.experiments.enableUltrasequencerSolver": "", + "text.autoconfig.skyblocker.option.general.acceptReparty": "", + "text.autoconfig.skyblocker.option.general.etherwarpOverlay": "", + "text.autoconfig.skyblocker.option.general.fishing": "", + "text.autoconfig.skyblocker.option.general.fishing.enableFishingHelper": "", + "text.autoconfig.skyblocker.option.general.fairySouls": "", + "text.autoconfig.skyblocker.option.general.fairySouls.enableFairySoulsHelper": "", + "text.autoconfig.skyblocker.option.general.fairySouls.highlightFoundSouls": "", + "text.autoconfig.skyblocker.option.general.fairySouls.highlightOnlyNearbySouls": "", + "text.autoconfig.skyblocker.option.general.fairySouls.highlightOnlyNearbySouls.@Tooltip": "", + "text.autoconfig.skyblocker.option.general.shortcuts": "", + "text.autoconfig.skyblocker.option.general.shortcuts.enableShortcuts": "", + "text.autoconfig.skyblocker.option.general.shortcuts.enableShortcuts.@Tooltip": "", + "text.autoconfig.skyblocker.option.general.shortcuts.enableCommandShortcuts": "", + "text.autoconfig.skyblocker.option.general.shortcuts.enableCommandShortcuts.@Tooltip": "", + "text.autoconfig.skyblocker.option.general.shortcuts.enableCommandArgShortcuts": "", + "text.autoconfig.skyblocker.option.general.shortcuts.enableCommandArgShortcuts.@Tooltip": "", + "text.autoconfig.skyblocker.option.general.quiverWarning": "", + "text.autoconfig.skyblocker.option.general.quiverWarning.enableQuiverWarning": "", + "text.autoconfig.skyblocker.option.general.quiverWarning.enableQuiverWarningInDungeons": "", + "text.autoconfig.skyblocker.option.general.quiverWarning.enableQuiverWarningAfterDungeon": "", + "text.autoconfig.skyblocker.option.general.backpackPreviewWithoutShift": "", + "text.autoconfig.skyblocker.option.general.compactorDeletorPreview": "", + "text.autoconfig.skyblocker.option.general.tabHud": "", + "text.autoconfig.skyblocker.option.general.tabHud.tabHudEnabled": "", + "text.autoconfig.skyblocker.option.general.tabHud.tabHudScale": "", + "text.autoconfig.skyblocker.option.general.tabHud.tabHudScale.@Tooltip": "", + "text.autoconfig.skyblocker.option.general.tabHud.plainPlayerNames": "", + "text.autoconfig.skyblocker.option.general.tabHud.plainPlayerNames.@Tooltip": "", + "text.autoconfig.skyblocker.option.general.tabHud.nameSorting": "", + "text.autoconfig.skyblocker.option.general.tabHud.nameSorting.@Tooltip": "", + "text.autoconfig.skyblocker.option.general.itemTooltip": "", + "text.autoconfig.skyblocker.option.general.itemTooltip.enableNPCPrice": "", + "text.autoconfig.skyblocker.option.general.itemTooltip.enableMotesPrice": "", + "text.autoconfig.skyblocker.option.general.itemTooltip.enableMotesPrice.@Tooltip": "", + "text.autoconfig.skyblocker.option.general.itemTooltip.enableAvgBIN": "", + "text.autoconfig.skyblocker.option.general.itemTooltip.avg": "", + "text.autoconfig.skyblocker.option.general.itemTooltip.avg.@Tooltip": "", + "text.autoconfig.skyblocker.option.general.itemTooltip.avg.ONE_DAY": "", + "text.autoconfig.skyblocker.option.general.itemTooltip.avg.THREE_DAY": "", + "text.autoconfig.skyblocker.option.general.itemTooltip.avg.BOTH": "", + "text.autoconfig.skyblocker.option.general.itemTooltip.enableLowestBIN": "", + "text.autoconfig.skyblocker.option.general.itemTooltip.enableBazaarPrice": "", + "text.autoconfig.skyblocker.option.general.itemTooltip.enableMuseumDate": "", + "text.autoconfig.skyblocker.option.general.itemInfoDisplay": "", + "text.autoconfig.skyblocker.option.general.itemInfoDisplay.attributeShardInfo": "", + "text.autoconfig.skyblocker.option.general.itemInfoDisplay.attributeShardInfo.@Tooltip": "", + "text.autoconfig.skyblocker.option.general.specialEffects": "", + "text.autoconfig.skyblocker.option.general.specialEffects.rareDungeonDropEffects": "", + "text.autoconfig.skyblocker.option.general.specialEffects.rareDungeonDropEffects.@Tooltip": "", + "text.autoconfig.skyblocker.option.general.hitbox": "", + "text.autoconfig.skyblocker.option.general.hitbox.oldFarmlandHitbox": "", + "text.autoconfig.skyblocker.option.general.hitbox.oldLeverHitbox": "", + "text.autoconfig.skyblocker.option.general.titleContainer": "", + "text.autoconfig.skyblocker.option.general.titleContainer.@Tooltip": "", + "text.autoconfig.skyblocker.option.general.titleContainer.titleContainerScale": "", + "text.autoconfig.skyblocker.option.general.titleContainer.x": "", + "text.autoconfig.skyblocker.option.general.titleContainer.y": "", + "text.autoconfig.skyblocker.option.general.titleContainer.direction": "", + "text.autoconfig.skyblocker.option.general.titleContainer.alignment": "", + "text.autoconfig.skyblocker.option.general.teleportOverlay": "", + "text.autoconfig.skyblocker.option.general.teleportOverlay.enableTeleportOverlays": "", + "text.autoconfig.skyblocker.option.general.teleportOverlay.enableWeirdTransmission": "", + "text.autoconfig.skyblocker.option.general.teleportOverlay.enableInstantTransmission": "", + "text.autoconfig.skyblocker.option.general.teleportOverlay.enableEtherTransmission": "", + "text.autoconfig.skyblocker.option.general.teleportOverlay.enableSinrecallTransmission": "", + "text.autoconfig.skyblocker.option.general.teleportOverlay.enableWitherImpact": "", + "skyblocker.itemTooltip.nullMessage": "", + "skyblocker.itemTooltip.noData": "", + "text.autoconfig.skyblocker.category.richPresence": "", + "text.autoconfig.skyblocker.option.richPresence.info": "", + "text.autoconfig.skyblocker.option.richPresence.info.PURSE": "", + "text.autoconfig.skyblocker.option.richPresence.info.BITS": "", + "text.autoconfig.skyblocker.option.richPresence.info.LOCATION": "", + "text.autoconfig.skyblocker.option.richPresence.info.@Tooltip": "", + "text.autoconfig.skyblocker.option.richPresence.cycleMode": "", + "text.autoconfig.skyblocker.option.richPresence.enableRichPresence": "", + "text.autoconfig.skyblocker.option.richPresence.customMessage": "", + "text.autoconfig.skyblocker.category.quickNav": "", + "text.autoconfig.skyblocker.option.quickNav.enableQuickNav": "", + "text.autoconfig.skyblocker.option.quickNav.button1": "", + "text.autoconfig.skyblocker.option.quickNav.button1.render": "", + "text.autoconfig.skyblocker.option.quickNav.button1.item": "", + "text.autoconfig.skyblocker.option.quickNav.button1.item.itemName": "", + "text.autoconfig.skyblocker.option.quickNav.button1.item.count": "", + "text.autoconfig.skyblocker.option.quickNav.button1.item.nbt": "", + "text.autoconfig.skyblocker.option.quickNav.button1.uiTitle": "", + "text.autoconfig.skyblocker.option.quickNav.button1.clickEvent": "", + "text.autoconfig.skyblocker.option.quickNav.button2": "", + "text.autoconfig.skyblocker.option.quickNav.button2.render": "", + "text.autoconfig.skyblocker.option.quickNav.button2.item": "", + "text.autoconfig.skyblocker.option.quickNav.button2.item.itemName": "", + "text.autoconfig.skyblocker.option.quickNav.button2.item.count": "", + "text.autoconfig.skyblocker.option.quickNav.button2.item.nbt": "", + "text.autoconfig.skyblocker.option.quickNav.button2.uiTitle": "", + "text.autoconfig.skyblocker.option.quickNav.button2.clickEvent": "", + "text.autoconfig.skyblocker.option.quickNav.button3": "", + "text.autoconfig.skyblocker.option.quickNav.button3.render": "", + "text.autoconfig.skyblocker.option.quickNav.button3.item": "", + "text.autoconfig.skyblocker.option.quickNav.button3.item.itemName": "", + "text.autoconfig.skyblocker.option.quickNav.button3.item.count": "", + "text.autoconfig.skyblocker.option.quickNav.button3.item.nbt": "", + "text.autoconfig.skyblocker.option.quickNav.button3.uiTitle": "", + "text.autoconfig.skyblocker.option.quickNav.button3.clickEvent": "", + "text.autoconfig.skyblocker.option.quickNav.button4": "", + "text.autoconfig.skyblocker.option.quickNav.button4.render": "", + "text.autoconfig.skyblocker.option.quickNav.button4.item": "", + "text.autoconfig.skyblocker.option.quickNav.button4.item.itemName": "", + "text.autoconfig.skyblocker.option.quickNav.button4.item.count": "", + "text.autoconfig.skyblocker.option.quickNav.button4.item.nbt": "", + "text.autoconfig.skyblocker.option.quickNav.button4.uiTitle": "", + "text.autoconfig.skyblocker.option.quickNav.button4.clickEvent": "", + "text.autoconfig.skyblocker.option.quickNav.button5": "", + "text.autoconfig.skyblocker.option.quickNav.button5.render": "", + "text.autoconfig.skyblocker.option.quickNav.button5.item": "", + "text.autoconfig.skyblocker.option.quickNav.button5.item.itemName": "", + "text.autoconfig.skyblocker.option.quickNav.button5.item.count": "", + "text.autoconfig.skyblocker.option.quickNav.button5.item.nbt": "", + "text.autoconfig.skyblocker.option.quickNav.button5.uiTitle": "", + "text.autoconfig.skyblocker.option.quickNav.button5.clickEvent": "", + "text.autoconfig.skyblocker.option.quickNav.button6": "", + "text.autoconfig.skyblocker.option.quickNav.button6.render": "", + "text.autoconfig.skyblocker.option.quickNav.button6.item": "", + "text.autoconfig.skyblocker.option.quickNav.button6.item.itemName": "", + "text.autoconfig.skyblocker.option.quickNav.button6.item.count": "", + "text.autoconfig.skyblocker.option.quickNav.button6.item.nbt": "", + "text.autoconfig.skyblocker.option.quickNav.button6.uiTitle": "", + "text.autoconfig.skyblocker.option.quickNav.button6.clickEvent": "", + "text.autoconfig.skyblocker.option.quickNav.button7": "", + "text.autoconfig.skyblocker.option.quickNav.button7.render": "", + "text.autoconfig.skyblocker.option.quickNav.button7.item": "", + "text.autoconfig.skyblocker.option.quickNav.button7.item.itemName": "", + "text.autoconfig.skyblocker.option.quickNav.button7.item.count": "", + "text.autoconfig.skyblocker.option.quickNav.button7.item.nbt": "", + "text.autoconfig.skyblocker.option.quickNav.button7.uiTitle": "", + "text.autoconfig.skyblocker.option.quickNav.button7.clickEvent": "", + "text.autoconfig.skyblocker.option.quickNav.button8": "", + "text.autoconfig.skyblocker.option.quickNav.button8.render": "", + "text.autoconfig.skyblocker.option.quickNav.button8.item": "", + "text.autoconfig.skyblocker.option.quickNav.button8.item.itemName": "", + "text.autoconfig.skyblocker.option.quickNav.button8.item.count": "", + "text.autoconfig.skyblocker.option.quickNav.button8.item.nbt": "", + "text.autoconfig.skyblocker.option.quickNav.button8.uiTitle": "", + "text.autoconfig.skyblocker.option.quickNav.button8.clickEvent": "", + "text.autoconfig.skyblocker.option.quickNav.button9": "", + "text.autoconfig.skyblocker.option.quickNav.button9.render": "", + "text.autoconfig.skyblocker.option.quickNav.button9.item": "", + "text.autoconfig.skyblocker.option.quickNav.button9.item.itemName": "", + "text.autoconfig.skyblocker.option.quickNav.button9.item.count": "", + "text.autoconfig.skyblocker.option.quickNav.button9.item.nbt": "", + "text.autoconfig.skyblocker.option.quickNav.button9.uiTitle": "", + "text.autoconfig.skyblocker.option.quickNav.button9.clickEvent": "", + "text.autoconfig.skyblocker.option.quickNav.button10": "", + "text.autoconfig.skyblocker.option.quickNav.button10.render": "", + "text.autoconfig.skyblocker.option.quickNav.button10.item": "", + "text.autoconfig.skyblocker.option.quickNav.button10.item.itemName": "", + "text.autoconfig.skyblocker.option.quickNav.button10.item.count": "", + "text.autoconfig.skyblocker.option.quickNav.button10.item.nbt": "", + "text.autoconfig.skyblocker.option.quickNav.button10.uiTitle": "", + "text.autoconfig.skyblocker.option.quickNav.button10.clickEvent": "", + "text.autoconfig.skyblocker.option.quickNav.button11": "", + "text.autoconfig.skyblocker.option.quickNav.button11.render": "", + "text.autoconfig.skyblocker.option.quickNav.button11.item": "", + "text.autoconfig.skyblocker.option.quickNav.button11.item.itemName": "", + "text.autoconfig.skyblocker.option.quickNav.button11.item.count": "", + "text.autoconfig.skyblocker.option.quickNav.button11.item.nbt": "", + "text.autoconfig.skyblocker.option.quickNav.button11.uiTitle": "", + "text.autoconfig.skyblocker.option.quickNav.button11.clickEvent": "", + "text.autoconfig.skyblocker.option.quickNav.button12": "", + "text.autoconfig.skyblocker.option.quickNav.button12.render": "", + "text.autoconfig.skyblocker.option.quickNav.button12.item": "", + "text.autoconfig.skyblocker.option.quickNav.button12.item.itemName": "", + "text.autoconfig.skyblocker.option.quickNav.button12.item.count": "", + "text.autoconfig.skyblocker.option.quickNav.button12.item.nbt": "", + "text.autoconfig.skyblocker.option.quickNav.button12.uiTitle": "", + "text.autoconfig.skyblocker.option.quickNav.button12.clickEvent": "", + "text.autoconfig.skyblocker.option.general.itemList": "", + "text.autoconfig.skyblocker.option.general.itemList.enableItemList": "", + "text.autoconfig.skyblocker.category.locations": "", + "text.autoconfig.skyblocker.option.locations.barn": "", + "text.autoconfig.skyblocker.option.locations.barn.solveHungryHiker": "", + "text.autoconfig.skyblocker.option.locations.barn.solveTreasureHunter": "", + "text.autoconfig.skyblocker.option.locations.spidersDen": "", + "text.autoconfig.skyblocker.option.locations.spidersDen.relics": "", + "text.autoconfig.skyblocker.option.locations.spidersDen.relics.enableRelicsHelper": "", + "text.autoconfig.skyblocker.option.locations.spidersDen.relics.highlightFoundRelics": "", + "text.autoconfig.skyblocker.option.locations.dungeons": "", + "text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints": "", + "text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.enableSecretWaypoints": "", + "text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.noInitSecretWaypoints": "", + "text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.noInitSecretWaypoints.@Tooltip": "", + "text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.enableEntranceWaypoints": "", + "text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.enableSuperboomWaypoints": "", + "text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.enableChestWaypoints": "", + "text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.enableItemWaypoints": "", + "text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.enableBatWaypoints": "", + "text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.enableWitherWaypoints": "", + "text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.enableLeverWaypoints": "", + "text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.enableFairySoulWaypoints": "", + "text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.enableStonkWaypoints": "", + "text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.enableDefaultWaypoints": "", + "text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.enableDefaultWaypoints.@Tooltip": "", + "text.autoconfig.skyblocker.option.locations.dungeons.dungeonChestProfit": "", + "text.autoconfig.skyblocker.option.locations.dungeons.dungeonChestProfit.enableProfitCalculator": "", + "text.autoconfig.skyblocker.option.locations.dungeons.dungeonChestProfit.enableProfitCalculator.@Tooltip": "", + "text.autoconfig.skyblocker.option.locations.dungeons.dungeonChestProfit.includeKismet": "", + "text.autoconfig.skyblocker.option.locations.dungeons.dungeonChestProfit.includeKismet.@Tooltip": "", + "text.autoconfig.skyblocker.option.locations.dungeons.dungeonChestProfit.includeEssence": "", + "text.autoconfig.skyblocker.option.locations.dungeons.dungeonChestProfit.includeEssence.@Tooltip": "", + "text.autoconfig.skyblocker.option.locations.dungeons.dungeonChestProfit.neutralThreshold": "", + "text.autoconfig.skyblocker.option.locations.dungeons.dungeonChestProfit.neutralThreshold.@Tooltip": "", + "text.autoconfig.skyblocker.option.locations.dungeons.dungeonChestProfit.neutralColor": "", + "text.autoconfig.skyblocker.option.locations.dungeons.dungeonChestProfit.profitColor": "", + "text.autoconfig.skyblocker.option.locations.dungeons.dungeonChestProfit.lossColor": "", + "text.autoconfig.skyblocker.option.locations.dungeons.dungeonChestProfit.incompleteColor": "", + "text.autoconfig.skyblocker.option.locations.dungeons.dungeonChestProfit.incompleteColor.@Tooltip": "", + "text.autoconfig.skyblocker.option.locations.dungeons.croesusHelper": "", + "text.autoconfig.skyblocker.option.locations.dungeons.croesusHelper.@Tooltip": "", + "text.autoconfig.skyblocker.option.locations.dungeons.enableMap": "", + "text.autoconfig.skyblocker.option.locations.dungeons.mapScaling": "", + "text.autoconfig.skyblocker.option.locations.dungeons.mapX": "", + "text.autoconfig.skyblocker.option.locations.dungeons.mapY": "", + "text.autoconfig.skyblocker.option.locations.dungeons.starredMobGlow": "", + "text.autoconfig.skyblocker.option.locations.dungeons.starredMobGlow.@Tooltip": "", + "text.autoconfig.skyblocker.option.locations.dungeons.solveThreeWeirdos": "", + "text.autoconfig.skyblocker.option.locations.dungeons.blazesolver": "", + "text.autoconfig.skyblocker.option.locations.dungeons.blazesolver.@Tooltip": "", + "text.autoconfig.skyblocker.option.locations.dungeons.solveTrivia": "", + "text.autoconfig.skyblocker.option.locations.dungeons.solveTicTacToe": "", + "text.autoconfig.skyblocker.option.locations.dungeons.solveTicTacToe.@Tooltip": "", + "text.autoconfig.skyblocker.option.locations.dungeons.lividColor": "", + "text.autoconfig.skyblocker.option.locations.dungeons.lividColor.enableLividColor": "", + "text.autoconfig.skyblocker.option.locations.dungeons.lividColor.enableLividColor.@Tooltip": "", + "text.autoconfig.skyblocker.option.locations.dungeons.lividColor.lividColorText": "", + "text.autoconfig.skyblocker.option.locations.dungeons.lividColor.lividColorText.@Tooltip": "", + "text.autoconfig.skyblocker.option.locations.dungeons.terminals": "", + "text.autoconfig.skyblocker.option.locations.dungeons.terminals.solveColor": "", + "text.autoconfig.skyblocker.option.locations.dungeons.terminals.solveOrder": "", + "text.autoconfig.skyblocker.option.locations.dungeons.terminals.solveStartsWith": "", + "text.autoconfig.skyblocker.option.locations.dwarvenMines": "", + "text.autoconfig.skyblocker.option.locations.dwarvenMines.enableDrillFuel": "", + "text.autoconfig.skyblocker.option.locations.dwarvenMines.solveFetchur": "", + "text.autoconfig.skyblocker.option.locations.dwarvenMines.solvePuzzler": "", + "text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud": "", + "text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.enabled": "", + "text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.style": "", + "text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.style.@Tooltip[0]": "", + "text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.style.@Tooltip[1]": "", + "text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.style.@Tooltip[2]": "", + "text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.enableBackground": "", + "text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.x": "", + "text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.y": "", + "text.autoconfig.skyblocker.option.locations.rift": "", + "text.autoconfig.skyblocker.option.locations.rift.mirrorverseWaypoints": "", + "text.autoconfig.skyblocker.option.locations.rift.mcGrubberStacks": "", + "text.autoconfig.skyblocker.option.locations.rift.mcGrubberStacks.@Tooltip": "", + "text.autoconfig.skyblocker.category.messages": "", + "text.autoconfig.skyblocker.option.messages.chatFilterResult.PASS": "", + "text.autoconfig.skyblocker.option.messages.chatFilterResult.FILTER": "", + "text.autoconfig.skyblocker.option.messages.chatFilterResult.ACTION_BAR": "", + "text.autoconfig.skyblocker.option.messages.hideAbility": "", + "text.autoconfig.skyblocker.option.messages.hideHeal": "", + "text.autoconfig.skyblocker.option.messages.hideAOTE": "", + "text.autoconfig.skyblocker.option.messages.hideImplosion": "", + "text.autoconfig.skyblocker.option.messages.hideMoltenWave": "", + "text.autoconfig.skyblocker.option.messages.hideAds": "", + "text.autoconfig.skyblocker.option.messages.hideTeleportPad": "", + "text.autoconfig.skyblocker.option.messages.hideCombo": "", + "text.autoconfig.skyblocker.option.messages.hideAutopet": "", + "text.autoconfig.skyblocker.option.messages.hideMana": "", + "text.autoconfig.skyblocker.option.messages.hideMana.@Tooltip": "", + "text.autoconfig.skyblocker.option.messages.hideShowOff": "", + "text.autoconfig.skyblocker.option.messages.hideShowOff.@Tooltip": "", + "text.autoconfig.skyblocker.category.slayer": "", + "text.autoconfig.skyblocker.option.slayer.vampireSlayer": "", + "text.autoconfig.skyblocker.option.slayer.vampireSlayer.enableEffigyWaypoints": "", + "text.autoconfig.skyblocker.option.slayer.vampireSlayer.compactEffigyWaypoints": "", + "text.autoconfig.skyblocker.option.slayer.vampireSlayer.effigyUpdateFrequency": "", + "text.autoconfig.skyblocker.option.slayer.vampireSlayer.effigyUpdateFrequency.@Tooltip": "", + "text.autoconfig.skyblocker.option.slayer.vampireSlayer.enableHolyIceIndicator": "", + "text.autoconfig.skyblocker.option.slayer.vampireSlayer.holyIceIndicatorTickDelay": "", + "text.autoconfig.skyblocker.option.slayer.vampireSlayer.holyIceUpdateFrequency": "", + "text.autoconfig.skyblocker.option.slayer.vampireSlayer.holyIceUpdateFrequency.@Tooltip": "", + "text.autoconfig.skyblocker.option.slayer.vampireSlayer.enableHealingMelonIndicator": "", + "text.autoconfig.skyblocker.option.slayer.vampireSlayer.healingMelonHealthThreshold": "", + "text.autoconfig.skyblocker.option.slayer.vampireSlayer.enableSteakStakeIndicator": "", + "text.autoconfig.skyblocker.option.slayer.vampireSlayer.steakStakeUpdateFrequency": "", + "text.autoconfig.skyblocker.option.slayer.vampireSlayer.steakStakeUpdateFrequency.@Tooltip": "", + "text.autoconfig.skyblocker.option.slayer.vampireSlayer.enableManiaIndicator": "", + "text.autoconfig.skyblocker.option.slayer.vampireSlayer.maniaUpdateFrequency": "", + "text.autoconfig.skyblocker.option.slayer.vampireSlayer.maniaUpdateFrequency.@Tooltip": "", + "text.autoconfig.skyblocker.option.general.hideEmptyTooltips": "", + "text.autoconfig.skyblocker.option.general.hideStatusEffectOverlay": "", + "skyblocker.updaterepository.failed": "", + "skyblocker.dungeons.secrets.physicalEntranceNotFound": "", + "skyblocker.dungeons.secrets.markSecretFound": "", + "skyblocker.dungeons.secrets.markSecretMissing": "", + "skyblocker.dungeons.secrets.markSecretFoundUnable": "", + "skyblocker.dungeons.secrets.markSecretMissingUnable": "", + "skyblocker.fishing.reelNow": "", + "skyblocker.rift.healNow": "", + "skyblocker.rift.iceNow": "", + "skyblocker.rift.mania": "", + "skyblocker.rift.stakeNow": "", + "skyblocker.fairySouls.markAllFound": "", + "skyblocker.fairySouls.markAllMissing": "", + "skyblocker.relics.markAllFound": "", + "skyblocker.relics.markAllMissing": "", + "skyblocker.shortcuts.config": "", + "skyblocker.shortcuts.notLoaded": "", + "skyblocker.shortcuts.command.target": "", + "skyblocker.shortcuts.command.replacement": "", + "skyblocker.shortcuts.commandArg.target": "", + "skyblocker.shortcuts.commandArg.replacement": "", + "skyblocker.shortcuts.commandArg.tooltip": "", + "skyblocker.shortcuts.deleteQuestion": "", + "skyblocker.shortcuts.deleteWarning": "", + "skyblocker.shortcuts.new": "", + "skyblocker.shortcuts.commandSuggestionTooltip": "", + "skyblocker.customItemNames.removed": "", + "skyblocker.customItemNames.neverHad": "", + "skyblocker.customItemNames.added": "", + "skyblocker.customItemNames.noItemUuid": "", + "skyblocker.customItemNames.unableToSetName": "", + "skyblocker.customDyeColors.invalidHex": "", + "skyblocker.customDyeColors.notDyeable": "", + "skyblocker.customDyeColors.removed": "", + "skyblocker.customDyeColors.neverHad": "", + "skyblocker.customDyeColors.added": "", + "skyblocker.customDyeColors.noItemUuid": "", + "skyblocker.customDyeColors.unableToSetColor": "", + "skyblocker.customArmorTrims.invalidMaterialOrPattern": "", + "skyblocker.customArmorTrims.notAnArmorPiece": "", + "skyblocker.customArmorTrims.removed": "", + "skyblocker.customArmorTrims.neverHad": "", + "skyblocker.customArmorTrims.added": "", + "skyblocker.customArmorTrims.noItemUuid": "", + "skyblocker.customArmorTrims.unableToSetTrim": "", + "skyblocker.quiverWarning.50Left": "", + "skyblocker.quiverWarning.10Left": "", + "skyblocker.quiverWarning.empty": "", + "emi.category.skyblocker.skyblock": "" +} -- cgit From e2142dfe250c110dd970a373f8e930fceb847fb3 Mon Sep 17 00:00:00 2001 From: Weblate Date: Fri, 22 Sep 2023 22:22:20 +0200 Subject: Update translation files Updated by "Remove blank strings" hook in Weblate. Translation: Skyblocker/Skyblocker Translate-URL: https://translate.hysky.de/projects/Skyblocker/skyblocker/ --- .../resources/assets/skyblocker/lang/pt_br.json | 367 +-------------------- 1 file changed, 1 insertion(+), 366 deletions(-) diff --git a/src/main/resources/assets/skyblocker/lang/pt_br.json b/src/main/resources/assets/skyblocker/lang/pt_br.json index 95367382..0967ef42 100644 --- a/src/main/resources/assets/skyblocker/lang/pt_br.json +++ b/src/main/resources/assets/skyblocker/lang/pt_br.json @@ -1,366 +1 @@ -{ - "key.categories.skyblocker": "", - "key.hotbarSlotLock": "", - "key.skyblocker.toggleB": "", - "key.skyblocker.defaultTgl": "", - "key.skyblocker.toggleA": "", - "key.wikiLookup": "", - "text.autoconfig.skyblocker.title": "", - "text.autoconfig.skyblocker.category.general": "", - "text.autoconfig.skyblocker.option.general.bars": "", - "text.autoconfig.skyblocker.option.general.bars.enableBars": "", - "text.autoconfig.skyblocker.option.general.bars.barpositions": "", - "text.autoconfig.skyblocker.option.general.bars.barpositions.LAYER1": "", - "text.autoconfig.skyblocker.option.general.bars.barpositions.LAYER2": "", - "text.autoconfig.skyblocker.option.general.bars.barpositions.RIGHT": "", - "text.autoconfig.skyblocker.option.general.bars.barpositions.NONE": "", - "text.autoconfig.skyblocker.option.general.bars.barpositions.healthBarPosition": "", - "text.autoconfig.skyblocker.option.general.bars.barpositions.manaBarPosition": "", - "text.autoconfig.skyblocker.option.general.bars.barpositions.defenceBarPosition": "", - "text.autoconfig.skyblocker.option.general.bars.barpositions.experienceBarPosition": "", - "text.autoconfig.skyblocker.option.general.experiments": "", - "text.autoconfig.skyblocker.option.general.experiments.enableChronomatronSolver": "", - "text.autoconfig.skyblocker.option.general.experiments.enableSuperpairsSolver": "", - "text.autoconfig.skyblocker.option.general.experiments.enableUltrasequencerSolver": "", - "text.autoconfig.skyblocker.option.general.acceptReparty": "", - "text.autoconfig.skyblocker.option.general.etherwarpOverlay": "", - "text.autoconfig.skyblocker.option.general.fishing": "", - "text.autoconfig.skyblocker.option.general.fishing.enableFishingHelper": "", - "text.autoconfig.skyblocker.option.general.fairySouls": "", - "text.autoconfig.skyblocker.option.general.fairySouls.enableFairySoulsHelper": "", - "text.autoconfig.skyblocker.option.general.fairySouls.highlightFoundSouls": "", - "text.autoconfig.skyblocker.option.general.fairySouls.highlightOnlyNearbySouls": "", - "text.autoconfig.skyblocker.option.general.fairySouls.highlightOnlyNearbySouls.@Tooltip": "", - "text.autoconfig.skyblocker.option.general.shortcuts": "", - "text.autoconfig.skyblocker.option.general.shortcuts.enableShortcuts": "", - "text.autoconfig.skyblocker.option.general.shortcuts.enableShortcuts.@Tooltip": "", - "text.autoconfig.skyblocker.option.general.shortcuts.enableCommandShortcuts": "", - "text.autoconfig.skyblocker.option.general.shortcuts.enableCommandShortcuts.@Tooltip": "", - "text.autoconfig.skyblocker.option.general.shortcuts.enableCommandArgShortcuts": "", - "text.autoconfig.skyblocker.option.general.shortcuts.enableCommandArgShortcuts.@Tooltip": "", - "text.autoconfig.skyblocker.option.general.quiverWarning": "", - "text.autoconfig.skyblocker.option.general.quiverWarning.enableQuiverWarning": "", - "text.autoconfig.skyblocker.option.general.quiverWarning.enableQuiverWarningInDungeons": "", - "text.autoconfig.skyblocker.option.general.quiverWarning.enableQuiverWarningAfterDungeon": "", - "text.autoconfig.skyblocker.option.general.backpackPreviewWithoutShift": "", - "text.autoconfig.skyblocker.option.general.compactorDeletorPreview": "", - "text.autoconfig.skyblocker.option.general.tabHud": "", - "text.autoconfig.skyblocker.option.general.tabHud.tabHudEnabled": "", - "text.autoconfig.skyblocker.option.general.tabHud.tabHudScale": "", - "text.autoconfig.skyblocker.option.general.tabHud.tabHudScale.@Tooltip": "", - "text.autoconfig.skyblocker.option.general.tabHud.plainPlayerNames": "", - "text.autoconfig.skyblocker.option.general.tabHud.plainPlayerNames.@Tooltip": "", - "text.autoconfig.skyblocker.option.general.tabHud.nameSorting": "", - "text.autoconfig.skyblocker.option.general.tabHud.nameSorting.@Tooltip": "", - "text.autoconfig.skyblocker.option.general.itemTooltip": "", - "text.autoconfig.skyblocker.option.general.itemTooltip.enableNPCPrice": "", - "text.autoconfig.skyblocker.option.general.itemTooltip.enableMotesPrice": "", - "text.autoconfig.skyblocker.option.general.itemTooltip.enableMotesPrice.@Tooltip": "", - "text.autoconfig.skyblocker.option.general.itemTooltip.enableAvgBIN": "", - "text.autoconfig.skyblocker.option.general.itemTooltip.avg": "", - "text.autoconfig.skyblocker.option.general.itemTooltip.avg.@Tooltip": "", - "text.autoconfig.skyblocker.option.general.itemTooltip.avg.ONE_DAY": "", - "text.autoconfig.skyblocker.option.general.itemTooltip.avg.THREE_DAY": "", - "text.autoconfig.skyblocker.option.general.itemTooltip.avg.BOTH": "", - "text.autoconfig.skyblocker.option.general.itemTooltip.enableLowestBIN": "", - "text.autoconfig.skyblocker.option.general.itemTooltip.enableBazaarPrice": "", - "text.autoconfig.skyblocker.option.general.itemTooltip.enableMuseumDate": "", - "text.autoconfig.skyblocker.option.general.itemInfoDisplay": "", - "text.autoconfig.skyblocker.option.general.itemInfoDisplay.attributeShardInfo": "", - "text.autoconfig.skyblocker.option.general.itemInfoDisplay.attributeShardInfo.@Tooltip": "", - "text.autoconfig.skyblocker.option.general.specialEffects": "", - "text.autoconfig.skyblocker.option.general.specialEffects.rareDungeonDropEffects": "", - "text.autoconfig.skyblocker.option.general.specialEffects.rareDungeonDropEffects.@Tooltip": "", - "text.autoconfig.skyblocker.option.general.hitbox": "", - "text.autoconfig.skyblocker.option.general.hitbox.oldFarmlandHitbox": "", - "text.autoconfig.skyblocker.option.general.hitbox.oldLeverHitbox": "", - "text.autoconfig.skyblocker.option.general.titleContainer": "", - "text.autoconfig.skyblocker.option.general.titleContainer.@Tooltip": "", - "text.autoconfig.skyblocker.option.general.titleContainer.titleContainerScale": "", - "text.autoconfig.skyblocker.option.general.titleContainer.x": "", - "text.autoconfig.skyblocker.option.general.titleContainer.y": "", - "text.autoconfig.skyblocker.option.general.titleContainer.direction": "", - "text.autoconfig.skyblocker.option.general.titleContainer.alignment": "", - "text.autoconfig.skyblocker.option.general.teleportOverlay": "", - "text.autoconfig.skyblocker.option.general.teleportOverlay.enableTeleportOverlays": "", - "text.autoconfig.skyblocker.option.general.teleportOverlay.enableWeirdTransmission": "", - "text.autoconfig.skyblocker.option.general.teleportOverlay.enableInstantTransmission": "", - "text.autoconfig.skyblocker.option.general.teleportOverlay.enableEtherTransmission": "", - "text.autoconfig.skyblocker.option.general.teleportOverlay.enableSinrecallTransmission": "", - "text.autoconfig.skyblocker.option.general.teleportOverlay.enableWitherImpact": "", - "skyblocker.itemTooltip.nullMessage": "", - "skyblocker.itemTooltip.noData": "", - "text.autoconfig.skyblocker.category.richPresence": "", - "text.autoconfig.skyblocker.option.richPresence.info": "", - "text.autoconfig.skyblocker.option.richPresence.info.PURSE": "", - "text.autoconfig.skyblocker.option.richPresence.info.BITS": "", - "text.autoconfig.skyblocker.option.richPresence.info.LOCATION": "", - "text.autoconfig.skyblocker.option.richPresence.info.@Tooltip": "", - "text.autoconfig.skyblocker.option.richPresence.cycleMode": "", - "text.autoconfig.skyblocker.option.richPresence.enableRichPresence": "", - "text.autoconfig.skyblocker.option.richPresence.customMessage": "", - "text.autoconfig.skyblocker.category.quickNav": "", - "text.autoconfig.skyblocker.option.quickNav.enableQuickNav": "", - "text.autoconfig.skyblocker.option.quickNav.button1": "", - "text.autoconfig.skyblocker.option.quickNav.button1.render": "", - "text.autoconfig.skyblocker.option.quickNav.button1.item": "", - "text.autoconfig.skyblocker.option.quickNav.button1.item.itemName": "", - "text.autoconfig.skyblocker.option.quickNav.button1.item.count": "", - "text.autoconfig.skyblocker.option.quickNav.button1.item.nbt": "", - "text.autoconfig.skyblocker.option.quickNav.button1.uiTitle": "", - "text.autoconfig.skyblocker.option.quickNav.button1.clickEvent": "", - "text.autoconfig.skyblocker.option.quickNav.button2": "", - "text.autoconfig.skyblocker.option.quickNav.button2.render": "", - "text.autoconfig.skyblocker.option.quickNav.button2.item": "", - "text.autoconfig.skyblocker.option.quickNav.button2.item.itemName": "", - "text.autoconfig.skyblocker.option.quickNav.button2.item.count": "", - "text.autoconfig.skyblocker.option.quickNav.button2.item.nbt": "", - "text.autoconfig.skyblocker.option.quickNav.button2.uiTitle": "", - "text.autoconfig.skyblocker.option.quickNav.button2.clickEvent": "", - "text.autoconfig.skyblocker.option.quickNav.button3": "", - "text.autoconfig.skyblocker.option.quickNav.button3.render": "", - "text.autoconfig.skyblocker.option.quickNav.button3.item": "", - "text.autoconfig.skyblocker.option.quickNav.button3.item.itemName": "", - "text.autoconfig.skyblocker.option.quickNav.button3.item.count": "", - "text.autoconfig.skyblocker.option.quickNav.button3.item.nbt": "", - "text.autoconfig.skyblocker.option.quickNav.button3.uiTitle": "", - "text.autoconfig.skyblocker.option.quickNav.button3.clickEvent": "", - "text.autoconfig.skyblocker.option.quickNav.button4": "", - "text.autoconfig.skyblocker.option.quickNav.button4.render": "", - "text.autoconfig.skyblocker.option.quickNav.button4.item": "", - "text.autoconfig.skyblocker.option.quickNav.button4.item.itemName": "", - "text.autoconfig.skyblocker.option.quickNav.button4.item.count": "", - "text.autoconfig.skyblocker.option.quickNav.button4.item.nbt": "", - "text.autoconfig.skyblocker.option.quickNav.button4.uiTitle": "", - "text.autoconfig.skyblocker.option.quickNav.button4.clickEvent": "", - "text.autoconfig.skyblocker.option.quickNav.button5": "", - "text.autoconfig.skyblocker.option.quickNav.button5.render": "", - "text.autoconfig.skyblocker.option.quickNav.button5.item": "", - "text.autoconfig.skyblocker.option.quickNav.button5.item.itemName": "", - "text.autoconfig.skyblocker.option.quickNav.button5.item.count": "", - "text.autoconfig.skyblocker.option.quickNav.button5.item.nbt": "", - "text.autoconfig.skyblocker.option.quickNav.button5.uiTitle": "", - "text.autoconfig.skyblocker.option.quickNav.button5.clickEvent": "", - "text.autoconfig.skyblocker.option.quickNav.button6": "", - "text.autoconfig.skyblocker.option.quickNav.button6.render": "", - "text.autoconfig.skyblocker.option.quickNav.button6.item": "", - "text.autoconfig.skyblocker.option.quickNav.button6.item.itemName": "", - "text.autoconfig.skyblocker.option.quickNav.button6.item.count": "", - "text.autoconfig.skyblocker.option.quickNav.button6.item.nbt": "", - "text.autoconfig.skyblocker.option.quickNav.button6.uiTitle": "", - "text.autoconfig.skyblocker.option.quickNav.button6.clickEvent": "", - "text.autoconfig.skyblocker.option.quickNav.button7": "", - "text.autoconfig.skyblocker.option.quickNav.button7.render": "", - "text.autoconfig.skyblocker.option.quickNav.button7.item": "", - "text.autoconfig.skyblocker.option.quickNav.button7.item.itemName": "", - "text.autoconfig.skyblocker.option.quickNav.button7.item.count": "", - "text.autoconfig.skyblocker.option.quickNav.button7.item.nbt": "", - "text.autoconfig.skyblocker.option.quickNav.button7.uiTitle": "", - "text.autoconfig.skyblocker.option.quickNav.button7.clickEvent": "", - "text.autoconfig.skyblocker.option.quickNav.button8": "", - "text.autoconfig.skyblocker.option.quickNav.button8.render": "", - "text.autoconfig.skyblocker.option.quickNav.button8.item": "", - "text.autoconfig.skyblocker.option.quickNav.button8.item.itemName": "", - "text.autoconfig.skyblocker.option.quickNav.button8.item.count": "", - "text.autoconfig.skyblocker.option.quickNav.button8.item.nbt": "", - "text.autoconfig.skyblocker.option.quickNav.button8.uiTitle": "", - "text.autoconfig.skyblocker.option.quickNav.button8.clickEvent": "", - "text.autoconfig.skyblocker.option.quickNav.button9": "", - "text.autoconfig.skyblocker.option.quickNav.button9.render": "", - "text.autoconfig.skyblocker.option.quickNav.button9.item": "", - "text.autoconfig.skyblocker.option.quickNav.button9.item.itemName": "", - "text.autoconfig.skyblocker.option.quickNav.button9.item.count": "", - "text.autoconfig.skyblocker.option.quickNav.button9.item.nbt": "", - "text.autoconfig.skyblocker.option.quickNav.button9.uiTitle": "", - "text.autoconfig.skyblocker.option.quickNav.button9.clickEvent": "", - "text.autoconfig.skyblocker.option.quickNav.button10": "", - "text.autoconfig.skyblocker.option.quickNav.button10.render": "", - "text.autoconfig.skyblocker.option.quickNav.button10.item": "", - "text.autoconfig.skyblocker.option.quickNav.button10.item.itemName": "", - "text.autoconfig.skyblocker.option.quickNav.button10.item.count": "", - "text.autoconfig.skyblocker.option.quickNav.button10.item.nbt": "", - "text.autoconfig.skyblocker.option.quickNav.button10.uiTitle": "", - "text.autoconfig.skyblocker.option.quickNav.button10.clickEvent": "", - "text.autoconfig.skyblocker.option.quickNav.button11": "", - "text.autoconfig.skyblocker.option.quickNav.button11.render": "", - "text.autoconfig.skyblocker.option.quickNav.button11.item": "", - "text.autoconfig.skyblocker.option.quickNav.button11.item.itemName": "", - "text.autoconfig.skyblocker.option.quickNav.button11.item.count": "", - "text.autoconfig.skyblocker.option.quickNav.button11.item.nbt": "", - "text.autoconfig.skyblocker.option.quickNav.button11.uiTitle": "", - "text.autoconfig.skyblocker.option.quickNav.button11.clickEvent": "", - "text.autoconfig.skyblocker.option.quickNav.button12": "", - "text.autoconfig.skyblocker.option.quickNav.button12.render": "", - "text.autoconfig.skyblocker.option.quickNav.button12.item": "", - "text.autoconfig.skyblocker.option.quickNav.button12.item.itemName": "", - "text.autoconfig.skyblocker.option.quickNav.button12.item.count": "", - "text.autoconfig.skyblocker.option.quickNav.button12.item.nbt": "", - "text.autoconfig.skyblocker.option.quickNav.button12.uiTitle": "", - "text.autoconfig.skyblocker.option.quickNav.button12.clickEvent": "", - "text.autoconfig.skyblocker.option.general.itemList": "", - "text.autoconfig.skyblocker.option.general.itemList.enableItemList": "", - "text.autoconfig.skyblocker.category.locations": "", - "text.autoconfig.skyblocker.option.locations.barn": "", - "text.autoconfig.skyblocker.option.locations.barn.solveHungryHiker": "", - "text.autoconfig.skyblocker.option.locations.barn.solveTreasureHunter": "", - "text.autoconfig.skyblocker.option.locations.spidersDen": "", - "text.autoconfig.skyblocker.option.locations.spidersDen.relics": "", - "text.autoconfig.skyblocker.option.locations.spidersDen.relics.enableRelicsHelper": "", - "text.autoconfig.skyblocker.option.locations.spidersDen.relics.highlightFoundRelics": "", - "text.autoconfig.skyblocker.option.locations.dungeons": "", - "text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints": "", - "text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.enableSecretWaypoints": "", - "text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.noInitSecretWaypoints": "", - "text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.noInitSecretWaypoints.@Tooltip": "", - "text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.enableEntranceWaypoints": "", - "text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.enableSuperboomWaypoints": "", - "text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.enableChestWaypoints": "", - "text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.enableItemWaypoints": "", - "text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.enableBatWaypoints": "", - "text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.enableWitherWaypoints": "", - "text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.enableLeverWaypoints": "", - "text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.enableFairySoulWaypoints": "", - "text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.enableStonkWaypoints": "", - "text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.enableDefaultWaypoints": "", - "text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.enableDefaultWaypoints.@Tooltip": "", - "text.autoconfig.skyblocker.option.locations.dungeons.dungeonChestProfit": "", - "text.autoconfig.skyblocker.option.locations.dungeons.dungeonChestProfit.enableProfitCalculator": "", - "text.autoconfig.skyblocker.option.locations.dungeons.dungeonChestProfit.enableProfitCalculator.@Tooltip": "", - "text.autoconfig.skyblocker.option.locations.dungeons.dungeonChestProfit.includeKismet": "", - "text.autoconfig.skyblocker.option.locations.dungeons.dungeonChestProfit.includeKismet.@Tooltip": "", - "text.autoconfig.skyblocker.option.locations.dungeons.dungeonChestProfit.includeEssence": "", - "text.autoconfig.skyblocker.option.locations.dungeons.dungeonChestProfit.includeEssence.@Tooltip": "", - "text.autoconfig.skyblocker.option.locations.dungeons.dungeonChestProfit.neutralThreshold": "", - "text.autoconfig.skyblocker.option.locations.dungeons.dungeonChestProfit.neutralThreshold.@Tooltip": "", - "text.autoconfig.skyblocker.option.locations.dungeons.dungeonChestProfit.neutralColor": "", - "text.autoconfig.skyblocker.option.locations.dungeons.dungeonChestProfit.profitColor": "", - "text.autoconfig.skyblocker.option.locations.dungeons.dungeonChestProfit.lossColor": "", - "text.autoconfig.skyblocker.option.locations.dungeons.dungeonChestProfit.incompleteColor": "", - "text.autoconfig.skyblocker.option.locations.dungeons.dungeonChestProfit.incompleteColor.@Tooltip": "", - "text.autoconfig.skyblocker.option.locations.dungeons.croesusHelper": "", - "text.autoconfig.skyblocker.option.locations.dungeons.croesusHelper.@Tooltip": "", - "text.autoconfig.skyblocker.option.locations.dungeons.enableMap": "", - "text.autoconfig.skyblocker.option.locations.dungeons.mapScaling": "", - "text.autoconfig.skyblocker.option.locations.dungeons.mapX": "", - "text.autoconfig.skyblocker.option.locations.dungeons.mapY": "", - "text.autoconfig.skyblocker.option.locations.dungeons.starredMobGlow": "", - "text.autoconfig.skyblocker.option.locations.dungeons.starredMobGlow.@Tooltip": "", - "text.autoconfig.skyblocker.option.locations.dungeons.solveThreeWeirdos": "", - "text.autoconfig.skyblocker.option.locations.dungeons.blazesolver": "", - "text.autoconfig.skyblocker.option.locations.dungeons.blazesolver.@Tooltip": "", - "text.autoconfig.skyblocker.option.locations.dungeons.solveTrivia": "", - "text.autoconfig.skyblocker.option.locations.dungeons.solveTicTacToe": "", - "text.autoconfig.skyblocker.option.locations.dungeons.solveTicTacToe.@Tooltip": "", - "text.autoconfig.skyblocker.option.locations.dungeons.lividColor": "", - "text.autoconfig.skyblocker.option.locations.dungeons.lividColor.enableLividColor": "", - "text.autoconfig.skyblocker.option.locations.dungeons.lividColor.enableLividColor.@Tooltip": "", - "text.autoconfig.skyblocker.option.locations.dungeons.lividColor.lividColorText": "", - "text.autoconfig.skyblocker.option.locations.dungeons.lividColor.lividColorText.@Tooltip": "", - "text.autoconfig.skyblocker.option.locations.dungeons.terminals": "", - "text.autoconfig.skyblocker.option.locations.dungeons.terminals.solveColor": "", - "text.autoconfig.skyblocker.option.locations.dungeons.terminals.solveOrder": "", - "text.autoconfig.skyblocker.option.locations.dungeons.terminals.solveStartsWith": "", - "text.autoconfig.skyblocker.option.locations.dwarvenMines": "", - "text.autoconfig.skyblocker.option.locations.dwarvenMines.enableDrillFuel": "", - "text.autoconfig.skyblocker.option.locations.dwarvenMines.solveFetchur": "", - "text.autoconfig.skyblocker.option.locations.dwarvenMines.solvePuzzler": "", - "text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud": "", - "text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.enabled": "", - "text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.style": "", - "text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.style.@Tooltip[0]": "", - "text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.style.@Tooltip[1]": "", - "text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.style.@Tooltip[2]": "", - "text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.enableBackground": "", - "text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.x": "", - "text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.y": "", - "text.autoconfig.skyblocker.option.locations.rift": "", - "text.autoconfig.skyblocker.option.locations.rift.mirrorverseWaypoints": "", - "text.autoconfig.skyblocker.option.locations.rift.mcGrubberStacks": "", - "text.autoconfig.skyblocker.option.locations.rift.mcGrubberStacks.@Tooltip": "", - "text.autoconfig.skyblocker.category.messages": "", - "text.autoconfig.skyblocker.option.messages.chatFilterResult.PASS": "", - "text.autoconfig.skyblocker.option.messages.chatFilterResult.FILTER": "", - "text.autoconfig.skyblocker.option.messages.chatFilterResult.ACTION_BAR": "", - "text.autoconfig.skyblocker.option.messages.hideAbility": "", - "text.autoconfig.skyblocker.option.messages.hideHeal": "", - "text.autoconfig.skyblocker.option.messages.hideAOTE": "", - "text.autoconfig.skyblocker.option.messages.hideImplosion": "", - "text.autoconfig.skyblocker.option.messages.hideMoltenWave": "", - "text.autoconfig.skyblocker.option.messages.hideAds": "", - "text.autoconfig.skyblocker.option.messages.hideTeleportPad": "", - "text.autoconfig.skyblocker.option.messages.hideCombo": "", - "text.autoconfig.skyblocker.option.messages.hideAutopet": "", - "text.autoconfig.skyblocker.option.messages.hideMana": "", - "text.autoconfig.skyblocker.option.messages.hideMana.@Tooltip": "", - "text.autoconfig.skyblocker.option.messages.hideShowOff": "", - "text.autoconfig.skyblocker.option.messages.hideShowOff.@Tooltip": "", - "text.autoconfig.skyblocker.category.slayer": "", - "text.autoconfig.skyblocker.option.slayer.vampireSlayer": "", - "text.autoconfig.skyblocker.option.slayer.vampireSlayer.enableEffigyWaypoints": "", - "text.autoconfig.skyblocker.option.slayer.vampireSlayer.compactEffigyWaypoints": "", - "text.autoconfig.skyblocker.option.slayer.vampireSlayer.effigyUpdateFrequency": "", - "text.autoconfig.skyblocker.option.slayer.vampireSlayer.effigyUpdateFrequency.@Tooltip": "", - "text.autoconfig.skyblocker.option.slayer.vampireSlayer.enableHolyIceIndicator": "", - "text.autoconfig.skyblocker.option.slayer.vampireSlayer.holyIceIndicatorTickDelay": "", - "text.autoconfig.skyblocker.option.slayer.vampireSlayer.holyIceUpdateFrequency": "", - "text.autoconfig.skyblocker.option.slayer.vampireSlayer.holyIceUpdateFrequency.@Tooltip": "", - "text.autoconfig.skyblocker.option.slayer.vampireSlayer.enableHealingMelonIndicator": "", - "text.autoconfig.skyblocker.option.slayer.vampireSlayer.healingMelonHealthThreshold": "", - "text.autoconfig.skyblocker.option.slayer.vampireSlayer.enableSteakStakeIndicator": "", - "text.autoconfig.skyblocker.option.slayer.vampireSlayer.steakStakeUpdateFrequency": "", - "text.autoconfig.skyblocker.option.slayer.vampireSlayer.steakStakeUpdateFrequency.@Tooltip": "", - "text.autoconfig.skyblocker.option.slayer.vampireSlayer.enableManiaIndicator": "", - "text.autoconfig.skyblocker.option.slayer.vampireSlayer.maniaUpdateFrequency": "", - "text.autoconfig.skyblocker.option.slayer.vampireSlayer.maniaUpdateFrequency.@Tooltip": "", - "text.autoconfig.skyblocker.option.general.hideEmptyTooltips": "", - "text.autoconfig.skyblocker.option.general.hideStatusEffectOverlay": "", - "skyblocker.updaterepository.failed": "", - "skyblocker.dungeons.secrets.physicalEntranceNotFound": "", - "skyblocker.dungeons.secrets.markSecretFound": "", - "skyblocker.dungeons.secrets.markSecretMissing": "", - "skyblocker.dungeons.secrets.markSecretFoundUnable": "", - "skyblocker.dungeons.secrets.markSecretMissingUnable": "", - "skyblocker.fishing.reelNow": "", - "skyblocker.rift.healNow": "", - "skyblocker.rift.iceNow": "", - "skyblocker.rift.mania": "", - "skyblocker.rift.stakeNow": "", - "skyblocker.fairySouls.markAllFound": "", - "skyblocker.fairySouls.markAllMissing": "", - "skyblocker.relics.markAllFound": "", - "skyblocker.relics.markAllMissing": "", - "skyblocker.shortcuts.config": "", - "skyblocker.shortcuts.notLoaded": "", - "skyblocker.shortcuts.command.target": "", - "skyblocker.shortcuts.command.replacement": "", - "skyblocker.shortcuts.commandArg.target": "", - "skyblocker.shortcuts.commandArg.replacement": "", - "skyblocker.shortcuts.commandArg.tooltip": "", - "skyblocker.shortcuts.deleteQuestion": "", - "skyblocker.shortcuts.deleteWarning": "", - "skyblocker.shortcuts.new": "", - "skyblocker.shortcuts.commandSuggestionTooltip": "", - "skyblocker.customItemNames.removed": "", - "skyblocker.customItemNames.neverHad": "", - "skyblocker.customItemNames.added": "", - "skyblocker.customItemNames.noItemUuid": "", - "skyblocker.customItemNames.unableToSetName": "", - "skyblocker.customDyeColors.invalidHex": "", - "skyblocker.customDyeColors.notDyeable": "", - "skyblocker.customDyeColors.removed": "", - "skyblocker.customDyeColors.neverHad": "", - "skyblocker.customDyeColors.added": "", - "skyblocker.customDyeColors.noItemUuid": "", - "skyblocker.customDyeColors.unableToSetColor": "", - "skyblocker.customArmorTrims.invalidMaterialOrPattern": "", - "skyblocker.customArmorTrims.notAnArmorPiece": "", - "skyblocker.customArmorTrims.removed": "", - "skyblocker.customArmorTrims.neverHad": "", - "skyblocker.customArmorTrims.added": "", - "skyblocker.customArmorTrims.noItemUuid": "", - "skyblocker.customArmorTrims.unableToSetTrim": "", - "skyblocker.quiverWarning.50Left": "", - "skyblocker.quiverWarning.10Left": "", - "skyblocker.quiverWarning.empty": "", - "emi.category.skyblocker.skyblock": "" -} +{} -- cgit From 1a4e6abc9c690085782b7cb66e0720c8dd474327 Mon Sep 17 00:00:00 2001 From: oreto Date: Fri, 22 Sep 2023 20:25:22 +0000 Subject: Translated using Weblate (Portuguese (Brazil)) Currently translated at 17.0% (62 of 364 strings) Translation: Skyblocker/Skyblocker Translate-URL: https://translate.hysky.de/projects/Skyblocker/skyblocker/pt_BR/ --- .../resources/assets/skyblocker/lang/pt_br.json | 66 +++++++++++++++++++++- 1 file changed, 65 insertions(+), 1 deletion(-) diff --git a/src/main/resources/assets/skyblocker/lang/pt_br.json b/src/main/resources/assets/skyblocker/lang/pt_br.json index 0967ef42..708e009f 100644 --- a/src/main/resources/assets/skyblocker/lang/pt_br.json +++ b/src/main/resources/assets/skyblocker/lang/pt_br.json @@ -1 +1,65 @@ -{} +{ + "key.skyblocker.toggleB": "Alternar HUD da tab para tela B", + "key.skyblocker.defaultTgl": "Trocar HUD da tab para padrão", + "key.skyblocker.toggleA": "Alternar HUD da tab para tela A", + "key.wikiLookup": "Olhar na Wiki", + "text.autoconfig.skyblocker.category.general": "Geral", + "text.autoconfig.skyblocker.option.general.bars": "Barra de Vida, Mana, Defesa & XP", + "text.autoconfig.skyblocker.option.general.bars.enableBars": "Ativar Barras", + "text.autoconfig.skyblocker.option.general.bars.barpositions.LAYER1": "Camada 1", + "text.autoconfig.skyblocker.option.general.bars.barpositions.LAYER2": "Camada 2", + "text.autoconfig.skyblocker.option.general.bars.barpositions.RIGHT": "Direita", + "text.autoconfig.skyblocker.option.general.bars.barpositions.NONE": "Desativado", + "text.autoconfig.skyblocker.option.general.bars.barpositions.healthBarPosition": "Posição da Barra de Vida", + "text.autoconfig.skyblocker.option.general.bars.barpositions.defenceBarPosition": "Posição da Barra de Defesa", + "text.autoconfig.skyblocker.option.general.bars.barpositions.experienceBarPosition": "Posição da Barra de Experiência", + "text.autoconfig.skyblocker.option.general.experiments": "Solucionador de Experimentos", + "text.autoconfig.skyblocker.option.general.experiments.enableSuperpairsSolver": "Ativar Solucionador de Superpairs", + "text.autoconfig.skyblocker.option.general.experiments.enableUltrasequencerSolver": "Ativar Solucionador de Ultrasequencer", + "text.autoconfig.skyblocker.option.general.tabHud.nameSorting": "Método de Organizar Nome de Player", + "text.autoconfig.skyblocker.option.general.itemTooltip.enableMotesPrice": "Ativar Preço de Motes", + "text.autoconfig.skyblocker.option.general.itemTooltip.enableNPCPrice": "Ativar Preço de NPC", + "text.autoconfig.skyblocker.option.general.specialEffects.rareDungeonDropEffects.@Tooltip": "Adiciona um efeito especial visual acionado quando é obtido um loot raro de dungeon!", + "text.autoconfig.skyblocker.option.general.hitbox.oldFarmlandHitbox": "Ativar hitbox de farmland do 1.8", + "text.autoconfig.skyblocker.option.general.hitbox.oldLeverHitbox": "Ativar hitbox de alavanca do 1.8", + "text.autoconfig.skyblocker.option.general.titleContainer": "Contêiner de Título", + "text.autoconfig.skyblocker.option.general.titleContainer.titleContainerScale": "Escala de Contêiner de Título", + "text.autoconfig.skyblocker.option.general.titleContainer.x": "Posição X do Contêiner de Título", + "text.autoconfig.skyblocker.option.general.titleContainer.y": "Posição Y do Contêiner de Título", + "text.autoconfig.skyblocker.option.general.titleContainer.alignment": "Alinhamento Horizontal do Contêiner de Título", + "text.autoconfig.skyblocker.option.general.teleportOverlay": "Overlay de Teleporte", + "text.autoconfig.skyblocker.option.general.teleportOverlay.enableWeirdTransmission": "Ativar Overlay de Transmissão Estranho", + "text.autoconfig.skyblocker.option.general.teleportOverlay.enableInstantTransmission": "Ativar Overlay de Transmissão Instantâneo", + "text.autoconfig.skyblocker.option.general.teleportOverlay.enableSinrecallTransmission": "Ativar Overlay de Transmissão de Sinrecall", + "text.autoconfig.skyblocker.option.general.teleportOverlay.enableWitherImpact": "Ativar Overlay de Impacto de Wither", + "skyblocker.itemTooltip.noData": "§cSem Dados", + "text.autoconfig.skyblocker.option.richPresence.info": "Informação do Skyblock", + "text.autoconfig.skyblocker.option.richPresence.info.PURSE": "BOLSA", + "text.autoconfig.skyblocker.option.richPresence.info.@Tooltip": "Esse valor não importa se você está passando por um ciclo", + "text.autoconfig.skyblocker.option.richPresence.cycleMode": "Informação de Ciclo do Skyblock", + "text.autoconfig.skyblocker.option.richPresence.enableRichPresence": "Ativado", + "text.autoconfig.skyblocker.option.richPresence.customMessage": "Mensagem Personalizada", + "text.autoconfig.skyblocker.option.quickNav.enableQuickNav": "Ativar Navegação Rápida", + "text.autoconfig.skyblocker.option.quickNav.button1": "Botão 1", + "text.autoconfig.skyblocker.option.quickNav.button1.render": "Renderizar", + "key.hotbarSlotLock": "Trancar Slot (Hotbar)", + "text.autoconfig.skyblocker.title": "Configurações do Skyblocker", + "text.autoconfig.skyblocker.option.general.bars.barpositions": "Configurar Posições das Barras", + "text.autoconfig.skyblocker.option.general.bars.barpositions.manaBarPosition": "Posição da Barra de Mana", + "text.autoconfig.skyblocker.option.general.experiments.enableChronomatronSolver": "Ativar Solucionador de Chronomatron", + "text.autoconfig.skyblocker.option.general.acceptReparty": "Aceitar Automaticamente Reparty", + "text.autoconfig.skyblocker.option.general.shortcuts": "Atalhos", + "text.autoconfig.skyblocker.option.general.shortcuts.enableShortcuts": "Ativar Atalhos", + "text.autoconfig.skyblocker.option.general.tabHud.plainPlayerNames": "Nomes de Players Simples", + "text.autoconfig.skyblocker.option.general.tabHud.plainPlayerNames.@Tooltip": "Ative para mostrar nomes de player sem formatação especial em ilhas publicas.", + "text.autoconfig.skyblocker.option.general.specialEffects": "Efeitos Especial", + "text.autoconfig.skyblocker.option.general.specialEffects.rareDungeonDropEffects": "Efeito de Drop Raro de Dungeon", + "text.autoconfig.skyblocker.option.general.titleContainer.@Tooltip": "Usado para mostrar vários títulos de uma vez, Exemplo de uso: Vampire Slayer", + "text.autoconfig.skyblocker.option.general.titleContainer.direction": "Orientação do Contêiner de Título", + "text.autoconfig.skyblocker.option.general.teleportOverlay.enableTeleportOverlays": "Ativar Overlays de Teleporte", + "text.autoconfig.skyblocker.option.general.teleportOverlay.enableEtherTransmission": "Ativar Overlay de Transmissão Éter", + "skyblocker.itemTooltip.nullMessage": "§b[§6Skyblocker§b] §cA Informação do preço do item no tooltip irá se renovar no máximo 60 segundos. Caso contrário, cheque \"latest.log\"", + "text.autoconfig.skyblocker.option.richPresence.info.LOCATION": "LOCALIZAÇÃO", + "text.autoconfig.skyblocker.category.quickNav": "Navegação Rápida", + "text.autoconfig.skyblocker.option.quickNav.button1.item.itemName": "Nome do item" +} -- cgit From 824678ff745f562c7060139f0c3522db11ee908f Mon Sep 17 00:00:00 2001 From: oreto Date: Fri, 22 Sep 2023 21:23:03 +0000 Subject: Translated using Weblate (Portuguese (Brazil)) Currently translated at 35.7% (130 of 364 strings) Translation: Skyblocker/Skyblocker Translate-URL: https://translate.hysky.de/projects/Skyblocker/skyblocker/pt_BR/ --- .../resources/assets/skyblocker/lang/pt_br.json | 75 +++++++++++++++++++++- 1 file changed, 74 insertions(+), 1 deletion(-) diff --git a/src/main/resources/assets/skyblocker/lang/pt_br.json b/src/main/resources/assets/skyblocker/lang/pt_br.json index 708e009f..21d0d6d4 100644 --- a/src/main/resources/assets/skyblocker/lang/pt_br.json +++ b/src/main/resources/assets/skyblocker/lang/pt_br.json @@ -61,5 +61,78 @@ "skyblocker.itemTooltip.nullMessage": "§b[§6Skyblocker§b] §cA Informação do preço do item no tooltip irá se renovar no máximo 60 segundos. Caso contrário, cheque \"latest.log\"", "text.autoconfig.skyblocker.option.richPresence.info.LOCATION": "LOCALIZAÇÃO", "text.autoconfig.skyblocker.category.quickNav": "Navegação Rápida", - "text.autoconfig.skyblocker.option.quickNav.button1.item.itemName": "Nome do item" + "text.autoconfig.skyblocker.option.quickNav.button1.item.itemName": "Nome do item", + "key.categories.skyblocker": "Skyblocker", + "text.autoconfig.skyblocker.option.general.etherwarpOverlay": "Overlay de Etherwarp", + "text.autoconfig.skyblocker.option.general.fishing": "Assistente de Pesca", + "text.autoconfig.skyblocker.option.general.fishing.enableFishingHelper": "Ativar Assistente de Pesca", + "text.autoconfig.skyblocker.option.general.fairySouls": "Assistente de Alma das Fadas", + "text.autoconfig.skyblocker.option.general.fairySouls.highlightFoundSouls": "Destacar alma das fadas encontradas", + "text.autoconfig.skyblocker.option.general.fairySouls.highlightOnlyNearbySouls": "Apenas destacar alma das fadas por perto", + "text.autoconfig.skyblocker.option.general.shortcuts.enableCommandShortcuts": "Ativar Atalhos de Comando", + "text.autoconfig.skyblocker.option.general.shortcuts.enableShortcuts.@Tooltip": "Apenas funciona no Hypixel, Edite atalhos com \"/skyblocker shortcuts\". Pelo menos uma das opções tem que está ativo para tomar efeito.", + "text.autoconfig.skyblocker.option.general.tabHud": "HUD do tab Bonito", + "text.autoconfig.skyblocker.option.general.tabHud.tabHudEnabled": "Ativar HUD do tab Bonito", + "text.autoconfig.skyblocker.option.general.itemTooltip": "Tooltip do Item", + "text.autoconfig.skyblocker.option.general.itemTooltip.enableAvgBIN": "Ativar Preço Mediano do BIN", + "text.autoconfig.skyblocker.option.general.itemTooltip.avg.THREE_DAY": "Preço de 3 dias", + "text.autoconfig.skyblocker.option.general.itemTooltip.avg.BOTH": "Ambos", + "text.autoconfig.skyblocker.option.general.itemTooltip.enableLowestBIN": "Ativar Menor Preço do BIN", + "text.autoconfig.skyblocker.option.general.itemTooltip.avg.@Tooltip": "Você pode escolher quantos dias de preço médio para ser", + "text.autoconfig.skyblocker.option.general.itemInfoDisplay": "Exibição de Informação do Item", + "text.autoconfig.skyblocker.option.general.itemInfoDisplay.attributeShardInfo": "Informação de Fragmento de Atributo", + "text.autoconfig.skyblocker.category.richPresence": "Discord Rich Presence", + "text.autoconfig.skyblocker.option.richPresence.info.BITS": "BITS", + "text.autoconfig.skyblocker.option.quickNav.button1.item": "Item", + "text.autoconfig.skyblocker.option.quickNav.button1.uiTitle": "Título de UI", + "text.autoconfig.skyblocker.option.quickNav.button1.clickEvent": "Evento de Click", + "text.autoconfig.skyblocker.option.quickNav.button2": "Botão 2", + "text.autoconfig.skyblocker.option.quickNav.button2.render": "Renderizar", + "text.autoconfig.skyblocker.option.quickNav.button1.item.nbt": "NBT", + "text.autoconfig.skyblocker.option.quickNav.button2.item.count": "Contagem de itens", + "text.autoconfig.skyblocker.option.quickNav.button2.uiTitle": "Título de UI", + "text.autoconfig.skyblocker.option.quickNav.button3": "Botão 3", + "text.autoconfig.skyblocker.option.quickNav.button3.render": "Renderizar", + "text.autoconfig.skyblocker.option.quickNav.button3.item": "Item", + "text.autoconfig.skyblocker.category.messages": "Mensagens", + "text.autoconfig.skyblocker.option.messages.hideImplosion": "Esconder Mensagem de Implosão", + "text.autoconfig.skyblocker.option.messages.hideMoltenWave": "Esconder Mensagem do Molten Wave", + "text.autoconfig.skyblocker.option.messages.hideAds": "Esconder Anúncios do Chat Público", + "text.autoconfig.skyblocker.option.messages.hideCombo": "Esconder Mensagens de Combo", + "text.autoconfig.skyblocker.option.messages.hideAutopet": "Esconder Mensagens de Autopet", + "text.autoconfig.skyblocker.option.messages.hideMana": "Esconder Mensagens de Consumo de Mana da Barra de Ação", + "text.autoconfig.skyblocker.option.messages.hideMana.@Tooltip": "Oferece uma experiência melhor com FancyBar", + "text.autoconfig.skyblocker.option.messages.hideShowOff.@Tooltip": "Filtra mensagens do comando /show", + "text.autoconfig.skyblocker.option.slayer.vampireSlayer.enableEffigyWaypoints": "Ativar Waypoints de Effigy", + "text.autoconfig.skyblocker.option.slayer.vampireSlayer.compactEffigyWaypoints": "Compactar Waypoints de Effigy", + "text.autoconfig.skyblocker.option.slayer.vampireSlayer.effigyUpdateFrequency.@Tooltip": "Quanto menor o valor, maior será a frequência de atualizações, o que irá talvez causa lag.", + "text.autoconfig.skyblocker.option.slayer.vampireSlayer.enableHolyIceIndicator": "Ativar Indicador de Gelo Santo", + "text.autoconfig.skyblocker.option.slayer.vampireSlayer.holyIceIndicatorTickDelay": "Atraso (Ticks) do Indicador de Gelo Santo", + "skyblocker.shortcuts.config": "Configurações de Atalhos", + "skyblocker.shortcuts.new": "Novo Atalho", + "skyblocker.shortcuts.deleteQuestion": "Você tem certeza que quer remover esse atalho?", + "emi.category.skyblocker.skyblock": "Skyblock", + "text.autoconfig.skyblocker.option.quickNav.button1.item.count": "Contagem de Itens", + "text.autoconfig.skyblocker.option.quickNav.button2.item.itemName": "Nome de Item", + "text.autoconfig.skyblocker.option.quickNav.button2.clickEvent": "Evento de Click", + "text.autoconfig.skyblocker.option.general.backpackPreviewWithoutShift": "Ver preview da mochila sem segurar Shift", + "skyblocker.shortcuts.commandSuggestionTooltip": "Devido às limitações do Minecraft, sugestões de comando vai apenas funcionar após o reiniciamento do jogo.", + "skyblocker.shortcuts.deleteWarning": "Atalho '%s' vai ser perdido para sempre! (Por um longo tempo!)", + "skyblocker.shortcuts.notLoaded": "§c§lAtalhos ainda não foram carregados", + "text.autoconfig.skyblocker.category.locations": "Localizações", + "text.autoconfig.skyblocker.option.general.fairySouls.enableFairySoulsHelper": "Ativar Assistente de Alma das Fadas", + "text.autoconfig.skyblocker.option.general.fairySouls.highlightOnlyNearbySouls.@Tooltip": "Quando ativado, somente a alma das fadas em um raio de 50 blocos são destacados", + "text.autoconfig.skyblocker.option.general.shortcuts.enableCommandShortcuts.@Tooltip": "Atalhos para comandos consistindo em apenas uma palavra. Edite atalhos com \"/skyblocker shortcuts\". Atalhos tem que está ativos para tomar efeito.", + "text.autoconfig.skyblocker.option.general.itemTooltip.avg": "Tipo Mediano", + "text.autoconfig.skyblocker.option.general.itemTooltip.avg.ONE_DAY": "Preço de 1 dia", + "text.autoconfig.skyblocker.option.general.itemTooltip.enableBazaarPrice": "Ativar Preço de compra/venda do Bazar", + "text.autoconfig.skyblocker.option.general.itemTooltip.enableMuseumDate": "Ativar Museu & Data", + "text.autoconfig.skyblocker.option.messages.hideAOTE": "Esconder Mensagens do AOTE", + "text.autoconfig.skyblocker.option.messages.hideTeleportPad": "Esconder Mensagens do Pad de Teleporte", + "text.autoconfig.skyblocker.option.messages.hideShowOff": "Esconder Mensagens de Show Off", + "text.autoconfig.skyblocker.option.slayer.vampireSlayer.effigyUpdateFrequency": "Frequência de Atualização (Ticks) de Waypoints de Effigy", + "text.autoconfig.skyblocker.option.slayer.vampireSlayer.holyIceUpdateFrequency.@Tooltip": "Quanto menor o valor, maior será a frequência de atualizações, o que irá talvez causa lag.", + "text.autoconfig.skyblocker.option.slayer.vampireSlayer.steakStakeUpdateFrequency.@Tooltip": "Quanto menor o valor, maior será a frequência de atualizações, o que irá talvez causa lag.", + "text.autoconfig.skyblocker.option.slayer.vampireSlayer.maniaUpdateFrequency.@Tooltip": "Quanto menor o valor, maior será a frequência de atualizações, o que irá talvez causa lag.", + "text.autoconfig.skyblocker.option.general.hideEmptyTooltips": "Esconder tooltips vazio de itens nos menus" } -- cgit From ef848b924df1fabf2b59ae0ddbf586220337e4b7 Mon Sep 17 00:00:00 2001 From: OhRetro Date: Sat, 23 Sep 2023 01:07:42 +0000 Subject: Translated using Weblate (Portuguese (Brazil)) Currently translated at 44.5% (162 of 364 strings) Translation: Skyblocker/Skyblocker Translate-URL: https://translate.hysky.de/projects/Skyblocker/skyblocker/pt_BR/ --- .../resources/assets/skyblocker/lang/pt_br.json | 31 +++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/src/main/resources/assets/skyblocker/lang/pt_br.json b/src/main/resources/assets/skyblocker/lang/pt_br.json index 21d0d6d4..900edcba 100644 --- a/src/main/resources/assets/skyblocker/lang/pt_br.json +++ b/src/main/resources/assets/skyblocker/lang/pt_br.json @@ -134,5 +134,34 @@ "text.autoconfig.skyblocker.option.slayer.vampireSlayer.holyIceUpdateFrequency.@Tooltip": "Quanto menor o valor, maior será a frequência de atualizações, o que irá talvez causa lag.", "text.autoconfig.skyblocker.option.slayer.vampireSlayer.steakStakeUpdateFrequency.@Tooltip": "Quanto menor o valor, maior será a frequência de atualizações, o que irá talvez causa lag.", "text.autoconfig.skyblocker.option.slayer.vampireSlayer.maniaUpdateFrequency.@Tooltip": "Quanto menor o valor, maior será a frequência de atualizações, o que irá talvez causa lag.", - "text.autoconfig.skyblocker.option.general.hideEmptyTooltips": "Esconder tooltips vazio de itens nos menus" + "text.autoconfig.skyblocker.option.general.hideEmptyTooltips": "Esconder tooltips vazio de itens nos menus", + "text.autoconfig.skyblocker.option.general.shortcuts.enableCommandArgShortcuts": "Ativar Atalhos de Argumentos de Comando", + "text.autoconfig.skyblocker.option.general.quiverWarning.enableQuiverWarningInDungeons": "Ativar Aviso de Aljava em Dungeons", + "text.autoconfig.skyblocker.option.general.quiverWarning.enableQuiverWarningAfterDungeon": "Ativar Aviso de Aljava Após uma Dungeon", + "text.autoconfig.skyblocker.option.general.tabHud.tabHudScale": "Fator de escala do HUD de tab Bonito", + "text.autoconfig.skyblocker.option.general.tabHud.tabHudScale.@Tooltip": "Valor em %, relativo a sua escala vanilla do GUI", + "text.autoconfig.skyblocker.option.general.hitbox": "Hitboxes", + "skyblocker.relics.markAllFound": "§b[§6Skyblocker§b] §rTodas as relíquias foram marcados como encontrado", + "skyblocker.shortcuts.command.target": "Comando Alvo", + "skyblocker.shortcuts.command.replacement": "Comando de Reposição", + "skyblocker.shortcuts.commandArg.target": "Argumento do Comando Alvo", + "skyblocker.shortcuts.commandArg.replacement": "Argumento do Comando de Reposição", + "skyblocker.customDyeColors.invalidHex": "§b[§6Skyblocker§b] §cCódigo de cor HEX invalido!", + "skyblocker.customItemNames.unableToSetName": "§b[§6Skyblocker§b] §cNão foi possível colocar um nome personalizado no item :( (Você está no skyblock?, Você está segurando um item?)", + "skyblocker.customDyeColors.notDyeable": "§b[§6Skyblocker§b] §cEsse item não é uma peça de armadura pintável!", + "skyblocker.customDyeColors.removed": "§b[§6Skyblocker§b] §fRemovido a cor personalizada desse item.", + "skyblocker.quiverWarning.50Left": "Você tem apenas 50 flechas restantes no seu Aljava!", + "skyblocker.customArmorTrims.neverHad": "§b[§6Skyblocker§b] §fEsse item ainda não tem um acabamento personalizado de armadura colocada, por que não coloca uma? ;)", + "skyblocker.customArmorTrims.unableToSetTrim": "§b[§6Skyblocker§b] §cNão foi possível colocar um acabamento personalizado na armadura :( (Você está no skyblock?, Você está segurando um item?)", + "skyblocker.quiverWarning.10Left": "Você tem apenas 10 flechas restantes no seu Aljava!", + "skyblocker.quiverWarning.empty": "Você não tem nenhuma flecha no seu Aljava!", + "text.autoconfig.skyblocker.option.general.quiverWarning": "Aviso de Aljava", + "text.autoconfig.skyblocker.option.general.quiverWarning.enableQuiverWarning": "Ativar Aviso de Aljava", + "skyblocker.customArmorTrims.notAnArmorPiece": "§b[§6Skyblocker§b] §cEsse item não é uma peça de armadura!", + "skyblocker.customArmorTrims.added": "§b[§6Skyblocker§b] §fColoque um acabamento personalizado de armadura para o item que você está segurando!", + "skyblocker.customItemNames.neverHad": "§b[§6Skyblocker§b] §fEsse item ainda não tem um nome personalizado colocado, por que não colocar um? ;)", + "skyblocker.relics.markAllMissing": "§b[§6Skyblocker§b] §rTodas as relíquias foram marcados como faltando", + "skyblocker.dungeons.secrets.markSecretFound": "§b[§6Skyblocker§b] §r #%d secreto marcado como encontrado.", + "skyblocker.dungeons.secrets.markSecretMissing": "§b[§6Skyblocker§b] §r #%d secreto marcado como faltando.", + "skyblocker.customArmorTrims.noItemUuid": "§b[§6Skyblocker§b] §cVocê tem que tá segurando um item que tenha um uuid para poder colocar um acabamento personalizado na armadura!" } -- cgit From 43e5ffe15dab64a63fb61f77a12e31f03c214abd Mon Sep 17 00:00:00 2001 From: OhRetro Date: Sat, 23 Sep 2023 10:44:20 +0000 Subject: Translated using Weblate (Portuguese (Brazil)) Currently translated at 47.5% (173 of 364 strings) Translation: Skyblocker/Skyblocker Translate-URL: https://translate.hysky.de/projects/Skyblocker/skyblocker/pt_BR/ --- src/main/resources/assets/skyblocker/lang/pt_br.json | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/main/resources/assets/skyblocker/lang/pt_br.json b/src/main/resources/assets/skyblocker/lang/pt_br.json index 900edcba..a549f0c8 100644 --- a/src/main/resources/assets/skyblocker/lang/pt_br.json +++ b/src/main/resources/assets/skyblocker/lang/pt_br.json @@ -161,7 +161,15 @@ "skyblocker.customArmorTrims.added": "§b[§6Skyblocker§b] §fColoque um acabamento personalizado de armadura para o item que você está segurando!", "skyblocker.customItemNames.neverHad": "§b[§6Skyblocker§b] §fEsse item ainda não tem um nome personalizado colocado, por que não colocar um? ;)", "skyblocker.relics.markAllMissing": "§b[§6Skyblocker§b] §rTodas as relíquias foram marcados como faltando", - "skyblocker.dungeons.secrets.markSecretFound": "§b[§6Skyblocker§b] §r #%d secreto marcado como encontrado.", - "skyblocker.dungeons.secrets.markSecretMissing": "§b[§6Skyblocker§b] §r #%d secreto marcado como faltando.", - "skyblocker.customArmorTrims.noItemUuid": "§b[§6Skyblocker§b] §cVocê tem que tá segurando um item que tenha um uuid para poder colocar um acabamento personalizado na armadura!" + "skyblocker.dungeons.secrets.markSecretFound": "§b[§6Skyblocker§b] §r#%d secreto marcado como encontrado.", + "skyblocker.dungeons.secrets.markSecretMissing": "§b[§6Skyblocker§b] §r#%d secreto marcado como faltando.", + "skyblocker.customArmorTrims.noItemUuid": "§b[§6Skyblocker§b] §cVocê tem que tá segurando um item que tenha um uuid para poder colocar um acabamento personalizado na armadura!", + "text.autoconfig.skyblocker.option.general.shortcuts.enableCommandArgShortcuts.@Tooltip": "Atalhos que trocam uma ou mais palavra(s)/argumento(s) de um comando com múltiplas palavras/argumentos. Edite atalhos com \"/skyblocker shortcuts\". Atalhos tem que está ativos para tomar efeito.", + "text.autoconfig.skyblocker.option.general.compactorDeletorPreview": "Ativar Preview do Compactador/Deletador", + "text.autoconfig.skyblocker.option.general.tabHud.nameSorting.@Tooltip": "Ordenando nomes em ordem alfabética enquanto Padrão não tem uma ordem particular.", + "text.autoconfig.skyblocker.option.general.itemTooltip.enableMotesPrice.@Tooltip": "Mostrar os preços de venda dos Motes de um item enquanto está no The Rift.", + "text.autoconfig.skyblocker.option.general.itemInfoDisplay.attributeShardInfo.@Tooltip": "Mostra o nível do atributo como uma contagem de stack e os iniciais do nome do atributo.", + "text.autoconfig.skyblocker.category.slayer": "Slayers", + "skyblocker.updaterepository.failed": "§b[§6Skyblocker§b] §cAtualização do repositório local falhou. Remova os arquivos manualmente e reinicie o jogo.", + "text.autoconfig.skyblocker.option.general.hideStatusEffectOverlay": "Esconder Overlay de Status de Efeitos" } -- cgit From 757456d81d8c16db571fc95db5522e1478236227 Mon Sep 17 00:00:00 2001 From: OhRetro Date: Sun, 24 Sep 2023 12:24:36 +0000 Subject: Translated using Weblate (Portuguese (Brazil)) Currently translated at 58.2% (212 of 364 strings) Translation: Skyblocker/Skyblocker Translate-URL: https://translate.hysky.de/projects/Skyblocker/skyblocker/pt_BR/ --- .../resources/assets/skyblocker/lang/pt_br.json | 45 ++++++++++++++++++++-- 1 file changed, 42 insertions(+), 3 deletions(-) diff --git a/src/main/resources/assets/skyblocker/lang/pt_br.json b/src/main/resources/assets/skyblocker/lang/pt_br.json index a549f0c8..fbef7e11 100644 --- a/src/main/resources/assets/skyblocker/lang/pt_br.json +++ b/src/main/resources/assets/skyblocker/lang/pt_br.json @@ -61,7 +61,7 @@ "skyblocker.itemTooltip.nullMessage": "§b[§6Skyblocker§b] §cA Informação do preço do item no tooltip irá se renovar no máximo 60 segundos. Caso contrário, cheque \"latest.log\"", "text.autoconfig.skyblocker.option.richPresence.info.LOCATION": "LOCALIZAÇÃO", "text.autoconfig.skyblocker.category.quickNav": "Navegação Rápida", - "text.autoconfig.skyblocker.option.quickNav.button1.item.itemName": "Nome do item", + "text.autoconfig.skyblocker.option.quickNav.button1.item.itemName": "Nome do Item", "key.categories.skyblocker": "Skyblocker", "text.autoconfig.skyblocker.option.general.etherwarpOverlay": "Overlay de Etherwarp", "text.autoconfig.skyblocker.option.general.fishing": "Assistente de Pesca", @@ -113,7 +113,7 @@ "skyblocker.shortcuts.deleteQuestion": "Você tem certeza que quer remover esse atalho?", "emi.category.skyblocker.skyblock": "Skyblock", "text.autoconfig.skyblocker.option.quickNav.button1.item.count": "Contagem de Itens", - "text.autoconfig.skyblocker.option.quickNav.button2.item.itemName": "Nome de Item", + "text.autoconfig.skyblocker.option.quickNav.button2.item.itemName": "Nome do Item", "text.autoconfig.skyblocker.option.quickNav.button2.clickEvent": "Evento de Click", "text.autoconfig.skyblocker.option.general.backpackPreviewWithoutShift": "Ver preview da mochila sem segurar Shift", "skyblocker.shortcuts.commandSuggestionTooltip": "Devido às limitações do Minecraft, sugestões de comando vai apenas funcionar após o reiniciamento do jogo.", @@ -171,5 +171,44 @@ "text.autoconfig.skyblocker.option.general.itemInfoDisplay.attributeShardInfo.@Tooltip": "Mostra o nível do atributo como uma contagem de stack e os iniciais do nome do atributo.", "text.autoconfig.skyblocker.category.slayer": "Slayers", "skyblocker.updaterepository.failed": "§b[§6Skyblocker§b] §cAtualização do repositório local falhou. Remova os arquivos manualmente e reinicie o jogo.", - "text.autoconfig.skyblocker.option.general.hideStatusEffectOverlay": "Esconder Overlay de Status de Efeitos" + "text.autoconfig.skyblocker.option.general.hideStatusEffectOverlay": "Esconder Overlay de Status de Efeitos", + "text.autoconfig.skyblocker.option.quickNav.button2.item": "Item", + "text.autoconfig.skyblocker.option.quickNav.button2.item.nbt": "NBT", + "text.autoconfig.skyblocker.option.quickNav.button3.item.nbt": "NBT", + "text.autoconfig.skyblocker.option.quickNav.button3.uiTitle": "Título de UI", + "text.autoconfig.skyblocker.option.quickNav.button3.clickEvent": "Evento de Click", + "text.autoconfig.skyblocker.option.quickNav.button4": "Botão 4", + "text.autoconfig.skyblocker.option.quickNav.button4.item": "Item", + "text.autoconfig.skyblocker.option.quickNav.button4.item.itemName": "Nome do Item", + "text.autoconfig.skyblocker.option.quickNav.button4.item.count": "Contagem de Itens", + "text.autoconfig.skyblocker.option.quickNav.button4.item.nbt": "NBT", + "text.autoconfig.skyblocker.option.quickNav.button4.uiTitle": "Título de UI", + "text.autoconfig.skyblocker.option.quickNav.button4.clickEvent": "Evento de Click", + "text.autoconfig.skyblocker.option.quickNav.button5": "Botão 5", + "text.autoconfig.skyblocker.option.quickNav.button5.render": "Renderizar", + "text.autoconfig.skyblocker.option.quickNav.button5.item.itemName": "Nome do Item", + "text.autoconfig.skyblocker.option.quickNav.button5.item.count": "Contagem de Itens", + "text.autoconfig.skyblocker.option.quickNav.button5.item.nbt": "NBT", + "text.autoconfig.skyblocker.option.quickNav.button5.clickEvent": "Evento de Click", + "text.autoconfig.skyblocker.option.quickNav.button6": "Botão 6", + "text.autoconfig.skyblocker.option.quickNav.button6.item": "Item", + "text.autoconfig.skyblocker.option.quickNav.button6.item.itemName": "Nome do Item", + "text.autoconfig.skyblocker.option.quickNav.button6.item.count": "Contagem de Itens", + "text.autoconfig.skyblocker.option.quickNav.button6.item.nbt": "NBT", + "text.autoconfig.skyblocker.option.quickNav.button6.uiTitle": "Título de UI", + "text.autoconfig.skyblocker.option.quickNav.button6.clickEvent": "Evento de Click", + "text.autoconfig.skyblocker.option.quickNav.button7.render": "Renderizar", + "text.autoconfig.skyblocker.option.quickNav.button7.item": "Item", + "text.autoconfig.skyblocker.option.quickNav.button7.item.itemName": "Nome do Item", + "text.autoconfig.skyblocker.option.quickNav.button7.item.count": "Contagem de Itens", + "text.autoconfig.skyblocker.option.quickNav.button7.item.nbt": "NBT", + "text.autoconfig.skyblocker.option.quickNav.button3.item.itemName": "Nome do Item", + "text.autoconfig.skyblocker.option.quickNav.button3.item.count": "Contagem de Itens", + "text.autoconfig.skyblocker.option.quickNav.button4.render": "Renderizar", + "text.autoconfig.skyblocker.option.quickNav.button5.item": "Item", + "text.autoconfig.skyblocker.option.quickNav.button5.uiTitle": "Título de UI", + "text.autoconfig.skyblocker.option.quickNav.button6.render": "Renderizar", + "text.autoconfig.skyblocker.option.quickNav.button7": "Botão 7", + "text.autoconfig.skyblocker.option.quickNav.button7.uiTitle": "Título de UI", + "text.autoconfig.skyblocker.option.quickNav.button7.clickEvent": "Evento de Click" } -- cgit From 1b7eb59472d19e2e57e22afb1dd371ce39009493 Mon Sep 17 00:00:00 2001 From: MrDonSebas <40346644+IngeSebastian@users.noreply.github.com> Date: Sun, 24 Sep 2023 22:34:44 +0000 Subject: Translated using Weblate (Spanish) Currently translated at 33.7% (123 of 364 strings) Translation: Skyblocker/Skyblocker Translate-URL: https://translate.hysky.de/projects/Skyblocker/skyblocker/es/ --- src/main/resources/assets/skyblocker/lang/es_es.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/resources/assets/skyblocker/lang/es_es.json b/src/main/resources/assets/skyblocker/lang/es_es.json index faa77b85..d967b947 100644 --- a/src/main/resources/assets/skyblocker/lang/es_es.json +++ b/src/main/resources/assets/skyblocker/lang/es_es.json @@ -136,5 +136,9 @@ "text.autoconfig.skyblocker.option.quickNav.button12.item": "Objeto", "text.autoconfig.skyblocker.option.quickNav.button12.item.itemName": "Nombre del objeto", "text.autoconfig.skyblocker.option.quickNav.button12.item.nbt": "NBT", - "text.autoconfig.skyblocker.option.quickNav.button12.uiTitle": "Titulo de la Interfaz" + "text.autoconfig.skyblocker.option.quickNav.button12.uiTitle": "Titulo de la Interfaz", + "text.autoconfig.skyblocker.option.general.shortcuts.enableShortcuts": "Habilitar atajos", + "text.autoconfig.skyblocker.option.general.shortcuts.enableShortcuts.@Tooltip": "Solo funciona en Hypixel. Edita atajos ejecutando \"/skyblocker shortcuts\". Al menos una de las siguientes opciones debe ser activada para surgir efecto.", + "text.autoconfig.skyblocker.option.general.shortcuts": "Atajos", + "text.autoconfig.skyblocker.option.general.compactorDeletorPreview": "Habilitar la previsualización del compactador/eliminador" } -- cgit From bff6c02e95b06c9d3037a04d19db90cd171a96bb Mon Sep 17 00:00:00 2001 From: Ghost Date: Thu, 5 Oct 2023 19:36:05 +0000 Subject: Translated using Weblate (Russian) Currently translated at 66.2% (249 of 376 strings) Translation: Skyblocker/Skyblocker Translate-URL: https://translate.hysky.de/projects/Skyblocker/skyblocker/ru/ --- src/main/resources/assets/skyblocker/lang/ru_ru.json | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/resources/assets/skyblocker/lang/ru_ru.json b/src/main/resources/assets/skyblocker/lang/ru_ru.json index 5ef92494..15f0955c 100644 --- a/src/main/resources/assets/skyblocker/lang/ru_ru.json +++ b/src/main/resources/assets/skyblocker/lang/ru_ru.json @@ -93,7 +93,7 @@ "text.autoconfig.skyblocker.option.quickNav.button12.clickEvent": "Команда по щелчку", "text.autoconfig.skyblocker.option.locations.dungeons.croesusHelper.@Tooltip": "Уже открытые сундуки будут закрашены серым.", "text.autoconfig.skyblocker.option.locations.dungeons.lividColor.lividColorText.@Tooltip": "Текст, который будет отправлен в чат во время боя с Livid. Вместо \"[color]\" отправится цвет босса.", - "text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.style.@Tooltip[1]": "Красивый: Показывает название, процент и шкалу выполнения, а также иконку.", + "text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.style.@Tooltip[1]": "\nКрасивый: Показывает название, процент и шкалу выполнения, а также иконку.", "text.autoconfig.skyblocker.option.locations.dungeons.mapScaling": "Размер Карты", "text.autoconfig.skyblocker.option.quickNav.button4.item.itemName": "ID Предмета", "text.autoconfig.skyblocker.option.quickNav.button5.item": "Предмет", @@ -106,7 +106,7 @@ "text.autoconfig.skyblocker.option.locations.dungeons.mapY": "Карта по Y", "text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.style": "Стиль HUD", "text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.style.@Tooltip[0]": "Упрощенный: Показывает название и процент выполнения.", - "text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.style.@Tooltip[2]": "Классический: Показывает название и процент выполнения в простом тёмном квадрате.", + "text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.style.@Tooltip[2]": "\nКлассический: Показывает название и процент выполнения в простом тёмном квадрате.", "text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.enableBackground": "Включить Фон", "text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.enabled": "Включить", "text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.y": "Y", @@ -249,5 +249,6 @@ "text.autoconfig.skyblocker.option.general.quiverWarning.enableQuiverWarning": "Включить предупреждение о нехватке стрел", "text.autoconfig.skyblocker.option.general.quiverWarning.enableQuiverWarningInDungeons": "Включить предупреждение о нехватке стрел (только в данжах)", "text.autoconfig.skyblocker.option.general.quiverWarning.enableQuiverWarningAfterDungeon": "Включить предупреждение о нехватке стрел (после прохождения данжа)", - "text.autoconfig.skyblocker.option.general.shortcuts.enableCommandArgShortcuts": "Включить сокращения аргументов команд" + "text.autoconfig.skyblocker.option.general.shortcuts.enableCommandArgShortcuts": "Включить сокращения аргументов команд", + "text.autoconfig.skyblocker.option.slayer.vampireSlayer.maniaUpdateFrequency.@Tooltip": "Чем меньше значение, тем чаще происходит обновление, что может привести к лагам." } -- cgit From a9ec1fd72e03dfe404fe37226f0e4b0788ce4066 Mon Sep 17 00:00:00 2001 From: OhRetro Date: Thu, 5 Oct 2023 23:01:58 +0000 Subject: Translated using Weblate (Portuguese (Brazil)) Currently translated at 68.8% (259 of 376 strings) Translation: Skyblocker/Skyblocker Translate-URL: https://translate.hysky.de/projects/Skyblocker/skyblocker/pt_BR/ --- .../resources/assets/skyblocker/lang/pt_br.json | 49 +++++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) diff --git a/src/main/resources/assets/skyblocker/lang/pt_br.json b/src/main/resources/assets/skyblocker/lang/pt_br.json index fbef7e11..765d7223 100644 --- a/src/main/resources/assets/skyblocker/lang/pt_br.json +++ b/src/main/resources/assets/skyblocker/lang/pt_br.json @@ -210,5 +210,52 @@ "text.autoconfig.skyblocker.option.quickNav.button6.render": "Renderizar", "text.autoconfig.skyblocker.option.quickNav.button7": "Botão 7", "text.autoconfig.skyblocker.option.quickNav.button7.uiTitle": "Título de UI", - "text.autoconfig.skyblocker.option.quickNav.button7.clickEvent": "Evento de Click" + "text.autoconfig.skyblocker.option.quickNav.button7.clickEvent": "Evento de Click", + "text.autoconfig.skyblocker.option.general.itemList.enableItemList": "Ativar Lista de Itens", + "text.autoconfig.skyblocker.option.quickNav.button8.render": "Renderizar", + "text.autoconfig.skyblocker.option.quickNav.button8": "Botão 8", + "text.autoconfig.skyblocker.option.quickNav.button8.item": "Item", + "text.autoconfig.skyblocker.option.quickNav.button8.item.nbt": "NBT", + "text.autoconfig.skyblocker.option.quickNav.button8.uiTitle": "Título de UI", + "text.autoconfig.skyblocker.option.quickNav.button8.clickEvent": "Evento de Click", + "text.autoconfig.skyblocker.option.quickNav.button8.item.itemName": "Nome do Item", + "text.autoconfig.skyblocker.option.quickNav.button8.item.count": "Contagem de Itens", + "text.autoconfig.skyblocker.option.quickNav.button9.render": "Renderizar", + "text.autoconfig.skyblocker.option.quickNav.button9.item": "Item", + "text.autoconfig.skyblocker.option.quickNav.button9.item.itemName": "Nome do Item", + "text.autoconfig.skyblocker.option.quickNav.button9.item.count": "Contagem de Itens", + "text.autoconfig.skyblocker.option.quickNav.button10.item.nbt": "NBT", + "text.autoconfig.skyblocker.option.quickNav.button10.uiTitle": "Título de UI", + "text.autoconfig.skyblocker.option.quickNav.button11": "Botão 11", + "text.autoconfig.skyblocker.option.quickNav.button10.render": "Renderizar", + "text.autoconfig.skyblocker.option.quickNav.button10.item": "Item", + "text.autoconfig.skyblocker.option.quickNav.button10.item.itemName": "Nome do Item", + "text.autoconfig.skyblocker.option.quickNav.button10.item.count": "Contagem de Itens", + "text.autoconfig.skyblocker.option.quickNav.button11.item.itemName": "Nome do Item", + "text.autoconfig.skyblocker.option.quickNav.button11.item.count": "Contagem de Itens", + "text.autoconfig.skyblocker.option.quickNav.button11.item": "Item", + "text.autoconfig.skyblocker.option.quickNav.button11.item.nbt": "NBT", + "text.autoconfig.skyblocker.option.quickNav.button11.uiTitle": "Título de UI", + "text.autoconfig.skyblocker.option.quickNav.button12.render": "Renderizar", + "text.autoconfig.skyblocker.option.quickNav.button12.item": "Item", + "text.autoconfig.skyblocker.option.quickNav.button11.clickEvent": "Evento de Click", + "text.autoconfig.skyblocker.option.quickNav.button12": "Botão 12", + "text.autoconfig.skyblocker.option.quickNav.button12.item.itemName": "Nome do Item", + "text.autoconfig.skyblocker.option.quickNav.button12.item.count": "Contagem de Itens", + "text.autoconfig.skyblocker.option.quickNav.button12.item.nbt": "NBT", + "text.autoconfig.skyblocker.option.quickNav.button12.uiTitle": "Título de UI", + "text.autoconfig.skyblocker.option.quickNav.button12.clickEvent": "Evento de Click", + "text.autoconfig.skyblocker.option.quickNav.button11.render": "Renderizar", + "text.autoconfig.skyblocker.option.quickNav.button9": "Botão 9", + "text.autoconfig.skyblocker.option.quickNav.button9.item.nbt": "NBT", + "text.autoconfig.skyblocker.option.quickNav.button9.uiTitle": "Título de UI", + "text.autoconfig.skyblocker.option.quickNav.button9.clickEvent": "Evento de Click", + "text.autoconfig.skyblocker.option.quickNav.button10": "Botão 10", + "text.autoconfig.skyblocker.option.quickNav.button10.clickEvent": "Evento de Click", + "text.autoconfig.skyblocker.option.general.itemList": "Lista de Itens", + "text.skyblocker.open": "Abrir", + "text.skyblocker.quit_config": "Mudanças Não Salvas", + "text.skyblocker.quit_config_sure": "Você tem certeza que quer sair de editar as configurações? Mudanças não vão ser salvas!", + "text.skyblocker.quit_discard": "Sair & Descartar Mudanças", + "text.autoconfig.skyblocker.option.general.shortcuts.config": "Configurações de Atalhos..." } -- cgit From da892652fef6ff290a95e4470934d4070b1ed73a Mon Sep 17 00:00:00 2001 From: Aaron Date: Sat, 7 Oct 2023 23:21:26 +0000 Subject: Translated using Weblate (English (Canada)) Currently translated at 7.6% (29 of 379 strings) Translation: Skyblocker/Skyblocker Translate-URL: https://translate.hysky.de/projects/Skyblocker/skyblocker/en_CA/ --- src/main/resources/assets/skyblocker/lang/en_ca.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/resources/assets/skyblocker/lang/en_ca.json b/src/main/resources/assets/skyblocker/lang/en_ca.json index 94458ed9..57b18c0b 100644 --- a/src/main/resources/assets/skyblocker/lang/en_ca.json +++ b/src/main/resources/assets/skyblocker/lang/en_ca.json @@ -26,5 +26,6 @@ "text.autoconfig.skyblocker.option.locations.dungeons.dungeonChestProfit.profitColor": "Profit Colour", "text.autoconfig.skyblocker.option.locations.dungeons.dungeonChestProfit.lossColor": "Loss Colour", "text.autoconfig.skyblocker.option.locations.dungeons.dungeonChestProfit.incompleteColor": "Incomplete Colour", - "text.autoconfig.skyblocker.option.locations.dungeons.dungeonChestProfit.incompleteColor.@Tooltip": "The colour to display when the price data is incomplete." + "text.autoconfig.skyblocker.option.locations.dungeons.dungeonChestProfit.incompleteColor.@Tooltip": "The colour to display when the price data is incomplete.", + "text.autoconfig.skyblocker.option.general.itemInfoDisplay.itemRarityBackgrounds.@Tooltip": "Displays a coloured background behind an item, the colour represents the item's rarity." } -- cgit From 0775d80d5851c40b6331cc7a0674f44c55563d2b Mon Sep 17 00:00:00 2001 From: hirochisan Date: Wed, 11 Oct 2023 08:55:22 +0000 Subject: Translated using Weblate (Japanese) Currently translated at 35.4% (135 of 381 strings) Translation: Skyblocker/Skyblocker Translate-URL: https://translate.hysky.de/projects/Skyblocker/skyblocker/ja/ --- .../resources/assets/skyblocker/lang/ja_jp.json | 73 +++++++++++++++++++++- 1 file changed, 72 insertions(+), 1 deletion(-) diff --git a/src/main/resources/assets/skyblocker/lang/ja_jp.json b/src/main/resources/assets/skyblocker/lang/ja_jp.json index a0456936..ab3889c0 100644 --- a/src/main/resources/assets/skyblocker/lang/ja_jp.json +++ b/src/main/resources/assets/skyblocker/lang/ja_jp.json @@ -62,5 +62,76 @@ "text.autoconfig.skyblocker.option.messages.hideCombo": "Comboのメッセージを非表示にする", "text.autoconfig.skyblocker.option.messages.hideAutopet": "Autopetのメッセージを非表示にする", "text.autoconfig.skyblocker.option.messages.hideMana": "マナの使用表示をアクションバーから非表示にする", - "text.autoconfig.skyblocker.option.messages.hideMana.@Tooltip": "FancyBarでより良くできます" + "text.autoconfig.skyblocker.option.messages.hideMana.@Tooltip": "FancyBarでより良くできます", + "key.skyblocker.toggleB": "tabを開いたときのHUDの表示メニューを種別Bに変更する", + "key.skyblocker.toggleA": "tabを開いたときのHUDの表示メニューを種別Aに変更する", + "text.autoconfig.skyblocker.option.general.teleportOverlay.enableTeleportOverlays": "テレポート先の表示を有効にする", + "text.autoconfig.skyblocker.option.general.teleportOverlay": "テレポート先の表示", + "text.autoconfig.skyblocker.option.general.tabHud.nameSorting.@Tooltip": "アルファベット順のソートは名前をABC順に並べますがデフォルトソートは並び替えをしません。", + "text.autoconfig.skyblocker.option.general.tabHud.plainPlayerNames.@Tooltip": "有効にすることでpublic islandにおいてプレイヤー名をhypixel独自の修飾なしに表示します。", + "text.autoconfig.skyblocker.option.general.itemInfoDisplay.attributeShardInfo": "Attribute Ahardの情報の表示", + "text.autoconfig.skyblocker.option.general.itemInfoDisplay.attributeShardInfo.@Tooltip": "Attributeのレベルをアイテムの数とアイテムの頭文字に表示します。", + "text.autoconfig.skyblocker.option.general.itemInfoDisplay": "アイテムの情報ディスプレイ", + "text.autoconfig.skyblocker.option.general.specialEffects.rareDungeonDropEffects.@Tooltip": "ダンジョンでレアなアイテムを手に入れたときに特別なエフェクトを出します!", + "text.autoconfig.skyblocker.option.general.itemCooldown": "アイテムのクールダウン", + "text.autoconfig.skyblocker.option.general.itemCooldown.enableItemCooldowns": "アイテムのクールダウン表示を有効にする", + "text.autoconfig.skyblocker.option.general.shortcuts.enableCommandShortcuts": "コマンドショートカットを有効にする", + "text.autoconfig.skyblocker.option.general.shortcuts.enableCommandShortcuts.@Tooltip": "1単語だけで構成されるコマンドのためのショートカット。「/skyblocker shortcuts」で編集してください。使用するにはこの設定が有効になっている必要があります.", + "text.autoconfig.skyblocker.option.general.shortcuts.enableCommandArgShortcuts": "コマンドの引数のショートカット", + "text.autoconfig.skyblocker.option.general.quiverWarning.enableQuiverWarningInDungeons": "ダンジョン内でQuiverの通知を有効にする", + "text.autoconfig.skyblocker.option.general.shortcuts.enableCommandArgShortcuts.@Tooltip": "複数の単語で構成されるコマンドの1以上の単語を置き換えるショートカット。「/skyblocker shortcuts」で編集できます。使用するにはこの設定が有効になっている必要があります。", + "text.autoconfig.skyblocker.option.general.shortcuts.config": "ショートカットの設定...", + "text.autoconfig.skyblocker.option.general.quiverWarning.enableQuiverWarningAfterDungeon": "ダンジョンが終わった後のQuiverの通知を有効にする", + "text.autoconfig.skyblocker.option.general.tabHud.plainPlayerNames": "そのままのプレイヤー名", + "text.autoconfig.skyblocker.option.general.itemTooltip.avg.ONE_DAY": "今日の平均の値段", + "text.autoconfig.skyblocker.option.general.itemTooltip.avg.BOTH": "両方", + "text.autoconfig.skyblocker.option.general.titleContainer.alignment": "タイトルコンテナの水平での位置合わせ", + "text.autoconfig.skyblocker.option.general.titleContainer.config": "タイトルコンテナの置き方の設定...", + "text.autoconfig.skyblocker.option.general.experiments.enableSuperpairsSolver": "Superpairsのソルバーを有効にするか", + "text.autoconfig.skyblocker.option.general.experiments.enableUltrasequencerSolver": "Ultrasequencerのソルバーを有効にするか", + "text.autoconfig.skyblocker.option.general.experiments": "experimentation tableのソルバー", + "text.autoconfig.skyblocker.option.general.experiments.enableChronomatronSolver": "chronomatronのソルバーを有効にするか", + "text.autoconfig.skyblocker.option.general.titleContainer.@Tooltip": "いくつかの表示を一度に表示するときに使います。(例:Vampire Slayer)", + "text.autoconfig.skyblocker.option.general.titleContainer": "画面に表示するタイトルコンテナ", + "text.autoconfig.skyblocker.option.general.titleContainer.x": "X座標での表示位置", + "text.autoconfig.skyblocker.option.general.titleContainer.titleContainerScale": "タイトルコンテナの大きさ", + "text.autoconfig.skyblocker.option.general.fairySouls.highlightFoundSouls": "見つけたフェアリーソウルもハイライトする", + "text.autoconfig.skyblocker.option.general.fairySouls.highlightOnlyNearbySouls": "近くにあるフェアリーソウルだけをハイライトする", + "text.autoconfig.skyblocker.option.general.fairySouls.highlightOnlyNearbySouls.@Tooltip": "50ブルック以内にフェアリーソウルがあるときだけハイライトされます", + "text.autoconfig.skyblocker.option.general.fishing": "フィッシングヘルパー", + "text.autoconfig.skyblocker.option.general.fishing.enableFishingHelper": "フィッシングヘルパーを有効にするか", + "text.autoconfig.skyblocker.option.general.tabHud.tabHudScale": "tab HUDの要素の大きさ", + "key.skyblocker.defaultTgl": "tabを開いたときに表示されるHUDをデフォルトに戻す", + "text.autoconfig.skyblocker.option.general.tabHud": "ファンシーなtab HUD", + "text.autoconfig.skyblocker.option.general.tabHud.tabHudScale.@Tooltip": "バニラGUIとの比 (%)で設定します", + "text.autoconfig.skyblocker.option.general.tabHud.tabHudEnabled": "ファンシーなtab HUDを有効にする", + "text.autoconfig.skyblocker.option.general.fairySouls": "フェアリーソウルヘルパー", + "text.autoconfig.skyblocker.option.general.fairySouls.enableFairySoulsHelper": "フェアリーソウルヘルパーを有効にするか", + "text.autoconfig.skyblocker.option.general.itemTooltip.enableMotesPrice.@Tooltip": "The Riftディメンションにいるときにアイテムの売値をmotesで表示する。", + "text.autoconfig.skyblocker.option.general.itemTooltip.enableMotesPrice": "売値をmotesで表示", + "text.autoconfig.skyblocker.option.general.titleContainer.direction": "タイトルコンテナの向き", + "text.autoconfig.skyblocker.option.general.titleContainer.y": "Y座標での表示位置", + "text.autoconfig.skyblocker.option.general.etherwarpOverlay": "Etherwarp移動先の表示", + "text.autoconfig.skyblocker.option.general.quiverWarning": "Quiverの通知", + "text.autoconfig.skyblocker.option.general.quiverWarning.enableQuiverWarning": "Quiverの通知を有効にする", + "text.autoconfig.skyblocker.option.general.shortcuts": "ショートカット", + "text.autoconfig.skyblocker.option.general.shortcuts.enableShortcuts": "ショートカットを有効にする", + "text.autoconfig.skyblocker.option.general.tabHud.nameSorting": "プレイヤー名の並び替えの方式", + "text.autoconfig.skyblocker.option.general.itemTooltip.avg.THREE_DAY": "この3日間での平均の値段", + "text.autoconfig.skyblocker.option.general.acceptReparty": "リパーティーの自動受諾", + "text.autoconfig.skyblocker.option.general.specialEffects": "特別なエフェクト", + "text.autoconfig.skyblocker.option.general.specialEffects.rareDungeonDropEffects": "レアなダンジョンドロップのエフェクト", + "text.autoconfig.skyblocker.option.general.compactorDeletorPreview": "CompatorとDeletorのプレビューを有効にする", + "text.autoconfig.skyblocker.option.general.itemInfoDisplay.itemRarityBackgrounds": "アイテムのレアリティを背景にする", + "text.autoconfig.skyblocker.option.general.itemInfoDisplay.itemRarityBackgrounds.@Tooltip": "アイテムスロットの背景をそのアイテムのレアリティに応じた色で表示します。", + "text.autoconfig.skyblocker.option.general.itemInfoDisplay.itemRarityBackgroundsOpacity": "アイテムのレアリティ背景の不透明度", + "text.autoconfig.skyblocker.option.general.bars.barpositions.LAYER1": "レイヤー1", + "text.skyblocker.open": "開く", + "text.skyblocker.quit_config_sure": "このまま設定画面を閉じてよろしいですか?変更は保存されません!", + "text.skyblocker.quit_discard": "このまま閉じる", + "text.skyblocker.quit_config": "変更が保存されていません", + "text.autoconfig.skyblocker.option.general.bars.barpositions.LAYER2": "レイヤー2", + "text.autoconfig.skyblocker.option.general.bars.barpositions.RIGHT": "右側", + "text.autoconfig.skyblocker.option.general.bars.barpositions.NONE": "オフ", + "text.autoconfig.skyblocker.option.general.shortcuts.enableShortcuts.@Tooltip": "バニラでもどこでも動きます。「/skyblocker shortcuts」で編集でき、使用するには少なくともこの下の設定のうちの一つが有効になっている必要があります。" } -- cgit From 178becc44e8095991fefd4be7c8c9dd765682c29 Mon Sep 17 00:00:00 2001 From: PumpkinXD Date: Wed, 18 Oct 2023 14:01:51 +0000 Subject: Translated using Weblate (Chinese (Simplified)) Currently translated at 63.9% (250 of 391 strings) Translation: Skyblocker/Skyblocker Translate-URL: https://translate.hysky.de/projects/Skyblocker/skyblocker/zh_Hans/ --- src/main/resources/assets/skyblocker/lang/zh_cn.json | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main/resources/assets/skyblocker/lang/zh_cn.json b/src/main/resources/assets/skyblocker/lang/zh_cn.json index d322b371..b7836eb4 100644 --- a/src/main/resources/assets/skyblocker/lang/zh_cn.json +++ b/src/main/resources/assets/skyblocker/lang/zh_cn.json @@ -243,5 +243,14 @@ "text.autoconfig.skyblocker.option.general.quiverWarning": "箭袋提示", "text.autoconfig.skyblocker.option.general.quiverWarning.enableQuiverWarning": "启用箭袋提示", "text.autoconfig.skyblocker.option.general.itemInfoDisplay": "物品信息显示", - "text.autoconfig.skyblocker.option.locations.dungeons.dungeonChestProfit.enableProfitCalculator": "启用利润计算器" + "text.autoconfig.skyblocker.option.locations.dungeons.dungeonChestProfit.enableProfitCalculator": "启用利润计算器", + "text.autoconfig.skyblocker.option.general.fairySouls.highlightOnlyNearbySouls.@Tooltip": "当此功能启用时, 在玩家半径50格以内的仙女之魂将被高亮", + "text.autoconfig.skyblocker.option.general.fairySouls.highlightFoundSouls": "将已找到的仙女之魂高亮", + "text.autoconfig.skyblocker.option.general.fairySouls.highlightOnlyNearbySouls": "仅高亮附近的仙女之魂", + "text.skyblocker.quit_discard": "不保存退出", + "text.skyblocker.quit_config": "修改未保存", + "text.skyblocker.quit_config_sure": "确定退出吗? 你的修改将不会被保存!", + "text.autoconfig.skyblocker.option.general.wikiLookup": "查阅 wiki", + "text.autoconfig.skyblocker.option.general.wikiLookup.officialWiki": "使用Hypixel官方 Wiki", + "text.autoconfig.skyblocker.option.general.wikiLookup.officialWiki.@Tooltip": "在查阅时使用Hypixel 官方 wiki 代替 Fandom wiki" } -- cgit From 2d22fd9a5213cec66d50581a35c3f5ecb37d88e7 Mon Sep 17 00:00:00 2001 From: Aaron <51387595+AzureAaron@users.noreply.github.com> Date: Thu, 19 Oct 2023 02:03:08 -0400 Subject: New Message Feedback Prefix --- .../de/hysky/skyblocker/skyblock/FairySouls.java | 5 +- .../skyblock/dungeon/secrets/DungeonSecrets.java | 5 +- .../skyblock/item/CustomArmorDyeColors.java | 15 ++--- .../skyblocker/skyblock/item/CustomArmorTrims.java | 15 ++--- .../skyblocker/skyblock/item/CustomItemNames.java | 11 ++-- .../skyblocker/skyblock/item/ItemProtection.java | 9 +-- .../skyblocker/skyblock/item/PriceInfoTooltip.java | 3 +- .../skyblock/itemlist/ItemRepository.java | 3 +- .../skyblocker/skyblock/spidersden/Relics.java | 5 +- .../java/de/hysky/skyblocker/utils/Constants.java | 22 +++++++ .../de/hysky/skyblocker/utils/NEURepoManager.java | 2 +- .../resources/assets/skyblocker/lang/en_ca.json | 26 ++++---- .../resources/assets/skyblocker/lang/en_us.json | 70 +++++++++++----------- .../resources/assets/skyblocker/lang/es_es.json | 4 +- .../resources/assets/skyblocker/lang/fr_fr.json | 4 +- .../resources/assets/skyblocker/lang/id_id.json | 2 +- .../resources/assets/skyblocker/lang/ja_jp.json | 2 +- .../resources/assets/skyblocker/lang/ko_kr.json | 2 +- .../resources/assets/skyblocker/lang/nb_no.json | 2 +- .../resources/assets/skyblocker/lang/pt_br.json | 32 +++++----- .../resources/assets/skyblocker/lang/ru_ru.json | 4 +- .../resources/assets/skyblocker/lang/tr_tr.json | 4 +- .../resources/assets/skyblocker/lang/zh_cn.json | 4 +- .../resources/assets/skyblocker/lang/zh_tw.json | 2 +- 24 files changed, 143 insertions(+), 110 deletions(-) diff --git a/src/main/java/de/hysky/skyblocker/skyblock/FairySouls.java b/src/main/java/de/hysky/skyblocker/skyblock/FairySouls.java index b2ea2b16..cef17d8e 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/FairySouls.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/FairySouls.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.NEURepoManager; import de.hysky.skyblocker.utils.PosUtils; import de.hysky.skyblocker.utils.Utils; @@ -117,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/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/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 ff9e13c9..cec84b38 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/item/CustomArmorTrims.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/item/CustomArmorTrims.java @@ -8,6 +8,7 @@ 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; @@ -108,32 +109,32 @@ 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; 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/itemlist/ItemRepository.java b/src/main/java/de/hysky/skyblocker/skyblock/itemlist/ItemRepository.java index a8e92104..bd2ac27a 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/itemlist/ItemRepository.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/itemlist/ItemRepository.java @@ -1,6 +1,7 @@ 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; @@ -88,7 +89,7 @@ public class ItemRepository { private static void warnNoWikiLink(PlayerEntity player) { if (player != null) { - player.sendMessage(Text.of("[Skyblocker] Unable to locate a wiki article for this item..."), false); + player.sendMessage(Constants.PREFIX.get().append(Text.translatable("skyblocker.wikiLookup.noArticleFound")), false); } } 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..274869d4 100644 --- a/src/main/java/de/hysky/skyblocker/utils/Constants.java +++ b/src/main/java/de/hysky/skyblocker/utils/Constants.java @@ -1,8 +1,30 @@ 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; + /** * 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> WITH_COLOR = color -> style -> style.withColor(color); + Supplier PREFIX = () -> Text.empty() + .append(Text.literal("[").styled(WITH_COLOR.apply(0x8c8c8c))) + .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("] ").styled(WITH_COLOR.apply(0x8c8c8c))); } diff --git a/src/main/java/de/hysky/skyblocker/utils/NEURepoManager.java b/src/main/java/de/hysky/skyblocker/utils/NEURepoManager.java index e6ede542..6d78b3f3 100644 --- a/src/main/java/de/hysky/skyblocker/utils/NEURepoManager.java +++ b/src/main/java/de/hysky/skyblocker/utils/NEURepoManager.java @@ -78,7 +78,7 @@ public class NEURepoManager { 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; } loadRepository(); diff --git a/src/main/resources/assets/skyblocker/lang/en_ca.json b/src/main/resources/assets/skyblocker/lang/en_ca.json index 57b18c0b..5ecbd676 100644 --- a/src/main/resources/assets/skyblocker/lang/en_ca.json +++ b/src/main/resources/assets/skyblocker/lang/en_ca.json @@ -8,19 +8,19 @@ "text.autoconfig.skyblocker.option.locations.dungeons.lividColor.lividColorText.@Tooltip": "Text which will be sent in the chat during the Livid boss fight. The string \"[color]\" will be replaced with the livid colour.", "text.autoconfig.skyblocker.option.locations.dungeons.terminals.solveColor": "Solve Select Coloured", "text.autoconfig.skyblocker.option.general.bars.barpositions.defenceBarPosition": "Defence Bar Position", - "skyblocker.customDyeColors.notDyeable": "§b[§6Skyblocker§b] §cThis item isn't a dyeable armour piece!", - "skyblocker.customDyeColors.added": "§b[§6Skyblocker§b] §fSet a custom dye colour for your currently held item!", - "skyblocker.customDyeColors.noItemUuid": "§b[§6Skyblocker§b] §cYou must be holding an item that has a uuid in order to set a custom dye colour!", - "skyblocker.customArmorTrims.neverHad": "§b[§6Skyblocker§b] §fThis item doesn't have an armour trim set, but why not add one? ;)", - "skyblocker.customArmorTrims.added": "§b[§6Skyblocker§b] §fSet a custom armour trim for your currently held item!", - "skyblocker.customArmorTrims.unableToSetTrim": "§b[§6Skyblocker§b] §cUnable to set a custom armour trim :( (Are you in skyblock?, are you holding an item?)", - "skyblocker.customDyeColors.invalidHex": "§b[§6Skyblocker§b] §cInvalid HEX colour code!", - "skyblocker.customDyeColors.removed": "§b[§6Skyblocker§b] §fRemoved this item's custom dye colour.", - "skyblocker.customDyeColors.neverHad": "§b[§6Skyblocker§b] §fThis item doesn't have a custom dye colour set, but why not add one? ;)", - "skyblocker.customDyeColors.unableToSetColor": "§b[§6Skyblocker§b] §cUnable to set a custom dye colour :( (Are you in skyblock?, are you holding an item?)", - "skyblocker.customArmorTrims.notAnArmorPiece": "§b[§6Skyblocker§b] §cThis item isn't an armour piece!", - "skyblocker.customArmorTrims.removed": "§b[§6Skyblocker§b] §fRemoved this item's custom armour trim.", - "skyblocker.customArmorTrims.noItemUuid": "§b[§6Skyblocker§b] §cYou must be holding an item that has a uuid in order to set a custom armour trim!", + "skyblocker.customDyeColors.notDyeable": "§cThis item isn't a dyeable armour piece!", + "skyblocker.customDyeColors.added": "§fSet a custom dye colour for your currently held item!", + "skyblocker.customDyeColors.noItemUuid": "§cYou must be holding an item that has a uuid in order to set a custom dye colour!", + "skyblocker.customArmorTrims.neverHad": "§fThis item doesn't have an armour trim set, but why not add one? ;)", + "skyblocker.customArmorTrims.added": "§fSet a custom armour trim for your currently held item!", + "skyblocker.customArmorTrims.unableToSetTrim": "§cUnable to set a custom armour trim :( (Are you in skyblock?, are you holding an item?)", + "skyblocker.customDyeColors.invalidHex": "§cInvalid HEX colour code!", + "skyblocker.customDyeColors.removed": "§fRemoved this item's custom dye colour.", + "skyblocker.customDyeColors.neverHad": "§fThis item doesn't have a custom dye colour set, but why not add one? ;)", + "skyblocker.customDyeColors.unableToSetColor": "§cUnable to set a custom dye colour :( (Are you in skyblock?, are you holding an item?)", + "skyblocker.customArmorTrims.notAnArmorPiece": "§cThis item isn't an armour piece!", + "skyblocker.customArmorTrims.removed": "§fRemoved this item's custom armour trim.", + "skyblocker.customArmorTrims.noItemUuid": "§cYou must be holding an item that has a uuid in order to set a custom armour trim!", "text.autoconfig.skyblocker.option.locations.dungeons.dungeonChestProfit.enableProfitCalculator.@Tooltip": "Displays the profit of a dungeon chest in the chest screen's title.\nGreen if there's profit.\nRed if there isn't profit.\nGrey if you don't gain or lose anything.\nBlue if calculations were based on incomplete data.", "text.autoconfig.skyblocker.option.locations.dungeons.dungeonChestProfit.neutralColor": "Neutral Colour", "text.autoconfig.skyblocker.option.locations.dungeons.dungeonChestProfit.profitColor": "Profit Colour", diff --git a/src/main/resources/assets/skyblocker/lang/en_us.json b/src/main/resources/assets/skyblocker/lang/en_us.json index 552caf7c..e868e22b 100644 --- a/src/main/resources/assets/skyblocker/lang/en_us.json +++ b/src/main/resources/assets/skyblocker/lang/en_us.json @@ -110,8 +110,10 @@ "text.autoconfig.skyblocker.option.general.flameOverlay": "Flame Overlay", "text.autoconfig.skyblocker.option.general.flameOverlay.flameHeight": "Flame Height", "text.autoconfig.skyblocker.option.general.flameOverlay.flameOpacity": "Flame Opacity", - "skyblocker.itemTooltip.nullMessage": "§b[§6Skyblocker§b] §cItem price information on tooltip will renew in max 60 seconds. If not, check latest.log", + "skyblocker.itemTooltip.nullMessage": "§cItem price information on tooltip will renew in max 60 seconds. If not, check latest.log", "skyblocker.itemTooltip.noData": "§cNo Data", + + "skyblocker.wikiLookup.noArticleFound": "§rUnable to locate a wiki article for this item...", "text.autoconfig.skyblocker.category.richPresence": "Discord Rich Presence", "text.autoconfig.skyblocker.option.richPresence.info": "Skyblock Info", @@ -351,23 +353,23 @@ "text.autoconfig.skyblocker.option.general.hideEmptyTooltips": "Hide empty item tooltips in menus", "text.autoconfig.skyblocker.option.general.hideStatusEffectOverlay": "Hide Status Effect Overlay", - "skyblocker.updaterepository.failed": "§b[§6Skyblocker§b] §cUpdating local repository failed. Remove files manually and restart game.", + "skyblocker.updaterepository.failed": "§cUpdating local repository failed. Remove files manually and restart game.", - "skyblocker.dungeons.secrets.physicalEntranceNotFound": "§b[§6Skyblocker§b] §cDungeon Entrance Room coordinates not found. Please go back to the green Entrance Room.", - "skyblocker.dungeons.secrets.markSecretFound": "§b[§6Skyblocker§b] §rMarked secret #%d as found.", - "skyblocker.dungeons.secrets.markSecretMissing": "§b[§6Skyblocker§b] §rMarked secret #%d as missing.", - "skyblocker.dungeons.secrets.markSecretFoundUnable": "§b[§6Skyblocker§b] §cUnable to mark secret #%d as found.", - "skyblocker.dungeons.secrets.markSecretMissingUnable": "§b[§6Skyblocker§b] §cUnable to mark secret #%d as missing.", + "skyblocker.dungeons.secrets.physicalEntranceNotFound": "§cDungeon Entrance Room coordinates not found. Please go back to the green Entrance Room.", + "skyblocker.dungeons.secrets.markSecretFound": "§rMarked secret #%d as found.", + "skyblocker.dungeons.secrets.markSecretMissing": "§rMarked secret #%d as missing.", + "skyblocker.dungeons.secrets.markSecretFoundUnable": "§cUnable to mark secret #%d as found.", + "skyblocker.dungeons.secrets.markSecretMissingUnable": "§cUnable to mark secret #%d as missing.", "skyblocker.fishing.reelNow": "Reel in now!", "skyblocker.rift.healNow": "Heal now!", "skyblocker.rift.iceNow": "Ice now!", "skyblocker.rift.mania": "Mania!", "skyblocker.rift.stakeNow": "Stake now!", - "skyblocker.fairySouls.markAllFound": "§b[§6Skyblocker§b] §rMarked all fairy souls in the current island as found", - "skyblocker.fairySouls.markAllMissing": "§b[§6Skyblocker§b] §rMarked all fairy souls in the current island as missing", - "skyblocker.relics.markAllFound": "§b[§6Skyblocker§b] §rMarked all relics as found", - "skyblocker.relics.markAllMissing": "§b[§6Skyblocker§b] §rMarked all relics as missing", + "skyblocker.fairySouls.markAllFound": "§rMarked all fairy souls in the current island as found", + "skyblocker.fairySouls.markAllMissing": "§rMarked all fairy souls in the current island as missing", + "skyblocker.relics.markAllFound": "§rMarked all relics as found", + "skyblocker.relics.markAllMissing": "§rMarked all relics as missing", "skyblocker.shortcuts.config": "Shortcuts Config", "skyblocker.shortcuts.notLoaded": "§c§lShortcuts not loaded yet", "skyblocker.shortcuts.command.target": "Target Command", @@ -380,36 +382,36 @@ "skyblocker.shortcuts.new": "New Shortcut", "skyblocker.shortcuts.commandSuggestionTooltip": "Due to limitations of Minecraft, command suggestions will only work after a restart of the game.", - "skyblocker.customItemNames.removed": "§b[§6Skyblocker§b] §fRemoved this item's custom name.", - "skyblocker.customItemNames.neverHad": "§b[§6Skyblocker§b] §fThis item doesn't have a custom name set, but why not add one? ;)", - "skyblocker.customItemNames.added": "§b[§6Skyblocker§b] §fSet a custom name for your currently held item!", - "skyblocker.customItemNames.noItemUuid": "§b[§6Skyblocker§b] §cYou must be holding an item that has a uuid in order to set a custom name!", - "skyblocker.customItemNames.unableToSetName": "§b[§6Skyblocker§b] §cUnable to set a custom item name :( (Are you in skyblock?, are you holding an item?)", + "skyblocker.customItemNames.removed": "§fRemoved this item's custom name.", + "skyblocker.customItemNames.neverHad": "§fThis item doesn't have a custom name set, but why not add one? ;)", + "skyblocker.customItemNames.added": "§fSet a custom name for your currently held item!", + "skyblocker.customItemNames.noItemUuid": "§cYou must be holding an item that has a uuid in order to set a custom name!", + "skyblocker.customItemNames.unableToSetName": "§cUnable to set a custom item name :( (Are you in skyblock?, are you holding an item?)", - "skyblocker.customDyeColors.invalidHex": "§b[§6Skyblocker§b] §cInvalid HEX color code!", - "skyblocker.customDyeColors.notDyeable": "§b[§6Skyblocker§b] §cThis item isn't a dyeable armor piece!", - "skyblocker.customDyeColors.removed": "§b[§6Skyblocker§b] §fRemoved this item's custom dye color.", - "skyblocker.customDyeColors.neverHad": "§b[§6Skyblocker§b] §fThis item doesn't have a custom dye color set, but why not add one? ;)", - "skyblocker.customDyeColors.added": "§b[§6Skyblocker§b] §fSet a custom dye color for your currently held item!", - "skyblocker.customDyeColors.noItemUuid": "§b[§6Skyblocker§b] §cYou must be holding an item that has a uuid in order to set a custom dye color!", - "skyblocker.customDyeColors.unableToSetColor": "§b[§6Skyblocker§b] §cUnable to set a custom dye color :( (Are you in skyblock?, are you holding an item?)", + "skyblocker.customDyeColors.invalidHex": "§cInvalid HEX color code!", + "skyblocker.customDyeColors.notDyeable": "§cThis item isn't a dyeable armor piece!", + "skyblocker.customDyeColors.removed": "§fRemoved this item's custom dye color.", + "skyblocker.customDyeColors.neverHad": "§fThis item doesn't have a custom dye color set, but why not add one? ;)", + "skyblocker.customDyeColors.added": "§fSet a custom dye color for your currently held item!", + "skyblocker.customDyeColors.noItemUuid": "§cYou must be holding an item that has a uuid in order to set a custom dye color!", + "skyblocker.customDyeColors.unableToSetColor": "§cUnable to set a custom dye color :( (Are you in skyblock?, are you holding an item?)", - "skyblocker.customArmorTrims.invalidMaterialOrPattern": "§b[§6Skyblocker§b] §cYou supplied either an invalid material, or an invalid trim pattern!", - "skyblocker.customArmorTrims.notAnArmorPiece": "§b[§6Skyblocker§b] §cThis item isn't an armor piece!", - "skyblocker.customArmorTrims.removed": "§b[§6Skyblocker§b] §fRemoved this item's custom armor trim.", - "skyblocker.customArmorTrims.neverHad": "§b[§6Skyblocker§b] §fThis item doesn't have a armor trim set, but why not add one? ;)", - "skyblocker.customArmorTrims.added": "§b[§6Skyblocker§b] §fSet a custom armor trim for your currently held item!", - "skyblocker.customArmorTrims.noItemUuid": "§b[§6Skyblocker§b] §cYou must be holding an item that has a uuid in order to set a custom armor trim!", - "skyblocker.customArmorTrims.unableToSetTrim": "§b[§6Skyblocker§b] §cUnable to set a custom armor trim :( (Are you in skyblock?, are you holding an item?)", + "skyblocker.customArmorTrims.invalidMaterialOrPattern": "§cYou supplied either an invalid material, or an invalid trim pattern!", + "skyblocker.customArmorTrims.notAnArmorPiece": "§cThis item isn't an armor piece!", + "skyblocker.customArmorTrims.removed": "§fRemoved this item's custom armor trim.", + "skyblocker.customArmorTrims.neverHad": "§fThis item doesn't have a armor trim set, but why not add one? ;)", + "skyblocker.customArmorTrims.added": "§fSet a custom armor trim for your currently held item!", + "skyblocker.customArmorTrims.noItemUuid": "§cYou must be holding an item that has a uuid in order to set a custom armor trim!", + "skyblocker.customArmorTrims.unableToSetTrim": "§cUnable to set a custom armor trim :( (Are you in skyblock?, are you holding an item?)", "skyblocker.quiverWarning.50Left": "You only have 50 Arrows left in your Quiver!", "skyblocker.quiverWarning.10Left": "You only have 10 Arrows left in your Quiver!", "skyblocker.quiverWarning.empty": "You don't have any more Arrows left in your Quiver!", - "skyblocker.itemProtection.added": "§b[§6Skyblocker§b] §fYour %s will now be protected! §o*your item now feels a little safer :')*", - "skyblocker.itemProtection.removed": "§b[§6Skyblocker§b] §fYour %s will §nno longer be protected§f :( - §lBeware of the dangers in doing this!", - "skyblocker.itemProtection.noItemUuid": "§b[§6Skyblocker§b] §cYou must be holding an item that has a uuid in order to protect it!", - "skyblocker.itemProtection.unableToProtect": "§b[§6Skyblocker§b] §cUnable to protect this item :( (Are you in skyblock?, are you holding an item?)", + "skyblocker.itemProtection.added": "§fYour %s will now be protected! §o*your item now feels a little safer :')*", + "skyblocker.itemProtection.removed": "§fYour %s will §nno longer be protected§f :( - §lBeware of the dangers in doing this!", + "skyblocker.itemProtection.noItemUuid": "§cYou must be holding an item that has a uuid in order to protect it!", + "skyblocker.itemProtection.unableToProtect": "§cUnable to protect this item :( (Are you in skyblock?, are you holding an item?)", "emi.category.skyblocker.skyblock": "Skyblock" } diff --git a/src/main/resources/assets/skyblocker/lang/es_es.json b/src/main/resources/assets/skyblocker/lang/es_es.json index d967b947..7ec449aa 100644 --- a/src/main/resources/assets/skyblocker/lang/es_es.json +++ b/src/main/resources/assets/skyblocker/lang/es_es.json @@ -53,7 +53,7 @@ "text.autoconfig.skyblocker.option.locations.dungeons.croesusHelper.@Tooltip": "Obscurece los cofres que ya han sido abiertos.", "text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.enableBackground": "Habilitar Fondo", "text.autoconfig.skyblocker.option.general.itemTooltip": "Información extra de los objetos", - "skyblocker.itemTooltip.nullMessage": "§b[§6Skyblocker§b] §cEl precio en la información en los objetos se actualiza cada 60 segundos. De lo contrario revisa lastest.log", + "skyblocker.itemTooltip.nullMessage": "§cEl precio en la información en los objetos se actualiza cada 60 segundos. De lo contrario revisa lastest.log", "text.autoconfig.skyblocker.option.richPresence.info.@Tooltip": "Este valor no importa si estas ciclando", "text.autoconfig.skyblocker.option.quickNav.button1.item": "Objeto", "text.autoconfig.skyblocker.option.quickNav.button1.item.itemName": "Nombre del objeto", @@ -93,7 +93,7 @@ "text.autoconfig.skyblocker.option.messages.hideAOTE": "Ocultar Mensajes de la AOTE", "text.autoconfig.skyblocker.option.messages.hideMana": "Ocultar los Mensajes del Consumo de Maná de la Barra de Acción", "text.autoconfig.skyblocker.option.messages.hideMana.@Tooltip": "Da una mejor experiencia con FancyBar", - "skyblocker.updaterepository.failed": "§b[§6Skyblocker§b] §cLa actualización del repositorio local fallo. Elimina los archivos manualmente y reinicia el juego.", + "skyblocker.updaterepository.failed": "§cLa actualización del repositorio local fallo. Elimina los archivos manualmente y reinicia el juego.", "text.autoconfig.skyblocker.option.quickNav.button11": "Botón 11", "text.autoconfig.skyblocker.option.quickNav.button9.item.itemName": "Nombre del objeto", "text.autoconfig.skyblocker.option.quickNav.button3.item.nbt": "NBT", diff --git a/src/main/resources/assets/skyblocker/lang/fr_fr.json b/src/main/resources/assets/skyblocker/lang/fr_fr.json index 8da7809a..dae2de9a 100644 --- a/src/main/resources/assets/skyblocker/lang/fr_fr.json +++ b/src/main/resources/assets/skyblocker/lang/fr_fr.json @@ -23,7 +23,7 @@ "text.autoconfig.skyblocker.option.general.hitbox": "Boites de collisions", "text.autoconfig.skyblocker.option.general.hitbox.oldFarmlandHitbox": "Hitbox 1.8 de la terre labourée", "text.autoconfig.skyblocker.option.general.hitbox.oldLeverHitbox": "Hitbox 1.8 du levier", - "skyblocker.itemTooltip.nullMessage": "§b[§6Skyblocker§b] §cLes informations sur le prix des objets vont s'actualiser dans 60 secondes maximum. Sinon consultez le fichier latest.log", + "skyblocker.itemTooltip.nullMessage": "§cLes informations sur le prix des objets vont s'actualiser dans 60 secondes maximum. Sinon consultez le fichier latest.log", "skyblocker.itemTooltip.noData": "§cPas de données", "text.autoconfig.skyblocker.category.richPresence": "Rich Presence Discord", "text.autoconfig.skyblocker.option.richPresence.info": "Information à afficher", @@ -107,7 +107,7 @@ "text.autoconfig.skyblocker.option.quickNav.button1.uiTitle": "Titre du menu", "text.autoconfig.skyblocker.option.quickNav.button1.clickEvent": "Evènement de clic", "text.autoconfig.skyblocker.option.quickNav.button2": "Bouton 2", - "skyblocker.updaterepository.failed": "§b[§6Skyblocker§b] §cLa mise à jour de la repository a échoué. Supprimez les fichiers manuellement et relancez le jeu.", + "skyblocker.updaterepository.failed": "§cLa mise à jour de la repository a échoué. Supprimez les fichiers manuellement et relancez le jeu.", "skyblocker.fishing.reelNow": "Enroulez la ligne !", "text.autoconfig.skyblocker.option.general.fishing.enableFishingHelper": "Activer l'assistant de pêche", "text.autoconfig.skyblocker.option.general.fishing": "Assistant de pêche", diff --git a/src/main/resources/assets/skyblocker/lang/id_id.json b/src/main/resources/assets/skyblocker/lang/id_id.json index 52a6f9bb..f0dbc967 100644 --- a/src/main/resources/assets/skyblocker/lang/id_id.json +++ b/src/main/resources/assets/skyblocker/lang/id_id.json @@ -17,7 +17,7 @@ "text.autoconfig.skyblocker.option.messages.hideAds": "Sembunyikan Iklan dari Chat Publik", "text.autoconfig.skyblocker.option.general.itemTooltip.enableNPCPrice": "Aktifkan Harga NPC", "text.autoconfig.skyblocker.option.general.itemTooltip.enableLowestBIN": "Aktifkan Harga BIN Terendah", - "skyblocker.itemTooltip.nullMessage": "§b[§6Skyblocker§b] §cInformasi harga item yang ditampilkan dalam tooltip akan diperbarui dalam jangka waktu maks. 60 detik. Jika pembaharuan gagal silahkan check latest.log", + "skyblocker.itemTooltip.nullMessage": "§cInformasi harga item yang ditampilkan dalam tooltip akan diperbarui dalam jangka waktu maks. 60 detik. Jika pembaharuan gagal silahkan check latest.log", "text.autoconfig.skyblocker.option.general.itemTooltip.enableAvgBIN": "Aktifkan Rata-rata Harga BIN", "text.autoconfig.skyblocker.option.general.itemTooltip.avg": "Tipe Rata-rata", "text.autoconfig.skyblocker.option.general.itemTooltip.enableBazaarPrice": "Aktifkan Harga Jual Beli Bazaar", diff --git a/src/main/resources/assets/skyblocker/lang/ja_jp.json b/src/main/resources/assets/skyblocker/lang/ja_jp.json index ab3889c0..0d62361f 100644 --- a/src/main/resources/assets/skyblocker/lang/ja_jp.json +++ b/src/main/resources/assets/skyblocker/lang/ja_jp.json @@ -23,7 +23,7 @@ "text.autoconfig.skyblocker.option.general.hitbox": "ヒットボックス", "text.autoconfig.skyblocker.option.general.hitbox.oldFarmlandHitbox": "バージョン1.8での作物のヒットボックスを使う", "text.autoconfig.skyblocker.option.general.hitbox.oldLeverHitbox": "バージョン1.8でのレバーのヒットボックスを使う", - "skyblocker.itemTooltip.nullMessage": "§b[§6Skyblocker§b]§cツールチップ上のアイテムの値段は最大60秒ごとに更新されます。されていない場合はlatest.logを確認してください", + "skyblocker.itemTooltip.nullMessage": "§cツールチップ上のアイテムの値段は最大60秒ごとに更新されます。されていない場合はlatest.logを確認してください", "text.autoconfig.skyblocker.category.richPresence": "discordに自分のゲームアクティビティを表示する", "text.autoconfig.skyblocker.option.richPresence.info": "skyblockの情報", "text.autoconfig.skyblocker.option.richPresence.info.@Tooltip": "この値はあなたがサイクリングしている場合は重要ではありません", diff --git a/src/main/resources/assets/skyblocker/lang/ko_kr.json b/src/main/resources/assets/skyblocker/lang/ko_kr.json index 4cfbab47..fb890c33 100644 --- a/src/main/resources/assets/skyblocker/lang/ko_kr.json +++ b/src/main/resources/assets/skyblocker/lang/ko_kr.json @@ -30,7 +30,7 @@ "text.autoconfig.skyblocker.option.general.hitbox": "히트박스", "text.autoconfig.skyblocker.option.general.hitbox.oldFarmlandHitbox": "1.8 농지 히트박스 활성화", "text.autoconfig.skyblocker.option.general.hitbox.oldLeverHitbox": "1.8 레버 히트박스 활성화", - "skyblocker.itemTooltip.nullMessage": "§b[§6Skyblocker§b] §c아이템 가격 툴팁이 최대 60초 이내에 갱신됩니다. 갱신되지 않을 시 latest.log 를 확인하세요.", + "skyblocker.itemTooltip.nullMessage": "§c아이템 가격 툴팁이 최대 60초 이내에 갱신됩니다. 갱신되지 않을 시 latest.log 를 확인하세요.", "skyblocker.itemTooltip.noData": "§c데이터 없음", "text.autoconfig.skyblocker.category.richPresence": "디스코드 Rich Presence", "text.autoconfig.skyblocker.option.richPresence.info": "스카이블록 정보", diff --git a/src/main/resources/assets/skyblocker/lang/nb_no.json b/src/main/resources/assets/skyblocker/lang/nb_no.json index e44d492f..3bbd67dd 100644 --- a/src/main/resources/assets/skyblocker/lang/nb_no.json +++ b/src/main/resources/assets/skyblocker/lang/nb_no.json @@ -76,7 +76,7 @@ "text.autoconfig.skyblocker.option.general.bars": "Helse, mana, forsvar og XP-barer", "text.autoconfig.skyblocker.option.general.bars.barpositions.experienceBarPosition": "Experience Bar stilling", "text.autoconfig.skyblocker.option.general.itemTooltip.avg.@Tooltip": "Du kan velge hvor mange dager med gjennomsnittspris som skal være", - "skyblocker.itemTooltip.nullMessage": "§b[§6Skyblocker§b] §cVareprisinformasjon på verktøytips fornyes om maks 60 sekunder. Hvis ikke, sjekk latest.log", + "skyblocker.itemTooltip.nullMessage": "§cVareprisinformasjon på verktøytips fornyes om maks 60 sekunder. Hvis ikke, sjekk latest.log", "text.autoconfig.skyblocker.option.quickNav.button1": "Knapp 1", "text.autoconfig.skyblocker.option.quickNav.button1.item.itemName": "Gjenstand navn", "text.autoconfig.skyblocker.option.quickNav.button3.render": "Rendering", diff --git a/src/main/resources/assets/skyblocker/lang/pt_br.json b/src/main/resources/assets/skyblocker/lang/pt_br.json index 765d7223..2361d7bd 100644 --- a/src/main/resources/assets/skyblocker/lang/pt_br.json +++ b/src/main/resources/assets/skyblocker/lang/pt_br.json @@ -58,7 +58,7 @@ "text.autoconfig.skyblocker.option.general.titleContainer.direction": "Orientação do Contêiner de Título", "text.autoconfig.skyblocker.option.general.teleportOverlay.enableTeleportOverlays": "Ativar Overlays de Teleporte", "text.autoconfig.skyblocker.option.general.teleportOverlay.enableEtherTransmission": "Ativar Overlay de Transmissão Éter", - "skyblocker.itemTooltip.nullMessage": "§b[§6Skyblocker§b] §cA Informação do preço do item no tooltip irá se renovar no máximo 60 segundos. Caso contrário, cheque \"latest.log\"", + "skyblocker.itemTooltip.nullMessage": "§cA Informação do preço do item no tooltip irá se renovar no máximo 60 segundos. Caso contrário, cheque \"latest.log\"", "text.autoconfig.skyblocker.option.richPresence.info.LOCATION": "LOCALIZAÇÃO", "text.autoconfig.skyblocker.category.quickNav": "Navegação Rápida", "text.autoconfig.skyblocker.option.quickNav.button1.item.itemName": "Nome do Item", @@ -141,36 +141,36 @@ "text.autoconfig.skyblocker.option.general.tabHud.tabHudScale": "Fator de escala do HUD de tab Bonito", "text.autoconfig.skyblocker.option.general.tabHud.tabHudScale.@Tooltip": "Valor em %, relativo a sua escala vanilla do GUI", "text.autoconfig.skyblocker.option.general.hitbox": "Hitboxes", - "skyblocker.relics.markAllFound": "§b[§6Skyblocker§b] §rTodas as relíquias foram marcados como encontrado", + "skyblocker.relics.markAllFound": "§rTodas as relíquias foram marcados como encontrado", "skyblocker.shortcuts.command.target": "Comando Alvo", "skyblocker.shortcuts.command.replacement": "Comando de Reposição", "skyblocker.shortcuts.commandArg.target": "Argumento do Comando Alvo", "skyblocker.shortcuts.commandArg.replacement": "Argumento do Comando de Reposição", - "skyblocker.customDyeColors.invalidHex": "§b[§6Skyblocker§b] §cCódigo de cor HEX invalido!", - "skyblocker.customItemNames.unableToSetName": "§b[§6Skyblocker§b] §cNão foi possível colocar um nome personalizado no item :( (Você está no skyblock?, Você está segurando um item?)", - "skyblocker.customDyeColors.notDyeable": "§b[§6Skyblocker§b] §cEsse item não é uma peça de armadura pintável!", - "skyblocker.customDyeColors.removed": "§b[§6Skyblocker§b] §fRemovido a cor personalizada desse item.", + "skyblocker.customDyeColors.invalidHex": "§cCódigo de cor HEX invalido!", + "skyblocker.customItemNames.unableToSetName": "§cNão foi possível colocar um nome personalizado no item :( (Você está no skyblock?, Você está segurando um item?)", + "skyblocker.customDyeColors.notDyeable": "§cEsse item não é uma peça de armadura pintável!", + "skyblocker.customDyeColors.removed": "§fRemovido a cor personalizada desse item.", "skyblocker.quiverWarning.50Left": "Você tem apenas 50 flechas restantes no seu Aljava!", - "skyblocker.customArmorTrims.neverHad": "§b[§6Skyblocker§b] §fEsse item ainda não tem um acabamento personalizado de armadura colocada, por que não coloca uma? ;)", - "skyblocker.customArmorTrims.unableToSetTrim": "§b[§6Skyblocker§b] §cNão foi possível colocar um acabamento personalizado na armadura :( (Você está no skyblock?, Você está segurando um item?)", + "skyblocker.customArmorTrims.neverHad": "§fEsse item ainda não tem um acabamento personalizado de armadura colocada, por que não coloca uma? ;)", + "skyblocker.customArmorTrims.unableToSetTrim": "§cNão foi possível colocar um acabamento personalizado na armadura :( (Você está no skyblock?, Você está segurando um item?)", "skyblocker.quiverWarning.10Left": "Você tem apenas 10 flechas restantes no seu Aljava!", "skyblocker.quiverWarning.empty": "Você não tem nenhuma flecha no seu Aljava!", "text.autoconfig.skyblocker.option.general.quiverWarning": "Aviso de Aljava", "text.autoconfig.skyblocker.option.general.quiverWarning.enableQuiverWarning": "Ativar Aviso de Aljava", - "skyblocker.customArmorTrims.notAnArmorPiece": "§b[§6Skyblocker§b] §cEsse item não é uma peça de armadura!", - "skyblocker.customArmorTrims.added": "§b[§6Skyblocker§b] §fColoque um acabamento personalizado de armadura para o item que você está segurando!", - "skyblocker.customItemNames.neverHad": "§b[§6Skyblocker§b] §fEsse item ainda não tem um nome personalizado colocado, por que não colocar um? ;)", - "skyblocker.relics.markAllMissing": "§b[§6Skyblocker§b] §rTodas as relíquias foram marcados como faltando", - "skyblocker.dungeons.secrets.markSecretFound": "§b[§6Skyblocker§b] §r#%d secreto marcado como encontrado.", - "skyblocker.dungeons.secrets.markSecretMissing": "§b[§6Skyblocker§b] §r#%d secreto marcado como faltando.", - "skyblocker.customArmorTrims.noItemUuid": "§b[§6Skyblocker§b] §cVocê tem que tá segurando um item que tenha um uuid para poder colocar um acabamento personalizado na armadura!", + "skyblocker.customArmorTrims.notAnArmorPiece": "§cEsse item não é uma peça de armadura!", + "skyblocker.customArmorTrims.added": "§fColoque um acabamento personalizado de armadura para o item que você está segurando!", + "skyblocker.customItemNames.neverHad": "§fEsse item ainda não tem um nome personalizado colocado, por que não colocar um? ;)", + "skyblocker.relics.markAllMissing": "§rTodas as relíquias foram marcados como faltando", + "skyblocker.dungeons.secrets.markSecretFound": "§r#%d secreto marcado como encontrado.", + "skyblocker.dungeons.secrets.markSecretMissing": "§r#%d secreto marcado como faltando.", + "skyblocker.customArmorTrims.noItemUuid": "§cVocê tem que tá segurando um item que tenha um uuid para poder colocar um acabamento personalizado na armadura!", "text.autoconfig.skyblocker.option.general.shortcuts.enableCommandArgShortcuts.@Tooltip": "Atalhos que trocam uma ou mais palavra(s)/argumento(s) de um comando com múltiplas palavras/argumentos. Edite atalhos com \"/skyblocker shortcuts\". Atalhos tem que está ativos para tomar efeito.", "text.autoconfig.skyblocker.option.general.compactorDeletorPreview": "Ativar Preview do Compactador/Deletador", "text.autoconfig.skyblocker.option.general.tabHud.nameSorting.@Tooltip": "Ordenando nomes em ordem alfabética enquanto Padrão não tem uma ordem particular.", "text.autoconfig.skyblocker.option.general.itemTooltip.enableMotesPrice.@Tooltip": "Mostrar os preços de venda dos Motes de um item enquanto está no The Rift.", "text.autoconfig.skyblocker.option.general.itemInfoDisplay.attributeShardInfo.@Tooltip": "Mostra o nível do atributo como uma contagem de stack e os iniciais do nome do atributo.", "text.autoconfig.skyblocker.category.slayer": "Slayers", - "skyblocker.updaterepository.failed": "§b[§6Skyblocker§b] §cAtualização do repositório local falhou. Remova os arquivos manualmente e reinicie o jogo.", + "skyblocker.updaterepository.failed": "§cAtualização do repositório local falhou. Remova os arquivos manualmente e reinicie o jogo.", "text.autoconfig.skyblocker.option.general.hideStatusEffectOverlay": "Esconder Overlay de Status de Efeitos", "text.autoconfig.skyblocker.option.quickNav.button2.item": "Item", "text.autoconfig.skyblocker.option.quickNav.button2.item.nbt": "NBT", diff --git a/src/main/resources/assets/skyblocker/lang/ru_ru.json b/src/main/resources/assets/skyblocker/lang/ru_ru.json index 15f0955c..c35e15a0 100644 --- a/src/main/resources/assets/skyblocker/lang/ru_ru.json +++ b/src/main/resources/assets/skyblocker/lang/ru_ru.json @@ -26,7 +26,7 @@ "text.autoconfig.skyblocker.option.locations.dungeons.terminals.solveColor": "Показывать Решение Select Colored", "text.autoconfig.skyblocker.option.locations.dungeons.terminals.solveOrder": "Показывать Решение Click In Order", "text.autoconfig.skyblocker.option.locations.dungeons.terminals.solveStartsWith": "Показывать Решение Starts With", - "skyblocker.itemTooltip.nullMessage": "§b[§6Skyblocker§b] §cИнформация о цене предмета обновится менее чем через 60 секунд. Если нет, проверьте latest.log", + "skyblocker.itemTooltip.nullMessage": "§cИнформация о цене предмета обновится менее чем через 60 секунд. Если нет, проверьте latest.log", "text.autoconfig.skyblocker.option.messages.hideTeleportPad": "Скрывать сообщения Teleport Pad", "text.autoconfig.skyblocker.option.general.itemTooltip.enableAvgBIN": "Показать средние цены на BIN", "text.autoconfig.skyblocker.option.general.itemTooltip.avg": "Период времени (для средней цены)", @@ -124,7 +124,7 @@ "text.autoconfig.skyblocker.option.locations.barn.solveTreasureHunter": "Показывать Решение Treasure Hunter", "text.autoconfig.skyblocker.option.messages.chatFilterResult.FILTER": "Скрыть", "text.autoconfig.skyblocker.option.messages.chatFilterResult.PASS": "Не скрывать", - "skyblocker.updaterepository.failed": "§b[§6Skyblocker§b] §cОшибка в обновлении местного репозитория. Перезапустите игру, удалив файлы вручную.", + "skyblocker.updaterepository.failed": "§cОшибка в обновлении местного репозитория. Перезапустите игру, удалив файлы вручную.", "text.autoconfig.skyblocker.option.richPresence.info.BITS": "BITS", "text.autoconfig.skyblocker.option.quickNav.button2.item": "Предмет", "text.autoconfig.skyblocker.option.quickNav.button2.item.itemName": "ID Предмета", diff --git a/src/main/resources/assets/skyblocker/lang/tr_tr.json b/src/main/resources/assets/skyblocker/lang/tr_tr.json index 8dee9a26..2441570a 100644 --- a/src/main/resources/assets/skyblocker/lang/tr_tr.json +++ b/src/main/resources/assets/skyblocker/lang/tr_tr.json @@ -10,7 +10,7 @@ "text.autoconfig.skyblocker.option.general.itemTooltip.enableBazaarPrice": "Pazar alış/satış fiyatını göster", "text.autoconfig.skyblocker.option.general.itemTooltip.enableMuseumDate": "Müze ve tarih bilgisini göster", "text.autoconfig.skyblocker.option.general.hitbox": "Hitbox'lar", - "skyblocker.itemTooltip.nullMessage": "§b[§6Skyblocker§b] §cEşya açıklamasındaki ürün fiyat bilgisi en fazla 60 saniye içinde yenilenecektir. Aksi takdirde latest.log dosyasını kontrol edin", + "skyblocker.itemTooltip.nullMessage": "§cEşya açıklamasındaki ürün fiyat bilgisi en fazla 60 saniye içinde yenilenecektir. Aksi takdirde latest.log dosyasını kontrol edin", "text.autoconfig.skyblocker.option.general.hitbox.oldFarmlandHitbox": "1.8 tarım hitboxlarını etkinleştir", "text.autoconfig.skyblocker.option.general.hitbox.oldLeverHitbox": "1.8 şalter hitboxunu etkinleştir", "skyblocker.itemTooltip.noData": "§cVeri yok", @@ -60,7 +60,7 @@ "text.autoconfig.skyblocker.option.general.bars.barpositions.defenceBarPosition": "Defans barı konumu", "text.autoconfig.skyblocker.option.general.bars.barpositions.experienceBarPosition": "Tecrübe barı konumu", "key.categories.skyblocker": "Skyblocker", - "skyblocker.updaterepository.failed": "§b[§6Skyblocker§b] §cYerel depo güncellenemedi. Dosyaları manuel olarak silip oyunu tekrar başlatın.", + "skyblocker.updaterepository.failed": "§cYerel depo güncellenemedi. Dosyaları manuel olarak silip oyunu tekrar başlatın.", "text.autoconfig.skyblocker.option.general.fishing": "Balık Tutma Yardımcısı", "text.autoconfig.skyblocker.option.general.fishing.enableFishingHelper": "Balık tutma yardımcısını aktifleştir", "text.autoconfig.skyblocker.category.messages": "Mesajlar", diff --git a/src/main/resources/assets/skyblocker/lang/zh_cn.json b/src/main/resources/assets/skyblocker/lang/zh_cn.json index b7836eb4..622e012e 100644 --- a/src/main/resources/assets/skyblocker/lang/zh_cn.json +++ b/src/main/resources/assets/skyblocker/lang/zh_cn.json @@ -30,7 +30,7 @@ "text.autoconfig.skyblocker.option.general.hitbox": "碰撞箱", "text.autoconfig.skyblocker.option.general.hitbox.oldFarmlandHitbox": "启用1.8的农田碰撞箱", "text.autoconfig.skyblocker.option.general.hitbox.oldLeverHitbox": "启用1.8的拉杆碰撞箱", - "skyblocker.itemTooltip.nullMessage": "§b[§6Skyblocker§b] §c物品提示里的价格信息会在最多60秒内更新。如果没有,请检查latest.log", + "skyblocker.itemTooltip.nullMessage": "§c物品提示里的价格信息会在最多60秒内更新。如果没有,请检查latest.log", "skyblocker.itemTooltip.noData": "§c没有数据", "text.autoconfig.skyblocker.category.richPresence": "Discord活动状态", "text.autoconfig.skyblocker.option.richPresence.info": "Skyblock信息", @@ -100,7 +100,7 @@ "text.autoconfig.skyblocker.option.quickNav.button4.item.nbt": "物品NBT", "text.autoconfig.skyblocker.option.general.hideEmptyTooltips": "隐藏菜单中分隔符的物品信息", "text.autoconfig.skyblocker.option.locations.dungeons.mapScaling": "地图界面大小", - "skyblocker.updaterepository.failed": "§b[§6Skyblocker§b] §c更新本地数据存储库失败,请手动删库并重启游戏", + "skyblocker.updaterepository.failed": "§c更新本地数据存储库失败,请手动删库并重启游戏", "text.autoconfig.skyblocker.option.quickNav.button1.item": "热键所显示物品", "text.autoconfig.skyblocker.option.quickNav.button1.uiTitle": "快捷界面标题", "text.autoconfig.skyblocker.option.quickNav.button1.item.itemName": "物品ID", diff --git a/src/main/resources/assets/skyblocker/lang/zh_tw.json b/src/main/resources/assets/skyblocker/lang/zh_tw.json index 1f53842b..44b5d9d6 100644 --- a/src/main/resources/assets/skyblocker/lang/zh_tw.json +++ b/src/main/resources/assets/skyblocker/lang/zh_tw.json @@ -33,7 +33,7 @@ "text.autoconfig.skyblocker.option.general.itemTooltip.enableMuseumDate": "顯示博物館与日期訊息", "text.autoconfig.skyblocker.option.general.hitbox.oldLeverHitbox": "啟用1.8的控制桿判定箱", "text.autoconfig.skyblocker.option.general.hitbox": "判定箱", - "skyblocker.itemTooltip.nullMessage": "§b[§6Skyblocker§b] §c物品資訊裡面的價格訊息會在最多60秒內更新。如果沒有,請檢查latest.log", + "skyblocker.itemTooltip.nullMessage": "§c物品資訊裡面的價格訊息會在最多60秒內更新。如果沒有,請檢查latest.log", "text.autoconfig.skyblocker.option.general.hitbox.oldFarmlandHitbox": "啟用1.8的耕地判定箱", "text.autoconfig.skyblocker.category.quickNav": "快速導航", "text.autoconfig.skyblocker.option.quickNav.enableQuickNav": "啟用快速導航", -- cgit From c1d96c49fe024c9114f2ed5bf59986675f1dde1f Mon Sep 17 00:00:00 2001 From: Aaron <51387595+AzureAaron@users.noreply.github.com> Date: Thu, 19 Oct 2023 02:10:38 -0400 Subject: Remove unused quicknav translation strings --- .../resources/assets/skyblocker/lang/en_us.json | 119 ++++----------------- 1 file changed, 21 insertions(+), 98 deletions(-) diff --git a/src/main/resources/assets/skyblocker/lang/en_us.json b/src/main/resources/assets/skyblocker/lang/en_us.json index 552caf7c..f75c421a 100644 --- a/src/main/resources/assets/skyblocker/lang/en_us.json +++ b/src/main/resources/assets/skyblocker/lang/en_us.json @@ -123,104 +123,27 @@ "text.autoconfig.skyblocker.option.richPresence.enableRichPresence": "Enabled", "text.autoconfig.skyblocker.option.richPresence.customMessage": "Custom Message", - "text.autoconfig.skyblocker.category.quickNav" : "Quick Navigation", - "text.autoconfig.skyblocker.option.quickNav.enableQuickNav" : "Enable Quick Navigation", - "text.autoconfig.skyblocker.option.quickNav.button1" : "Button 1", - "text.autoconfig.skyblocker.option.quickNav.button1.render" : "Render", - "text.autoconfig.skyblocker.option.quickNav.button1.item" : "Item", - "text.autoconfig.skyblocker.option.quickNav.button1.item.itemName" : "Item name", - "text.autoconfig.skyblocker.option.quickNav.button1.item.count" : "Item Count", - "text.autoconfig.skyblocker.option.quickNav.button1.item.nbt" : "NBT", - "text.autoconfig.skyblocker.option.quickNav.button1.uiTitle" : "UI Title", - "text.autoconfig.skyblocker.option.quickNav.button1.clickEvent" : "Click event", - "text.autoconfig.skyblocker.option.quickNav.button2" : "Button 2", - "text.autoconfig.skyblocker.option.quickNav.button2.render" : "Render", - "text.autoconfig.skyblocker.option.quickNav.button2.item" : "Item", - "text.autoconfig.skyblocker.option.quickNav.button2.item.itemName" : "Item name", - "text.autoconfig.skyblocker.option.quickNav.button2.item.count" : "Item Count", - "text.autoconfig.skyblocker.option.quickNav.button2.item.nbt" : "NBT", - "text.autoconfig.skyblocker.option.quickNav.button2.uiTitle" : "UI Title", - "text.autoconfig.skyblocker.option.quickNav.button2.clickEvent" : "Click event", - "text.autoconfig.skyblocker.option.quickNav.button3" : "Button 3", - "text.autoconfig.skyblocker.option.quickNav.button3.render" : "Render", - "text.autoconfig.skyblocker.option.quickNav.button3.item" : "Item", - "text.autoconfig.skyblocker.option.quickNav.button3.item.itemName" : "Item name", - "text.autoconfig.skyblocker.option.quickNav.button3.item.count" : "Item Count", - "text.autoconfig.skyblocker.option.quickNav.button3.item.nbt" : "NBT", - "text.autoconfig.skyblocker.option.quickNav.button3.uiTitle" : "UI Title", - "text.autoconfig.skyblocker.option.quickNav.button3.clickEvent" : "Click event", - "text.autoconfig.skyblocker.option.quickNav.button4" : "Button 4", - "text.autoconfig.skyblocker.option.quickNav.button4.render" : "Render", - "text.autoconfig.skyblocker.option.quickNav.button4.item" : "Item", - "text.autoconfig.skyblocker.option.quickNav.button4.item.itemName" : "Item name", - "text.autoconfig.skyblocker.option.quickNav.button4.item.count" : "Item Count", - "text.autoconfig.skyblocker.option.quickNav.button4.item.nbt" : "NBT", - "text.autoconfig.skyblocker.option.quickNav.button4.uiTitle" : "UI Title", - "text.autoconfig.skyblocker.option.quickNav.button4.clickEvent" : "Click event", - "text.autoconfig.skyblocker.option.quickNav.button5" : "Button 5", - "text.autoconfig.skyblocker.option.quickNav.button5.render" : "Render", - "text.autoconfig.skyblocker.option.quickNav.button5.item" : "Item", - "text.autoconfig.skyblocker.option.quickNav.button5.item.itemName" : "Item name", - "text.autoconfig.skyblocker.option.quickNav.button5.item.count" : "Item Count", - "text.autoconfig.skyblocker.option.quickNav.button5.item.nbt" : "NBT", - "text.autoconfig.skyblocker.option.quickNav.button5.uiTitle" : "UI Title", - "text.autoconfig.skyblocker.option.quickNav.button5.clickEvent" : "Click event", - "text.autoconfig.skyblocker.option.quickNav.button6" : "Button 6", - "text.autoconfig.skyblocker.option.quickNav.button6.render" : "Render", - "text.autoconfig.skyblocker.option.quickNav.button6.item" : "Item", - "text.autoconfig.skyblocker.option.quickNav.button6.item.itemName" : "Item name", - "text.autoconfig.skyblocker.option.quickNav.button6.item.count" : "Item Count", - "text.autoconfig.skyblocker.option.quickNav.button6.item.nbt" : "NBT", - "text.autoconfig.skyblocker.option.quickNav.button6.uiTitle" : "UI Title", - "text.autoconfig.skyblocker.option.quickNav.button6.clickEvent" : "Click event", - "text.autoconfig.skyblocker.option.quickNav.button7" : "Button 7", - "text.autoconfig.skyblocker.option.quickNav.button7.render" : "Render", - "text.autoconfig.skyblocker.option.quickNav.button7.item" : "Item", - "text.autoconfig.skyblocker.option.quickNav.button7.item.itemName" : "Item name", - "text.autoconfig.skyblocker.option.quickNav.button7.item.count" : "Item Count", - "text.autoconfig.skyblocker.option.quickNav.button7.item.nbt" : "NBT", - "text.autoconfig.skyblocker.option.quickNav.button7.uiTitle" : "UI Title", - "text.autoconfig.skyblocker.option.quickNav.button7.clickEvent" : "Click event", - "text.autoconfig.skyblocker.option.quickNav.button8" : "Button 8", - "text.autoconfig.skyblocker.option.quickNav.button8.render" : "Render", - "text.autoconfig.skyblocker.option.quickNav.button8.item" : "Item", - "text.autoconfig.skyblocker.option.quickNav.button8.item.itemName" : "Item name", - "text.autoconfig.skyblocker.option.quickNav.button8.item.count" : "Item Count", - "text.autoconfig.skyblocker.option.quickNav.button8.item.nbt" : "NBT", - "text.autoconfig.skyblocker.option.quickNav.button8.uiTitle" : "UI Title", - "text.autoconfig.skyblocker.option.quickNav.button8.clickEvent" : "Click event", - "text.autoconfig.skyblocker.option.quickNav.button9" : "Button 9", - "text.autoconfig.skyblocker.option.quickNav.button9.render" : "Render", - "text.autoconfig.skyblocker.option.quickNav.button9.item" : "Item", - "text.autoconfig.skyblocker.option.quickNav.button9.item.itemName" : "Item name", - "text.autoconfig.skyblocker.option.quickNav.button9.item.count" : "Item Count", - "text.autoconfig.skyblocker.option.quickNav.button9.item.nbt" : "NBT", - "text.autoconfig.skyblocker.option.quickNav.button9.uiTitle" : "UI Title", - "text.autoconfig.skyblocker.option.quickNav.button9.clickEvent" : "Click event", - "text.autoconfig.skyblocker.option.quickNav.button10" : "Button 10", - "text.autoconfig.skyblocker.option.quickNav.button10.render" : "Render", - "text.autoconfig.skyblocker.option.quickNav.button10.item" : "Item", - "text.autoconfig.skyblocker.option.quickNav.button10.item.itemName" : "Item name", - "text.autoconfig.skyblocker.option.quickNav.button10.item.count" : "Item Count", - "text.autoconfig.skyblocker.option.quickNav.button10.item.nbt" : "NBT", - "text.autoconfig.skyblocker.option.quickNav.button10.uiTitle" : "UI Title", - "text.autoconfig.skyblocker.option.quickNav.button10.clickEvent" : "Click event", - "text.autoconfig.skyblocker.option.quickNav.button11" : "Button 11", - "text.autoconfig.skyblocker.option.quickNav.button11.render" : "Render", - "text.autoconfig.skyblocker.option.quickNav.button11.item" : "Item", - "text.autoconfig.skyblocker.option.quickNav.button11.item.itemName" : "Item name", - "text.autoconfig.skyblocker.option.quickNav.button11.item.count" : "Item Count", - "text.autoconfig.skyblocker.option.quickNav.button11.item.nbt" : "NBT", - "text.autoconfig.skyblocker.option.quickNav.button11.uiTitle" : "UI Title", - "text.autoconfig.skyblocker.option.quickNav.button11.clickEvent" : "Click event", - "text.autoconfig.skyblocker.option.quickNav.button12" : "Button 12", - "text.autoconfig.skyblocker.option.quickNav.button12.render" : "Render", - "text.autoconfig.skyblocker.option.quickNav.button12.item" : "Item", - "text.autoconfig.skyblocker.option.quickNav.button12.item.itemName" : "Item name", - "text.autoconfig.skyblocker.option.quickNav.button12.item.count" : "Item Count", - "text.autoconfig.skyblocker.option.quickNav.button12.item.nbt" : "NBT", - "text.autoconfig.skyblocker.option.quickNav.button12.uiTitle" : "UI Title", - "text.autoconfig.skyblocker.option.quickNav.button12.clickEvent" : "Click event", + "text.autoconfig.skyblocker.category.quickNav": "Quick Navigation", + "text.autoconfig.skyblocker.option.quickNav.enableQuickNav": "Enable Quick Navigation", + "text.autoconfig.skyblocker.option.quickNav.button1": "Button 1", + "text.autoconfig.skyblocker.option.quickNav.button1.render": "Render", + "text.autoconfig.skyblocker.option.quickNav.button1.item": "Item", + "text.autoconfig.skyblocker.option.quickNav.button1.item.itemName": "Item name", + "text.autoconfig.skyblocker.option.quickNav.button1.item.count": "Item Count", + "text.autoconfig.skyblocker.option.quickNav.button1.item.nbt": "NBT", + "text.autoconfig.skyblocker.option.quickNav.button1.uiTitle": "UI Title", + "text.autoconfig.skyblocker.option.quickNav.button1.clickEvent": "Click event", + "text.autoconfig.skyblocker.option.quickNav.button2": "Button 2", + "text.autoconfig.skyblocker.option.quickNav.button3": "Button 3", + "text.autoconfig.skyblocker.option.quickNav.button4": "Button 4", + "text.autoconfig.skyblocker.option.quickNav.button5": "Button 5", + "text.autoconfig.skyblocker.option.quickNav.button6": "Button 6", + "text.autoconfig.skyblocker.option.quickNav.button7": "Button 7", + "text.autoconfig.skyblocker.option.quickNav.button8": "Button 8", + "text.autoconfig.skyblocker.option.quickNav.button9": "Button 9", + "text.autoconfig.skyblocker.option.quickNav.button10": "Button 10", + "text.autoconfig.skyblocker.option.quickNav.button11": "Button 11", + "text.autoconfig.skyblocker.option.quickNav.button12": "Button 12", "text.autoconfig.skyblocker.option.general.itemList": "Item List", "text.autoconfig.skyblocker.option.general.itemList.enableItemList": "Enable Item List", -- cgit From 6a0117ce7f58ee3e1b1b510ad5c53f08388a4128 Mon Sep 17 00:00:00 2001 From: Aaron <51387595+AzureAaron@users.noreply.github.com> Date: Fri, 20 Oct 2023 01:00:51 -0400 Subject: Simplify QuickNav translation strings --- .../config/categories/QuickNavigationCategory.java | 168 ++++++++++----------- .../resources/assets/skyblocker/lang/en_us.json | 27 +--- 2 files changed, 92 insertions(+), 103 deletions(-) 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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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/resources/assets/skyblocker/lang/en_us.json b/src/main/resources/assets/skyblocker/lang/en_us.json index f75c421a..4530c7e7 100644 --- a/src/main/resources/assets/skyblocker/lang/en_us.json +++ b/src/main/resources/assets/skyblocker/lang/en_us.json @@ -125,25 +125,14 @@ "text.autoconfig.skyblocker.category.quickNav": "Quick Navigation", "text.autoconfig.skyblocker.option.quickNav.enableQuickNav": "Enable Quick Navigation", - "text.autoconfig.skyblocker.option.quickNav.button1": "Button 1", - "text.autoconfig.skyblocker.option.quickNav.button1.render": "Render", - "text.autoconfig.skyblocker.option.quickNav.button1.item": "Item", - "text.autoconfig.skyblocker.option.quickNav.button1.item.itemName": "Item name", - "text.autoconfig.skyblocker.option.quickNav.button1.item.count": "Item Count", - "text.autoconfig.skyblocker.option.quickNav.button1.item.nbt": "NBT", - "text.autoconfig.skyblocker.option.quickNav.button1.uiTitle": "UI Title", - "text.autoconfig.skyblocker.option.quickNav.button1.clickEvent": "Click event", - "text.autoconfig.skyblocker.option.quickNav.button2": "Button 2", - "text.autoconfig.skyblocker.option.quickNav.button3": "Button 3", - "text.autoconfig.skyblocker.option.quickNav.button4": "Button 4", - "text.autoconfig.skyblocker.option.quickNav.button5": "Button 5", - "text.autoconfig.skyblocker.option.quickNav.button6": "Button 6", - "text.autoconfig.skyblocker.option.quickNav.button7": "Button 7", - "text.autoconfig.skyblocker.option.quickNav.button8": "Button 8", - "text.autoconfig.skyblocker.option.quickNav.button9": "Button 9", - "text.autoconfig.skyblocker.option.quickNav.button10": "Button 10", - "text.autoconfig.skyblocker.option.quickNav.button11": "Button 11", - "text.autoconfig.skyblocker.option.quickNav.button12": "Button 12", + "text.autoconfig.skyblocker.option.quickNav.button": "Button %d", + "text.autoconfig.skyblocker.option.quickNav.button.render": "Render", + "text.autoconfig.skyblocker.option.quickNav.button.item": "Item", + "text.autoconfig.skyblocker.option.quickNav.button.item.itemName": "Item name", + "text.autoconfig.skyblocker.option.quickNav.button.item.count": "Item Count", + "text.autoconfig.skyblocker.option.quickNav.button.item.nbt": "NBT", + "text.autoconfig.skyblocker.option.quickNav.button.uiTitle": "UI Title", + "text.autoconfig.skyblocker.option.quickNav.button.clickEvent": "Click event", "text.autoconfig.skyblocker.option.general.itemList": "Item List", "text.autoconfig.skyblocker.option.general.itemList.enableItemList": "Enable Item List", -- cgit From 918f614423dc85d6cbd64ad153ae6cd6d2c476cb Mon Sep 17 00:00:00 2001 From: Aaron <51387595+AzureAaron@users.noreply.github.com> Date: Fri, 20 Oct 2023 01:05:01 -0400 Subject: Accurate representation of what this means --- src/main/resources/assets/skyblocker/lang/en_us.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/assets/skyblocker/lang/en_us.json b/src/main/resources/assets/skyblocker/lang/en_us.json index 4530c7e7..a346aac8 100644 --- a/src/main/resources/assets/skyblocker/lang/en_us.json +++ b/src/main/resources/assets/skyblocker/lang/en_us.json @@ -128,7 +128,7 @@ "text.autoconfig.skyblocker.option.quickNav.button": "Button %d", "text.autoconfig.skyblocker.option.quickNav.button.render": "Render", "text.autoconfig.skyblocker.option.quickNav.button.item": "Item", - "text.autoconfig.skyblocker.option.quickNav.button.item.itemName": "Item name", + "text.autoconfig.skyblocker.option.quickNav.button.item.itemName": "Item ID", "text.autoconfig.skyblocker.option.quickNav.button.item.count": "Item Count", "text.autoconfig.skyblocker.option.quickNav.button.item.nbt": "NBT", "text.autoconfig.skyblocker.option.quickNav.button.uiTitle": "UI Title", -- cgit From e3177643df14bc08cd4544eed85898c723f02b4f Mon Sep 17 00:00:00 2001 From: Aaron <51387595+AzureAaron@users.noreply.github.com> Date: Fri, 20 Oct 2023 01:09:34 -0400 Subject: Grey brackets --- src/main/java/de/hysky/skyblocker/utils/Constants.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/de/hysky/skyblocker/utils/Constants.java b/src/main/java/de/hysky/skyblocker/utils/Constants.java index 274869d4..f144b519 100644 --- a/src/main/java/de/hysky/skyblocker/utils/Constants.java +++ b/src/main/java/de/hysky/skyblocker/utils/Constants.java @@ -7,6 +7,7 @@ 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 @@ -15,7 +16,7 @@ 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> WITH_COLOR = color -> style -> style.withColor(color); Supplier PREFIX = () -> Text.empty() - .append(Text.literal("[").styled(WITH_COLOR.apply(0x8c8c8c))) + .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))) @@ -26,5 +27,5 @@ public interface Constants { .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("] ").styled(WITH_COLOR.apply(0x8c8c8c))); + .append(Text.literal("] ").formatted(Formatting.GRAY)); } -- cgit From 99a538292ac344aa9fd6087a2752e20563bf310c Mon Sep 17 00:00:00 2001 From: Aaron <51387595+AzureAaron@users.noreply.github.com> Date: Fri, 20 Oct 2023 19:28:02 -0400 Subject: Patch Float/Double Field Controller Bug --- .../skyblocker/compatibility/MixinPlugin.java | 15 ++++++++ .../mixin/yacl/DoubleFieldControllerMixin.java | 27 ++++++++++++++ .../mixin/yacl/FloatFieldControllerMixin.java | 27 ++++++++++++++ .../mixin/yacl/IntegerFieldControllerMixin.java | 31 ++++++++++++++++ .../mixin/yacl/LongFieldControllerMixin.java | 31 ++++++++++++++++ .../mixin/yacl/NumberFieldControllerMixin.java | 43 ++++++++++++++++++++++ src/main/resources/skyblocker.mixins.json | 7 +++- 7 files changed, 180 insertions(+), 1 deletion(-) create mode 100644 src/main/java/de/hysky/skyblocker/mixin/yacl/DoubleFieldControllerMixin.java create mode 100644 src/main/java/de/hysky/skyblocker/mixin/yacl/FloatFieldControllerMixin.java create mode 100644 src/main/java/de/hysky/skyblocker/mixin/yacl/IntegerFieldControllerMixin.java create mode 100644 src/main/java/de/hysky/skyblocker/mixin/yacl/LongFieldControllerMixin.java create mode 100644 src/main/java/de/hysky/skyblocker/mixin/yacl/NumberFieldControllerMixin.java diff --git a/src/main/java/de/hysky/skyblocker/compatibility/MixinPlugin.java b/src/main/java/de/hysky/skyblocker/compatibility/MixinPlugin.java index c7fc6973..145f7ec4 100644 --- a/src/main/java/de/hysky/skyblocker/compatibility/MixinPlugin.java +++ b/src/main/java/de/hysky/skyblocker/compatibility/MixinPlugin.java @@ -4,13 +4,17 @@ import java.util.List; import java.util.Set; import org.objectweb.asm.tree.ClassNode; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin; import org.spongepowered.asm.mixin.extensibility.IMixinInfo; import net.fabricmc.loader.api.FabricLoader; public class MixinPlugin implements IMixinConfigPlugin { + private static final Logger LOGGER = LoggerFactory.getLogger(MixinPlugin.class); private static final boolean OPTIFABRIC_LOADED = FabricLoader.getInstance().isModLoaded("optifabric"); + private static final String YACL_VERSION = FabricLoader.getInstance().getModContainer("yet_another_config_lib_v3").get().getMetadata().getVersion().getFriendlyString(); @Override public void onLoad(String mixinPackage) { @@ -26,6 +30,17 @@ public class MixinPlugin implements IMixinConfigPlugin { public boolean shouldApplyMixin(String targetClassName, String mixinClassName) { //OptiFabric Compatibility if (mixinClassName.endsWith("WorldRendererMixin") && OPTIFABRIC_LOADED) return false; + + //YACL#103 Patch + if (mixinClassName.endsWith("DoubleFieldControllerMixin") || mixinClassName.endsWith("FloatFieldControllerMixin") || mixinClassName.endsWith("IntegerFieldControllerMixin") || mixinClassName.endsWith("LongFieldControllerMixin") || mixinClassName.endsWith("NumberFieldControllerMixin")) { + if (YACL_VERSION.equals("3.2.1+1.20.2")) { + LOGGER.info("[Skyblocker] Applying patch for " + targetClassName + " from " + mixinClassName); + } else { + LOGGER.info("[Skyblocker] Skipping patch on " + targetClassName + " due to an Unknown YACL version being found! Version: {}", YACL_VERSION); + + return false; + } + } return true; } diff --git a/src/main/java/de/hysky/skyblocker/mixin/yacl/DoubleFieldControllerMixin.java b/src/main/java/de/hysky/skyblocker/mixin/yacl/DoubleFieldControllerMixin.java new file mode 100644 index 00000000..ac24c09f --- /dev/null +++ b/src/main/java/de/hysky/skyblocker/mixin/yacl/DoubleFieldControllerMixin.java @@ -0,0 +1,27 @@ +package de.hysky.skyblocker.mixin.yacl; + +import java.text.NumberFormat; +import java.util.function.Function; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Overwrite; + +import dev.isxander.yacl3.api.Option; +import dev.isxander.yacl3.gui.controllers.string.number.DoubleFieldController; +import dev.isxander.yacl3.gui.controllers.string.number.NumberFieldController; +import net.minecraft.text.Text; + +@Mixin(value = DoubleFieldController.class, remap = false) +public abstract class DoubleFieldControllerMixin extends NumberFieldController { + private static final NumberFormat NUMBER_FORMAT = NumberFormat.getInstance(); + + + public DoubleFieldControllerMixin(Option option, Function displayFormatter) { + super(option, displayFormatter); + } + + @Overwrite + public String getString() { + return NUMBER_FORMAT.format(option().pendingValue()); + } +} diff --git a/src/main/java/de/hysky/skyblocker/mixin/yacl/FloatFieldControllerMixin.java b/src/main/java/de/hysky/skyblocker/mixin/yacl/FloatFieldControllerMixin.java new file mode 100644 index 00000000..d67993c2 --- /dev/null +++ b/src/main/java/de/hysky/skyblocker/mixin/yacl/FloatFieldControllerMixin.java @@ -0,0 +1,27 @@ +package de.hysky.skyblocker.mixin.yacl; + +import java.text.NumberFormat; +import java.util.function.Function; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Overwrite; + +import dev.isxander.yacl3.api.Option; +import dev.isxander.yacl3.gui.controllers.string.number.FloatFieldController; +import dev.isxander.yacl3.gui.controllers.string.number.NumberFieldController; +import net.minecraft.text.Text; + +@Mixin(value = FloatFieldController.class, remap = false) +public abstract class FloatFieldControllerMixin extends NumberFieldController { + private static final NumberFormat NUMBER_FORMAT = NumberFormat.getInstance(); + + + public FloatFieldControllerMixin(Option option, Function displayFormatter) { + super(option, displayFormatter); + } + + @Overwrite + public String getString() { + return NUMBER_FORMAT.format(option().pendingValue()); + } +} diff --git a/src/main/java/de/hysky/skyblocker/mixin/yacl/IntegerFieldControllerMixin.java b/src/main/java/de/hysky/skyblocker/mixin/yacl/IntegerFieldControllerMixin.java new file mode 100644 index 00000000..b95cbef7 --- /dev/null +++ b/src/main/java/de/hysky/skyblocker/mixin/yacl/IntegerFieldControllerMixin.java @@ -0,0 +1,31 @@ +package de.hysky.skyblocker.mixin.yacl; + +import java.text.NumberFormat; +import java.util.function.Function; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Overwrite; + +import dev.isxander.yacl3.api.Option; +import dev.isxander.yacl3.gui.controllers.string.number.IntegerFieldController; +import dev.isxander.yacl3.gui.controllers.string.number.NumberFieldController; +import net.minecraft.text.Text; + +@Mixin(value = IntegerFieldController.class, remap = false) +public abstract class IntegerFieldControllerMixin extends NumberFieldController { + private static final NumberFormat NUMBER_FORMAT = NumberFormat.getInstance(); + + public IntegerFieldControllerMixin(Option option, Function displayFormatter) { + super(option, displayFormatter); + } + + @Overwrite + public String getString() { + return NUMBER_FORMAT.format(option().pendingValue()); + } + + @Overwrite + public boolean isInputValid(String input) { + return super.isInputValid(input); + } +} diff --git a/src/main/java/de/hysky/skyblocker/mixin/yacl/LongFieldControllerMixin.java b/src/main/java/de/hysky/skyblocker/mixin/yacl/LongFieldControllerMixin.java new file mode 100644 index 00000000..99871e2e --- /dev/null +++ b/src/main/java/de/hysky/skyblocker/mixin/yacl/LongFieldControllerMixin.java @@ -0,0 +1,31 @@ +package de.hysky.skyblocker.mixin.yacl; + +import java.text.NumberFormat; +import java.util.function.Function; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Overwrite; + +import dev.isxander.yacl3.api.Option; +import dev.isxander.yacl3.gui.controllers.string.number.LongFieldController; +import dev.isxander.yacl3.gui.controllers.string.number.NumberFieldController; +import net.minecraft.text.Text; + +@Mixin(value = LongFieldController.class, remap = false) +public abstract class LongFieldControllerMixin extends NumberFieldController { + private static final NumberFormat NUMBER_FORMAT = NumberFormat.getInstance(); + + public LongFieldControllerMixin(Option option, Function displayFormatter) { + super(option, displayFormatter); + } + + @Overwrite + public String getString() { + return NUMBER_FORMAT.format(option().pendingValue()); + } + + @Overwrite + public boolean isInputValid(String input) { + return super.isInputValid(input); + } +} diff --git a/src/main/java/de/hysky/skyblocker/mixin/yacl/NumberFieldControllerMixin.java b/src/main/java/de/hysky/skyblocker/mixin/yacl/NumberFieldControllerMixin.java new file mode 100644 index 00000000..17a99cfd --- /dev/null +++ b/src/main/java/de/hysky/skyblocker/mixin/yacl/NumberFieldControllerMixin.java @@ -0,0 +1,43 @@ +package de.hysky.skyblocker.mixin.yacl; + +import java.text.DecimalFormatSymbols; +import java.text.NumberFormat; +import java.text.ParseException; +import java.text.ParsePosition; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Overwrite; + +import dev.isxander.yacl3.gui.controllers.slider.ISliderController; +import dev.isxander.yacl3.gui.controllers.string.number.NumberFieldController; +import dev.isxander.yacl3.impl.utils.YACLConstants; +import net.minecraft.util.math.MathHelper; + +@Mixin(value = NumberFieldController.class, remap = false) +public abstract class NumberFieldControllerMixin implements ISliderController { + private static final NumberFormat NUMBER_FORMAT = NumberFormat.getInstance(); + private static final DecimalFormatSymbols DECIMAL_FORMAT_SYMBOLS = DecimalFormatSymbols.getInstance(); + + @Overwrite + public void setFromString(String value) { + try { + setPendingValue(MathHelper.clamp(NUMBER_FORMAT.parse(value).doubleValue(), min(), max())); + } catch (ParseException ignore) { + YACLConstants.LOGGER.warn("Failed to parse number: {}", value); + } + } + + @Overwrite + public boolean isInputValid(String input) { + input = input.replace(DECIMAL_FORMAT_SYMBOLS.getGroupingSeparator() + "", ""); + ParsePosition parsePosition = new ParsePosition(0); + NUMBER_FORMAT.parse(input, parsePosition); + + return parsePosition.getIndex() == input.length(); + } + + @Overwrite + protected String cleanupNumberString(String number) { + throw new UnsupportedOperationException("This method should no longer be called."); + } +} diff --git a/src/main/resources/skyblocker.mixins.json b/src/main/resources/skyblocker.mixins.json index 4e7bfe16..5bafb324 100644 --- a/src/main/resources/skyblocker.mixins.json +++ b/src/main/resources/skyblocker.mixins.json @@ -36,7 +36,12 @@ "accessor.PlayerListHudAccessor", "accessor.RecipeBookWidgetAccessor", "accessor.ScreenAccessor", - "accessor.WorldRendererAccessor" + "accessor.WorldRendererAccessor", + "yacl.DoubleFieldControllerMixin", + "yacl.FloatFieldControllerMixin", + "yacl.IntegerFieldControllerMixin", + "yacl.LongFieldControllerMixin", + "yacl.NumberFieldControllerMixin" ], "injectors": { "defaultRequire": 1 -- cgit From 2fd4ca4e9042329a9af4e7cce76c72a3225d656d Mon Sep 17 00:00:00 2001 From: Aaron <51387595+AzureAaron@users.noreply.github.com> Date: Sat, 21 Oct 2023 05:20:11 -0400 Subject: Room Position Command --- .../skyblock/dungeon/secrets/DungeonSecrets.java | 36 +++++++++++++++++++++- .../skyblocker/skyblock/dungeon/secrets/Room.java | 14 +++++++++ .../resources/assets/skyblocker/lang/en_us.json | 2 ++ 3 files changed, 51 insertions(+), 1 deletion(-) 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 cb9615fb..d143a3c2 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 @@ -7,6 +7,10 @@ import com.mojang.brigadier.Command; import com.mojang.brigadier.arguments.IntegerArgumentType; import com.mojang.brigadier.builder.ArgumentBuilder; import com.mojang.brigadier.builder.RequiredArgumentBuilder; + +import it.unimi.dsi.fastutil.ints.IntRBTreeSet; +import it.unimi.dsi.fastutil.ints.IntSortedSet; +import it.unimi.dsi.fastutil.ints.IntSortedSets; import it.unimi.dsi.fastutil.objects.Object2ByteMap; import it.unimi.dsi.fastutil.objects.Object2ByteOpenHashMap; import it.unimi.dsi.fastutil.objects.ObjectIntPair; @@ -37,6 +41,8 @@ import net.minecraft.text.Text; import net.minecraft.util.ActionResult; import net.minecraft.util.Identifier; import net.minecraft.util.hit.BlockHitResult; +import net.minecraft.util.hit.HitResult; +import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Vec3d; import net.minecraft.world.World; import org.jetbrains.annotations.Contract; @@ -149,7 +155,9 @@ public class DungeonSecrets { UseBlockCallback.EVENT.register((player, world, hand, hitResult) -> onUseBlock(world, hitResult)); ClientCommandRegistrationCallback.EVENT.register((dispatcher, registryAccess) -> dispatcher.register(literal(SkyblockerMod.NAMESPACE).then(literal("dungeons").then(literal("secrets") .then(literal("markAsFound").then(markSecretsCommand(true))) - .then(literal("markAsMissing").then(markSecretsCommand(false))))))); + .then(literal("markAsMissing").then(markSecretsCommand(false))) + .then(literal("getPos").executes(context -> registerPosCommand(context.getSource(), false))) + .then(literal("getFacingPos").executes(context -> registerPosCommand(context.getSource(), true))))))); ClientPlayConnectionEvents.JOIN.register(((handler, sender, client) -> reset())); } @@ -222,6 +230,32 @@ public class DungeonSecrets { return Command.SINGLE_SUCCESS; }); } + + //TODO This logic can be split into a separate method for when we want to allow for adding custom waypoints + private static int registerPosCommand(FabricClientCommandSource source, boolean facing) { + if (currentRoom != null && currentRoom.getDirection() != null) { + MinecraftClient client = MinecraftClient.getInstance(); + + if (facing && (client.crosshairTarget == null || client.crosshairTarget.getType() != HitResult.Type.BLOCK)) { + source.sendError(Constants.PREFIX.get().append(Text.translatable("skyblocker.dungeons.secrets.unableToFindPos"))); + + return Command.SINGLE_SUCCESS; + } + + BlockPos blockToCheck = facing && client.crosshairTarget instanceof BlockHitResult blockHitResult ? blockHitResult.getBlockPos() : client.player.getBlockPos(); + IntSortedSet segmentsX = IntSortedSets.unmodifiable(new IntRBTreeSet(currentRoom.getSegments().stream().mapToInt(Vector2ic::x).toArray())); + IntSortedSet segmentsY = IntSortedSets.unmodifiable(new IntRBTreeSet(currentRoom.getSegments().stream().mapToInt(Vector2ic::y).toArray())); + Vector2ic physicalCornerPos = DungeonMapUtils.getPhysicalCornerPos(currentRoom.getDirection(), segmentsX, segmentsY); + + BlockPos relativePos = DungeonMapUtils.actualToRelative(currentRoom.getDirection(), physicalCornerPos, blockToCheck); + + source.sendFeedback(Constants.PREFIX.get().append(Text.translatable("skyblocker.dungeons.secrets.posMessage", relativePos.getX(), relativePos.getY(), relativePos.getZ()))); + } else { + source.sendError(Constants.PREFIX.get().append(Text.translatable("skyblocker.dungeons.secrets.unableToFindPos"))); + } + + return Command.SINGLE_SUCCESS; + } /** * Updates the dungeon. The general idea is similar to the Dungeon Rooms Mod. diff --git a/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/Room.java b/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/Room.java index dd7dc91e..6e7ee953 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/Room.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/Room.java @@ -28,6 +28,7 @@ import net.minecraft.world.World; import org.apache.commons.lang3.tuple.MutableTriple; import org.apache.commons.lang3.tuple.Triple; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; import org.joml.Vector2i; import org.joml.Vector2ic; @@ -72,6 +73,7 @@ public class Room { */ private TriState matched = TriState.DEFAULT; private Table secretWaypoints; + private Direction direction = null; public Room(@NotNull Type type, @NotNull Vector2ic... physicalPositions) { this.type = type; @@ -91,6 +93,16 @@ public class Room { public boolean isMatched() { return matched == TriState.TRUE; } + + @Nullable + public Direction getDirection() { + return direction; + } + + @NotNull + public Set getSegments() { + return segments; + } @Override public String toString() { @@ -297,6 +309,8 @@ public class Room { } secretWaypoints = ImmutableTable.copyOf(secretWaypointsMutable); matched = TriState.TRUE; + this.direction = direction; + DungeonSecrets.LOGGER.info("[Skyblocker] Room {} matched after checking {} block(s)", name, checkedBlocks.size()); } diff --git a/src/main/resources/assets/skyblocker/lang/en_us.json b/src/main/resources/assets/skyblocker/lang/en_us.json index 4dbe210e..b42ab1e3 100644 --- a/src/main/resources/assets/skyblocker/lang/en_us.json +++ b/src/main/resources/assets/skyblocker/lang/en_us.json @@ -272,6 +272,8 @@ "skyblocker.dungeons.secrets.markSecretMissing": "§rMarked secret #%d as missing.", "skyblocker.dungeons.secrets.markSecretFoundUnable": "§cUnable to mark secret #%d as found.", "skyblocker.dungeons.secrets.markSecretMissingUnable": "§cUnable to mark secret #%d as missing.", + "skyblocker.dungeons.secrets.posMessage": "§rRoom Pos: X: %d, Y: %d, Z: %d", + "skyblocker.dungeons.secrets.unableToFindPos": "§cUnable to find room position! (Are you in a dungeon room, are you facing a block?)", "skyblocker.fishing.reelNow": "Reel in now!", "skyblocker.rift.healNow": "Heal now!", -- cgit From 333db39ef1949aba6ed64b949d71d04cec11ec46 Mon Sep 17 00:00:00 2001 From: Yasin Date: Sat, 21 Oct 2023 20:22:56 +0200 Subject: Update to 1.15.0 --- CHANGELOG.md | 56 ++++ FEATURES.md | 150 +++++++---- MRREADME.md | 513 ++++++++++++++++++++++++++++++------- README.md | 185 ++++++++----- gradle.properties | 2 +- src/main/resources/fabric.mod.json | 2 +- 6 files changed, 696 insertions(+), 212 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b9eb2efc..09766a05 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,59 @@ +# Release 1.15.0 + +## Highlight +* New configuration frontend (YACL) by @AzureAaron +* Item Protection (`/skyblocker protectItem`) by @AzureAaron +* Item Rarity Backgrounds by @AzureAaron +* Item cooldown display by @Grayray75 +* Creeper beam puzzle solver by @msg-programs +* Configure Flame height by @LifeIsAParadox +* Secret Waypoint Rendering Customization by @AzureAaron +* Optimize Drill Fuel and Picko Durability with Caching by @kevinthegreat1 + +## What's Changed +* 1.20.2 by @AzureAaron in https://github.com/SkyblockerMod/Skyblocker/pull/324 +* YACL Config by @AzureAaron in https://github.com/SkyblockerMod/Skyblocker/pull/328 +* Config Tweaks by @AzureAaron in https://github.com/SkyblockerMod/Skyblocker/pull/334 +* Item Protection by @AzureAaron in https://github.com/SkyblockerMod/Skyblocker/pull/335 +* Use standardised license identifier by @Grayray75 in https://github.com/SkyblockerMod/Skyblocker/pull/320 +* Update shortcuts description by @AzureAaron in https://github.com/SkyblockerMod/Skyblocker/pull/342 +* Item Rarity Backgrounds by @AzureAaron in https://github.com/SkyblockerMod/Skyblocker/pull/340 +* sync MRREADME.md with modrinth description by @LifeIsAParadox in https://github.com/SkyblockerMod/Skyblocker/pull/338 +* Fix recipe book slot textures by @AzureAaron in https://github.com/SkyblockerMod/Skyblocker/pull/343 +* Add Support for Custom toString Function for Enum Dropdowns by @kevinthegreat1 in https://github.com/SkyblockerMod/Skyblocker/pull/344 +* Item cooldown display by @Grayray75 in https://github.com/SkyblockerMod/Skyblocker/pull/332 +* Update Loom and Gradle by @kevinthegreat1 in https://github.com/SkyblockerMod/Skyblocker/pull/345 +* Hook actual durability for Pickonimbus/Drills by @0xallie in https://github.com/SkyblockerMod/Skyblocker/pull/341 +* Optimize Scoreboard Stuff by @AzureAaron in https://github.com/SkyblockerMod/Skyblocker/pull/346 +* me.xrmvizzy -> de.hysky by @LifeIsAParadox in https://github.com/SkyblockerMod/Skyblocker/pull/348 +* Fix potential NPE by @kevinthegreat1 in https://github.com/SkyblockerMod/Skyblocker/pull/352 +* fix blaze by @LifeIsAParadox in https://github.com/SkyblockerMod/Skyblocker/pull/356 +* Fix Golden Goblin Slayer showing up as Goblin Slayer on commission HUD by @0xallie in https://github.com/SkyblockerMod/Skyblocker/pull/347 +* Refactor Utils by @kevinthegreat1 in https://github.com/SkyblockerMod/Skyblocker/pull/354 +* Refactor NBT Parsing by @kevinthegreat1 in https://github.com/SkyblockerMod/Skyblocker/pull/350 +* fix quick nav background texture by @LifeIsAParadox in https://github.com/SkyblockerMod/Skyblocker/pull/359 +* update issue template by @LifeIsAParadox in https://github.com/SkyblockerMod/Skyblocker/pull/360 +* Creeper beam puzzle solver by @msg-programs in https://github.com/SkyblockerMod/Skyblocker/pull/355 +* Scheduler Multithreaded Support + Refactor by @AzureAaron in https://github.com/SkyblockerMod/Skyblocker/pull/361 +* Update Fetchur solver by @0xallie in https://github.com/SkyblockerMod/Skyblocker/pull/363 +* Codec-based Test by @AzureAaron in https://github.com/SkyblockerMod/Skyblocker/pull/367 +* Optimize Drill Fuel and Picko Durability with Caching by @kevinthegreat1 in https://github.com/SkyblockerMod/Skyblocker/pull/366 +* fix issue_template by @LifeIsAParadox in https://github.com/SkyblockerMod/Skyblocker/pull/369 +* Refactor NEU Repo by @kevinthegreat1 in https://github.com/SkyblockerMod/Skyblocker/pull/364 +* change flame height by @LifeIsAParadox in https://github.com/SkyblockerMod/Skyblocker/pull/370 +* Secret Waypoint Rendering Customization by @AzureAaron in https://github.com/SkyblockerMod/Skyblocker/pull/371 +* Translations update from hysky translate by @Weblate-LifeIsAParadox in https://github.com/SkyblockerMod/Skyblocker/pull/325 +* New Message Feedback Prefix by @AzureAaron in https://github.com/SkyblockerMod/Skyblocker/pull/373 +* Remove unused quicknav translation strings by @AzureAaron in https://github.com/SkyblockerMod/Skyblocker/pull/374 +* Fix some HUD options resetting sometimes by @AzureAaron in https://github.com/SkyblockerMod/Skyblocker/pull/337 +* Patch Float/Double Field Controller Bug by @AzureAaron in https://github.com/SkyblockerMod/Skyblocker/pull/377 + +## New Contributors +* @0xallie made their first contribution in https://github.com/SkyblockerMod/Skyblocker/pull/341 + +**Full Changelog**: https://github.com/SkyblockerMod/Skyblocker/compare/v1.14.0...v1.15.0 +___ + # Release 1.14.0 ## Highlight diff --git a/FEATURES.md b/FEATURES.md index 66e5a15f..66d95587 100644 --- a/FEATURES.md +++ b/FEATURES.md @@ -1,49 +1,101 @@ -* Bars: Health and absorption, Mana, Defense, XP (moving fancy bars) -* Hide Messages: Ability Cooldown, Heal, AOTE, Implosion, Molten Wave, Teleport Pad Messages -* Dungeon Minimap -* Dungeon Secrets -* Starred Mob Glow -* Dungeon Puzzle Solver: - * Three Weirdos - * Blaze - * Tic Tac Toe - * Croesus - * Terminal: - * Order - * Coloured Items - * Item Name -* Dwarven Mines Solver: Fetchur, Puzzler -* Barn Solver: Treasure Hunter, Hungry Hiker -* Experiments Solvers -* Slayer helper: - * Vampire : Effigy Waypoints, Healing Melon Indicator, Twinclaws Ice Indicator, Steak Stake Indicator -* Drill Fuel and Pickonimbus 2000 in Item Durability Bar -* Hotbar Slot Lock Keybind (Select the hotbar slot you want to lock/unlock and press the lockbutton) -* Price tooltip: npc, motes, bazaar (avg, lbin), ah, museum -* reparty: write /rp to reparty + auto rejoin -* Wiki Lookup: press f4 to open the wiki page about the held item -* Discord Rich Presence: Allows user to show either their Piggy, Bits, or location. Along with a custom message -* Quicknav: fast navigate between pets, armor, enderchest, skill, collection, crafting, enchant, envil, warp dungeon, - warp hub -* Recipe book: in the vanilla recipe book all skyblock items are listed, and you can see the recipe of the item -* Backpack preview: after you clicked your backpack or enderchest once you can hover over the backpack or enderchest and - hold shift to preview -* Update notification -* Commission HUD: Dwarven Mines quests -* 1.8 hitbox for lever and farmland -* Custom Tab HUD + Fully configureable with ressourcepack -* Roughly enough items (REI) and Emi Support -* Fishing Helper + sound notification -* Mirrorverse Waypoints -* Attribute Shard Info Display -* Item and Armour customisation: - * Item Renaming - * Custom Armour Dye Colours - * Custom Armour Trims -* OptiFabric Compatibility -* Rare Drop Special Effects! Dungeon chest -* Dungeon Chest Profit Calculator -* Hide Status Effect Overlay -* Personal Compactor/Deletor preview -* Hide fake players in social interactions screen -* hidden relic helper \ No newline at end of file +### Dungeon Features: +- **Secrets Highlight:** Fully configurable +- **Minimap** +- **Starred Mob Glow** +- **Puzzle Helper:** + - *Croesus* + - *Three Weirdos* + - *Blaze* + - *Creeper Beams* + - *Trivia* + - *Tic Tac Toe* + - *Terminal:* + - *Order* + - *Coloured Items* + - *Item Name* +- **Rare Drop Special Effects** +- **Chest Profit Calculator** +- **Livid Color Helper** +- **Reparty:** Type /rp to reparty and enable auto-rejoin. + +### Item and Armor Customization: +- *Item Renaming* +- *Custom Armor Dye Colors* +- *Custom Armor Trims* + +### Health and Status Bars: +- **Bars:** + - *Health and absorption* + - *Mana* + - *Defense* + - *XP* + +### Dwarven Mines: +- **Dwarven Mines Solver:** + - *Fetchur* + - *Puzzler* +- **Commission HUD** + - *Provides information on Dwarven Mines quests* + +### Rift Features: +- **Mirrorverse Waypoints** + +### Spider's Den Features: +- **Hidden Relic Helper** + +### Slayer Helper: +- **Vampire:** + - *Effigy Waypoints* + - *Healing Melon Indicator* + - *Twinclaws Ice Indicator* + - *Steak Stake Indicator* + +### Visual Enhancements: +- **Fancy Tab HUD:** Fully configurable with a resource pack. +- **1.8 Hitbox for Lever and Farmland** +- **Hide Status Effect Overlay** +- **Personal Compactor/Deletor Preview** +- **Hide Fake Players in Social Interactions Screen** +- **Item Rarity Backgrounds** +- **Item Cooldown Display** +- **Configure Fire-Overlay Height** + +### User Interface Enhancements: +- **Attribute Shard Info Display** +- **Drill Fuel and Pickonimbus 2000 in Item Durability Bar** +- **Hotbar Slot Lock Keybind:** Select the hotbar slot you want to lock/unlock and press the lock button. +- **Price Tooltip:** (Provides information on) + - *NPC Prices* + - *Motes Prices* + - *bazaar (average, lowest bin)* + - *Auction House* + - *Museum* +- **Quicknav:** (Fully customizeable) Fast navigation between pets, armor, enderchest, skill, collection, crafting, enchant, anvil, warp dungeon, and warp hub. +- **Recipe Book:** Lists all Skyblock items in the vanilla recipe book, allowing you to see the recipe of the item. +- **Backpack Preview:** After clicking your backpack or enderchest once, you can hover over the backpack or enderchest and hold Shift to preview its contents. + +### Barn Features: +- **Barn Solver:** + - *Treasure Hunter* + - *Hungry Hiker* + +### Chat Features: +- **Hide Messages:** + - *Ability Cooldown* + - *Heal* + - *Aspect of the End (AOTE)* + - *Implosion* + - *Molten Wave* + - *`/show command`* + - *Teleport Pad Messages* + +### Miscellaneous Solvers: +- **Experiments Solvers** +- **Fishing Helper:** Includes sound notifications. + +### Miscellaneous Features: +- **Roughly Enough Items (REI) and EMI Support** +- **Item Protection** +- **Discord Rich Presence:** Allows users to show their Piggy, Bits, or location, along with a custom message. +- **Wiki Lookup:** Press F4 to open the wiki page about the held item. +- **OptiFabric Compatibility** \ No newline at end of file diff --git a/MRREADME.md b/MRREADME.md index 7e1e68ad..67dd29b2 100644 --- a/MRREADME.md +++ b/MRREADME.md @@ -2,7 +2,7 @@ ## Skyblocker -Hypixel Skyblock Mod for Minecraft 1.17.x + 1.18.x + 1.19.x + 1.20.x +Hypixel Skyblock Mod for Minecraft 1.20.2 ## 🔧 Configuration - [Mod Menu](https://modrinth.com/mod/modmenu) not required open config with modmenu \ @@ -10,17 +10,31 @@ or **/skyblocker config** Skyblocker has a variety of configurations. \ To access the configuration menu, you must install [Mod Menu](https://modrinth.com/mod/modmenu). -
Mod Menu
Mod Menu - Skyblocker config
+
Mod Menu
Skyblocker config
### List of Configuration
General -|Config option|Description| -|---|---| -| Update Notification | Get notified when there is a new update | -| View [backpack preview](https://cdn-raw.modrinth.com/data/y6DuFGwJ/images/ef33e34b79c1615bcb23f3a395b29b793ef32e34.png) without holding shift | Preview on hover | +| Config option | Description | +|-----------------------------------------------------------------------------------------------------------------------------------------------|---------------------| +| Auto accept Reparty | Auto accept Reparty | +| View [backpack preview](https://cdn-raw.modrinth.com/data/y6DuFGwJ/images/ef33e34b79c1615bcb23f3a395b29b793ef32e34.png) without holding shift | Preview on hover | +| Enable Comactor/Deletor Preview | Preview on hover | +| Hide empty item tooltips in menus | | +| Hide Status Effect Overlay | | + +
+ Fancy tab HUD + +| Config option | Description | +|-------------------------------|---------------------------------------------------------------------------| +| Enable fancy tab HUD | | +| Scale factor of fancy tab HUD | | +| Plain Player Names | display names without any special formatting | +| Player Name Sorty Method | default has no particular order. Alphabetical sort names alphabetically | +
Health, Mana, Defence & XP Bars @@ -31,12 +45,75 @@ To access the configuration menu, you must install [Mod Menu](https://modrinth.c |Configure Bar Position|[Customize Bar Positions](https://cdn.discordapp.com/attachments/1103292463558438993/1103292498345984070/healt-layer.png)|
+
+ Experiments Solver + +| Config option | Description | +|------------------------------|-------------| +| Enable Chromatron Solver | | +| Enable Superpairs Solver | | +| Enable Ultrasequencer Solver | | + +
+ +
+ Fishing Helper + +| Config option | Description | +|-----------------------|-------------| +| Enable Fishing Helper | | + +
+ +
+ Fairy Souls Helper + +| Config option | Description | +|-----------------------------------|---------------------| +| Enable Fairy Souls Helper | | +| Highlight found fairy souls | | +| Only highlight nearby fairy souls | radius of 50 blocks | + +
+ +
+ Item Cooldown + +| Config option | Description | +|----------------------|---------------------| +| Enable Item Cooldown | | + +
+ +
+ Shortcuts + +| Config option | Description | +|-----------------------------------|----------------------------------------| +| Enable Shortcuts | | +| Enable Command Shortcuts | | +| Enable Command Argument Shortcuts | | +| Shortcuts Config | Open new window to configure shortcuts | + +
+ +
+ Quiver Warning + +| Config option | Description | +|---------------------------------------|----------------------------------------| +| Enable Quiver Warning | | +| Enable Quiver Warning In Dungeons | | +| Enable Quiver Warning After a Dungeon | | + +
+
Item List -|Config option|Description| -|---|---| -|Enable Item List| Acitvate [recipe viewer](https://cdn-raw.modrinth.com/data/y6DuFGwJ/images/cf9f8077067b9781686f23116f163d529c21c404.png)| +| Config option | Description | +|------------------|--------------------------------------------------------------------------------------------------------------------------| +| Enable Item List | Acitvate [recipe viewer](https://cdn-raw.modrinth.com/data/y6DuFGwJ/images/cf9f8077067b9781686f23116f163d529c21c404.png) |
@@ -44,54 +121,244 @@ To access the configuration menu, you must install [Mod Menu](https://modrinth.c Customize [Item tooltip](https://cdn-raw.modrinth.com/data/y6DuFGwJ/images/12903f3f839d769fac48a4e74e04bee9aa1657d5.png) +| Config option | Description | +|------------------------------|----------------------------------------| +| Enable NPC Price | | +| Enable Motes Price | | +| Enable Avg. BIN Price | | +| Average Type | | +| Enable Lowest BIN Price | | +| Enable Bazaar buy/sell Price | | +| Enable Museum & Date | | + +
+ +
+ Item Info Display + +| Config option | Description | +|--------------------------------|-------------| +| Attribute Shard Info | | +| Item Rarity Backgrounds | | +| Item Rarity Background Opacity | | +
+ +
+ Wiki Lookup + +| Config option | Description | +|--------------------|-----------------------------------------------------| +| Enable Wiki Lookup | press f4 to open the wiki page pof the hovered item | +| Use Official Wiki | | +
+ +
+ Special Effects + +| Config option | Description | +|---------------------------|-------------| +| Rare Dungeon Drop Effects | |
Hitboxes -|Config option|Description| -|---|---| -|Enable 1.8 farmland hitbox| Change hitbox to the 1.8 one | -|Enable 1.8 lever hitbox| Change hitbox to the 1.8 one | +| Config option | Description | +|----------------------------|------------------------------| +| Enable 1.8 farmland hitbox | Change hitbox to the 1.8 one | +| Enable 1.8 lever hitbox | Change hitbox to the 1.8 one |
+ +
+ Title Container + +Used to display multiple titles at once, Example use: Vampire Slayer + +| Config option | Description | +|----------------------------------|-------------| +| Title Container Scale | | +| Title Container Placement Config | |
- Locations + Teleport Overlay + +| Config option | Description | +|---------------------------------------|-------------| +| Enable Teleport Overlays | | +| Enable Weird Transmission Overlay | | +| Enable Instant Transmission Overlay | | +| Enable Ether Transmission Overlay | | +| Enable Sinrecall Transmission Overlay | | +| Enable Wither Impact Overlay | | +
+ +
+ Flame Overlay + +| Config option | Description | +|---------------|-------------| +| Flame Height | | +| Flame Opacity | | +
+ +
Dungeons -|Config option|Description| -|---|---| -|Croseus Helper|Gray out chests that have already been opened| -|Enable Map| [Map](https://cdn-raw.modrinth.com/data/y6DuFGwJ/images/43243429b1c4d17236ae3e5a9836ecd7d905644b.png)| -|Solve Three Weirdos Puzzle|Solver usefull in Dungeons| -|Solve Blaze Puzzle|Solver usefull in Dungeons| -|Solve Trivia Puzzle|Solver usefull in Dungeons| +| Config option | Description | +|------------------------------|--------------------------------------------------------------------------------------------------------| +| Croseus Helper | Gray out chests that have already been opened | +| Enable Map | [Map](https://cdn-raw.modrinth.com/data/y6DuFGwJ/images/43243429b1c4d17236ae3e5a9836ecd7d905644b.png) | +| Dungeon Map Placement Config | | +| Map Scaling | | +| Starred Mob Glow | | +| Solve Three Weirdos Puzzle | Solver usefull in Dungeons | +| Solve Blaze Puzzle | Solver usefull in Dungeons | +| Solve Creeper Beams Puzzle | | +| Solve Trivia Puzzle | Solver usefull in Dungeons | +| Solve Tic Tac Toe Puzzle | |
- Terminal + Dungeon Secret Waypoints + +| Config option | Description | +|------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| Enable Dungeon Secret Waypoints | | +| Do Not Initialize Secret Waypoints | | +| Waypoint Type | Waypoint: Displays a highkught and beam
Outlined Waypoint: Displays both a waypoint and an outline
Highlight: Only displays a highlight
Outlined Highlight: Displays both a highlight and an outline
Outline: Outlines the secret in a box. | +| Show Secret Text | | +| Enable Entrance Waypoints | | +| Enable Superboom Waypoints | | +| Enable Chest Waypoints | | +| Enable Item Waypoints | | +| Enable Bat Waypoints | | +| Enable Wither Essence Waypoints | | +| Enable Lever Waypoints | | +| Enable Fairy Soul Waypoints | | +| Enable Stonk Waypoints | | +| Enable Default Waypoints | | +
-|Config option|Description| -|---|---| -|Solve Selectect Colored|Solver usefull in Dungeons 7| -|Solve Click In Order|Solver usefull in Dungeons 7| -|Solve Starts With|Solver usefull in Dungeons 7| +
+ Dungeon Chest Profit Calculator + +| Config option | Description | +|--------------------------|-------------| +| Enable Profit Calculator | | +| Include Kismet Price | | +| Include Essence | | +| Neutral Threshold | | +| Neutral Color | | +| Profit Color | | +| Loss Color | | +| Incomplete Color | | +
+ +
+ Livid Color + +| Config option | Description | +|--------------------|----------------------------------------------------------| +| Enable Livid Color | Send the livid color in chat during the Livid boss fight | +| Livid Color Text | text wich will be sent in the chat | +
+ +
+ Terminal Solvers + +| Config option | Description | +|-------------------------|------------------------------| +| Solve Selectect Colored | Solver usefull in Dungeons 7 | +| Solve Click In Order | Solver usefull in Dungeons 7 | +| Solve Starts With | Solver usefull in Dungeons 7 |
+
+
Dwarven Mines -|Config option|Description| -|---|---| -|Enable Drill Fuel|[Drill icon](https://cdn-raw.modrinth.com/data/y6DuFGwJ/images/43c7ab7aa7c90fcf833c7cddbf73e6644c6ce5fa.png)| -|Solve Fetchur| Solver usefull in Mines| -|Solve Puzzler Puzzle| Solver usefull in Mines | -|Dwarven Hud| [Commision Hud](https://cdn.discordapp.com/attachments/905867886428565565/950513333478494248/Screen_Shot_2022-03-07_at_4.58.12_PM.png)| +| Config option | Description | +|----------------------|----------------------------------------------------------------------------------------------------------------------------------------| +| Enable Drill Fuel | [Drill icon](https://cdn-raw.modrinth.com/data/y6DuFGwJ/images/43c7ab7aa7c90fcf833c7cddbf73e6644c6ce5fa.png) | +| Solve Fetchur | Solver usefull in Mines | +| Solve Puzzler Puzzle | Solver usefull in Mines | + +
+ Dwarven HUD + +| Config option | Description | +|-----------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------| +| Enabled | | +| Style for HUD | Simple: Shows name and percentage
Fancy: Shows name, percentage, progress bar and an icon
Classic: Shows name and percentage in a very simple box | +| Dwarven HUD Config... | | +| Enable Background | | + +
+ +
+ +
+ Locations + +
+ Barn + +| Config option | Description | +|:----------------------|:------------| +| Solve Hungry Hiker | | +| Solve Treasure Hunter | | + +
+ +
+ The Rift + +| Config option | Description | +|:-----------------------------|:---------------------------------------| +| Enable Mirrorverse Waypoints | | +| McGrubber Sacks | Used for calculating Motes sell prices | + +
+ +
+ Spider's Den + +| Config option | Description | +|:----------------------------|:------------| +| Enable Hidden Relics Helper | | +| Highlight found relics | | +
+
+
+ Slayers + +
+ Vampire Slayer + +| Config option | Description | +|:-----------------------------------------------|:------------| +| Enable Effigy Waypoints | | +| Compact Effigy Waypoints | | +| Effigy Waypoints Update Frequency (Ticks) | | +| Enable Holy Ice Indicator | | +| Holy Ice Indicator Delay (Ticks) | | +| Holy Ice Indicator Update Frequency (Ticks) | | +| Enable Healing Melon Indicator | | +| Healing Melon Indicator Threshold (Hearts) | | +| Enable Steak Stake Indicator | | +| Steak Stake Indicator Update Frequency (Ticks) | | +| Enable Mania Block Indicator | | +| Mania Indicator Update Frequency (Ticks) | | + +
+ +
Quick Navigation @@ -112,25 +379,24 @@ Customize [Item tooltip](https://cdn-raw.modrinth.com/data/y6DuFGwJ/images/12903
-
Messages -|Config option|Description| -|---|---| -|Hide Ability Cooldown|Disable,Filter or Move to action bar| -|Hide Heal Messages|Disable,Filter or Move to action bar| -|Hide AOTE Messages|Disable,Filter or Move to action bar| -|Hide Implosion Message|Disable,Filter or Move to action bar| -|Hide Molten Wave Message|Disable,Filter or Move to action bar| -|Hide Ads from Public Chat|Disable,Filter or Move to action bar| -|Hide Teleport Pad Messages|Disable,Filter or Move to action bar| -|Hide Combo Messages|Disable,Filter or Move to action bar| -|Hide Autopet Messages|Disable,Filter or Move to action bar| -|Hide Mana Consumption Messages from Action Bar|Activate or deactivate| +| Config option | Description | +|------------------------------------------------|-----------------------------------------| +| Hide Ability Cooldown | Disable,Filter or Move to action bar | +| Hide Heal Messages | Disable,Filter or Move to action bar | +| Hide AOTE Messages | Disable,Filter or Move to action bar | +| Hide Implosion Message | Disable,Filter or Move to action bar | +| Hide Molten Wave Message | Disable,Filter or Move to action bar | +| Hide Ads from Public Chat | Disable,Filter or Move to action bar | +| Hide Teleport Pad Messages | Disable,Filter or Move to action bar | +| Hide Combo Messages | Disable,Filter or Move to action bar | +| Hide Autopet Messages | Disable,Filter or Move to action bar | +| Hide Show Off Messages | Filters messages from the `/show command` | +| Hide Mana Consumption Messages from Action Bar | Activate or deactivate |
-
Discord Rich Presence @@ -146,58 +412,111 @@ Customize [Item tooltip](https://cdn-raw.modrinth.com/data/y6DuFGwJ/images/12903 Click [#Gallery](https://modrinth.com/mod/skyblocker-liap/gallery) for images to this mod ## 📖Features -
+
open -* Bars: Health and absorption, Mana, Defense, XP (moving fancy bars) -* Hide Messages: Ability Cooldown, Heal, AOTE, Implosion, Molten Wave, Teleport Pad Messages -* Dungeon Minimap -* Dungeon Secrets -* Starred Mob Glow -* Dungeon Puzzle Solver: - * Three Weirdos - * Blaze - * Tic Tac Toe - * Croesus - * Terminal: - * Order - * Coloured Items - * Item Name -* Dwarven Mines Solver: Fetchur, Puzzler -* Barn Solver: Treasure Hunter, Hungry Hiker -* Experiments Solvers -* Slayer helper: - * Vampire : Effigy Waypoints, Healing Melon Indicator, Twinclaws Ice Indicator, Steak Stake Indicator -* Drill Fuel and Pickonimbus 2000 in Item Durability Bar -* Hotbar Slot Lock Keybind (Select the hotbar slot you want to lock/unlock and press the lockbutton) -* Price tooltip: npc, motes, bazaar (avg, lbin), ah, museum -* reparty: write /rp to reparty + auto rejoin -* Wiki Lookup: press f4 to open the wiki page about the held item -* Discord Rich Presence: Allows user to show either their Piggy, Bits, or location. Along with a custom message -* Quicknav: fast navigate between pets, armor, enderchest, skill, collection, crafting, enchant, envil, warp dungeon, - warp hub -* Recipe book: in the vanilla recipe book all skyblock items are listed, and you can see the recipe of the item -* Backpack preview: after you clicked your backpack or enderchest once you can hover over the backpack or enderchest and - hold shift to preview -* Update notification -* Commission HUD: Dwarven Mines quests -* 1.8 hitbox for lever and farmland -* Custom Tab HUD + Fully configureable with ressourcepack -* Roughly enough items (REI) and Emi Support -* Fishing Helper + sound notification -* Mirrorverse Waypoints -* Attribute Shard Info Display -* Item and Armour customisation: - * Item Renaming - * Custom Armour Dye Colours - * Custom Armour Trims -* OptiFabric Compatibility -* Rare Drop Special Effects! Dungeon chest -* Dungeon Chest Profit Calculator -* Hide Status Effect Overlay -* Personal Compactor/Deletor preview -* Hide fake players in social interactions screen -* hidden relic helper +### Dungeon Features: +- **Secrets Highlight:** Fully configurable +- **Minimap** +- **Starred Mob Glow** +- **Puzzle Helper:** + - *Croesus* + - *Three Weirdos* + - *Blaze* + - *Creeper Beams* + - *Trivia* + - *Tic Tac Toe* + - *Terminal:* + - *Order* + - *Coloured Items* + - *Item Name* +- **Rare Drop Special Effects** +- **Chest Profit Calculator** +- **Livid Color Helper** +- **Reparty:** Type /rp to reparty and enable auto-rejoin. + +### Item and Armor Customization: +- *Item Renaming* +- *Custom Armor Dye Colors* +- *Custom Armor Trims* + +### Health and Status Bars: +- **Bars:** + - *Health and absorption* + - *Mana* + - *Defense* + - *XP* + +### Dwarven Mines: +- **Dwarven Mines Solver:** + - *Fetchur* + - *Puzzler* +- **Commission HUD** + - *Provides information on Dwarven Mines quests* + +### Rift Features: +- **Mirrorverse Waypoints** + +### Spider's Den Features: +- **Hidden Relic Helper** + +### Slayer Helper: +- **Vampire:** + - *Effigy Waypoints* + - *Healing Melon Indicator* + - *Twinclaws Ice Indicator* + - *Steak Stake Indicator* + +### Visual Enhancements: +- **Fancy Tab HUD:** Fully configurable with a resource pack. +- **1.8 Hitbox for Lever and Farmland** +- **Hide Status Effect Overlay** +- **Personal Compactor/Deletor Preview** +- **Hide Fake Players in Social Interactions Screen** +- **Item Rarity Backgrounds** +- **Item Cooldown Display** +- **Configure Fire-Overlay Height** + +### User Interface Enhancements: +- **Attribute Shard Info Display** +- **Drill Fuel and Pickonimbus 2000 in Item Durability Bar** +- **Hotbar Slot Lock Keybind:** Select the hotbar slot you want to lock/unlock and press the lock button. +- **Price Tooltip:** (Provides information on) + - *NPC Prices* + - *Motes Prices* + - *bazaar (average, lowest bin)* + - *Auction House* + - *Museum* +- **Quicknav:** (Fully customizeable) Fast navigation between pets, armor, enderchest, skill, collection, crafting, enchant, anvil, warp dungeon, and warp hub. +- **Recipe Book:** Lists all Skyblock items in the vanilla recipe book, allowing you to see the recipe of the item. +- **Backpack Preview:** After clicking your backpack or enderchest once, you can hover over the backpack or enderchest and hold Shift to preview its contents. + +### Barn Features: +- **Barn Solver:** + - *Treasure Hunter* + - *Hungry Hiker* + +### Chat Features: +- **Hide Messages:** + - *Ability Cooldown* + - *Heal* + - *Aspect of the End (AOTE)* + - *Implosion* + - *Molten Wave* + - *`/show command`* + - *Teleport Pad Messages* + +### Miscellaneous Solvers: +- **Experiments Solvers** +- **Fishing Helper:** Includes sound notifications. + +### Miscellaneous Features: +- **Roughly Enough Items (REI) and EMI Support** +- **Item Protection** +- **Discord Rich Presence:** Allows users to show their Piggy, Bits, or location, along with a custom message. +- **Wiki Lookup:** Press F4 to open the wiki page about the held item. +- **OptiFabric Compatibility** +
diff --git a/README.md b/README.md index a5f7f9cf..18797225 100644 --- a/README.md +++ b/README.md @@ -17,55 +17,107 @@ Installation guide is [here](https://github.com/SkyblockerMod/Skyblocker/wiki/in
open -* Bars: Health and absorption, Mana, Defense, XP (moving fancy bars) -* Hide Messages: Ability Cooldown, Heal, AOTE, Implosion, Molten Wave, Teleport Pad Messages -* Dungeon Minimap -* Dungeon Secrets -* Starred Mob Glow -* Dungeon Puzzle Solver: - * Three Weirdos - * Blaze - * Tic Tac Toe - * Croesus - * Terminal: - * Order - * Coloured Items - * Item Name -* Dwarven Mines Solver: Fetchur, Puzzler -* Barn Solver: Treasure Hunter, Hungry Hiker -* Experiments Solvers -* Slayer helper: - * Vampire : Effigy Waypoints, Healing Melon Indicator, Twinclaws Ice Indicator, Steak Stake Indicator -* Drill Fuel and Pickonimbus 2000 in Item Durability Bar -* Hotbar Slot Lock Keybind (Select the hotbar slot you want to lock/unlock and press the lockbutton) -* Price tooltip: npc, motes, bazaar (avg, lbin), ah, museum -* reparty: write /rp to reparty + auto rejoin -* Wiki Lookup: press f4 to open the wiki page about the held item -* Discord Rich Presence: Allows user to show either their Piggy, Bits, or location. Along with a custom message -* Quicknav: fast navigate between pets, armor, enderchest, skill, collection, crafting, enchant, envil, warp dungeon, - warp hub -* Recipe book: in the vanilla recipe book all skyblock items are listed, and you can see the recipe of the item -* Backpack preview: after you clicked your backpack or enderchest once you can hover over the backpack or enderchest and - hold shift to preview -* Update notification -* Commission HUD: Dwarven Mines quests -* 1.8 hitbox for lever and farmland -* Custom Tab HUD + Fully configureable with ressourcepack -* Roughly enough items (REI) and Emi Support -* Fishing Helper + sound notification -* Mirrorverse Waypoints -* Attribute Shard Info Display -* Item and Armour customisation: - * Item Renaming - * Custom Armour Dye Colours - * Custom Armour Trims -* OptiFabric Compatibility -* Rare Drop Special Effects! Dungeon chest -* Dungeon Chest Profit Calculator -* Hide Status Effect Overlay -* Personal Compactor/Deletor preview -* Hide fake players in social interactions screen -* hidden relic helper +### Dungeon Features: +- **Secrets Highlight:** Fully configurable +- **Minimap** +- **Starred Mob Glow** +- **Puzzle Helper:** + - *Croesus* + - *Three Weirdos* + - *Blaze* + - *Creeper Beams* + - *Trivia* + - *Tic Tac Toe* + - *Terminal:* + - *Order* + - *Coloured Items* + - *Item Name* +- **Rare Drop Special Effects** +- **Chest Profit Calculator** +- **Livid Color Helper** +- **Reparty:** Type /rp to reparty and enable auto-rejoin. + +### Item and Armor Customization: +- *Item Renaming* +- *Custom Armor Dye Colors* +- *Custom Armor Trims* + +### Health and Status Bars: +- **Bars:** + - *Health and absorption* + - *Mana* + - *Defense* + - *XP* + +### Dwarven Mines: +- **Dwarven Mines Solver:** + - *Fetchur* + - *Puzzler* +- **Commission HUD** + - *Provides information on Dwarven Mines quests* + +### Rift Features: +- **Mirrorverse Waypoints** + +### Spider's Den Features: +- **Hidden Relic Helper** + +### Slayer Helper: +- **Vampire:** + - *Effigy Waypoints* + - *Healing Melon Indicator* + - *Twinclaws Ice Indicator* + - *Steak Stake Indicator* + +### Visual Enhancements: +- **Fancy Tab HUD:** Fully configurable with a resource pack. +- **1.8 Hitbox for Lever and Farmland** +- **Hide Status Effect Overlay** +- **Personal Compactor/Deletor Preview** +- **Hide Fake Players in Social Interactions Screen** +- **Item Rarity Backgrounds** +- **Item Cooldown Display** +- **Configure Fire-Overlay Height** + +### User Interface Enhancements: +- **Attribute Shard Info Display** +- **Drill Fuel and Pickonimbus 2000 in Item Durability Bar** +- **Hotbar Slot Lock Keybind:** Select the hotbar slot you want to lock/unlock and press the lock button. +- **Price Tooltip:** (Provides information on) + - *NPC Prices* + - *Motes Prices* + - *bazaar (average, lowest bin)* + - *Auction House* + - *Museum* +- **Quicknav:** (Fully customizeable) Fast navigation between pets, armor, enderchest, skill, collection, crafting, enchant, anvil, warp dungeon, and warp hub. +- **Recipe Book:** Lists all Skyblock items in the vanilla recipe book, allowing you to see the recipe of the item. +- **Backpack Preview:** After clicking your backpack or enderchest once, you can hover over the backpack or enderchest and hold Shift to preview its contents. + +### Barn Features: +- **Barn Solver:** + - *Treasure Hunter* + - *Hungry Hiker* + +### Chat Features: +- **Hide Messages:** + - *Ability Cooldown* + - *Heal* + - *Aspect of the End (AOTE)* + - *Implosion* + - *Molten Wave* + - *`/show command`* + - *Teleport Pad Messages* + +### Miscellaneous Solvers: +- **Experiments Solvers** +- **Fishing Helper:** Includes sound notifications. + +### Miscellaneous Features: +- **Roughly Enough Items (REI) and EMI Support** +- **Item Protection** +- **Discord Rich Presence:** Allows users to show their Piggy, Bits, or location, along with a custom message. +- **Wiki Lookup:** Press F4 to open the wiki page about the held item. +- **OptiFabric Compatibility**
@@ -73,13 +125,14 @@ ___ ## Commands -| command | option | comment | -|:---------------------:|:-------------------------------------:|:-------------------------------------------| -| /skyblocker config | | open config menu (modMenu not needed) | -| /skyblocker options | | open config menu (modMenu not needed) | -| /skyblocker hud | dwarven / dungeonmap / titleContainer | move dwarven, dungeonmap or titleContainer | -| /skyblocker shortcuts | | add/edit shortcuts | -| /skyblocker custom | renameItem / armorTrim / dyeColor | Item and Armour customisation | +| command | option | comment | +|:-----------------------:|:-------------------------------------:|:----------------------------------------------------| +| /skyblocker config | | open config menu (modMenu not needed) | +| /skyblocker options | | open config menu (modMenu not needed) | +| /skyblocker hud | dwarven / dungeonmap / titleContainer | move dwarven, dungeonmap or titleContainer | +| /skyblocker shortcuts | | add/edit shortcuts | +| /skyblocker custom | renameItem / armorTrim / dyeColor | Item and Armour customisation | +| /skyblocker protectItem | | When an item is protected it's safe from:
- Being dropped while holding it, regardless of the slot being locked
- Being dropped from picking it up in your inventory then clicking outside the screen
- Being dropped via hovering over it and pressing the drop key | --- @@ -110,6 +163,8 @@ information. ## Credits +### Contributor + | [Kraineff](https://github.com/Kraineff) | [d3dx9](https://github.com/d3dx9) | [LifeIsAParadox](https://github.com/LifeIsAParadox) | [ExternalTime](https://github.com/ExternalTime) | |:-----------------------------------------------------------------------------------------------------:|:--------------------------------------------------------------------------------------------:|:-----------------------------------------------------------------------------------------------------------------------:|:-----------------------------------------------------------------------------------------------------------------:| | [Kraineff](https://github.com/Kraineff) | [d3dx9](https://github.com/d3dx9) | [LifeIsAParadox](https://github.com/LifeIsAParadox) | [ExternalTime](https://github.com/ExternalTime) | @@ -126,18 +181,19 @@ information. |:--------------------------------------------------------------------------------------------------:|:-----------------------------------------------------------------------------------------------------------------------:|:-----------------------------------------------------------------------------------------------------------:|:-----------------------------------------------------------------------------------------------------------------:| | [catandA](https://github.com/catandA) | [kevinthegreat1](https://github.com/kevinthegreat1) | [AzureAaron](https://github.com/AzureAaron) | [msg-programs](https://github.com/msg-programs) | -| [lantice3720](https://github.com/lantice3720) | [lantice3720](https://github.com/koloiyolo) | [lantice3720](https://github.com/Futuremappermydud) |[viciscat](https://github.com/Futuremappermydud) | -|:--------------------------------------------------------------------------------------------------------------:|:----------------------------------------------------------------------------------------------------------:|:--------------------------------------------------------------------------------------------------------------------------:|:--------------------------------------------------------------------------------------------------------------------------:| -| [lantice3720](https://github.com/lantice3720) | [koloiyolo](https://github.com/koloiyolo) | [Futuremappermydud](https://github.com/Futuremappermydud) | [viciscat](https://github.com/Futuremappermydud) | +| [lantice3720](https://github.com/lantice3720) | [koloiyolo](https://github.com/koloiyolo) | [Futuremappermydud](https://github.com/Futuremappermydud) | [viciscat](https://github.com/viciscat) | +|:--------------------------------------------------------------------------------------------------------------:|:----------------------------------------------------------------------------------------------------------:|:--------------------------------------------------------------------------------------------------------------------------:|:--------------------------------------------------------------------------------------------------------------:| +| [lantice3720](https://github.com/lantice3720) | [koloiyolo](https://github.com/koloiyolo) | [Futuremappermydud](https://github.com/Futuremappermydud) | [viciscat](https://github.com/viciscat) | + +| [Grayray75](https://github.com/Grayray75) | [alexiayaa](https://github.com/alexiayaa) | +|:----------------------------------------------------------------------------------------------------------------:|:----------------------------------------------------------------------------------------------------------------:| +| [Grayray75](https://github.com/Grayray75) | [alexiayaa](https://github.com/alexiayaa) | -| [Grayray75](https://github.com/Futuremappermydud) | -|:--------------------------------------------------------------------------------------------------------------:| -| [Grayray75](https://github.com/lantice3720) | ### Translators German ([LifeIsAParadox](https://github.com/LifeIsAParadox) & [msg-programs](https://github.com/msg-programs)) \ Indonesian ([null2264](https://github.com/null2264)) \ -Russian ([HyperSoop](https://github.com/HyperSoop) & [CrimsonIsle](https://github.com/CrimsonIsle))\ +Russian ([HyperSoop](https://github.com/HyperSoop) & [CrimsonIsle](https://github.com/CrimsonIsle) & [Ghost-3](https://github.com/Ghost-3))\ French ([edgarogh](https://github.com/edgarogh) & [Julienraptor01](https://github.com/Julienraptor01) & [viciscat](https://github.com/viciscat) & [Kiverty](https://github.com/Kiverty)) \ Japanese ([hirochisan](https://github.com/hirochisan)) \ Chinese ([catandA](https://github.com/catandA)) \ @@ -147,4 +203,5 @@ Spanish ([IngeSebastian](https://github.com/IngeSebastian)) \ Norwegian Bokmål ([KdGaming0](https://github.com/KdGaming0)) \ Norwegian Nynorsk ([KdGaming0](https://github.com/KdGaming0)) \ Turkish ([Fix3dll](https://github.com/Fix3dll)) \ -Canadian English ([AzureAaron](https://github.com/AzureAaron)) \ No newline at end of file +Canadian English ([AzureAaron](https://github.com/AzureAaron)) \ +Portuguese (Brazil) ([OhRetro](https://github.com/OhRetro)) \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index abe5d2f7..c5794079 100644 --- a/gradle.properties +++ b/gradle.properties @@ -33,7 +33,7 @@ occlusionculling_version = 0.0.7-SNAPSHOT repoparser_version = 1.4.0 # Mod Properties -mod_version = 1.14.0 +mod_version = 1.15.0 maven_group = de.hysky archives_base_name = skyblocker modrinth_id=y6DuFGwJ \ No newline at end of file diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index e5900e76..b55214d5 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -5,7 +5,7 @@ "name": "Skyblocker", "description": "Hypixel Skyblock Mod", "authors": ["xMrVizzy", "d3dx9", "LifeIsAParadox"], - "contributors": ["ExternalTime", "Zailer43", "TacoMonkey", "KonaeAkira", "Fix3dll", "null2264", "HyperSoop", "edgarogh", "TheColdPot", "Julienraptor01", "ADON15c", "catandA", "kevinthegreat1", "AzureAaron", "msg-programs", "lantice3720"], + "contributors": ["ExternalTime", "Zailer43", "TacoMonkey", "KonaeAkira", "Fix3dll", "null2264", "HyperSoop", "edgarogh", "TheColdPot", "Julienraptor01", "ADON15c", "catandA", "kevinthegreat1", "AzureAaron", "msg-programs", "lantice3720", "Futuremappermydud", "koloiyolo", "viciscat", "Grayray75", "alexiayaa"], "contact": { "homepage": "https://hysky.de", "sources": "https://github.com/SkyblockerMod/Skyblocker", -- cgit From 3a3c2d2c8e8c044a3d13750619e89e122922eeaa Mon Sep 17 00:00:00 2001 From: Yasin Date: Sat, 21 Oct 2023 21:07:36 +0200 Subject: some changes --- CHANGELOG.md | 8 ++++---- FEATURES.md | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 09766a05..e6930a81 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,19 +23,19 @@ * Add Support for Custom toString Function for Enum Dropdowns by @kevinthegreat1 in https://github.com/SkyblockerMod/Skyblocker/pull/344 * Item cooldown display by @Grayray75 in https://github.com/SkyblockerMod/Skyblocker/pull/332 * Update Loom and Gradle by @kevinthegreat1 in https://github.com/SkyblockerMod/Skyblocker/pull/345 -* Hook actual durability for Pickonimbus/Drills by @0xallie in https://github.com/SkyblockerMod/Skyblocker/pull/341 +* Hook actual durability for Pickonimbus/Drills by @alexiayaa in https://github.com/SkyblockerMod/Skyblocker/pull/341 * Optimize Scoreboard Stuff by @AzureAaron in https://github.com/SkyblockerMod/Skyblocker/pull/346 * me.xrmvizzy -> de.hysky by @LifeIsAParadox in https://github.com/SkyblockerMod/Skyblocker/pull/348 * Fix potential NPE by @kevinthegreat1 in https://github.com/SkyblockerMod/Skyblocker/pull/352 * fix blaze by @LifeIsAParadox in https://github.com/SkyblockerMod/Skyblocker/pull/356 -* Fix Golden Goblin Slayer showing up as Goblin Slayer on commission HUD by @0xallie in https://github.com/SkyblockerMod/Skyblocker/pull/347 +* Fix Golden Goblin Slayer showing up as Goblin Slayer on commission HUD by @alexiayaa in https://github.com/SkyblockerMod/Skyblocker/pull/347 * Refactor Utils by @kevinthegreat1 in https://github.com/SkyblockerMod/Skyblocker/pull/354 * Refactor NBT Parsing by @kevinthegreat1 in https://github.com/SkyblockerMod/Skyblocker/pull/350 * fix quick nav background texture by @LifeIsAParadox in https://github.com/SkyblockerMod/Skyblocker/pull/359 * update issue template by @LifeIsAParadox in https://github.com/SkyblockerMod/Skyblocker/pull/360 * Creeper beam puzzle solver by @msg-programs in https://github.com/SkyblockerMod/Skyblocker/pull/355 * Scheduler Multithreaded Support + Refactor by @AzureAaron in https://github.com/SkyblockerMod/Skyblocker/pull/361 -* Update Fetchur solver by @0xallie in https://github.com/SkyblockerMod/Skyblocker/pull/363 +* Update Fetchur solver by @alexiayaa in https://github.com/SkyblockerMod/Skyblocker/pull/363 * Codec-based Test by @AzureAaron in https://github.com/SkyblockerMod/Skyblocker/pull/367 * Optimize Drill Fuel and Picko Durability with Caching by @kevinthegreat1 in https://github.com/SkyblockerMod/Skyblocker/pull/366 * fix issue_template by @LifeIsAParadox in https://github.com/SkyblockerMod/Skyblocker/pull/369 @@ -49,7 +49,7 @@ * Patch Float/Double Field Controller Bug by @AzureAaron in https://github.com/SkyblockerMod/Skyblocker/pull/377 ## New Contributors -* @0xallie made their first contribution in https://github.com/SkyblockerMod/Skyblocker/pull/341 +* @alexiayaa made their first contribution in https://github.com/SkyblockerMod/Skyblocker/pull/341 **Full Changelog**: https://github.com/SkyblockerMod/Skyblocker/compare/v1.14.0...v1.15.0 ___ diff --git a/FEATURES.md b/FEATURES.md index 66d95587..a8c8ae79 100644 --- a/FEATURES.md +++ b/FEATURES.md @@ -1,13 +1,13 @@ ### Dungeon Features: -- **Secrets Highlight:** Fully configurable +- **Secrets Waypoint Highlight:** Fully configurable - **Minimap** - **Starred Mob Glow** -- **Puzzle Helper:** - - *Croesus* +- **Croesus Helper** +- **Puzzle Solver:** - *Three Weirdos* - *Blaze* - *Creeper Beams* - - *Trivia* + - *Quiz - Ouro the Omniscient* - *Tic Tac Toe* - *Terminal:* - *Order* -- cgit From 9cc09de788ce6f1003a92d1bdedabe8f0fd20c4e Mon Sep 17 00:00:00 2001 From: Aaron <51387595+AzureAaron@users.noreply.github.com> Date: Sun, 22 Oct 2023 04:01:26 -0400 Subject: Add AOTV & Pearl Secret Waypoints --- .../hysky/skyblocker/config/SkyblockerConfig.java | 6 ++ .../config/categories/DungeonsCategory.java | 15 +++++ .../skyblock/dungeon/secrets/DungeonSecrets.java | 2 +- .../skyblocker/skyblock/dungeon/secrets/Room.java | 13 ++++- .../skyblock/dungeon/secrets/SecretWaypoint.java | 4 ++ .../skyblocker/dungeons/secretlocations.json | 65 +++++++++++++++++++++- .../resources/assets/skyblocker/lang/en_us.json | 5 +- 7 files changed, 104 insertions(+), 6 deletions(-) diff --git a/src/main/java/de/hysky/skyblocker/config/SkyblockerConfig.java b/src/main/java/de/hysky/skyblocker/config/SkyblockerConfig.java index d7279bc8..3f39c933 100644 --- a/src/main/java/de/hysky/skyblocker/config/SkyblockerConfig.java +++ b/src/main/java/de/hysky/skyblocker/config/SkyblockerConfig.java @@ -605,6 +605,12 @@ public class SkyblockerConfig { @SerialEntry public boolean enableStonkWaypoints = true; + + @SerialEntry + public boolean enableAotvWaypoints = true; + + @SerialEntry + public boolean enablePearlWaypoints = true; @SerialEntry public boolean enableDefaultWaypoints = true; 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 7b32cb78..0101eccf 100644 --- a/src/main/java/de/hysky/skyblocker/config/categories/DungeonsCategory.java +++ b/src/main/java/de/hysky/skyblocker/config/categories/DungeonsCategory.java @@ -122,6 +122,21 @@ public class DungeonsCategory { newValue -> config.locations.dungeons.secretWaypoints.enableStonkWaypoints = newValue) .controller(ConfigUtils::createBooleanController) .build()) + .option(Option.createBuilder() + .name(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.enableAotvWaypoints")) + .binding(defaults.locations.dungeons.secretWaypoints.enableAotvWaypoints, + () -> config.locations.dungeons.secretWaypoints.enableAotvWaypoints, + newValue -> config.locations.dungeons.secretWaypoints.enableAotvWaypoints = newValue) + .controller(ConfigUtils::createBooleanController) + .build()) + .option(Option.createBuilder() + .name(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.enablePearlWaypoints")) + .description(OptionDescription.of(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.enablePearlWaypoints.@Tooltip"))) + .binding(defaults.locations.dungeons.secretWaypoints.enablePearlWaypoints, + () -> config.locations.dungeons.secretWaypoints.enablePearlWaypoints, + newValue -> config.locations.dungeons.secretWaypoints.enablePearlWaypoints = newValue) + .controller(ConfigUtils::createBooleanController) + .build()) .option(Option.createBuilder() .name(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.enableDefaultWaypoints")) .description(OptionDescription.of(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.enableDefaultWaypoints.@Tooltip"))) 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 d143a3c2..d01305f9 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 @@ -249,7 +249,7 @@ public class DungeonSecrets { BlockPos relativePos = DungeonMapUtils.actualToRelative(currentRoom.getDirection(), physicalCornerPos, blockToCheck); - source.sendFeedback(Constants.PREFIX.get().append(Text.translatable("skyblocker.dungeons.secrets.posMessage", relativePos.getX(), relativePos.getY(), relativePos.getZ()))); + source.sendFeedback(Constants.PREFIX.get().append(Text.translatable("skyblocker.dungeons.secrets.posMessage", currentRoom.getName(), relativePos.getX(), relativePos.getY(), relativePos.getZ()))); } else { source.sendError(Constants.PREFIX.get().append(Text.translatable("skyblocker.dungeons.secrets.unableToFindPos"))); } diff --git a/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/Room.java b/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/Room.java index 6e7ee953..79b13d3b 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/Room.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/Room.java @@ -74,6 +74,7 @@ public class Room { private TriState matched = TriState.DEFAULT; private Table secretWaypoints; private Direction direction = null; + private String name = null; public Room(@NotNull Type type, @NotNull Vector2ic... physicalPositions) { this.type = type; @@ -90,6 +91,11 @@ public class Room { return type; } + @NotNull + public Set getSegments() { + return segments; + } + public boolean isMatched() { return matched == TriState.TRUE; } @@ -99,9 +105,9 @@ public class Room { return direction; } - @NotNull - public Set getSegments() { - return segments; + @Nullable + public String getName() { + return name; } @Override @@ -310,6 +316,7 @@ public class Room { secretWaypoints = ImmutableTable.copyOf(secretWaypointsMutable); matched = TriState.TRUE; this.direction = direction; + this.name = name; DungeonSecrets.LOGGER.info("[Skyblocker] Room {} matched after checking {} block(s)", name, checkedBlocks.size()); } 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 0d9bdff1..a520c73f 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 @@ -112,6 +112,8 @@ public class SecretWaypoint { LEVER(secretWaypoints -> secretWaypoints.enableLeverWaypoints, 250, 217, 2), FAIRYSOUL(secretWaypoints -> secretWaypoints.enableFairySoulWaypoints, 255, 85, 255), STONK(secretWaypoints -> secretWaypoints.enableStonkWaypoints, 146, 52, 235), + AOTV(secretWaypoints -> secretWaypoints.enableAotvWaypoints, 252, 98, 3), + PEARL(secretWaypoints -> secretWaypoints.enablePearlWaypoints, 57, 117, 125), DEFAULT(secretWaypoints -> secretWaypoints.enableDefaultWaypoints, 190, 255, 252); private final Predicate enabledPredicate; private final float[] colorComponents; @@ -135,6 +137,8 @@ public class SecretWaypoint { case "lever" -> Category.LEVER; case "fairysoul" -> Category.FAIRYSOUL; case "stonk" -> Category.STONK; + case "aotv" -> Category.AOTV; + case "pearl" -> Category.PEARL; default -> Category.DEFAULT; }; } diff --git a/src/main/resources/assets/skyblocker/dungeons/secretlocations.json b/src/main/resources/assets/skyblocker/dungeons/secretlocations.json index d5e38345..5972659f 100644 --- a/src/main/resources/assets/skyblocker/dungeons/secretlocations.json +++ b/src/main/resources/assets/skyblocker/dungeons/secretlocations.json @@ -834,6 +834,13 @@ "y":75, "z":21 }, + { + "secretName":"2 - AOTV", + "category":"aotv", + "x":25, + "y":76, + "z":22 + }, { "secretName":"2 - Stonk", "category":"stonk", @@ -2947,7 +2954,7 @@ "category":"stonk", "x":17, "y":70, - "z":15 + "z":14 }, { "secretName":"6 - Pressure Plate 2", @@ -3058,6 +3065,13 @@ "y":70, "z":5 }, + { + "secretName":"2 - AOTV", + "category":"aotv", + "x":77, + "y":82, + "z":16 + }, { "secretName":"2 - Wither Essence", "category":"wither", @@ -3109,6 +3123,13 @@ "y":50, "z":9 }, + { + "secretName":"3 - AOTV", + "category":"aotv", + "x":7, + "y":80, + "z":15 + }, { "secretName":"3 - Superboom", "category":"superboom", @@ -3225,6 +3246,13 @@ "y":89, "z":24 }, + { + "secretName":"1/2 - AOTV", + "category":"aotv", + "x":84, + "y":91, + "z":26 + }, { "secretName":"1 - Bat", "category":"bat", @@ -4071,6 +4099,13 @@ "y":109, "z":30 }, + { + "secretName":"5 - AOTV", + "category":"aotv", + "x":52, + "y":78, + "z":9 + }, { "secretName":"5 - Crypt", "category":"superboom", @@ -5080,6 +5115,13 @@ "y":86, "z":61 }, + { + "secretName": "7 - AOTV", + "category":"aotv", + "x":39, + "y":84, + "z":58 + }, { "secretName":"7 - Chest", "category":"chest", @@ -5331,6 +5373,13 @@ "y":85, "z":43 }, + { + "secretName":"3/4 - AOTV", + "category":"aotv", + "x":49, + "y":83, + "z":36 + }, { "secretName":"3 - Chest", "category":"chest", @@ -5552,6 +5601,13 @@ "y":45, "z":15 }, + { + "secretName":"5 - Pearl", + "category":"pearl", + "x":8, + "y":59, + "z":14 + }, { "secretName":"5 - Entrance", "category":"entrance", @@ -5835,6 +5891,13 @@ } ], "Double-Stair-3":[ + { + "secretName":"1 - Pearl", + "category":"pearl", + "x":24, + "y":72, + "z":11 + }, { "secretName":"1 - Wither Essence", "category":"wither", diff --git a/src/main/resources/assets/skyblocker/lang/en_us.json b/src/main/resources/assets/skyblocker/lang/en_us.json index b42ab1e3..a6bf6b49 100644 --- a/src/main/resources/assets/skyblocker/lang/en_us.json +++ b/src/main/resources/assets/skyblocker/lang/en_us.json @@ -164,6 +164,9 @@ "text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.enableLeverWaypoints" : "Enable Lever Waypoints", "text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.enableFairySoulWaypoints" : "Enable Fairy Soul Waypoints", "text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.enableStonkWaypoints" : "Enable Stonk Waypoints", + "text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.enableAotvWaypoints" : "Enable AOTV Waypoints", + "text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.enablePearlWaypoints": "Enable Pearl Waypoints", + "text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.enablePearlWaypoints.@Tooltip": "With these waypoints, you throw a pearl towards the block and at the same time AOTV up.", "text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.enableDefaultWaypoints" : "Enable Default Waypoints", "text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.enableDefaultWaypoints.@Tooltip" : "This includes all waypoints that do not belong to a category.", "text.autoconfig.skyblocker.option.locations.dungeons.dungeonChestProfit": "Dungeon Chest Profit Calculator", @@ -272,7 +275,7 @@ "skyblocker.dungeons.secrets.markSecretMissing": "§rMarked secret #%d as missing.", "skyblocker.dungeons.secrets.markSecretFoundUnable": "§cUnable to mark secret #%d as found.", "skyblocker.dungeons.secrets.markSecretMissingUnable": "§cUnable to mark secret #%d as missing.", - "skyblocker.dungeons.secrets.posMessage": "§rRoom Pos: X: %d, Y: %d, Z: %d", + "skyblocker.dungeons.secrets.posMessage": "§rRoom: %s, X: %d, Y: %d, Z: %d", "skyblocker.dungeons.secrets.unableToFindPos": "§cUnable to find room position! (Are you in a dungeon room, are you facing a block?)", "skyblocker.fishing.reelNow": "Reel in now!", -- cgit From c9c4157977e2818e17f4eaedb9c028a612b9b633 Mon Sep 17 00:00:00 2001 From: Kevin <92656833+kevinthegreat1@users.noreply.github.com> Date: Sun, 22 Oct 2023 05:40:04 -0400 Subject: Refactor Durability Parsing (#380) * Refactor durability parsing * Store fuel predicate as constant * Update todo --- .../java/de/hysky/skyblocker/utils/ItemUtils.java | 65 +++++++++------------- 1 file changed, 27 insertions(+), 38 deletions(-) diff --git a/src/main/java/de/hysky/skyblocker/utils/ItemUtils.java b/src/main/java/de/hysky/skyblocker/utils/ItemUtils.java index 50a9bcd1..ed46677d 100644 --- a/src/main/java/de/hysky/skyblocker/utils/ItemUtils.java +++ b/src/main/java/de/hysky/skyblocker/utils/ItemUtils.java @@ -12,34 +12,34 @@ import net.minecraft.util.Formatting; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Optional; +import java.util.function.Predicate; import java.util.regex.Pattern; public class ItemUtils { - private final static Pattern WHITESPACES = Pattern.compile("^\\s*$"); public static final String EXTRA_ATTRIBUTES = "ExtraAttributes"; public static final String ID = "id"; public static final String UUID = "uuid"; + public static final Pattern NOT_DURABILITY = Pattern.compile("[^0-9 /]"); + public static final Predicate FUEL_PREDICATE = line -> line.contains("Fuel: "); - public static List getTooltip(ItemStack item) { + public static List getTooltips(ItemStack item) { MinecraftClient client = MinecraftClient.getInstance(); return client.player == null || item == null ? Collections.emptyList() : item.getTooltip(client.player, TooltipContext.Default.BASIC); } - public static List getTooltipStrings(ItemStack item) { - List lines = getTooltip(item); - List list = new ArrayList<>(); - - for (Text line : lines) { + @Nullable + public static String getTooltip(ItemStack item, Predicate predicate) { + for (Text line : getTooltips(item)) { String string = line.getString(); - if (!WHITESPACES.matcher(string).matches()) - list.add(string); + if (predicate.test(string)) { + return string; + } } - return list; + return null; } /** @@ -98,7 +98,7 @@ public class ItemUtils { * Gets the UUID of the item stack from the {@code ExtraAttributes} NBT tag. * * @param stack the item stack to get the UUID from - * @return the UUID of the item stack, or null if the item stack is null or does not have a UUID + * @return the UUID of the item stack, or an empty string if the item stack is null or does not have a UUID */ public static String getItemUuid(@NotNull ItemStack stack) { NbtCompound extraAttributes = getExtraAttributes(stack); @@ -112,32 +112,21 @@ public class ItemUtils { @Nullable public static IntIntPair getDurability(@NotNull ItemStack stack) { - int current = 0; - int max = 0; - String clearFormatting; - - for (String line : getTooltipStrings(stack)) { - clearFormatting = Formatting.strip(line); - if (line.contains("Fuel: ")) { - if (clearFormatting != null) { - String clear = Pattern.compile("[^0-9 /]").matcher(clearFormatting).replaceAll("").trim(); - String[] split = clear.split("/"); - current = Integer.parseInt(split[0]); - max = Integer.parseInt(split[1]) * 1000; - return IntIntPair.of(current, max); - } - } else if (line.contains("uses.")) { - if (clearFormatting != null) { - int startIndex = clearFormatting.lastIndexOf("after") + 6; - int endIndex = clearFormatting.indexOf("uses", startIndex); - if (startIndex >= 0 && endIndex > startIndex) { - String usesString = clearFormatting.substring(startIndex, endIndex).trim(); - current = Integer.parseInt(usesString); - max = 5000; - } - return IntIntPair.of(current, max); - } - } + NbtCompound extraAttributes = getExtraAttributes(stack); + if (extraAttributes == null) return null; + + // TODO Calculate drill durability based on the drill_fuel flag, fuel_tank flag, and hotm level + // TODO Cache the max durability and only update the current durability on inventory tick + + int pickonimbusDurability = extraAttributes.getInt("pickonimbus_durability"); + if (pickonimbusDurability > 0) { + return IntIntPair.of(pickonimbusDurability, 5000); + } + + String drillFuel = Formatting.strip(getTooltip(stack, FUEL_PREDICATE)); + if (drillFuel != null) { + String[] drillFuelStrings = NOT_DURABILITY.matcher(drillFuel).replaceAll("").trim().split("/"); + return IntIntPair.of(Integer.parseInt(drillFuelStrings[0]), Integer.parseInt(drillFuelStrings[1]) * 1000); } return null; -- cgit From 519b38d68c3c36dd6565e7d8bb9be40f87d07385 Mon Sep 17 00:00:00 2001 From: OhRetro Date: Thu, 19 Oct 2023 23:40:57 +0000 Subject: Translated using Weblate (Portuguese (Brazil)) Currently translated at 69.2% (273 of 394 strings) Translation: Skyblocker/Skyblocker Translate-URL: https://translate.hysky.de/projects/Skyblocker/skyblocker/pt_BR/ --- src/main/resources/assets/skyblocker/lang/pt_br.json | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/main/resources/assets/skyblocker/lang/pt_br.json b/src/main/resources/assets/skyblocker/lang/pt_br.json index 2361d7bd..20ebeeca 100644 --- a/src/main/resources/assets/skyblocker/lang/pt_br.json +++ b/src/main/resources/assets/skyblocker/lang/pt_br.json @@ -70,7 +70,7 @@ "text.autoconfig.skyblocker.option.general.fairySouls.highlightFoundSouls": "Destacar alma das fadas encontradas", "text.autoconfig.skyblocker.option.general.fairySouls.highlightOnlyNearbySouls": "Apenas destacar alma das fadas por perto", "text.autoconfig.skyblocker.option.general.shortcuts.enableCommandShortcuts": "Ativar Atalhos de Comando", - "text.autoconfig.skyblocker.option.general.shortcuts.enableShortcuts.@Tooltip": "Apenas funciona no Hypixel, Edite atalhos com \"/skyblocker shortcuts\". Pelo menos uma das opções tem que está ativo para tomar efeito.", + "text.autoconfig.skyblocker.option.general.shortcuts.enableShortcuts.@Tooltip": "Funciona em qualquer lugar, até mesmo no vanilla! Edite atalhos com \"/skyblocker shortcuts\". Pelo menos uma das opções tem que está ativo para tomar efeito.", "text.autoconfig.skyblocker.option.general.tabHud": "HUD do tab Bonito", "text.autoconfig.skyblocker.option.general.tabHud.tabHudEnabled": "Ativar HUD do tab Bonito", "text.autoconfig.skyblocker.option.general.itemTooltip": "Tooltip do Item", @@ -257,5 +257,19 @@ "text.skyblocker.quit_config": "Mudanças Não Salvas", "text.skyblocker.quit_config_sure": "Você tem certeza que quer sair de editar as configurações? Mudanças não vão ser salvas!", "text.skyblocker.quit_discard": "Sair & Descartar Mudanças", - "text.autoconfig.skyblocker.option.general.shortcuts.config": "Configurações de Atalhos..." + "text.autoconfig.skyblocker.option.general.shortcuts.config": "Configurações de Atalhos...", + "text.autoconfig.skyblocker.option.general.flameOverlay": "Overlay de Chama", + "text.autoconfig.skyblocker.option.general.flameOverlay.flameHeight": "Altura da Chama", + "text.autoconfig.skyblocker.option.general.flameOverlay.flameOpacity": "Opacidade da Chama", + "text.autoconfig.skyblocker.option.general.itemCooldown": "Cooldown de Item", + "text.autoconfig.skyblocker.option.general.itemCooldown.enableItemCooldowns": "Ativar Cooldown de Item", + "text.autoconfig.skyblocker.option.general.titleContainer.config": "Configuração de Colocação do Contêiner de Título...", + "text.autoconfig.skyblocker.option.general.itemInfoDisplay.itemRarityBackgroundsOpacity": "Opacidade do Fundos de Raridade de Item", + "text.autoconfig.skyblocker.option.general.wikiLookup": "Olhar na Wiki", + "text.autoconfig.skyblocker.option.general.wikiLookup.enableWikiLookup": "Ativar Olhar na Wiki", + "text.autoconfig.skyblocker.option.general.wikiLookup.enableWikiLookup.@Tooltip": "Abrir a pagina da wiki do item com o mouse em cima com F4.", + "text.autoconfig.skyblocker.option.general.wikiLookup.officialWiki": "Usar Wiki Oficial", + "text.autoconfig.skyblocker.option.general.wikiLookup.officialWiki.@Tooltip": "Usar a wiki oficial em vez da wiki do Fandom.", + "text.autoconfig.skyblocker.option.general.itemInfoDisplay.itemRarityBackgrounds": "Fundos de Raridade de Item", + "text.autoconfig.skyblocker.option.general.itemInfoDisplay.itemRarityBackgrounds.@Tooltip": "Mostra um fundo colorido atrás de um item, a cor representa a raridade do item." } -- cgit From 125461ec270498b323ad3396661ebe27c3864045 Mon Sep 17 00:00:00 2001 From: Weblate Date: Fri, 20 Oct 2023 21:22:13 +0200 Subject: Update translation files Updated by "Cleanup translation files" hook in Weblate. Translation: Skyblocker/Skyblocker Translate-URL: https://translate.hysky.de/projects/Skyblocker/skyblocker/ --- .../resources/assets/skyblocker/lang/es_es.json | 60 -------------- .../resources/assets/skyblocker/lang/fr_fr.json | 96 ---------------------- .../resources/assets/skyblocker/lang/ko_kr.json | 96 ---------------------- .../resources/assets/skyblocker/lang/nb_no.json | 96 ---------------------- .../resources/assets/skyblocker/lang/pt_br.json | 96 ---------------------- .../resources/assets/skyblocker/lang/ru_ru.json | 96 ---------------------- .../resources/assets/skyblocker/lang/zh_cn.json | 96 ---------------------- .../resources/assets/skyblocker/lang/zh_tw.json | 8 -- 8 files changed, 644 deletions(-) diff --git a/src/main/resources/assets/skyblocker/lang/es_es.json b/src/main/resources/assets/skyblocker/lang/es_es.json index 7ec449aa..2338f502 100644 --- a/src/main/resources/assets/skyblocker/lang/es_es.json +++ b/src/main/resources/assets/skyblocker/lang/es_es.json @@ -40,14 +40,6 @@ "text.autoconfig.skyblocker.option.richPresence.customMessage": "Mensaje Personalizado", "text.autoconfig.skyblocker.category.quickNav": "Navegación Rápida", "text.autoconfig.skyblocker.option.quickNav.enableQuickNav": "Habilitar Navegación Rápida", - "text.autoconfig.skyblocker.option.quickNav.button1": "Botón 1", - "text.autoconfig.skyblocker.option.quickNav.button2.item.nbt": "NBT", - "text.autoconfig.skyblocker.option.quickNav.button2.uiTitle": "Titulo de la Interfaz", - "text.autoconfig.skyblocker.option.quickNav.button3": "Botón 3", - "text.autoconfig.skyblocker.option.quickNav.button4": "Botón 4", - "text.autoconfig.skyblocker.option.quickNav.button5": "Botón 5", - "text.autoconfig.skyblocker.option.quickNav.button6": "Botón 6", - "text.autoconfig.skyblocker.option.quickNav.button7": "Botón 7", "text.autoconfig.skyblocker.option.messages.hideImplosion": "Ocultar el mensaje de Implosion", "text.autoconfig.skyblocker.option.messages.hideCombo": "Ocultar Mensajes de Combos", "text.autoconfig.skyblocker.option.locations.dungeons.croesusHelper.@Tooltip": "Obscurece los cofres que ya han sido abiertos.", @@ -55,15 +47,6 @@ "text.autoconfig.skyblocker.option.general.itemTooltip": "Información extra de los objetos", "skyblocker.itemTooltip.nullMessage": "§cEl precio en la información en los objetos se actualiza cada 60 segundos. De lo contrario revisa lastest.log", "text.autoconfig.skyblocker.option.richPresence.info.@Tooltip": "Este valor no importa si estas ciclando", - "text.autoconfig.skyblocker.option.quickNav.button1.item": "Objeto", - "text.autoconfig.skyblocker.option.quickNav.button1.item.itemName": "Nombre del objeto", - "text.autoconfig.skyblocker.option.quickNav.button1.item.nbt": "NBT", - "text.autoconfig.skyblocker.option.quickNav.button1.uiTitle": "Titulo de la Interfaz", - "text.autoconfig.skyblocker.option.quickNav.button2": "Botón 2", - "text.autoconfig.skyblocker.option.quickNav.button2.item": "Objeto", - "text.autoconfig.skyblocker.option.quickNav.button2.item.itemName": "Nombre del objeto", - "text.autoconfig.skyblocker.option.quickNav.button3.item": "Objeto", - "text.autoconfig.skyblocker.option.quickNav.button3.item.itemName": "Nombre del objeto", "text.autoconfig.skyblocker.option.messages.hideAds": "Ocultar anuncios del Chat Publico", "text.autoconfig.skyblocker.option.messages.hideTeleportPad": "Ocultar mensajes del Pad de Teletransporte", "text.autoconfig.skyblocker.option.messages.hideAutopet": "Ocultar mensajes del Autopet", @@ -94,49 +77,6 @@ "text.autoconfig.skyblocker.option.messages.hideMana": "Ocultar los Mensajes del Consumo de Maná de la Barra de Acción", "text.autoconfig.skyblocker.option.messages.hideMana.@Tooltip": "Da una mejor experiencia con FancyBar", "skyblocker.updaterepository.failed": "§cLa actualización del repositorio local fallo. Elimina los archivos manualmente y reinicia el juego.", - "text.autoconfig.skyblocker.option.quickNav.button11": "Botón 11", - "text.autoconfig.skyblocker.option.quickNav.button9.item.itemName": "Nombre del objeto", - "text.autoconfig.skyblocker.option.quickNav.button3.item.nbt": "NBT", - "text.autoconfig.skyblocker.option.quickNav.button3.uiTitle": "Titulo de la Interfaz", - "text.autoconfig.skyblocker.option.quickNav.button4.item": "Objeto", - "text.autoconfig.skyblocker.option.quickNav.button4.item.itemName": "Nombre del objeto", - "text.autoconfig.skyblocker.option.quickNav.button4.item.nbt": "NBT", - "text.autoconfig.skyblocker.option.quickNav.button4.uiTitle": "Titulo de la Interfaz", - "text.autoconfig.skyblocker.option.quickNav.button5.item": "Objeto", - "text.autoconfig.skyblocker.option.quickNav.button5.item.itemName": "Nombre del objeto", - "text.autoconfig.skyblocker.option.quickNav.button5.item.nbt": "NBT", - "text.autoconfig.skyblocker.option.quickNav.button5.uiTitle": "Titulo de la Interfaz", - "text.autoconfig.skyblocker.option.quickNav.button6.item": "Objeto", - "text.autoconfig.skyblocker.option.quickNav.button6.item.itemName": "Nombre del objeto", - "text.autoconfig.skyblocker.option.quickNav.button6.item.nbt": "NBT", - "text.autoconfig.skyblocker.option.quickNav.button8": "Botón 8", - "text.autoconfig.skyblocker.option.quickNav.button9": "Botón 9", - "text.autoconfig.skyblocker.option.quickNav.button10": "Botón 10", - "text.autoconfig.skyblocker.option.quickNav.button6.uiTitle": "Titulo de la Interfaz", - "text.autoconfig.skyblocker.option.quickNav.button7.item": "Objeto", - "text.autoconfig.skyblocker.option.quickNav.button7.item.itemName": "Nombre del objeto", - "text.autoconfig.skyblocker.option.quickNav.button7.item.nbt": "NBT", - "text.autoconfig.skyblocker.option.quickNav.button7.uiTitle": "Titulo de la Interfaz", - "text.autoconfig.skyblocker.option.quickNav.button8.item": "Objeto", - "text.autoconfig.skyblocker.option.quickNav.button8.item.itemName": "Nombre del objeto", - "text.autoconfig.skyblocker.option.quickNav.button8.item.nbt": "NBT", - "text.autoconfig.skyblocker.option.quickNav.button8.uiTitle": "Titulo de la Interfaz", - "text.autoconfig.skyblocker.option.quickNav.button9.item": "Objeto", - "text.autoconfig.skyblocker.option.quickNav.button9.item.nbt": "NBT", - "text.autoconfig.skyblocker.option.quickNav.button9.uiTitle": "Titulo de la Interfaz", - "text.autoconfig.skyblocker.option.quickNav.button10.item": "Objeto", - "text.autoconfig.skyblocker.option.quickNav.button10.item.itemName": "Nombre del objeto", - "text.autoconfig.skyblocker.option.quickNav.button10.item.nbt": "NBT", - "text.autoconfig.skyblocker.option.quickNav.button10.uiTitle": "Titulo de la Interfaz", - "text.autoconfig.skyblocker.option.quickNav.button11.item": "Objeto", - "text.autoconfig.skyblocker.option.quickNav.button11.item.itemName": "Nombre del objeto", - "text.autoconfig.skyblocker.option.quickNav.button11.item.nbt": "NBT", - "text.autoconfig.skyblocker.option.quickNav.button11.uiTitle": "Titulo de la Interfaz", - "text.autoconfig.skyblocker.option.quickNav.button12": "Botón 12", - "text.autoconfig.skyblocker.option.quickNav.button12.item": "Objeto", - "text.autoconfig.skyblocker.option.quickNav.button12.item.itemName": "Nombre del objeto", - "text.autoconfig.skyblocker.option.quickNav.button12.item.nbt": "NBT", - "text.autoconfig.skyblocker.option.quickNav.button12.uiTitle": "Titulo de la Interfaz", "text.autoconfig.skyblocker.option.general.shortcuts.enableShortcuts": "Habilitar atajos", "text.autoconfig.skyblocker.option.general.shortcuts.enableShortcuts.@Tooltip": "Solo funciona en Hypixel. Edita atajos ejecutando \"/skyblocker shortcuts\". Al menos una de las siguientes opciones debe ser activada para surgir efecto.", "text.autoconfig.skyblocker.option.general.shortcuts": "Atajos", diff --git a/src/main/resources/assets/skyblocker/lang/fr_fr.json b/src/main/resources/assets/skyblocker/lang/fr_fr.json index dae2de9a..3e9bf6f0 100644 --- a/src/main/resources/assets/skyblocker/lang/fr_fr.json +++ b/src/main/resources/assets/skyblocker/lang/fr_fr.json @@ -67,7 +67,6 @@ "text.autoconfig.skyblocker.option.messages.hideMana": "Cacher les messages de consommation de mana de la barre d'action", "text.autoconfig.skyblocker.option.messages.hideMana.@Tooltip": "Permet une meilleure expérience avec les barres", "text.autoconfig.skyblocker.option.locations.dungeons.mapScaling": "Taille de la Carte", - "text.autoconfig.skyblocker.option.quickNav.button1.render": "Render", "text.autoconfig.skyblocker.option.locations.dungeons.lividColor.lividColorText.@Tooltip": "Texte qui sera envoyé dans le chat lors du boss Livid. Le string \"[color]\" sera remplacé par la couleur Livid.", "text.autoconfig.skyblocker.option.locations.dungeons.lividColor": "Couleur Livid", "text.autoconfig.skyblocker.option.locations.dungeons.lividColor.enableLividColor": "Activer la Couleur Livid", @@ -99,14 +98,6 @@ "text.autoconfig.skyblocker.option.richPresence.info.LOCATION": "LIEU", "text.autoconfig.skyblocker.category.quickNav": "Navigation rapide", "text.autoconfig.skyblocker.option.quickNav.enableQuickNav": "Activer la navigation rapide", - "text.autoconfig.skyblocker.option.quickNav.button1": "Bouton 1", - "text.autoconfig.skyblocker.option.quickNav.button1.item": "Item", - "text.autoconfig.skyblocker.option.quickNav.button1.item.itemName": "Nom de l'item", - "text.autoconfig.skyblocker.option.quickNav.button1.item.count": "Nombre d'items", - "text.autoconfig.skyblocker.option.quickNav.button1.item.nbt": "NBT", - "text.autoconfig.skyblocker.option.quickNav.button1.uiTitle": "Titre du menu", - "text.autoconfig.skyblocker.option.quickNav.button1.clickEvent": "Evènement de clic", - "text.autoconfig.skyblocker.option.quickNav.button2": "Bouton 2", "skyblocker.updaterepository.failed": "§cLa mise à jour de la repository a échoué. Supprimez les fichiers manuellement et relancez le jeu.", "skyblocker.fishing.reelNow": "Enroulez la ligne !", "text.autoconfig.skyblocker.option.general.fishing.enableFishingHelper": "Activer l'assistant de pêche", @@ -115,93 +106,6 @@ "text.autoconfig.skyblocker.option.general.itemTooltip.avg.BOTH": "Les deux", "text.autoconfig.skyblocker.option.richPresence.info.PURSE": "PORTE-MONNAIE", "text.autoconfig.skyblocker.option.richPresence.info.BITS": "BITS", - "text.autoconfig.skyblocker.option.quickNav.button4.render": "Render", - "text.autoconfig.skyblocker.option.quickNav.button4.item": "Item", - "text.autoconfig.skyblocker.option.quickNav.button7": "Bouton 7", - "text.autoconfig.skyblocker.option.quickNav.button2.render": "Render", - "text.autoconfig.skyblocker.option.quickNav.button2.item": "Item", - "text.autoconfig.skyblocker.option.quickNav.button2.item.itemName": "Nom de l'item", - "text.autoconfig.skyblocker.option.quickNav.button2.item.count": "Nombre d'items", - "text.autoconfig.skyblocker.option.quickNav.button2.item.nbt": "NBT", - "text.autoconfig.skyblocker.option.quickNav.button9.render": "Render", - "text.autoconfig.skyblocker.option.quickNav.button9.item": "Item", - "text.autoconfig.skyblocker.option.quickNav.button9.item.itemName": "Nom de l'item", - "text.autoconfig.skyblocker.option.quickNav.button9.item.count": "Nombre d'items", - "text.autoconfig.skyblocker.option.quickNav.button9.item.nbt": "NBT", - "text.autoconfig.skyblocker.option.quickNav.button9.uiTitle": "Titre du menu", - "text.autoconfig.skyblocker.option.quickNav.button9.clickEvent": "Evènement de clic", - "text.autoconfig.skyblocker.option.quickNav.button10": "Bouton 10", - "text.autoconfig.skyblocker.option.quickNav.button10.render": "Render", - "text.autoconfig.skyblocker.option.quickNav.button10.item": "Item", - "text.autoconfig.skyblocker.option.quickNav.button10.item.itemName": "Nom de l'item", - "text.autoconfig.skyblocker.option.quickNav.button10.item.count": "Nombre d'items", - "text.autoconfig.skyblocker.option.quickNav.button10.item.nbt": "NBT", - "text.autoconfig.skyblocker.option.quickNav.button10.uiTitle": "Titre du menu", - "text.autoconfig.skyblocker.option.quickNav.button3.item": "Item", - "text.autoconfig.skyblocker.option.quickNav.button3.item.itemName": "Nom de l'item", - "text.autoconfig.skyblocker.option.quickNav.button3.item.count": "Nombre d'items", - "text.autoconfig.skyblocker.option.quickNav.button3.item.nbt": "NBT", - "text.autoconfig.skyblocker.option.quickNav.button2.uiTitle": "Titre du menu", - "text.autoconfig.skyblocker.option.quickNav.button2.clickEvent": "Evènement de clic", - "text.autoconfig.skyblocker.option.quickNav.button3": "Bouton 3", - "text.autoconfig.skyblocker.option.quickNav.button3.render": "Render", - "text.autoconfig.skyblocker.option.quickNav.button3.uiTitle": "Titre du menu", - "text.autoconfig.skyblocker.option.quickNav.button3.clickEvent": "Evènement de clic", - "text.autoconfig.skyblocker.option.quickNav.button4": "Bouton 4", - "text.autoconfig.skyblocker.option.quickNav.button4.item.itemName": "Nom de l'item", - "text.autoconfig.skyblocker.option.quickNav.button4.item.count": "Nombre d'items", - "text.autoconfig.skyblocker.option.quickNav.button4.item.nbt": "NBT", - "text.autoconfig.skyblocker.option.quickNav.button4.uiTitle": "Titre du menu", - "text.autoconfig.skyblocker.option.quickNav.button4.clickEvent": "Evènement de clic", - "text.autoconfig.skyblocker.option.quickNav.button5": "Bouton 5", - "text.autoconfig.skyblocker.option.quickNav.button5.render": "Render", - "text.autoconfig.skyblocker.option.quickNav.button5.item": "Item", - "text.autoconfig.skyblocker.option.quickNav.button5.item.itemName": "Nom de l'item", - "text.autoconfig.skyblocker.option.quickNav.button5.item.count": "Nombre d'items", - "text.autoconfig.skyblocker.option.quickNav.button5.item.nbt": "NBT", - "text.autoconfig.skyblocker.option.quickNav.button5.uiTitle": "Titre du menu", - "text.autoconfig.skyblocker.option.quickNav.button5.clickEvent": "Evènement de clic", - "text.autoconfig.skyblocker.option.quickNav.button6": "Bouton 6", - "text.autoconfig.skyblocker.option.quickNav.button6.render": "Render", - "text.autoconfig.skyblocker.option.quickNav.button6.item": "Item", - "text.autoconfig.skyblocker.option.quickNav.button6.item.itemName": "Nom de l'item", - "text.autoconfig.skyblocker.option.quickNav.button6.item.count": "Nombre d'items", - "text.autoconfig.skyblocker.option.quickNav.button6.item.nbt": "NBT", - "text.autoconfig.skyblocker.option.quickNav.button6.uiTitle": "Titre du menu", - "text.autoconfig.skyblocker.option.quickNav.button6.clickEvent": "Evènement de clic", - "text.autoconfig.skyblocker.option.quickNav.button7.render": "Render", - "text.autoconfig.skyblocker.option.quickNav.button7.item": "Item", - "text.autoconfig.skyblocker.option.quickNav.button7.item.itemName": "Nom de l'item", - "text.autoconfig.skyblocker.option.quickNav.button7.item.count": "Nombre d'items", - "text.autoconfig.skyblocker.option.quickNav.button7.item.nbt": "NBT", - "text.autoconfig.skyblocker.option.quickNav.button7.uiTitle": "Titre du menu", - "text.autoconfig.skyblocker.option.quickNav.button7.clickEvent": "Evènement de clic", - "text.autoconfig.skyblocker.option.quickNav.button8": "Bouton 8", - "text.autoconfig.skyblocker.option.quickNav.button8.render": "Render", - "text.autoconfig.skyblocker.option.quickNav.button8.item": "Item", - "text.autoconfig.skyblocker.option.quickNav.button8.item.itemName": "Nom de l'item", - "text.autoconfig.skyblocker.option.quickNav.button8.item.count": "Nombre d'items", - "text.autoconfig.skyblocker.option.quickNav.button8.item.nbt": "NBT", - "text.autoconfig.skyblocker.option.quickNav.button8.uiTitle": "Titre du menu", - "text.autoconfig.skyblocker.option.quickNav.button8.clickEvent": "Evènement de clic", - "text.autoconfig.skyblocker.option.quickNav.button9": "Bouton 9", - "text.autoconfig.skyblocker.option.quickNav.button10.clickEvent": "Evènement de clic", - "text.autoconfig.skyblocker.option.quickNav.button11": "Bouton 11", - "text.autoconfig.skyblocker.option.quickNav.button11.render": "Render", - "text.autoconfig.skyblocker.option.quickNav.button11.item": "Item", - "text.autoconfig.skyblocker.option.quickNav.button11.item.itemName": "Nom de l'item", - "text.autoconfig.skyblocker.option.quickNav.button11.item.count": "Nombre d'items", - "text.autoconfig.skyblocker.option.quickNav.button11.item.nbt": "NBT", - "text.autoconfig.skyblocker.option.quickNav.button11.uiTitle": "Titre du menu", - "text.autoconfig.skyblocker.option.quickNav.button11.clickEvent": "Evènement de clic", - "text.autoconfig.skyblocker.option.quickNav.button12": "Bouton 12", - "text.autoconfig.skyblocker.option.quickNav.button12.render": "Render", - "text.autoconfig.skyblocker.option.quickNav.button12.item": "Item", - "text.autoconfig.skyblocker.option.quickNav.button12.item.itemName": "Nom de l'item", - "text.autoconfig.skyblocker.option.quickNav.button12.item.count": "Nombre d'items", - "text.autoconfig.skyblocker.option.quickNav.button12.item.nbt": "NBT", - "text.autoconfig.skyblocker.option.quickNav.button12.uiTitle": "Titre du menu", - "text.autoconfig.skyblocker.option.quickNav.button12.clickEvent": "Evènement de clic", "text.autoconfig.skyblocker.option.general.experiments": "Aide aux expériences de la table d'expérimentation", "text.autoconfig.skyblocker.option.general.experiments.enableChronomatronSolver": "Activer l'aide au Chronomatron", "text.autoconfig.skyblocker.option.general.experiments.enableSuperpairsSolver": "Activer l'aide aux Superpairs", diff --git a/src/main/resources/assets/skyblocker/lang/ko_kr.json b/src/main/resources/assets/skyblocker/lang/ko_kr.json index fb890c33..cb35668a 100644 --- a/src/main/resources/assets/skyblocker/lang/ko_kr.json +++ b/src/main/resources/assets/skyblocker/lang/ko_kr.json @@ -43,102 +43,6 @@ "text.autoconfig.skyblocker.option.richPresence.customMessage": "사용자 지정 메시지", "text.autoconfig.skyblocker.category.quickNav": "즐겨찾기", "text.autoconfig.skyblocker.option.quickNav.enableQuickNav": "즐겨찾기 활성화", - "text.autoconfig.skyblocker.option.quickNav.button1": "버튼 1", - "text.autoconfig.skyblocker.option.quickNav.button1.render": "렌더", - "text.autoconfig.skyblocker.option.quickNav.button1.item": "아이템", - "text.autoconfig.skyblocker.option.quickNav.button1.item.itemName": "아이템 이름", - "text.autoconfig.skyblocker.option.quickNav.button1.item.count": "아이템 개수", - "text.autoconfig.skyblocker.option.quickNav.button1.item.nbt": "NBT", - "text.autoconfig.skyblocker.option.quickNav.button1.uiTitle": "UI 제목", - "text.autoconfig.skyblocker.option.quickNav.button1.clickEvent": "클릭 이벤트", - "text.autoconfig.skyblocker.option.quickNav.button2": "버튼 2", - "text.autoconfig.skyblocker.option.quickNav.button2.render": "렌더", - "text.autoconfig.skyblocker.option.quickNav.button2.item": "아이템", - "text.autoconfig.skyblocker.option.quickNav.button2.item.itemName": "아이템 이름", - "text.autoconfig.skyblocker.option.quickNav.button2.item.count": "아이템 개수", - "text.autoconfig.skyblocker.option.quickNav.button2.item.nbt": "NBT", - "text.autoconfig.skyblocker.option.quickNav.button2.uiTitle": "UI 제목", - "text.autoconfig.skyblocker.option.quickNav.button2.clickEvent": "클릭 이벤트", - "text.autoconfig.skyblocker.option.quickNav.button3": "버튼 3", - "text.autoconfig.skyblocker.option.quickNav.button3.render": "렌더", - "text.autoconfig.skyblocker.option.quickNav.button3.item": "아이템", - "text.autoconfig.skyblocker.option.quickNav.button3.item.itemName": "아이템 이름", - "text.autoconfig.skyblocker.option.quickNav.button3.item.count": "아이템 개수", - "text.autoconfig.skyblocker.option.quickNav.button3.item.nbt": "NBT", - "text.autoconfig.skyblocker.option.quickNav.button3.uiTitle": "UI 제목", - "text.autoconfig.skyblocker.option.quickNav.button3.clickEvent": "클릭 이벤트", - "text.autoconfig.skyblocker.option.quickNav.button4": "버튼 4", - "text.autoconfig.skyblocker.option.quickNav.button4.render": "렌더", - "text.autoconfig.skyblocker.option.quickNav.button4.item": "아이템", - "text.autoconfig.skyblocker.option.quickNav.button4.item.itemName": "아이템 이름", - "text.autoconfig.skyblocker.option.quickNav.button4.item.count": "아이템 개수", - "text.autoconfig.skyblocker.option.quickNav.button4.item.nbt": "NBT", - "text.autoconfig.skyblocker.option.quickNav.button4.uiTitle": "UI 제목", - "text.autoconfig.skyblocker.option.quickNav.button4.clickEvent": "클릭 이벤트", - "text.autoconfig.skyblocker.option.quickNav.button5": "버튼 5", - "text.autoconfig.skyblocker.option.quickNav.button5.render": "렌더", - "text.autoconfig.skyblocker.option.quickNav.button5.item": "아이템", - "text.autoconfig.skyblocker.option.quickNav.button5.item.itemName": "아이템 이름", - "text.autoconfig.skyblocker.option.quickNav.button5.item.count": "아이템 개수", - "text.autoconfig.skyblocker.option.quickNav.button5.item.nbt": "NBT", - "text.autoconfig.skyblocker.option.quickNav.button5.uiTitle": "UI 제목", - "text.autoconfig.skyblocker.option.quickNav.button5.clickEvent": "클릭 이벤트", - "text.autoconfig.skyblocker.option.quickNav.button6": "버튼 6", - "text.autoconfig.skyblocker.option.quickNav.button6.render": "렌더", - "text.autoconfig.skyblocker.option.quickNav.button6.item": "아이템", - "text.autoconfig.skyblocker.option.quickNav.button6.item.itemName": "아이템 이름", - "text.autoconfig.skyblocker.option.quickNav.button6.item.count": "아이템 개수", - "text.autoconfig.skyblocker.option.quickNav.button6.item.nbt": "NBT", - "text.autoconfig.skyblocker.option.quickNav.button6.uiTitle": "UI 제목", - "text.autoconfig.skyblocker.option.quickNav.button6.clickEvent": "클릭 이벤트", - "text.autoconfig.skyblocker.option.quickNav.button7": "버튼 7", - "text.autoconfig.skyblocker.option.quickNav.button7.render": "렌더", - "text.autoconfig.skyblocker.option.quickNav.button7.item": "아이템", - "text.autoconfig.skyblocker.option.quickNav.button7.item.itemName": "아이템 이름", - "text.autoconfig.skyblocker.option.quickNav.button7.item.count": "아이템 개수", - "text.autoconfig.skyblocker.option.quickNav.button7.item.nbt": "NBT", - "text.autoconfig.skyblocker.option.quickNav.button7.uiTitle": "UI 제목", - "text.autoconfig.skyblocker.option.quickNav.button7.clickEvent": "클릭 이벤트", - "text.autoconfig.skyblocker.option.quickNav.button8": "버튼 8", - "text.autoconfig.skyblocker.option.quickNav.button8.render": "렌더", - "text.autoconfig.skyblocker.option.quickNav.button8.item": "아이템", - "text.autoconfig.skyblocker.option.quickNav.button8.item.itemName": "아이템 이름", - "text.autoconfig.skyblocker.option.quickNav.button8.item.count": "아이템 개수", - "text.autoconfig.skyblocker.option.quickNav.button8.item.nbt": "NBT", - "text.autoconfig.skyblocker.option.quickNav.button8.uiTitle": "UI 제목", - "text.autoconfig.skyblocker.option.quickNav.button8.clickEvent": "클릭 이벤트", - "text.autoconfig.skyblocker.option.quickNav.button9": "버튼 9", - "text.autoconfig.skyblocker.option.quickNav.button9.render": "렌더", - "text.autoconfig.skyblocker.option.quickNav.button9.item": "아이템", - "text.autoconfig.skyblocker.option.quickNav.button9.item.itemName": "아이템 이름", - "text.autoconfig.skyblocker.option.quickNav.button9.item.count": "아이템 개수", - "text.autoconfig.skyblocker.option.quickNav.button9.item.nbt": "NBT", - "text.autoconfig.skyblocker.option.quickNav.button9.uiTitle": "UI 제목", - "text.autoconfig.skyblocker.option.quickNav.button9.clickEvent": "클릭 이벤트", - "text.autoconfig.skyblocker.option.quickNav.button10": "버튼 10", - "text.autoconfig.skyblocker.option.quickNav.button10.render": "렌더", - "text.autoconfig.skyblocker.option.quickNav.button10.item": "아이템", - "text.autoconfig.skyblocker.option.quickNav.button10.item.itemName": "아이템 이름", - "text.autoconfig.skyblocker.option.quickNav.button10.item.count": "아이템 개수", - "text.autoconfig.skyblocker.option.quickNav.button10.item.nbt": "NBT", - "text.autoconfig.skyblocker.option.quickNav.button10.uiTitle": "UI 제목", - "text.autoconfig.skyblocker.option.quickNav.button10.clickEvent": "클릭 이벤트", - "text.autoconfig.skyblocker.option.quickNav.button11": "버튼 11", - "text.autoconfig.skyblocker.option.quickNav.button11.render": "렌더", - "text.autoconfig.skyblocker.option.quickNav.button11.item": "아이템", - "text.autoconfig.skyblocker.option.quickNav.button11.item.itemName": "아이템 이름", - "text.autoconfig.skyblocker.option.quickNav.button11.item.count": "아이템 개수", - "text.autoconfig.skyblocker.option.quickNav.button11.item.nbt": "NBT", - "text.autoconfig.skyblocker.option.quickNav.button11.uiTitle": "UI 제목", - "text.autoconfig.skyblocker.option.quickNav.button11.clickEvent": "클릑 이벤트", - "text.autoconfig.skyblocker.option.quickNav.button12": "버튼 12", - "text.autoconfig.skyblocker.option.quickNav.button12.render": "렌더", - "text.autoconfig.skyblocker.option.quickNav.button12.item": "아이템", - "text.autoconfig.skyblocker.option.quickNav.button12.item.itemName": "아이템 이름", - "text.autoconfig.skyblocker.option.quickNav.button12.item.count": "아이템 개수", - "text.autoconfig.skyblocker.option.quickNav.button12.item.nbt": "NBT", - "text.autoconfig.skyblocker.option.quickNav.button12.uiTitle": "UI 제목", - "text.autoconfig.skyblocker.option.quickNav.button12.clickEvent": "클릭 이벤트", "text.autoconfig.skyblocker.option.general.itemList": "아이템 목록", "text.autoconfig.skyblocker.option.general.itemList.enableItemList": "아이템 목록 활성화", "text.autoconfig.skyblocker.category.locations": "위치", diff --git a/src/main/resources/assets/skyblocker/lang/nb_no.json b/src/main/resources/assets/skyblocker/lang/nb_no.json index 3bbd67dd..44d95570 100644 --- a/src/main/resources/assets/skyblocker/lang/nb_no.json +++ b/src/main/resources/assets/skyblocker/lang/nb_no.json @@ -36,40 +36,6 @@ "text.autoconfig.skyblocker.option.richPresence.customMessage": "Egendefinert melding", "text.autoconfig.skyblocker.category.quickNav": "Rask navigering", "text.autoconfig.skyblocker.option.quickNav.enableQuickNav": "Aktiver hurtignavigering", - "text.autoconfig.skyblocker.option.quickNav.button1.render": "Rendering", - "text.autoconfig.skyblocker.option.quickNav.button1.item": "Gjenstand", - "text.autoconfig.skyblocker.option.quickNav.button1.item.count": "Gjenstand Teller", - "text.autoconfig.skyblocker.option.quickNav.button1.item.nbt": "NBT", - "text.autoconfig.skyblocker.option.quickNav.button1.uiTitle": "UI Tittel", - "text.autoconfig.skyblocker.option.quickNav.button1.clickEvent": "Klikk hendelse", - "text.autoconfig.skyblocker.option.quickNav.button2": "Knapp 2", - "text.autoconfig.skyblocker.option.quickNav.button2.render": "Rendering", - "text.autoconfig.skyblocker.option.quickNav.button2.item": "Gjenstand", - "text.autoconfig.skyblocker.option.quickNav.button2.item.itemName": "Gjenstand navn", - "text.autoconfig.skyblocker.option.quickNav.button2.item.count": "Gjenstand Teller", - "text.autoconfig.skyblocker.option.quickNav.button2.item.nbt": "NBT", - "text.autoconfig.skyblocker.option.quickNav.button2.uiTitle": "UI Tittel", - "text.autoconfig.skyblocker.option.quickNav.button2.clickEvent": "Klikk hendelse", - "text.autoconfig.skyblocker.option.quickNav.button3": "Knapp 3", - "text.autoconfig.skyblocker.option.quickNav.button3.item": "Gjenstand", - "text.autoconfig.skyblocker.option.quickNav.button3.item.itemName": "Gjenstand Navn", - "text.autoconfig.skyblocker.option.quickNav.button3.item.count": "Gjenstand Teller", - "text.autoconfig.skyblocker.option.quickNav.button3.item.nbt": "NBT", - "text.autoconfig.skyblocker.option.quickNav.button3.uiTitle": "UI Tittel", - "text.autoconfig.skyblocker.option.quickNav.button3.clickEvent": "Klikk hendelse", - "text.autoconfig.skyblocker.option.quickNav.button4": "Knapp 4", - "text.autoconfig.skyblocker.option.quickNav.button4.render": "Rendering", - "text.autoconfig.skyblocker.option.quickNav.button4.item": "Gjenstand", - "text.autoconfig.skyblocker.option.quickNav.button4.item.itemName": "Gjenstand Navn", - "text.autoconfig.skyblocker.option.quickNav.button4.item.count": "Gjenstand Teller", - "text.autoconfig.skyblocker.option.quickNav.button4.item.nbt": "NBT", - "text.autoconfig.skyblocker.option.quickNav.button4.clickEvent": "Klikk hendelse", - "text.autoconfig.skyblocker.option.quickNav.button5": "Knapp 5", - "text.autoconfig.skyblocker.option.quickNav.button5.render": "Rendering", - "text.autoconfig.skyblocker.option.quickNav.button5.item": "Gjenstand", - "text.autoconfig.skyblocker.option.quickNav.button5.item.itemName": "Gjenstand Navn", - "text.autoconfig.skyblocker.option.quickNav.button5.item.count": "Gjenstand Teller", - "text.autoconfig.skyblocker.option.quickNav.button5.item.nbt": "NBT", "key.categories.skyblocker": "SkyBlocker", "key.hotbarSlotLock": "Slot lås (Hotbar)", "text.autoconfig.skyblocker.category.general": "Generelt", @@ -77,70 +43,8 @@ "text.autoconfig.skyblocker.option.general.bars.barpositions.experienceBarPosition": "Experience Bar stilling", "text.autoconfig.skyblocker.option.general.itemTooltip.avg.@Tooltip": "Du kan velge hvor mange dager med gjennomsnittspris som skal være", "skyblocker.itemTooltip.nullMessage": "§cVareprisinformasjon på verktøytips fornyes om maks 60 sekunder. Hvis ikke, sjekk latest.log", - "text.autoconfig.skyblocker.option.quickNav.button1": "Knapp 1", - "text.autoconfig.skyblocker.option.quickNav.button1.item.itemName": "Gjenstand navn", - "text.autoconfig.skyblocker.option.quickNav.button3.render": "Rendering", - "text.autoconfig.skyblocker.option.quickNav.button4.uiTitle": "UI Tittel", - "text.autoconfig.skyblocker.option.quickNav.button6.item.nbt": "NBT", - "text.autoconfig.skyblocker.option.quickNav.button6.clickEvent": "Klikk hendelse", - "text.autoconfig.skyblocker.option.quickNav.button8.clickEvent": "Klikk hendelse", - "text.autoconfig.skyblocker.option.quickNav.button10.clickEvent": "Klikk hendelse", - "text.autoconfig.skyblocker.option.quickNav.button12.item": "Gjenstand", "text.autoconfig.skyblocker.option.general.itemList.enableItemList": "Aktiver gjenstad liste", "text.autoconfig.skyblocker.option.locations.dungeons.blazeSolver": "Løs Blaze-puslespillet", - "text.autoconfig.skyblocker.option.quickNav.button5.uiTitle": "UI Tittel", - "text.autoconfig.skyblocker.option.quickNav.button5.clickEvent": "Klikk hendelse", - "text.autoconfig.skyblocker.option.quickNav.button6": "Knapp 6", - "text.autoconfig.skyblocker.option.quickNav.button6.render": "Rendering", - "text.autoconfig.skyblocker.option.quickNav.button6.item": "Gjenstand", - "text.autoconfig.skyblocker.option.quickNav.button6.item.itemName": "Gjenstand navn", - "text.autoconfig.skyblocker.option.quickNav.button6.item.count": "Gjenstand mengde", - "text.autoconfig.skyblocker.option.quickNav.button6.uiTitle": "UI Tittel", - "text.autoconfig.skyblocker.option.quickNav.button7": "Knapp 7", - "text.autoconfig.skyblocker.option.quickNav.button7.render": "Rendering", - "text.autoconfig.skyblocker.option.quickNav.button7.item": "Gjenstand", - "text.autoconfig.skyblocker.option.quickNav.button7.item.itemName": "Gjenstand navn", - "text.autoconfig.skyblocker.option.quickNav.button7.item.count": "Gjenstand navn", - "text.autoconfig.skyblocker.option.quickNav.button7.item.nbt": "NBT", - "text.autoconfig.skyblocker.option.quickNav.button7.uiTitle": "UI Tittel", - "text.autoconfig.skyblocker.option.quickNav.button7.clickEvent": "Klikk hendelse", - "text.autoconfig.skyblocker.option.quickNav.button8": "Knapp 8", - "text.autoconfig.skyblocker.option.quickNav.button8.render": "Rendering", - "text.autoconfig.skyblocker.option.quickNav.button8.item": "Gjenstand", - "text.autoconfig.skyblocker.option.quickNav.button8.item.itemName": "Gjenstand navn", - "text.autoconfig.skyblocker.option.quickNav.button8.item.count": "Gjenstand navn", - "text.autoconfig.skyblocker.option.quickNav.button8.item.nbt": "NBT", - "text.autoconfig.skyblocker.option.quickNav.button8.uiTitle": "UI Tittel", - "text.autoconfig.skyblocker.option.quickNav.button9": "Knapp 8", - "text.autoconfig.skyblocker.option.quickNav.button9.render": "Rendering", - "text.autoconfig.skyblocker.option.quickNav.button9.item": "Gjenstand", - "text.autoconfig.skyblocker.option.quickNav.button9.item.itemName": "Gjenstand Navn", - "text.autoconfig.skyblocker.option.quickNav.button9.item.count": "Gjenstand navn", - "text.autoconfig.skyblocker.option.quickNav.button9.item.nbt": "NBT", - "text.autoconfig.skyblocker.option.quickNav.button9.uiTitle": "UI Tittel", - "text.autoconfig.skyblocker.option.quickNav.button9.clickEvent": "Klikk hendelse", - "text.autoconfig.skyblocker.option.quickNav.button10": "Knapp 1", - "text.autoconfig.skyblocker.option.quickNav.button10.render": "Rendering", - "text.autoconfig.skyblocker.option.quickNav.button10.item": "Gjenstand", - "text.autoconfig.skyblocker.option.quickNav.button10.item.itemName": "Gjenstand Navn", - "text.autoconfig.skyblocker.option.quickNav.button10.item.count": "Gjenstand Mengde", - "text.autoconfig.skyblocker.option.quickNav.button10.item.nbt": "NBT", - "text.autoconfig.skyblocker.option.quickNav.button10.uiTitle": "UI Tittel", - "text.autoconfig.skyblocker.option.quickNav.button11": "Knapp 1", - "text.autoconfig.skyblocker.option.quickNav.button11.render": "Rendering", - "text.autoconfig.skyblocker.option.quickNav.button11.item": "Gjenstand", - "text.autoconfig.skyblocker.option.quickNav.button11.item.itemName": "Gjenstand Navn", - "text.autoconfig.skyblocker.option.quickNav.button11.item.count": "Gjenstand Mengde", - "text.autoconfig.skyblocker.option.quickNav.button11.item.nbt": "NBT", - "text.autoconfig.skyblocker.option.quickNav.button11.uiTitle": "UI Tittel", - "text.autoconfig.skyblocker.option.quickNav.button11.clickEvent": "Klikk hendelse", - "text.autoconfig.skyblocker.option.quickNav.button12": "Knapp 1", - "text.autoconfig.skyblocker.option.quickNav.button12.render": "Rendering", - "text.autoconfig.skyblocker.option.quickNav.button12.item.itemName": "Gjenstand Navn", - "text.autoconfig.skyblocker.option.quickNav.button12.item.count": "Gjenstand Mengde", - "text.autoconfig.skyblocker.option.quickNav.button12.item.nbt": "NBT", - "text.autoconfig.skyblocker.option.quickNav.button12.uiTitle": "UI Tittel", - "text.autoconfig.skyblocker.option.quickNav.button12.clickEvent": "Klikk hendelse", "text.autoconfig.skyblocker.option.general.itemList": "Gjenstand liste", "text.autoconfig.skyblocker.option.locations.dungeons": "Dungeons", "text.autoconfig.skyblocker.category.locations": "Lokasjoner", diff --git a/src/main/resources/assets/skyblocker/lang/pt_br.json b/src/main/resources/assets/skyblocker/lang/pt_br.json index 20ebeeca..f0f2222a 100644 --- a/src/main/resources/assets/skyblocker/lang/pt_br.json +++ b/src/main/resources/assets/skyblocker/lang/pt_br.json @@ -40,8 +40,6 @@ "text.autoconfig.skyblocker.option.richPresence.enableRichPresence": "Ativado", "text.autoconfig.skyblocker.option.richPresence.customMessage": "Mensagem Personalizada", "text.autoconfig.skyblocker.option.quickNav.enableQuickNav": "Ativar Navegação Rápida", - "text.autoconfig.skyblocker.option.quickNav.button1": "Botão 1", - "text.autoconfig.skyblocker.option.quickNav.button1.render": "Renderizar", "key.hotbarSlotLock": "Trancar Slot (Hotbar)", "text.autoconfig.skyblocker.title": "Configurações do Skyblocker", "text.autoconfig.skyblocker.option.general.bars.barpositions": "Configurar Posições das Barras", @@ -61,7 +59,6 @@ "skyblocker.itemTooltip.nullMessage": "§cA Informação do preço do item no tooltip irá se renovar no máximo 60 segundos. Caso contrário, cheque \"latest.log\"", "text.autoconfig.skyblocker.option.richPresence.info.LOCATION": "LOCALIZAÇÃO", "text.autoconfig.skyblocker.category.quickNav": "Navegação Rápida", - "text.autoconfig.skyblocker.option.quickNav.button1.item.itemName": "Nome do Item", "key.categories.skyblocker": "Skyblocker", "text.autoconfig.skyblocker.option.general.etherwarpOverlay": "Overlay de Etherwarp", "text.autoconfig.skyblocker.option.general.fishing": "Assistente de Pesca", @@ -83,17 +80,6 @@ "text.autoconfig.skyblocker.option.general.itemInfoDisplay.attributeShardInfo": "Informação de Fragmento de Atributo", "text.autoconfig.skyblocker.category.richPresence": "Discord Rich Presence", "text.autoconfig.skyblocker.option.richPresence.info.BITS": "BITS", - "text.autoconfig.skyblocker.option.quickNav.button1.item": "Item", - "text.autoconfig.skyblocker.option.quickNav.button1.uiTitle": "Título de UI", - "text.autoconfig.skyblocker.option.quickNav.button1.clickEvent": "Evento de Click", - "text.autoconfig.skyblocker.option.quickNav.button2": "Botão 2", - "text.autoconfig.skyblocker.option.quickNav.button2.render": "Renderizar", - "text.autoconfig.skyblocker.option.quickNav.button1.item.nbt": "NBT", - "text.autoconfig.skyblocker.option.quickNav.button2.item.count": "Contagem de itens", - "text.autoconfig.skyblocker.option.quickNav.button2.uiTitle": "Título de UI", - "text.autoconfig.skyblocker.option.quickNav.button3": "Botão 3", - "text.autoconfig.skyblocker.option.quickNav.button3.render": "Renderizar", - "text.autoconfig.skyblocker.option.quickNav.button3.item": "Item", "text.autoconfig.skyblocker.category.messages": "Mensagens", "text.autoconfig.skyblocker.option.messages.hideImplosion": "Esconder Mensagem de Implosão", "text.autoconfig.skyblocker.option.messages.hideMoltenWave": "Esconder Mensagem do Molten Wave", @@ -112,9 +98,6 @@ "skyblocker.shortcuts.new": "Novo Atalho", "skyblocker.shortcuts.deleteQuestion": "Você tem certeza que quer remover esse atalho?", "emi.category.skyblocker.skyblock": "Skyblock", - "text.autoconfig.skyblocker.option.quickNav.button1.item.count": "Contagem de Itens", - "text.autoconfig.skyblocker.option.quickNav.button2.item.itemName": "Nome do Item", - "text.autoconfig.skyblocker.option.quickNav.button2.clickEvent": "Evento de Click", "text.autoconfig.skyblocker.option.general.backpackPreviewWithoutShift": "Ver preview da mochila sem segurar Shift", "skyblocker.shortcuts.commandSuggestionTooltip": "Devido às limitações do Minecraft, sugestões de comando vai apenas funcionar após o reiniciamento do jogo.", "skyblocker.shortcuts.deleteWarning": "Atalho '%s' vai ser perdido para sempre! (Por um longo tempo!)", @@ -172,86 +155,7 @@ "text.autoconfig.skyblocker.category.slayer": "Slayers", "skyblocker.updaterepository.failed": "§cAtualização do repositório local falhou. Remova os arquivos manualmente e reinicie o jogo.", "text.autoconfig.skyblocker.option.general.hideStatusEffectOverlay": "Esconder Overlay de Status de Efeitos", - "text.autoconfig.skyblocker.option.quickNav.button2.item": "Item", - "text.autoconfig.skyblocker.option.quickNav.button2.item.nbt": "NBT", - "text.autoconfig.skyblocker.option.quickNav.button3.item.nbt": "NBT", - "text.autoconfig.skyblocker.option.quickNav.button3.uiTitle": "Título de UI", - "text.autoconfig.skyblocker.option.quickNav.button3.clickEvent": "Evento de Click", - "text.autoconfig.skyblocker.option.quickNav.button4": "Botão 4", - "text.autoconfig.skyblocker.option.quickNav.button4.item": "Item", - "text.autoconfig.skyblocker.option.quickNav.button4.item.itemName": "Nome do Item", - "text.autoconfig.skyblocker.option.quickNav.button4.item.count": "Contagem de Itens", - "text.autoconfig.skyblocker.option.quickNav.button4.item.nbt": "NBT", - "text.autoconfig.skyblocker.option.quickNav.button4.uiTitle": "Título de UI", - "text.autoconfig.skyblocker.option.quickNav.button4.clickEvent": "Evento de Click", - "text.autoconfig.skyblocker.option.quickNav.button5": "Botão 5", - "text.autoconfig.skyblocker.option.quickNav.button5.render": "Renderizar", - "text.autoconfig.skyblocker.option.quickNav.button5.item.itemName": "Nome do Item", - "text.autoconfig.skyblocker.option.quickNav.button5.item.count": "Contagem de Itens", - "text.autoconfig.skyblocker.option.quickNav.button5.item.nbt": "NBT", - "text.autoconfig.skyblocker.option.quickNav.button5.clickEvent": "Evento de Click", - "text.autoconfig.skyblocker.option.quickNav.button6": "Botão 6", - "text.autoconfig.skyblocker.option.quickNav.button6.item": "Item", - "text.autoconfig.skyblocker.option.quickNav.button6.item.itemName": "Nome do Item", - "text.autoconfig.skyblocker.option.quickNav.button6.item.count": "Contagem de Itens", - "text.autoconfig.skyblocker.option.quickNav.button6.item.nbt": "NBT", - "text.autoconfig.skyblocker.option.quickNav.button6.uiTitle": "Título de UI", - "text.autoconfig.skyblocker.option.quickNav.button6.clickEvent": "Evento de Click", - "text.autoconfig.skyblocker.option.quickNav.button7.render": "Renderizar", - "text.autoconfig.skyblocker.option.quickNav.button7.item": "Item", - "text.autoconfig.skyblocker.option.quickNav.button7.item.itemName": "Nome do Item", - "text.autoconfig.skyblocker.option.quickNav.button7.item.count": "Contagem de Itens", - "text.autoconfig.skyblocker.option.quickNav.button7.item.nbt": "NBT", - "text.autoconfig.skyblocker.option.quickNav.button3.item.itemName": "Nome do Item", - "text.autoconfig.skyblocker.option.quickNav.button3.item.count": "Contagem de Itens", - "text.autoconfig.skyblocker.option.quickNav.button4.render": "Renderizar", - "text.autoconfig.skyblocker.option.quickNav.button5.item": "Item", - "text.autoconfig.skyblocker.option.quickNav.button5.uiTitle": "Título de UI", - "text.autoconfig.skyblocker.option.quickNav.button6.render": "Renderizar", - "text.autoconfig.skyblocker.option.quickNav.button7": "Botão 7", - "text.autoconfig.skyblocker.option.quickNav.button7.uiTitle": "Título de UI", - "text.autoconfig.skyblocker.option.quickNav.button7.clickEvent": "Evento de Click", "text.autoconfig.skyblocker.option.general.itemList.enableItemList": "Ativar Lista de Itens", - "text.autoconfig.skyblocker.option.quickNav.button8.render": "Renderizar", - "text.autoconfig.skyblocker.option.quickNav.button8": "Botão 8", - "text.autoconfig.skyblocker.option.quickNav.button8.item": "Item", - "text.autoconfig.skyblocker.option.quickNav.button8.item.nbt": "NBT", - "text.autoconfig.skyblocker.option.quickNav.button8.uiTitle": "Título de UI", - "text.autoconfig.skyblocker.option.quickNav.button8.clickEvent": "Evento de Click", - "text.autoconfig.skyblocker.option.quickNav.button8.item.itemName": "Nome do Item", - "text.autoconfig.skyblocker.option.quickNav.button8.item.count": "Contagem de Itens", - "text.autoconfig.skyblocker.option.quickNav.button9.render": "Renderizar", - "text.autoconfig.skyblocker.option.quickNav.button9.item": "Item", - "text.autoconfig.skyblocker.option.quickNav.button9.item.itemName": "Nome do Item", - "text.autoconfig.skyblocker.option.quickNav.button9.item.count": "Contagem de Itens", - "text.autoconfig.skyblocker.option.quickNav.button10.item.nbt": "NBT", - "text.autoconfig.skyblocker.option.quickNav.button10.uiTitle": "Título de UI", - "text.autoconfig.skyblocker.option.quickNav.button11": "Botão 11", - "text.autoconfig.skyblocker.option.quickNav.button10.render": "Renderizar", - "text.autoconfig.skyblocker.option.quickNav.button10.item": "Item", - "text.autoconfig.skyblocker.option.quickNav.button10.item.itemName": "Nome do Item", - "text.autoconfig.skyblocker.option.quickNav.button10.item.count": "Contagem de Itens", - "text.autoconfig.skyblocker.option.quickNav.button11.item.itemName": "Nome do Item", - "text.autoconfig.skyblocker.option.quickNav.button11.item.count": "Contagem de Itens", - "text.autoconfig.skyblocker.option.quickNav.button11.item": "Item", - "text.autoconfig.skyblocker.option.quickNav.button11.item.nbt": "NBT", - "text.autoconfig.skyblocker.option.quickNav.button11.uiTitle": "Título de UI", - "text.autoconfig.skyblocker.option.quickNav.button12.render": "Renderizar", - "text.autoconfig.skyblocker.option.quickNav.button12.item": "Item", - "text.autoconfig.skyblocker.option.quickNav.button11.clickEvent": "Evento de Click", - "text.autoconfig.skyblocker.option.quickNav.button12": "Botão 12", - "text.autoconfig.skyblocker.option.quickNav.button12.item.itemName": "Nome do Item", - "text.autoconfig.skyblocker.option.quickNav.button12.item.count": "Contagem de Itens", - "text.autoconfig.skyblocker.option.quickNav.button12.item.nbt": "NBT", - "text.autoconfig.skyblocker.option.quickNav.button12.uiTitle": "Título de UI", - "text.autoconfig.skyblocker.option.quickNav.button12.clickEvent": "Evento de Click", - "text.autoconfig.skyblocker.option.quickNav.button11.render": "Renderizar", - "text.autoconfig.skyblocker.option.quickNav.button9": "Botão 9", - "text.autoconfig.skyblocker.option.quickNav.button9.item.nbt": "NBT", - "text.autoconfig.skyblocker.option.quickNav.button9.uiTitle": "Título de UI", - "text.autoconfig.skyblocker.option.quickNav.button9.clickEvent": "Evento de Click", - "text.autoconfig.skyblocker.option.quickNav.button10": "Botão 10", - "text.autoconfig.skyblocker.option.quickNav.button10.clickEvent": "Evento de Click", "text.autoconfig.skyblocker.option.general.itemList": "Lista de Itens", "text.skyblocker.open": "Abrir", "text.skyblocker.quit_config": "Mudanças Não Salvas", diff --git a/src/main/resources/assets/skyblocker/lang/ru_ru.json b/src/main/resources/assets/skyblocker/lang/ru_ru.json index c35e15a0..fe40f432 100644 --- a/src/main/resources/assets/skyblocker/lang/ru_ru.json +++ b/src/main/resources/assets/skyblocker/lang/ru_ru.json @@ -55,7 +55,6 @@ "text.autoconfig.skyblocker.option.general.backpackPreviewWithoutShift": "Просматривать содержимое рюкзаков без удержания кнопки Shift", "text.autoconfig.skyblocker.option.general.bars.barpositions.NONE": "Выключена", "text.autoconfig.skyblocker.option.general.bars.barpositions.manaBarPosition": "Расположение полоски маны", - "text.autoconfig.skyblocker.option.quickNav.button1.item": "Предмет", "skyblocker.fishing.reelNow": "Тяни!", "text.autoconfig.skyblocker.option.messages.hideAutopet": "Скрывать сообщения Autopet", "text.autoconfig.skyblocker.option.messages.hideMana": "Скрывать сообщения о расходе маны из Action Bar", @@ -74,29 +73,15 @@ "text.autoconfig.skyblocker.option.richPresence.info.LOCATION": "LOCATION", "text.autoconfig.skyblocker.category.quickNav": "Быстрый Доступ", "text.autoconfig.skyblocker.option.quickNav.enableQuickNav": "Включить Быстрый Доступ", - "text.autoconfig.skyblocker.option.quickNav.button1": "Кнопка 1", - "text.autoconfig.skyblocker.option.quickNav.button2": "Кнопка 2", - "text.autoconfig.skyblocker.option.quickNav.button3": "Кнопка 3", "text.autoconfig.skyblocker.option.general.tabHud": "Красивое TAB меню", "key.skyblocker.defaultTgl": "Показывать стандартное меню TAB", "text.autoconfig.skyblocker.option.general.tabHud.tabHudEnabled": "Включить красивое TAB меню", "text.autoconfig.skyblocker.option.general.tabHud.tabHudScale": "Размер TAB меню", "text.autoconfig.skyblocker.option.general.tabHud.tabHudScale.@Tooltip": "Значение в %, по отношению к размеру интерфейса игры", - "text.autoconfig.skyblocker.option.quickNav.button2.clickEvent": "Команда по щелчку", - "text.autoconfig.skyblocker.option.quickNav.button3.render": "Отображать", - "text.autoconfig.skyblocker.option.quickNav.button5.uiTitle": "Название Кнопки", - "text.autoconfig.skyblocker.option.quickNav.button6.item.count": "Количество", - "text.autoconfig.skyblocker.option.quickNav.button7.item.itemName": "ID Предмета", - "text.autoconfig.skyblocker.option.quickNav.button8.item": "Предмет", - "text.autoconfig.skyblocker.option.quickNav.button11.render": "Отображать", - "text.autoconfig.skyblocker.option.quickNav.button11.clickEvent": "Команда по щелчку", - "text.autoconfig.skyblocker.option.quickNav.button12.clickEvent": "Команда по щелчку", "text.autoconfig.skyblocker.option.locations.dungeons.croesusHelper.@Tooltip": "Уже открытые сундуки будут закрашены серым.", "text.autoconfig.skyblocker.option.locations.dungeons.lividColor.lividColorText.@Tooltip": "Текст, который будет отправлен в чат во время боя с Livid. Вместо \"[color]\" отправится цвет босса.", "text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.style.@Tooltip[1]": "\nКрасивый: Показывает название, процент и шкалу выполнения, а также иконку.", "text.autoconfig.skyblocker.option.locations.dungeons.mapScaling": "Размер Карты", - "text.autoconfig.skyblocker.option.quickNav.button4.item.itemName": "ID Предмета", - "text.autoconfig.skyblocker.option.quickNav.button5.item": "Предмет", "text.autoconfig.skyblocker.option.locations.dungeons.lividColor.enableLividColor": "Включить Цвет Босса Livid", "text.autoconfig.skyblocker.option.locations.dungeons.lividColor": "Цвет Босса Livid", "text.autoconfig.skyblocker.option.locations.dungeons.lividColor.enableLividColor.@Tooltip": "Отправляет в чат информацию о том, какого цвета босс Livid.", @@ -112,13 +97,7 @@ "text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.y": "Y", "text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud": "Dwarven HUD (Интерфейс Гномьих Шахт)", "text.autoconfig.skyblocker.option.messages.hideMana.@Tooltip": "Выглядит лучше, когда включены полоски Skyblocker (здоровья, маны и т.д.)", - "text.autoconfig.skyblocker.option.quickNav.button1.clickEvent": "Команда по щелчку", "text.autoconfig.skyblocker.option.locations.barn": "Barn (Ферма)", - "text.autoconfig.skyblocker.option.quickNav.button1.item.itemName": "ID Предмета", - "text.autoconfig.skyblocker.option.quickNav.button1.item.count": "Количество", - "text.autoconfig.skyblocker.option.quickNav.button1.item.nbt": "NBT", - "text.autoconfig.skyblocker.option.quickNav.button1.render": "Отображать", - "text.autoconfig.skyblocker.option.quickNav.button1.uiTitle": "Название Кнопки", "text.autoconfig.skyblocker.option.messages.chatFilterResult.ACTION_BAR": "Переместить в action bar", "text.autoconfig.skyblocker.option.locations.barn.solveHungryHiker": "Показывать Решение Hungry Hiker", "text.autoconfig.skyblocker.option.locations.barn.solveTreasureHunter": "Показывать Решение Treasure Hunter", @@ -126,81 +105,6 @@ "text.autoconfig.skyblocker.option.messages.chatFilterResult.PASS": "Не скрывать", "skyblocker.updaterepository.failed": "§cОшибка в обновлении местного репозитория. Перезапустите игру, удалив файлы вручную.", "text.autoconfig.skyblocker.option.richPresence.info.BITS": "BITS", - "text.autoconfig.skyblocker.option.quickNav.button2.item": "Предмет", - "text.autoconfig.skyblocker.option.quickNav.button2.item.itemName": "ID Предмета", - "text.autoconfig.skyblocker.option.quickNav.button2.item.count": "Количество", - "text.autoconfig.skyblocker.option.quickNav.button2.item.nbt": "NBT", - "text.autoconfig.skyblocker.option.quickNav.button2.uiTitle": "Название Кнопки", - "text.autoconfig.skyblocker.option.quickNav.button2.render": "Отображать", - "text.autoconfig.skyblocker.option.quickNav.button3.item": "Предмет", - "text.autoconfig.skyblocker.option.quickNav.button3.item.itemName": "ID Предмета", - "text.autoconfig.skyblocker.option.quickNav.button3.item.count": "Количество", - "text.autoconfig.skyblocker.option.quickNav.button3.item.nbt": "NBT", - "text.autoconfig.skyblocker.option.quickNav.button3.uiTitle": "Название Кнопки", - "text.autoconfig.skyblocker.option.quickNav.button5.item.count": "Количество", - "text.autoconfig.skyblocker.option.quickNav.button5.item.nbt": "NBT", - "text.autoconfig.skyblocker.option.quickNav.button5.clickEvent": "Команда по щелчку", - "text.autoconfig.skyblocker.option.quickNav.button6": "Кнопка 6", - "text.autoconfig.skyblocker.option.quickNav.button6.item": "Предмет", - "text.autoconfig.skyblocker.option.quickNav.button6.item.itemName": "ID Предмета", - "text.autoconfig.skyblocker.option.quickNav.button6.item.nbt": "NBT", - "text.autoconfig.skyblocker.option.quickNav.button6.uiTitle": "Название Кнопки", - "text.autoconfig.skyblocker.option.quickNav.button6.clickEvent": "Команда по щелчку", - "text.autoconfig.skyblocker.option.quickNav.button7": "Кнопка 7", - "text.autoconfig.skyblocker.option.quickNav.button7.item": "Предмет", - "text.autoconfig.skyblocker.option.quickNav.button7.item.count": "Количество", - "text.autoconfig.skyblocker.option.quickNav.button7.item.nbt": "NBT", - "text.autoconfig.skyblocker.option.quickNav.button7.uiTitle": "Название Кнопки", - "text.autoconfig.skyblocker.option.quickNav.button7.clickEvent": "Команда по щелчку", - "text.autoconfig.skyblocker.option.quickNav.button8": "Кнопка 8", - "text.autoconfig.skyblocker.option.quickNav.button8.item.itemName": "ID Предмета", - "text.autoconfig.skyblocker.option.quickNav.button8.item.count": "Количество", - "text.autoconfig.skyblocker.option.quickNav.button6.render": "Отображать", - "text.autoconfig.skyblocker.option.quickNav.button7.render": "Отображать", - "text.autoconfig.skyblocker.option.quickNav.button8.render": "Отображать", - "text.autoconfig.skyblocker.option.quickNav.button3.clickEvent": "Команда по щелчку", - "text.autoconfig.skyblocker.option.quickNav.button4": "Кнопка 4", - "text.autoconfig.skyblocker.option.quickNav.button4.render": "Отображать", - "text.autoconfig.skyblocker.option.quickNav.button4.item": "Предмет", - "text.autoconfig.skyblocker.option.quickNav.button4.item.count": "Количество", - "text.autoconfig.skyblocker.option.quickNav.button4.item.nbt": "NBT", - "text.autoconfig.skyblocker.option.quickNav.button4.uiTitle": "Название Кнопки", - "text.autoconfig.skyblocker.option.quickNav.button4.clickEvent": "Команда по щелчку", - "text.autoconfig.skyblocker.option.quickNav.button5": "Кнопка 5", - "text.autoconfig.skyblocker.option.quickNav.button5.render": "Отображать", - "text.autoconfig.skyblocker.option.quickNav.button5.item.itemName": "ID Предмета", - "text.autoconfig.skyblocker.option.quickNav.button8.item.nbt": "NBT", - "text.autoconfig.skyblocker.option.quickNav.button8.uiTitle": "Название Кнопки", - "text.autoconfig.skyblocker.option.quickNav.button8.clickEvent": "Команда по щелчку", - "text.autoconfig.skyblocker.option.quickNav.button9": "Кнопка 9", - "text.autoconfig.skyblocker.option.quickNav.button9.item": "Предмет", - "text.autoconfig.skyblocker.option.quickNav.button9.item.itemName": "ID Предмета", - "text.autoconfig.skyblocker.option.quickNav.button9.item.count": "Количество", - "text.autoconfig.skyblocker.option.quickNav.button9.item.nbt": "NBT", - "text.autoconfig.skyblocker.option.quickNav.button9.uiTitle": "Название Кнопки", - "text.autoconfig.skyblocker.option.quickNav.button9.clickEvent": "Команда по щелчку", - "text.autoconfig.skyblocker.option.quickNav.button10": "Кнопка 10", - "text.autoconfig.skyblocker.option.quickNav.button9.render": "Отображать", - "text.autoconfig.skyblocker.option.quickNav.button10.render": "Отображать", - "text.autoconfig.skyblocker.option.quickNav.button10.item": "Предмет", - "text.autoconfig.skyblocker.option.quickNav.button10.item.itemName": "ID Предмета", - "text.autoconfig.skyblocker.option.quickNav.button10.item.count": "Количество", - "text.autoconfig.skyblocker.option.quickNav.button10.item.nbt": "NBT", - "text.autoconfig.skyblocker.option.quickNav.button10.uiTitle": "Название Кнопки", - "text.autoconfig.skyblocker.option.quickNav.button10.clickEvent": "Команда по щелчку", - "text.autoconfig.skyblocker.option.quickNav.button11": "Кнопка 11", - "text.autoconfig.skyblocker.option.quickNav.button11.item": "Предмет", - "text.autoconfig.skyblocker.option.quickNav.button11.item.itemName": "ID Предмета", - "text.autoconfig.skyblocker.option.quickNav.button11.item.count": "Количество", - "text.autoconfig.skyblocker.option.quickNav.button11.item.nbt": "NBT", - "text.autoconfig.skyblocker.option.quickNav.button11.uiTitle": "Название Кнопки", - "text.autoconfig.skyblocker.option.quickNav.button12": "Кнопка 12", - "text.autoconfig.skyblocker.option.quickNav.button12.render": "Отображать", - "text.autoconfig.skyblocker.option.quickNav.button12.item": "Предмет", - "text.autoconfig.skyblocker.option.quickNav.button12.item.itemName": "ID Предмета", - "text.autoconfig.skyblocker.option.quickNav.button12.item.count": "Количество", - "text.autoconfig.skyblocker.option.quickNav.button12.item.nbt": "NBT", - "text.autoconfig.skyblocker.option.quickNav.button12.uiTitle": "Название Кнопки", "text.autoconfig.skyblocker.option.locations.dungeons.croesusHelper": "Помощь в меню Croesus", "text.autoconfig.skyblocker.option.general.experiments": "Помощь в Экспериментах", "text.autoconfig.skyblocker.option.general.experiments.enableUltrasequencerSolver": "Решать Ultrasequencer", diff --git a/src/main/resources/assets/skyblocker/lang/zh_cn.json b/src/main/resources/assets/skyblocker/lang/zh_cn.json index 622e012e..f56d6d93 100644 --- a/src/main/resources/assets/skyblocker/lang/zh_cn.json +++ b/src/main/resources/assets/skyblocker/lang/zh_cn.json @@ -43,18 +43,6 @@ "text.autoconfig.skyblocker.option.richPresence.customMessage": "自定义消息", "text.autoconfig.skyblocker.category.quickNav": "快速导航", "text.autoconfig.skyblocker.option.quickNav.enableQuickNav": "启用快速导航", - "text.autoconfig.skyblocker.option.quickNav.button1": "热键1", - "text.autoconfig.skyblocker.option.quickNav.button2": "热键2", - "text.autoconfig.skyblocker.option.quickNav.button3": "热键3", - "text.autoconfig.skyblocker.option.quickNav.button4": "热键4", - "text.autoconfig.skyblocker.option.quickNav.button5": "热键5", - "text.autoconfig.skyblocker.option.quickNav.button6": "热键6", - "text.autoconfig.skyblocker.option.quickNav.button7": "热键7", - "text.autoconfig.skyblocker.option.quickNav.button8": "热键8", - "text.autoconfig.skyblocker.option.quickNav.button9": "热键9", - "text.autoconfig.skyblocker.option.quickNav.button10": "热键10", - "text.autoconfig.skyblocker.option.quickNav.button11": "热键11", - "text.autoconfig.skyblocker.option.quickNav.button12": "热键12", "text.autoconfig.skyblocker.option.general.itemList": "物品列表", "text.autoconfig.skyblocker.option.general.itemList.enableItemList": "启用物品列表", "text.autoconfig.skyblocker.category.locations": "位置", @@ -96,93 +84,9 @@ "text.autoconfig.skyblocker.option.messages.hideAutopet": "隐藏自动宠物消息", "text.autoconfig.skyblocker.option.messages.hideMana": "在动作栏中隐藏法力消耗信息", "text.autoconfig.skyblocker.option.messages.hideMana.@Tooltip": "已被更好的属性条代替", - "text.autoconfig.skyblocker.option.quickNav.button1.item.nbt": "物品NBT", - "text.autoconfig.skyblocker.option.quickNav.button4.item.nbt": "物品NBT", "text.autoconfig.skyblocker.option.general.hideEmptyTooltips": "隐藏菜单中分隔符的物品信息", "text.autoconfig.skyblocker.option.locations.dungeons.mapScaling": "地图界面大小", "skyblocker.updaterepository.failed": "§c更新本地数据存储库失败,请手动删库并重启游戏", - "text.autoconfig.skyblocker.option.quickNav.button1.item": "热键所显示物品", - "text.autoconfig.skyblocker.option.quickNav.button1.uiTitle": "快捷界面标题", - "text.autoconfig.skyblocker.option.quickNav.button1.item.itemName": "物品ID", - "text.autoconfig.skyblocker.option.quickNav.button1.clickEvent": "点击时所执行的命令", - "text.autoconfig.skyblocker.option.quickNav.button1.render": "是否显示该热键", - "text.autoconfig.skyblocker.option.quickNav.button2.render": "是否显示该热键", - "text.autoconfig.skyblocker.option.quickNav.button2.item": "热键所显示物品", - "text.autoconfig.skyblocker.option.quickNav.button2.item.itemName": "物品ID", - "text.autoconfig.skyblocker.option.quickNav.button2.item.count": "物品数量", - "text.autoconfig.skyblocker.option.quickNav.button1.item.count": "物品数量", - "text.autoconfig.skyblocker.option.quickNav.button2.item.nbt": "物品NBT", - "text.autoconfig.skyblocker.option.quickNav.button2.uiTitle": "快捷界面标题", - "text.autoconfig.skyblocker.option.quickNav.button2.clickEvent": "点击时所执行的命令", - "text.autoconfig.skyblocker.option.quickNav.button3.render": "是否显示该热键", - "text.autoconfig.skyblocker.option.quickNav.button3.item.itemName": "物品ID", - "text.autoconfig.skyblocker.option.quickNav.button3.item.count": "物品数量", - "text.autoconfig.skyblocker.option.quickNav.button3.item.nbt": "物品NBT", - "text.autoconfig.skyblocker.option.quickNav.button3.uiTitle": "快捷界面标题", - "text.autoconfig.skyblocker.option.quickNav.button3.clickEvent": "点击时所执行的命令", - "text.autoconfig.skyblocker.option.quickNav.button4.render": "是否显示该热键", - "text.autoconfig.skyblocker.option.quickNav.button4.item": "热键所显示物品", - "text.autoconfig.skyblocker.option.quickNav.button4.item.itemName": "物品ID", - "text.autoconfig.skyblocker.option.quickNav.button4.uiTitle": "快捷界面标题", - "text.autoconfig.skyblocker.option.quickNav.button4.clickEvent": "点击时所执行的命令", - "text.autoconfig.skyblocker.option.quickNav.button5.render": "是否显示该热键", - "text.autoconfig.skyblocker.option.quickNav.button5.item": "热键所显示物品", - "text.autoconfig.skyblocker.option.quickNav.button5.item.itemName": "物品ID", - "text.autoconfig.skyblocker.option.quickNav.button5.item.count": "物品数量", - "text.autoconfig.skyblocker.option.quickNav.button5.item.nbt": "物品NBT", - "text.autoconfig.skyblocker.option.quickNav.button5.uiTitle": "快捷界面标题", - "text.autoconfig.skyblocker.option.quickNav.button5.clickEvent": "点击时所执行的命令", - "text.autoconfig.skyblocker.option.quickNav.button6.render": "是否显示该热键", - "text.autoconfig.skyblocker.option.quickNav.button6.item": "热键所显示物品", - "text.autoconfig.skyblocker.option.quickNav.button6.item.itemName": "物品ID", - "text.autoconfig.skyblocker.option.quickNav.button6.item.count": "物品数量", - "text.autoconfig.skyblocker.option.quickNav.button6.uiTitle": "快捷界面标题", - "text.autoconfig.skyblocker.option.quickNav.button6.clickEvent": "点击时所执行的命令", - "text.autoconfig.skyblocker.option.quickNav.button7.render": "是否显示该热键", - "text.autoconfig.skyblocker.option.quickNav.button7.item": "热键所显示物品", - "text.autoconfig.skyblocker.option.quickNav.button7.item.itemName": "物品ID", - "text.autoconfig.skyblocker.option.quickNav.button7.item.count": "热键物品显示数量", - "text.autoconfig.skyblocker.option.quickNav.button7.item.nbt": "物品NBT", - "text.autoconfig.skyblocker.option.quickNav.button7.uiTitle": "快捷界面标题", - "text.autoconfig.skyblocker.option.quickNav.button8.render": "是否显示该热键", - "text.autoconfig.skyblocker.option.quickNav.button8.item": "热键所显示物品", - "text.autoconfig.skyblocker.option.quickNav.button8.item.itemName": "物品ID", - "text.autoconfig.skyblocker.option.quickNav.button8.item.count": "热键物品显示数量", - "text.autoconfig.skyblocker.option.quickNav.button8.item.nbt": "物品NBT", - "text.autoconfig.skyblocker.option.quickNav.button8.uiTitle": "快捷界面标题", - "text.autoconfig.skyblocker.option.quickNav.button8.clickEvent": "点击时所执行的命令", - "text.autoconfig.skyblocker.option.quickNav.button9.render": "是否显示该热键", - "text.autoconfig.skyblocker.option.quickNav.button9.item": "热键所显示物品", - "text.autoconfig.skyblocker.option.quickNav.button9.item.count": "物品数量", - "text.autoconfig.skyblocker.option.quickNav.button9.item.nbt": "物品NBT", - "text.autoconfig.skyblocker.option.quickNav.button9.uiTitle": "快捷界面标题", - "text.autoconfig.skyblocker.option.quickNav.button9.clickEvent": "点击时所执行的命令", - "text.autoconfig.skyblocker.option.quickNav.button10.render": "是否显示该热键", - "text.autoconfig.skyblocker.option.quickNav.button10.item": "热键所显示物品", - "text.autoconfig.skyblocker.option.quickNav.button10.item.itemName": "物品ID", - "text.autoconfig.skyblocker.option.quickNav.button10.item.count": "物品数量", - "text.autoconfig.skyblocker.option.quickNav.button10.item.nbt": "物品NBT", - "text.autoconfig.skyblocker.option.quickNav.button10.uiTitle": "快捷界面标题", - "text.autoconfig.skyblocker.option.quickNav.button12.clickEvent": "点击时所执行的命令", - "text.autoconfig.skyblocker.option.quickNav.button11.render": "是否显示该热键", - "text.autoconfig.skyblocker.option.quickNav.button11.item": "热键所显示物品", - "text.autoconfig.skyblocker.option.quickNav.button11.item.itemName": "物品ID", - "text.autoconfig.skyblocker.option.quickNav.button11.item.count": "物品数量", - "text.autoconfig.skyblocker.option.quickNav.button11.item.nbt": "物品NBT", - "text.autoconfig.skyblocker.option.quickNav.button11.uiTitle": "快捷界面标题", - "text.autoconfig.skyblocker.option.quickNav.button11.clickEvent": "点击时所执行的命令", - "text.autoconfig.skyblocker.option.quickNav.button12.render": "是否显示该热键", - "text.autoconfig.skyblocker.option.quickNav.button12.item": "热键所显示物品", - "text.autoconfig.skyblocker.option.quickNav.button12.item.itemName": "物品ID", - "text.autoconfig.skyblocker.option.quickNav.button12.item.count": "物品数量", - "text.autoconfig.skyblocker.option.quickNav.button12.item.nbt": "物品NBT", - "text.autoconfig.skyblocker.option.quickNav.button12.uiTitle": "快捷界面标题", - "text.autoconfig.skyblocker.option.quickNav.button3.item": "热键所显示物品", - "text.autoconfig.skyblocker.option.quickNav.button4.item.count": "物品数量", - "text.autoconfig.skyblocker.option.quickNav.button6.item.nbt": "物品NBT", - "text.autoconfig.skyblocker.option.quickNav.button7.clickEvent": "点击时所执行的命令", - "text.autoconfig.skyblocker.option.quickNav.button9.item.itemName": "物品ID", - "text.autoconfig.skyblocker.option.quickNav.button10.clickEvent": "点击时所执行的命令", "text.autoconfig.skyblocker.option.general.fishing": "钓鱼助手", "text.autoconfig.skyblocker.option.general.fishing.enableFishingHelper": "启用钓鱼助手", "skyblocker.fishing.reelNow": "收竿!", diff --git a/src/main/resources/assets/skyblocker/lang/zh_tw.json b/src/main/resources/assets/skyblocker/lang/zh_tw.json index 44b5d9d6..d412de9c 100644 --- a/src/main/resources/assets/skyblocker/lang/zh_tw.json +++ b/src/main/resources/assets/skyblocker/lang/zh_tw.json @@ -37,9 +37,6 @@ "text.autoconfig.skyblocker.option.general.hitbox.oldFarmlandHitbox": "啟用1.8的耕地判定箱", "text.autoconfig.skyblocker.category.quickNav": "快速導航", "text.autoconfig.skyblocker.option.quickNav.enableQuickNav": "啟用快速導航", - "text.autoconfig.skyblocker.option.quickNav.button1": "熱鍵1", - "text.autoconfig.skyblocker.option.quickNav.button1.render": "是否顯示該熱鍵", - "text.autoconfig.skyblocker.option.quickNav.button1.item": "熱鍵所顯示物品", "text.autoconfig.skyblocker.option.locations.dungeons.enableMap": "啟用 Dungeon 地圖", "text.autoconfig.skyblocker.option.locations.barn.solveTreasureHunter": "Treasure Hunter 助手", "text.autoconfig.skyblocker.option.locations.dwarvenMines.enableDrillFuel": "顯示電鑽燃料", @@ -51,11 +48,6 @@ "text.autoconfig.skyblocker.option.richPresence.info.LOCATION": "位置", "text.autoconfig.skyblocker.option.richPresence.info.@Tooltip": "如果您正在循環模式,這個值將不會生效", "text.autoconfig.skyblocker.option.richPresence.customMessage": "自訂訊息", - "text.autoconfig.skyblocker.option.quickNav.button1.item.itemName": "物品ID", - "text.autoconfig.skyblocker.option.quickNav.button1.item.count": "物品數量", - "text.autoconfig.skyblocker.option.quickNav.button1.item.nbt": "物品NBT", - "text.autoconfig.skyblocker.option.quickNav.button1.uiTitle": "快捷介面標題", - "text.autoconfig.skyblocker.option.quickNav.button1.clickEvent": "點擊時所執行的指令", "text.autoconfig.skyblocker.option.locations.dwarvenMines.solveFetchur": "Fetchur 所需物品提示", "text.autoconfig.skyblocker.option.messages.chatFilterResult.ACTION_BAR": "移至動作欄", "text.autoconfig.skyblocker.option.messages.chatFilterResult.PASS": "關閉", -- cgit From 62465cfa3dc7f0fa438c58f0602811edf00a550d Mon Sep 17 00:00:00 2001 From: Weblate Date: Sat, 21 Oct 2023 11:42:38 +0200 Subject: Update translation files Updated by "Cleanup translation files" hook in Weblate. Translation: Skyblocker/Skyblocker Translate-URL: https://translate.hysky.de/projects/Skyblocker/skyblocker/ --- src/main/resources/assets/skyblocker/lang/es_es.json | 2 -- src/main/resources/assets/skyblocker/lang/fr_fr.json | 4 ---- src/main/resources/assets/skyblocker/lang/ja_jp.json | 6 ------ src/main/resources/assets/skyblocker/lang/ko_kr.json | 2 -- src/main/resources/assets/skyblocker/lang/pt_br.json | 4 ---- src/main/resources/assets/skyblocker/lang/ru_ru.json | 4 ---- src/main/resources/assets/skyblocker/lang/tr_tr.json | 2 -- src/main/resources/assets/skyblocker/lang/zh_cn.json | 4 ---- 8 files changed, 28 deletions(-) diff --git a/src/main/resources/assets/skyblocker/lang/es_es.json b/src/main/resources/assets/skyblocker/lang/es_es.json index 2338f502..87de5ab2 100644 --- a/src/main/resources/assets/skyblocker/lang/es_es.json +++ b/src/main/resources/assets/skyblocker/lang/es_es.json @@ -65,8 +65,6 @@ "text.autoconfig.skyblocker.option.locations.dwarvenMines.solveFetchur": "Resolver Fetchur", "text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud": "Interfaz de Dwarven", "text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.enabled": "Habilitado", - "text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.x": "X", - "text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.y": "Y", "text.autoconfig.skyblocker.category.messages": "Mensajes", "text.autoconfig.skyblocker.option.messages.chatFilterResult.PASS": "Deshabilitado", "text.autoconfig.skyblocker.option.messages.chatFilterResult.FILTER": "Filtro", diff --git a/src/main/resources/assets/skyblocker/lang/fr_fr.json b/src/main/resources/assets/skyblocker/lang/fr_fr.json index 3e9bf6f0..207852ac 100644 --- a/src/main/resources/assets/skyblocker/lang/fr_fr.json +++ b/src/main/resources/assets/skyblocker/lang/fr_fr.json @@ -52,8 +52,6 @@ "text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud": "ATH mine des nains", "text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.enabled": "Activé", "text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.enableBackground": "Activer l'arrière-plan", - "text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.x": "X", - "text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.y": "Y", "text.autoconfig.skyblocker.category.messages": "Messages", "text.autoconfig.skyblocker.option.messages.hideAbility": "Cacher le rechargement des capacités", "text.autoconfig.skyblocker.option.messages.hideHeal": "Cacher les messages de soin", @@ -77,8 +75,6 @@ "text.autoconfig.skyblocker.option.general.bars.barpositions.LAYER2": "Couche 2", "text.autoconfig.skyblocker.option.general.bars.barpositions.RIGHT": "Droite", "text.autoconfig.skyblocker.option.general.itemTooltip.avg.ONE_DAY": "Prix pour 1 jour", - "text.autoconfig.skyblocker.option.locations.dungeons.mapX": "Carte X", - "text.autoconfig.skyblocker.option.locations.dungeons.mapY": "Carte Y", "text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.style": "Style du HUD", "text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.style.@Tooltip[0]": "Simple : Montre le nom et le pourcentage.", "text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.style.@Tooltip[1]": "Détaillé : Montre le nom, pourcentage, barre de progression et une icone.", diff --git a/src/main/resources/assets/skyblocker/lang/ja_jp.json b/src/main/resources/assets/skyblocker/lang/ja_jp.json index 0d62361f..629bc1de 100644 --- a/src/main/resources/assets/skyblocker/lang/ja_jp.json +++ b/src/main/resources/assets/skyblocker/lang/ja_jp.json @@ -49,8 +49,6 @@ "text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud": "ドワーフマインでのHUD", "text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.enabled": "有効", "text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.enableBackground": "バックグラウンド表示を有効にする", - "text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.x": "X", - "text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.y": "Y", "text.autoconfig.skyblocker.category.messages": "メッセージ", "text.autoconfig.skyblocker.option.messages.hideAbility": "アビリティのクールダウンを非表示にする", "text.autoconfig.skyblocker.option.messages.hideHeal": "回復メッセージを非表示にする", @@ -85,7 +83,6 @@ "text.autoconfig.skyblocker.option.general.tabHud.plainPlayerNames": "そのままのプレイヤー名", "text.autoconfig.skyblocker.option.general.itemTooltip.avg.ONE_DAY": "今日の平均の値段", "text.autoconfig.skyblocker.option.general.itemTooltip.avg.BOTH": "両方", - "text.autoconfig.skyblocker.option.general.titleContainer.alignment": "タイトルコンテナの水平での位置合わせ", "text.autoconfig.skyblocker.option.general.titleContainer.config": "タイトルコンテナの置き方の設定...", "text.autoconfig.skyblocker.option.general.experiments.enableSuperpairsSolver": "Superpairsのソルバーを有効にするか", "text.autoconfig.skyblocker.option.general.experiments.enableUltrasequencerSolver": "Ultrasequencerのソルバーを有効にするか", @@ -93,7 +90,6 @@ "text.autoconfig.skyblocker.option.general.experiments.enableChronomatronSolver": "chronomatronのソルバーを有効にするか", "text.autoconfig.skyblocker.option.general.titleContainer.@Tooltip": "いくつかの表示を一度に表示するときに使います。(例:Vampire Slayer)", "text.autoconfig.skyblocker.option.general.titleContainer": "画面に表示するタイトルコンテナ", - "text.autoconfig.skyblocker.option.general.titleContainer.x": "X座標での表示位置", "text.autoconfig.skyblocker.option.general.titleContainer.titleContainerScale": "タイトルコンテナの大きさ", "text.autoconfig.skyblocker.option.general.fairySouls.highlightFoundSouls": "見つけたフェアリーソウルもハイライトする", "text.autoconfig.skyblocker.option.general.fairySouls.highlightOnlyNearbySouls": "近くにあるフェアリーソウルだけをハイライトする", @@ -109,8 +105,6 @@ "text.autoconfig.skyblocker.option.general.fairySouls.enableFairySoulsHelper": "フェアリーソウルヘルパーを有効にするか", "text.autoconfig.skyblocker.option.general.itemTooltip.enableMotesPrice.@Tooltip": "The Riftディメンションにいるときにアイテムの売値をmotesで表示する。", "text.autoconfig.skyblocker.option.general.itemTooltip.enableMotesPrice": "売値をmotesで表示", - "text.autoconfig.skyblocker.option.general.titleContainer.direction": "タイトルコンテナの向き", - "text.autoconfig.skyblocker.option.general.titleContainer.y": "Y座標での表示位置", "text.autoconfig.skyblocker.option.general.etherwarpOverlay": "Etherwarp移動先の表示", "text.autoconfig.skyblocker.option.general.quiverWarning": "Quiverの通知", "text.autoconfig.skyblocker.option.general.quiverWarning.enableQuiverWarning": "Quiverの通知を有効にする", diff --git a/src/main/resources/assets/skyblocker/lang/ko_kr.json b/src/main/resources/assets/skyblocker/lang/ko_kr.json index cb35668a..7834ca4c 100644 --- a/src/main/resources/assets/skyblocker/lang/ko_kr.json +++ b/src/main/resources/assets/skyblocker/lang/ko_kr.json @@ -65,8 +65,6 @@ "text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud": "Dwarven HUD", "text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.enabled": "활성화됨", "text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.enableBackground": "배경 활성화", - "text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.x": "X", - "text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.y": "Y", "text.autoconfig.skyblocker.category.messages": "메시지", "text.autoconfig.skyblocker.option.messages.chatFilterResult.PASS": "비활성화됨", "text.autoconfig.skyblocker.option.messages.chatFilterResult.FILTER": "필터", diff --git a/src/main/resources/assets/skyblocker/lang/pt_br.json b/src/main/resources/assets/skyblocker/lang/pt_br.json index f0f2222a..eb48c2f8 100644 --- a/src/main/resources/assets/skyblocker/lang/pt_br.json +++ b/src/main/resources/assets/skyblocker/lang/pt_br.json @@ -24,9 +24,6 @@ "text.autoconfig.skyblocker.option.general.hitbox.oldLeverHitbox": "Ativar hitbox de alavanca do 1.8", "text.autoconfig.skyblocker.option.general.titleContainer": "Contêiner de Título", "text.autoconfig.skyblocker.option.general.titleContainer.titleContainerScale": "Escala de Contêiner de Título", - "text.autoconfig.skyblocker.option.general.titleContainer.x": "Posição X do Contêiner de Título", - "text.autoconfig.skyblocker.option.general.titleContainer.y": "Posição Y do Contêiner de Título", - "text.autoconfig.skyblocker.option.general.titleContainer.alignment": "Alinhamento Horizontal do Contêiner de Título", "text.autoconfig.skyblocker.option.general.teleportOverlay": "Overlay de Teleporte", "text.autoconfig.skyblocker.option.general.teleportOverlay.enableWeirdTransmission": "Ativar Overlay de Transmissão Estranho", "text.autoconfig.skyblocker.option.general.teleportOverlay.enableInstantTransmission": "Ativar Overlay de Transmissão Instantâneo", @@ -53,7 +50,6 @@ "text.autoconfig.skyblocker.option.general.specialEffects": "Efeitos Especial", "text.autoconfig.skyblocker.option.general.specialEffects.rareDungeonDropEffects": "Efeito de Drop Raro de Dungeon", "text.autoconfig.skyblocker.option.general.titleContainer.@Tooltip": "Usado para mostrar vários títulos de uma vez, Exemplo de uso: Vampire Slayer", - "text.autoconfig.skyblocker.option.general.titleContainer.direction": "Orientação do Contêiner de Título", "text.autoconfig.skyblocker.option.general.teleportOverlay.enableTeleportOverlays": "Ativar Overlays de Teleporte", "text.autoconfig.skyblocker.option.general.teleportOverlay.enableEtherTransmission": "Ativar Overlay de Transmissão Éter", "skyblocker.itemTooltip.nullMessage": "§cA Informação do preço do item no tooltip irá se renovar no máximo 60 segundos. Caso contrário, cheque \"latest.log\"", diff --git a/src/main/resources/assets/skyblocker/lang/ru_ru.json b/src/main/resources/assets/skyblocker/lang/ru_ru.json index fe40f432..980c130a 100644 --- a/src/main/resources/assets/skyblocker/lang/ru_ru.json +++ b/src/main/resources/assets/skyblocker/lang/ru_ru.json @@ -86,15 +86,11 @@ "text.autoconfig.skyblocker.option.locations.dungeons.lividColor": "Цвет Босса Livid", "text.autoconfig.skyblocker.option.locations.dungeons.lividColor.enableLividColor.@Tooltip": "Отправляет в чат информацию о том, какого цвета босс Livid.", "text.autoconfig.skyblocker.option.locations.dungeons.lividColor.lividColorText": "Текст О Цвете Livid", - "text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.x": "X", - "text.autoconfig.skyblocker.option.locations.dungeons.mapX": "Карта по X", - "text.autoconfig.skyblocker.option.locations.dungeons.mapY": "Карта по Y", "text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.style": "Стиль HUD", "text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.style.@Tooltip[0]": "Упрощенный: Показывает название и процент выполнения.", "text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.style.@Tooltip[2]": "\nКлассический: Показывает название и процент выполнения в простом тёмном квадрате.", "text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.enableBackground": "Включить Фон", "text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.enabled": "Включить", - "text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.y": "Y", "text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud": "Dwarven HUD (Интерфейс Гномьих Шахт)", "text.autoconfig.skyblocker.option.messages.hideMana.@Tooltip": "Выглядит лучше, когда включены полоски Skyblocker (здоровья, маны и т.д.)", "text.autoconfig.skyblocker.option.locations.barn": "Barn (Ферма)", diff --git a/src/main/resources/assets/skyblocker/lang/tr_tr.json b/src/main/resources/assets/skyblocker/lang/tr_tr.json index 2441570a..f6b31dec 100644 --- a/src/main/resources/assets/skyblocker/lang/tr_tr.json +++ b/src/main/resources/assets/skyblocker/lang/tr_tr.json @@ -39,8 +39,6 @@ "text.autoconfig.skyblocker.option.messages.hideMana": "Aksiyon barındaki mana tüketimlerini gizle", "text.autoconfig.skyblocker.option.messages.hideMana.@Tooltip": "FancyBar ile daha iyi bir deneyim sunar", "text.autoconfig.skyblocker.option.general.hideEmptyTooltips": "Menülerdeki boş eşya açıklamalarını gizle", - "text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.y": "Y", - "text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.x": "X", "text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.enableBackground": "Arka planı göster", "text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.enabled": "Etkinleştir", "text.autoconfig.skyblocker.option.general.itemTooltip.avg.@Tooltip": "Kaç günlük ortalamanın gösterileceğini seçebilirsiniz", diff --git a/src/main/resources/assets/skyblocker/lang/zh_cn.json b/src/main/resources/assets/skyblocker/lang/zh_cn.json index f56d6d93..4a3abde3 100644 --- a/src/main/resources/assets/skyblocker/lang/zh_cn.json +++ b/src/main/resources/assets/skyblocker/lang/zh_cn.json @@ -67,8 +67,6 @@ "text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud": "矮人矿井 HUD", "text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.enabled": "启用", "text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.enableBackground": "启用背景", - "text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.x": "HUD所在横向位置", - "text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.y": "HUD所在纵向位置", "text.autoconfig.skyblocker.category.messages": "消息", "text.autoconfig.skyblocker.option.messages.chatFilterResult.PASS": "禁用", "text.autoconfig.skyblocker.option.messages.chatFilterResult.FILTER": "启用", @@ -97,8 +95,6 @@ "text.autoconfig.skyblocker.option.locations.dungeons.lividColor.lividColorText.@Tooltip": "Livid Boss战时发送到聊天栏的信息, 字段 “[color]” 将被替换为真 Livid 的颜色", "key.skyblocker.defaultTgl": "将tab键所显示的列表改为默认空岛生存列表", "text.autoconfig.skyblocker.option.general.tabHud.tabHudEnabled": "启用更好的Tab HUD", - "text.autoconfig.skyblocker.option.locations.dungeons.mapX": "地图所在横向位置", - "text.autoconfig.skyblocker.option.locations.dungeons.mapY": "地图所在纵向位置", "text.autoconfig.skyblocker.option.general.tabHud": "更好的Tab HUD", "text.autoconfig.skyblocker.option.general.tabHud.tabHudScale": "更好的Tab HUD缩放大小", "text.autoconfig.skyblocker.option.general.tabHud.tabHudScale.@Tooltip": "相对于原版 GUI 的百分比大小", -- cgit From 2dcade652c1cb6c0c75f7bda488348cc78ddc409 Mon Sep 17 00:00:00 2001 From: Aurin Date: Sun, 22 Oct 2023 04:23:58 +0000 Subject: Translated using Weblate (Portuguese (Brazil)) Currently translated at 80.2% (240 of 299 strings) Translation: Skyblocker/Skyblocker Translate-URL: https://translate.hysky.de/projects/Skyblocker/skyblocker/pt_BR/ --- .../resources/assets/skyblocker/lang/pt_br.json | 87 +++++++++++++++++++--- 1 file changed, 77 insertions(+), 10 deletions(-) diff --git a/src/main/resources/assets/skyblocker/lang/pt_br.json b/src/main/resources/assets/skyblocker/lang/pt_br.json index eb48c2f8..d0371642 100644 --- a/src/main/resources/assets/skyblocker/lang/pt_br.json +++ b/src/main/resources/assets/skyblocker/lang/pt_br.json @@ -90,7 +90,7 @@ "text.autoconfig.skyblocker.option.slayer.vampireSlayer.effigyUpdateFrequency.@Tooltip": "Quanto menor o valor, maior será a frequência de atualizações, o que irá talvez causa lag.", "text.autoconfig.skyblocker.option.slayer.vampireSlayer.enableHolyIceIndicator": "Ativar Indicador de Gelo Santo", "text.autoconfig.skyblocker.option.slayer.vampireSlayer.holyIceIndicatorTickDelay": "Atraso (Ticks) do Indicador de Gelo Santo", - "skyblocker.shortcuts.config": "Configurações de Atalhos", + "skyblocker.shortcuts.config": "Configurações de atalhos", "skyblocker.shortcuts.new": "Novo Atalho", "skyblocker.shortcuts.deleteQuestion": "Você tem certeza que quer remover esse atalho?", "emi.category.skyblocker.skyblock": "Skyblock", @@ -120,11 +120,11 @@ "text.autoconfig.skyblocker.option.general.tabHud.tabHudScale": "Fator de escala do HUD de tab Bonito", "text.autoconfig.skyblocker.option.general.tabHud.tabHudScale.@Tooltip": "Valor em %, relativo a sua escala vanilla do GUI", "text.autoconfig.skyblocker.option.general.hitbox": "Hitboxes", - "skyblocker.relics.markAllFound": "§rTodas as relíquias foram marcados como encontrado", - "skyblocker.shortcuts.command.target": "Comando Alvo", - "skyblocker.shortcuts.command.replacement": "Comando de Reposição", - "skyblocker.shortcuts.commandArg.target": "Argumento do Comando Alvo", - "skyblocker.shortcuts.commandArg.replacement": "Argumento do Comando de Reposição", + "skyblocker.relics.markAllFound": "§rTodas as relíquias foram marcadas como encontradas", + "skyblocker.shortcuts.command.target": "Comando alvo", + "skyblocker.shortcuts.command.replacement": "Comando de substituição", + "skyblocker.shortcuts.commandArg.target": "Argumento do comando alvo", + "skyblocker.shortcuts.commandArg.replacement": "Argumento do comando de substituição", "skyblocker.customDyeColors.invalidHex": "§cCódigo de cor HEX invalido!", "skyblocker.customItemNames.unableToSetName": "§cNão foi possível colocar um nome personalizado no item :( (Você está no skyblock?, Você está segurando um item?)", "skyblocker.customDyeColors.notDyeable": "§cEsse item não é uma peça de armadura pintável!", @@ -139,9 +139,9 @@ "skyblocker.customArmorTrims.notAnArmorPiece": "§cEsse item não é uma peça de armadura!", "skyblocker.customArmorTrims.added": "§fColoque um acabamento personalizado de armadura para o item que você está segurando!", "skyblocker.customItemNames.neverHad": "§fEsse item ainda não tem um nome personalizado colocado, por que não colocar um? ;)", - "skyblocker.relics.markAllMissing": "§rTodas as relíquias foram marcados como faltando", - "skyblocker.dungeons.secrets.markSecretFound": "§r#%d secreto marcado como encontrado.", - "skyblocker.dungeons.secrets.markSecretMissing": "§r#%d secreto marcado como faltando.", + "skyblocker.relics.markAllMissing": "§rTodas as relíquias foram marcadas como pendentes", + "skyblocker.dungeons.secrets.markSecretFound": "§r#%d segredo marcado como encontrado.", + "skyblocker.dungeons.secrets.markSecretMissing": "§r#%d segredo marcado como pendente.", "skyblocker.customArmorTrims.noItemUuid": "§cVocê tem que tá segurando um item que tenha um uuid para poder colocar um acabamento personalizado na armadura!", "text.autoconfig.skyblocker.option.general.shortcuts.enableCommandArgShortcuts.@Tooltip": "Atalhos que trocam uma ou mais palavra(s)/argumento(s) de um comando com múltiplas palavras/argumentos. Edite atalhos com \"/skyblocker shortcuts\". Atalhos tem que está ativos para tomar efeito.", "text.autoconfig.skyblocker.option.general.compactorDeletorPreview": "Ativar Preview do Compactador/Deletador", @@ -171,5 +171,72 @@ "text.autoconfig.skyblocker.option.general.wikiLookup.officialWiki": "Usar Wiki Oficial", "text.autoconfig.skyblocker.option.general.wikiLookup.officialWiki.@Tooltip": "Usar a wiki oficial em vez da wiki do Fandom.", "text.autoconfig.skyblocker.option.general.itemInfoDisplay.itemRarityBackgrounds": "Fundos de Raridade de Item", - "text.autoconfig.skyblocker.option.general.itemInfoDisplay.itemRarityBackgrounds.@Tooltip": "Mostra um fundo colorido atrás de um item, a cor representa a raridade do item." + "text.autoconfig.skyblocker.option.general.itemInfoDisplay.itemRarityBackgrounds.@Tooltip": "Mostra um fundo colorido atrás de um item, a cor representa a raridade do item.", + "text.autoconfig.skyblocker.option.locations.dungeons.mapScreen": "Configuração da posição do mapa da dungeon...", + "text.autoconfig.skyblocker.option.locations.dungeons.solveThreeWeirdos": "Guia para Puzzle dos Three Weridos", + "text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.style.@Tooltip[0]": "Simples: Exibe nome e porcentagem.", + "text.autoconfig.skyblocker.option.locations.dungeons.dungeonChestProfit.neutralThreshold": "Limite neutro", + "text.autoconfig.skyblocker.option.locations.dungeons.dungeonChestProfit.profitColor": "Cor do lucro", + "text.autoconfig.skyblocker.option.locations.dungeons.dungeonChestProfit.lossColor": "Cor de prejuízo", + "text.autoconfig.skyblocker.option.locations.dungeons.dungeonChestProfit.incompleteColor": "Cor incompleta", + "text.autoconfig.skyblocker.option.locations.dungeons.dungeonChestProfit.incompleteColor.@Tooltip": "A cor exibida quando a data de preço é incompleta.", + "text.autoconfig.skyblocker.option.locations.dungeons.croesusHelper.@Tooltip": "Acinzentar os baús que já foram abertos.", + "text.autoconfig.skyblocker.option.locations.dungeons.enableMap": "Ativar mapa", + "text.autoconfig.skyblocker.option.locations.dungeons.mapScaling": "Tamanho do mapa", + "text.autoconfig.skyblocker.option.locations.dungeons.lividColor": "Cor do Livid", + "text.autoconfig.skyblocker.option.locations.dungeons.lividColor.enableLividColor": "Ativar cor para Livid", + "text.autoconfig.skyblocker.option.locations.dungeons.terminals": "Guia dos terminais", + "text.autoconfig.skyblocker.option.locations.dungeons.terminals.solveColor": "Guia de seleção colorido", + "text.autoconfig.skyblocker.option.locations.dungeons.terminals.solveOrder": "Guia de clique em ordem", + "text.autoconfig.skyblocker.option.slayer.vampireSlayer.holyIceUpdateFrequency": "Frequência de atualização de indicador do Holy Ice (Em Ticks)", + "text.autoconfig.skyblocker.option.slayer.vampireSlayer.enableManiaIndicator": "Ativar indicador de Mania Block", + "skyblocker.dungeons.secrets.markSecretFoundUnable": "§cImpossibilitado de marcar segredo #%d como encontrado.", + "skyblocker.dungeons.secrets.markSecretMissingUnable": "§cImpossibilitado de marcar segredo #%d como pendente.", + "skyblocker.rift.healNow": "Cure agora!", + "text.autoconfig.skyblocker.option.locations.dwarvenMines.enableDrillFuel": "Ativar combustível da broca", + "text.autoconfig.skyblocker.option.locations.dwarvenMines.solveFetchur": "Guia para Fetchur", + "text.autoconfig.skyblocker.option.locations.rift": "A fenda", + "text.autoconfig.skyblocker.option.locations.rift.mirrorverseWaypoints": "Ativar marcadores do Mirrorverse", + "text.autoconfig.skyblocker.option.locations.dungeons.blazeSolver": "Guia para puzzle do Blaze", + "text.autoconfig.skyblocker.option.locations.dungeons.blazeSolver.@Tooltip": "Cria uma caixa em cor verde para o blaze correto além de desenhar uma linha, e cria uma caixa para o próximo blaze a ser morto em cor branca.", + "text.autoconfig.skyblocker.option.locations.dungeons.creeperSolver": "Guia para puzzle dos feixes de Creeper", + "text.autoconfig.skyblocker.option.locations.dungeons.creeperSolver.@Tooltip": "Contornar os melhores feixes para fazer o alvo atingir.", + "text.autoconfig.skyblocker.option.locations.dungeons.lividColor.lividColorText": "Texto da cor do Livid", + "text.autoconfig.skyblocker.option.locations.dwarvenMines.solvePuzzler": "Guia para puzzle do Puzzler", + "text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud": "Interface da mina dos anões", + "text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.enabled": "Ativado", + "text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.style": "Estilo para a interface", + "text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.style.@Tooltip[2]": "\nClássico: Exibe nome e porcentagem em uma caixa super simples.", + "text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.enableBackground": "Ativar fundo", + "text.autoconfig.skyblocker.option.locations.rift.mcGrubberStacks": "Pilhas de McGrubber", + "text.autoconfig.skyblocker.option.messages.chatFilterResult.PASS": "Desativado", + "text.autoconfig.skyblocker.option.messages.chatFilterResult.FILTER": "Filtro", + "text.autoconfig.skyblocker.option.messages.chatFilterResult.ACTION_BAR": "Mover para Action Bar", + "text.autoconfig.skyblocker.option.messages.hideAbility": "Esconder tempo de espera de habilidade", + "text.autoconfig.skyblocker.option.messages.hideHeal": "Esconder mensagens de cura", + "text.autoconfig.skyblocker.option.slayer.vampireSlayer.enableSteakStakeIndicator": "Ativar indicador estaca de carne", + "text.autoconfig.skyblocker.option.slayer.vampireSlayer.steakStakeUpdateFrequency": "Frequência de atualização de estanca de carne (Em Ticks)", + "skyblocker.rift.iceNow": "Gelo agora!", + "skyblocker.rift.mania": "Mania!", + "skyblocker.rift.stakeNow": "Estaca agora!", + "skyblocker.fairySouls.markAllFound": "§rMarcada todas as almas de fadas na ilha atual como encontradas", + "text.autoconfig.skyblocker.option.locations.dungeons.croesusHelper": "Guia para Croesus", + "text.autoconfig.skyblocker.option.locations.dungeons.dungeonChestProfit.neutralColor": "Cor do neutro", + "text.autoconfig.skyblocker.option.locations.dungeons.dungeonChestProfit.neutralThreshold.@Tooltip": "O limite abaixo do qual o lucro é declarado neutro.", + "text.autoconfig.skyblocker.option.locations.dungeons.solveTrivia": "Guia para puzzle do Trivia", + "text.autoconfig.skyblocker.option.locations.dungeons.terminals.solveStartsWith": "Guia de \"começa com\"", + "text.autoconfig.skyblocker.option.slayer.vampireSlayer": "Caçador de Vampiros", + "text.autoconfig.skyblocker.option.slayer.vampireSlayer.enableHealingMelonIndicator": "Ativar indicador de Healing Melon", + "skyblocker.fishing.reelNow": "Entre agora!", + "text.autoconfig.skyblocker.option.locations.dungeons.solveTicTacToe.@Tooltip": "Coloca uma caixa vermelha em volta do próximo melhor movimento para você fazer!", + "text.autoconfig.skyblocker.option.locations.dungeons.lividColor.lividColorText.@Tooltip": "Texto o qual será mandado no chat durante a luta contra Livid. A linha \"[cor]\" vai ser preenchida com a cor do Livid.", + "text.autoconfig.skyblocker.option.locations.dwarvenMines": "Mina dos anões", + "text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.style.@Tooltip[1]": "\nBonito: Exibe nome, porcentagem, barra de progresso e um ícone.", + "text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.screen": "Configurações da interface da mina dos anões...", + "text.autoconfig.skyblocker.option.locations.rift.mcGrubberStacks.@Tooltip": "Usado para calcular preço de venda de Motes.", + "skyblocker.fairySouls.markAllMissing": "§rMarcada todas as almas de fadas na ilha atual como pendentes", + "text.autoconfig.skyblocker.option.locations.dungeons.starredMobGlow": "Brilho em Mobs com estrela", + "text.autoconfig.skyblocker.option.locations.dungeons.starredMobGlow.@Tooltip": "Aplicar o efeito de brilho para Mobs estrelados que estão visíveis.", + "text.autoconfig.skyblocker.option.locations.dungeons.solveTicTacToe": "Guia para o Puzzle do jogo da velha", + "text.autoconfig.skyblocker.option.locations.dungeons.lividColor.enableLividColor.@Tooltip": "Mandar a cor do Livid no chat durante a luta contra Livid." } -- cgit From 69eb16bb751e0717444189e15efdc2be6cf90f44 Mon Sep 17 00:00:00 2001 From: Aaron <51387595+AzureAaron@users.noreply.github.com> Date: Sun, 22 Oct 2023 16:15:37 -0400 Subject: Fix waypoints not disappearing in boss --- .../skyblocker/skyblock/dungeon/secrets/DungeonSecrets.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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 d01305f9..96b4a7c9 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 @@ -377,6 +377,13 @@ public class DungeonSecrets { if (overlay && isCurrentRoomMatched()) { currentRoom.onChatMessage(text.getString()); } + + String message = text.getString(); + + if (message.equals("[BOSS] Bonzo: Gratz for making it this far, but I'm basically unbeatable.") || message.equals("[BOSS] Scarf: This is where the journey ends for you, Adventurers.") + || message.equals("[BOSS] The Professor: I was burdened with terrible news recently...") || message.equals("[BOSS] Thorn: Welcome Adventurers! I am Thorn, the Spirit! And host of the Vegan Trials!") + || message.equals("[BOSS] Livid: Welcome, you've arrived right on time. I am Livid, the Master of Shadows.") || message.equals("[BOSS] Sadan: So you made it all the way here... Now you wish to defy me? Sadan?!") + || message.equals("[BOSS] Maxor: WELL! WELL! WELL! LOOK WHO'S HERE!")) reset(); } /** @@ -474,7 +481,7 @@ public class DungeonSecrets { } /** - * Resets fields when leaving a dungeon. + * Resets fields when leaving a dungeon or entering boss. */ private static void reset() { mapEntrancePos = null; -- cgit From 219648e46b1b1e46ae27bcf8ba80e0b5536c6dab Mon Sep 17 00:00:00 2001 From: Aaron <51387595+AzureAaron@users.noreply.github.com> Date: Sun, 22 Oct 2023 20:21:19 -0400 Subject: Enigma Soul Waypoints --- .../hysky/skyblocker/config/SkyblockerConfig.java | 6 + .../config/categories/LocationsCategory.java | 15 + .../skyblocker/skyblock/rift/EnigmaSouls.java | 184 ++++ .../skyblock/rift/MirrorverseWaypoints.java | 2 +- .../de/hysky/skyblocker/skyblock/rift/TheRift.java | 8 + .../resources/assets/skyblocker/lang/en_us.json | 5 + .../assets/skyblocker/mirrorverse_waypoints.json | 1019 -------------------- .../skyblocker/rift/enigma_soul_waypoints.json | 215 +++++ .../skyblocker/rift/mirrorverse_waypoints.json | 1019 ++++++++++++++++++++ 9 files changed, 1453 insertions(+), 1020 deletions(-) create mode 100644 src/main/java/de/hysky/skyblocker/skyblock/rift/EnigmaSouls.java delete mode 100644 src/main/resources/assets/skyblocker/mirrorverse_waypoints.json create mode 100644 src/main/resources/assets/skyblocker/rift/enigma_soul_waypoints.json create mode 100644 src/main/resources/assets/skyblocker/rift/mirrorverse_waypoints.json diff --git a/src/main/java/de/hysky/skyblocker/config/SkyblockerConfig.java b/src/main/java/de/hysky/skyblocker/config/SkyblockerConfig.java index d7279bc8..57d12c76 100644 --- a/src/main/java/de/hysky/skyblocker/config/SkyblockerConfig.java +++ b/src/main/java/de/hysky/skyblocker/config/SkyblockerConfig.java @@ -730,6 +730,12 @@ public class SkyblockerConfig { public static class Rift { @SerialEntry public boolean mirrorverseWaypoints = true; + + @SerialEntry + public boolean enigmaSoulWaypoints = false; + + @SerialEntry + public boolean highlightFoundEnigmaSouls = true; @SerialEntry public int mcGrubberStacks = 0; diff --git a/src/main/java/de/hysky/skyblocker/config/categories/LocationsCategory.java b/src/main/java/de/hysky/skyblocker/config/categories/LocationsCategory.java index 399bb9f6..5e662fcc 100644 --- a/src/main/java/de/hysky/skyblocker/config/categories/LocationsCategory.java +++ b/src/main/java/de/hysky/skyblocker/config/categories/LocationsCategory.java @@ -46,6 +46,21 @@ public class LocationsCategory { newValue -> config.locations.rift.mirrorverseWaypoints = newValue) .controller(ConfigUtils::createBooleanController) .build()) + .option(Option.createBuilder() + .name(Text.translatable("text.autoconfig.skyblocker.option.locations.rift.enigmaSoulWaypoints")) + .description(OptionDescription.of(Text.translatable("text.autoconfig.skyblocker.option.locations.rift.enigmaSoulWaypoints.@Tooltip"))) + .binding(defaults.locations.rift.enigmaSoulWaypoints, + () -> config.locations.rift.enigmaSoulWaypoints, + newValue -> config.locations.rift.enigmaSoulWaypoints = newValue) + .controller(ConfigUtils::createBooleanController) + .build()) + .option(Option.createBuilder() + .name(Text.translatable("text.autoconfig.skyblocker.option.locations.rift.highlightFoundEnigmaSouls")) + .binding(defaults.locations.rift.highlightFoundEnigmaSouls, + () -> config.locations.rift.highlightFoundEnigmaSouls, + newValue -> config.locations.rift.highlightFoundEnigmaSouls = newValue) + .controller(ConfigUtils::createBooleanController) + .build()) .option(Option.createBuilder() .name(Text.translatable("text.autoconfig.skyblocker.option.locations.rift.mcGrubberStacks")) .description(OptionDescription.of(Text.translatable("text.autoconfig.skyblocker.option.locations.rift.mcGrubberStacks.@Tooltip"))) diff --git a/src/main/java/de/hysky/skyblocker/skyblock/rift/EnigmaSouls.java b/src/main/java/de/hysky/skyblocker/skyblock/rift/EnigmaSouls.java new file mode 100644 index 00000000..3a0651ef --- /dev/null +++ b/src/main/java/de/hysky/skyblocker/skyblock/rift/EnigmaSouls.java @@ -0,0 +1,184 @@ +package de.hysky.skyblocker.skyblock.rift; + +import static net.fabricmc.fabric.api.client.command.v2.ClientCommandManager.literal; + +import java.io.BufferedReader; +import java.io.BufferedWriter; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.NoSuchFileException; +import java.nio.file.Path; +import java.util.Arrays; +import java.util.Comparator; +import java.util.List; +import java.util.Map; +import java.util.concurrent.CompletableFuture; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParser; +import com.mojang.brigadier.Command; +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; +import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; +import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet; +import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource; +import net.fabricmc.fabric.api.client.rendering.v1.WorldRenderContext; +import net.minecraft.client.MinecraftClient; +import net.minecraft.client.network.ClientPlayerEntity; +import net.minecraft.command.CommandRegistryAccess; +import net.minecraft.text.Text; +import net.minecraft.util.DyeColor; +import net.minecraft.util.Formatting; +import net.minecraft.util.Identifier; +import net.minecraft.util.math.BlockPos; + +public class EnigmaSouls { + private static final Logger LOGGER = LoggerFactory.getLogger(EnigmaSouls.class); + private static final Identifier WAYPOINTS_JSON = new Identifier(SkyblockerMod.NAMESPACE, "rift/enigma_soul_waypoints.json"); + private static final BlockPos[] SOUL_WAYPOINTS = new BlockPos[42]; + private static final Path FOUND_SOULS_FILE = SkyblockerMod.CONFIG_DIR.resolve("found_enigma_souls.json"); + private static final Object2ObjectOpenHashMap> FOUND_SOULS = new Object2ObjectOpenHashMap<>(); + private static final float[] GREEN = DyeColor.GREEN.getColorComponents(); + private static final float[] RED = DyeColor.RED.getColorComponents(); + + private static CompletableFuture soulsLoaded; + + static void load(MinecraftClient client) { + //Load waypoints + soulsLoaded = CompletableFuture.runAsync(() -> { + try (BufferedReader reader = client.getResourceManager().openAsReader(WAYPOINTS_JSON)) { + JsonObject file = JsonParser.parseReader(reader).getAsJsonObject(); + JsonArray waypoints = file.get("waypoints").getAsJsonArray(); + + for (int i = 0; i < waypoints.size(); i++) { + JsonObject waypoint = waypoints.get(i).getAsJsonObject(); + SOUL_WAYPOINTS[i] = new BlockPos(waypoint.get("x").getAsInt(), waypoint.get("y").getAsInt(), waypoint.get("z").getAsInt()); + } + + } catch (IOException e) { + LOGGER.error("[Skyblocker] There was an error while loading enigma soul waypoints! Exception: {}", e); + } + + //Load found souls + try (BufferedReader reader = Files.newBufferedReader(FOUND_SOULS_FILE)) { + for (Map.Entry profile : JsonParser.parseReader(reader).getAsJsonObject().asMap().entrySet()) { + ObjectOpenHashSet foundSoulsOnProfile = new ObjectOpenHashSet<>(); + + for (JsonElement foundSoul : profile.getValue().getAsJsonArray().asList()) { + foundSoulsOnProfile.add(PosUtils.parsePosString(foundSoul.getAsString())); + } + + FOUND_SOULS.put(profile.getKey(), foundSoulsOnProfile); + } + } catch (NoSuchFileException ignored) { + } catch (IOException e) { + LOGGER.error("[Skyblocker] There was an error while loading found enigma souls! Exception: {}", e); + } + }); + } + + static void save(MinecraftClient client) { + JsonObject json = new JsonObject(); + + for (Map.Entry> foundSoulsForProfile : FOUND_SOULS.entrySet()) { + JsonArray foundSoulsJson = new JsonArray(); + + for (BlockPos foundSoul : foundSoulsForProfile.getValue()) { + foundSoulsJson.add(PosUtils.getPosString(foundSoul)); + } + + json.add(foundSoulsForProfile.getKey(), foundSoulsJson); + } + + try (BufferedWriter writer = Files.newBufferedWriter(FOUND_SOULS_FILE)) { + SkyblockerMod.GSON.toJson(json, writer); + } catch (IOException e) { + LOGGER.error("[Skyblocker] There was an error while saving found enigma souls! Exception: {}", e); + } + } + + static void render(WorldRenderContext wrc) { + SkyblockerConfig.Rift config = SkyblockerConfigManager.get().locations.rift; + + if (Utils.isInTheRift() && config.enigmaSoulWaypoints && soulsLoaded.isDone()) { + for (BlockPos pos : SOUL_WAYPOINTS) { + if (isSoulMissing(pos)) { + RenderHelper.renderFilledThroughWallsWithBeaconBeam(wrc, pos, GREEN, 0.5f); + } else if (config.highlightFoundEnigmaSouls) { + RenderHelper.renderFilledThroughWallsWithBeaconBeam(wrc, pos, RED, 0.5f); + } + } + } + } + + static void onMessage(Text text, boolean overlay) { + if (Utils.isInTheRift() && !overlay) { + String message = text.getString(); + + if (message.equals("You have already found that Enigma Soul!") || Formatting.strip(message).equals("SOUL! You unlocked an Enigma Soul!")) markClosestSoulAsFound(); + } + } + + static void registerCommands(CommandDispatcher dispatcher, CommandRegistryAccess registryAccess) { + dispatcher.register(literal(SkyblockerMod.NAMESPACE) + .then(literal("rift") + .then(literal("enigmaSouls") + .then(literal("markAllFound").executes(context -> { + markAllFound(); + context.getSource().sendFeedback(Constants.PREFIX.get().append(Text.translatable("skyblocker.rift.enigmaSouls.markAllFound"))); + + return Command.SINGLE_SUCCESS; + })) + .then(literal("markAllMissing").executes(context -> { + markAllMissing(); + context.getSource().sendFeedback(Constants.PREFIX.get().append(Text.translatable("skyblocker.rift.enigmaSouls.markAllMissing"))); + + return Command.SINGLE_SUCCESS; + }))))); + } + + @SuppressWarnings("resource") + private static void markClosestSoulAsFound() { + if (!soulsLoaded.isDone()) return; + + ClientPlayerEntity player = MinecraftClient.getInstance().player; + + Arrays.stream(SOUL_WAYPOINTS) + .filter(EnigmaSouls::isSoulMissing) + .min(Comparator.comparingDouble(soulPos -> soulPos.getSquaredDistance(player.getPos()))) + .filter(soulPos -> soulPos.getSquaredDistance(player.getPos()) <= 16) + .ifPresent(soulPos -> { + FOUND_SOULS.computeIfAbsent(Utils.getProfile(), profile -> new ObjectOpenHashSet<>()); + FOUND_SOULS.get(Utils.getProfile()).add(soulPos); + }); + } + + private static boolean isSoulMissing(BlockPos soulPos) { + ObjectOpenHashSet foundSoulsOnProfile = FOUND_SOULS.get(Utils.getProfile()); + + return foundSoulsOnProfile == null || !foundSoulsOnProfile.contains(soulPos); + } + + private static void markAllFound() { + FOUND_SOULS.computeIfAbsent(Utils.getProfile(), profile -> new ObjectOpenHashSet<>()); + FOUND_SOULS.get(Utils.getProfile()).addAll(List.of(SOUL_WAYPOINTS)); + } + + private static void markAllMissing() { + ObjectOpenHashSet foundSoulsOnProfile = FOUND_SOULS.get(Utils.getProfile()); + + if (foundSoulsOnProfile != null) foundSoulsOnProfile.clear(); + } +} diff --git a/src/main/java/de/hysky/skyblocker/skyblock/rift/MirrorverseWaypoints.java b/src/main/java/de/hysky/skyblocker/skyblock/rift/MirrorverseWaypoints.java index 06181349..d6e3f427 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/rift/MirrorverseWaypoints.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/rift/MirrorverseWaypoints.java @@ -21,7 +21,7 @@ import java.io.IOException; public class MirrorverseWaypoints { private static final Logger LOGGER = LoggerFactory.getLogger("skyblocker"); private static final MinecraftClient CLIENT = MinecraftClient.getInstance(); - private static final Identifier WAYPOINTS_JSON = new Identifier(SkyblockerMod.NAMESPACE, "mirrorverse_waypoints.json"); + private static final Identifier WAYPOINTS_JSON = new Identifier(SkyblockerMod.NAMESPACE, "rift/mirrorverse_waypoints.json"); private static final BlockPos[] LAVA_PATH_WAYPOINTS = new BlockPos[107]; private static final BlockPos[] UPSIDE_DOWN_WAYPOINTS = new BlockPos[66]; private static final BlockPos[] TURBULATOR_WAYPOINTS = new BlockPos[27]; diff --git a/src/main/java/de/hysky/skyblocker/skyblock/rift/TheRift.java b/src/main/java/de/hysky/skyblocker/skyblock/rift/TheRift.java index b39151d3..95a2ecf4 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/rift/TheRift.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/rift/TheRift.java @@ -2,6 +2,9 @@ package de.hysky.skyblocker.skyblock.rift; import de.hysky.skyblocker.config.SkyblockerConfigManager; import de.hysky.skyblocker.utils.scheduler.Scheduler; +import net.fabricmc.fabric.api.client.command.v2.ClientCommandRegistrationCallback; +import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientLifecycleEvents; +import net.fabricmc.fabric.api.client.message.v1.ClientReceiveMessageEvents; import net.fabricmc.fabric.api.client.rendering.v1.WorldRenderEvents; public class TheRift { @@ -13,6 +16,11 @@ public class TheRift { public static void init() { WorldRenderEvents.AFTER_TRANSLUCENT.register(MirrorverseWaypoints::render); WorldRenderEvents.AFTER_TRANSLUCENT.register(EffigyWaypoints::render); + WorldRenderEvents.AFTER_TRANSLUCENT.register(EnigmaSouls::render); + ClientLifecycleEvents.CLIENT_STARTED.register(EnigmaSouls::load); + ClientLifecycleEvents.CLIENT_STOPPING.register(EnigmaSouls::save); + ClientReceiveMessageEvents.GAME.register(EnigmaSouls::onMessage); + ClientCommandRegistrationCallback.EVENT.register(EnigmaSouls::registerCommands); Scheduler.INSTANCE.scheduleCyclic(EffigyWaypoints::updateEffigies, SkyblockerConfigManager.get().slayer.vampireSlayer.effigyUpdateFrequency); Scheduler.INSTANCE.scheduleCyclic(TwinClawsIndicator::updateIce, SkyblockerConfigManager.get().slayer.vampireSlayer.holyIceUpdateFrequency); Scheduler.INSTANCE.scheduleCyclic(ManiaIndicator::updateMania, SkyblockerConfigManager.get().slayer.vampireSlayer.maniaUpdateFrequency); diff --git a/src/main/resources/assets/skyblocker/lang/en_us.json b/src/main/resources/assets/skyblocker/lang/en_us.json index f02eb319..ea6931e0 100644 --- a/src/main/resources/assets/skyblocker/lang/en_us.json +++ b/src/main/resources/assets/skyblocker/lang/en_us.json @@ -215,6 +215,9 @@ "text.autoconfig.skyblocker.option.locations.rift": "The Rift", "text.autoconfig.skyblocker.option.locations.rift.mirrorverseWaypoints": "Enable Mirrorverse Waypoints", + "text.autoconfig.skyblocker.option.locations.rift.enigmaSoulWaypoints": "Enable Enigma Soul Waypoints", + "text.autoconfig.skyblocker.option.locations.rift.enigmaSoulWaypoints.@Tooltip": "Note: Many enigma souls have a small task you must complete in order to get it, so its recommended to also watch a YouTube video when finding them.", + "text.autoconfig.skyblocker.option.locations.rift.highlightFoundEnigmaSouls": "Highlight Found Enigma Souls", "text.autoconfig.skyblocker.option.locations.rift.mcGrubberStacks": "McGrubber Stacks", "text.autoconfig.skyblocker.option.locations.rift.mcGrubberStacks.@Tooltip": "Used for calculating Motes sell prices.", @@ -270,6 +273,8 @@ "skyblocker.rift.iceNow": "Ice now!", "skyblocker.rift.mania": "Mania!", "skyblocker.rift.stakeNow": "Stake now!", + "skyblocker.rift.enigmaSouls.markAllFound": "§rMarked all enigma souls as found!", + "skyblocker.rift.enigmaSouls.markAllMissing": "§rMarked all enigma souls as missing!", "skyblocker.fairySouls.markAllFound": "§rMarked all fairy souls in the current island as found", "skyblocker.fairySouls.markAllMissing": "§rMarked all fairy souls in the current island as missing", "skyblocker.relics.markAllFound": "§rMarked all relics as found", diff --git a/src/main/resources/assets/skyblocker/mirrorverse_waypoints.json b/src/main/resources/assets/skyblocker/mirrorverse_waypoints.json deleted file mode 100644 index 2bc0296e..00000000 --- a/src/main/resources/assets/skyblocker/mirrorverse_waypoints.json +++ /dev/null @@ -1,1019 +0,0 @@ -{ - "sections": [ - { - "name": "Lava Path", - "waypoints": [ - { - "x": -101, - "y": 52, - "z": -116 - }, - { - "x": -99, - "y": 52, - "z": -110 - }, - { - "x": -95, - "y": 52, - "z": -108 - }, - { - "x": -88, - "y": 52, - "z": -107 - }, - { - "x": -95, - "y": 52, - "z": -114 - }, - { - "x": -95, - "y": 52, - "z": -109 - }, - { - "x": -84, - "y": 52, - "z": -112 - }, - { - "x": -91, - "y": 52, - "z": -108 - }, - { - "x": -94, - "y": 52, - "z": -116 - }, - { - "x": -88, - "y": 52, - "z": -112 - }, - { - "x": -101, - "y": 52, - "z": -108 - }, - { - "x": -94, - "y": 52, - "z": -114 - }, - { - "x": -85, - "y": 52, - "z": -112 - }, - { - "x": -88, - "y": 52, - "z": -114 - }, - { - "x": -90, - "y": 52, - "z": -110 - }, - { - "x": -84, - "y": 52, - "z": -113 - }, - { - "x": -90, - "y": 52, - "z": -116 - }, - { - "x": -105, - "y": 52, - "z": -113 - }, - { - "x": -82, - "y": 52, - "z": -112 - }, - { - "x": -90, - "y": 52, - "z": -112 - }, - { - "x": -88, - "y": 52, - "z": -111 - }, - { - "x": -82, - "y": 52, - "z": -111 - }, - { - "x": -104, - "y": 52, - "z": -112 - }, - { - "x": -87, - "y": 52, - "z": -107 - }, - { - "x": -100, - "y": 52, - "z": -108 - }, - { - "x": -86, - "y": 52, - "z": -109 - }, - { - "x": -91, - "y": 52, - "z": -110 - }, - { - "x": -96, - "y": 52, - "z": -108 - }, - { - "x": -102, - "y": 52, - "z": -111 - }, - { - "x": -96, - "y": 52, - "z": -115 - }, - { - "x": -97, - "y": 52, - "z": -116 - }, - { - "x": -83, - "y": 52, - "z": -111 - }, - { - "x": -84, - "y": 52, - "z": -107 - }, - { - "x": -90, - "y": 52, - "z": -115 - }, - { - "x": -86, - "y": 52, - "z": -107 - }, - { - "x": -97, - "y": 52, - "z": -112 - }, - { - "x": -86, - "y": 52, - "z": -113 - }, - { - "x": -92, - "y": 52, - "z": -110 - }, - { - "x": -95, - "y": 52, - "z": -111 - }, - { - "x": -90, - "y": 52, - "z": -114 - }, - { - "x": -93, - "y": 52, - "z": -108 - }, - { - "x": -98, - "y": 52, - "z": -116 - }, - { - "x": -98, - "y": 52, - "z": -115 - }, - { - "x": -90, - "y": 52, - "z": -107 - }, - { - "x": -98, - "y": 52, - "z": -112 - }, - { - "x": -98, - "y": 52, - "z": -109 - }, - { - "x": -98, - "y": 52, - "z": -113 - }, - { - "x": -100, - "y": 52, - "z": -116 - }, - { - "x": -96, - "y": 52, - "z": -114 - }, - { - "x": -86, - "y": 52, - "z": -110 - }, - { - "x": -93, - "y": 52, - "z": -109 - }, - { - "x": -88, - "y": 52, - "z": -110 - }, - { - "x": -94, - "y": 52, - "z": -115 - }, - { - "x": -84, - "y": 52, - "z": -111 - }, - { - "x": -84, - "y": 52, - "z": -108 - }, - { - "x": -86, - "y": 52, - "z": -115 - }, - { - "x": -98, - "y": 52, - "z": -110 - }, - { - "x": -102, - "y": 52, - "z": -108 - }, - { - "x": -92, - "y": 52, - "z": -114 - }, - { - "x": -102, - "y": 52, - "z": -114 - }, - { - "x": -85, - "y": 52, - "z": -109 - }, - { - "x": -86, - "y": 52, - "z": -112 - }, - { - "x": -104, - "y": 52, - "z": -113 - }, - { - "x": -105, - "y": 52, - "z": -112 - }, - { - "x": -91, - "y": 52, - "z": -114 - }, - { - "x": -100, - "y": 52, - "z": -112 - }, - { - "x": -93, - "y": 52, - "z": -110 - }, - { - "x": -91, - "y": 52, - "z": -112 - }, - { - "x": -101, - "y": 52, - "z": -112 - }, - { - "x": -92, - "y": 52, - "z": -108 - }, - { - "x": -82, - "y": 52, - "z": -113 - }, - { - "x": -87, - "y": 52, - "z": -115 - }, - { - "x": -84, - "y": 52, - "z": -109 - }, - { - "x": -88, - "y": 52, - "z": -113 - }, - { - "x": -92, - "y": 52, - "z": -116 - }, - { - "x": -96, - "y": 52, - "z": -111 - }, - { - "x": -96, - "y": 52, - "z": -116 - }, - { - "x": -98, - "y": 52, - "z": -108 - }, - { - "x": -98, - "y": 52, - "z": -114 - }, - { - "x": -96, - "y": 52, - "z": -112 - }, - { - "x": -85, - "y": 52, - "z": -107 - }, - { - "x": -102, - "y": 52, - "z": -115 - }, - { - "x": -87, - "y": 52, - "z": -110 - }, - { - "x": -100, - "y": 52, - "z": -113 - }, - { - "x": -103, - "y": 52, - "z": -114 - }, - { - "x": -102, - "y": 52, - "z": -116 - }, - { - "x": -95, - "y": 52, - "z": -110 - }, - { - "x": -89, - "y": 52, - "z": -107 - }, - { - "x": -92, - "y": 52, - "z": -113 - }, - { - "x": -100, - "y": 52, - "z": -110 - }, - { - "x": -100, - "y": 52, - "z": -115 - }, - { - "x": -86, - "y": 52, - "z": -114 - }, - { - "x": -88, - "y": 52, - "z": -115 - }, - { - "x": -92, - "y": 52, - "z": -112 - }, - { - "x": -100, - "y": 52, - "z": -114 - }, - { - "x": -91, - "y": 52, - "z": -116 - }, - { - "x": -102, - "y": 52, - "z": -110 - }, - { - "x": -102, - "y": 52, - "z": -112 - }, - { - "x": -93, - "y": 52, - "z": -116 - }, - { - "x": -90, - "y": 52, - "z": -111 - }, - { - "x": -104, - "y": 52, - "z": -114 - }, - { - "x": -83, - "y": 52, - "z": -112 - }, - { - "x": -83, - "y": 52, - "z": -113 - }, - { - "x": -100, - "y": 52, - "z": -109 - }, - { - "x": -102, - "y": 52, - "z": -109 - }, - { - "x": -90, - "y": 52, - "z": -108 - }, - { - "x": -97, - "y": 52, - "z": -108 - } - ] - }, - { - "name": "Upside Down Parkour", - "waypoints": [ - { - "x": -137, - "y": 39, - "z": -104 - }, - { - "x": -169, - "y": 42, - "z": -116 - }, - { - "x": -173, - "y": 43, - "z": -112 - }, - { - "x": -197, - "y": 39, - "z": -92 - }, - { - "x": -161, - "y": 39, - "z": -92 - }, - { - "x": -137, - "y": 40, - "z": -116 - }, - { - "x": -213, - "y": 41, - "z": -116 - }, - { - "x": -173, - "y": 41, - "z": -96 - }, - { - "x": -205, - "y": 41, - "z": -100 - }, - { - "x": -205, - "y": 43, - "z": -108 - }, - { - "x": -137, - "y": 41, - "z": -96 - }, - { - "x": -145, - "y": 40, - "z": -104 - }, - { - "x": -149, - "y": 43, - "z": -112 - }, - { - "x": -189, - "y": 42, - "z": -120 - }, - { - "x": -157, - "y": 41, - "z": -104 - }, - { - "x": -189, - "y": 43, - "z": -116 - }, - { - "x": -193, - "y": 42, - "z": -104 - }, - { - "x": -161, - "y": 40, - "z": -120 - }, - { - "x": -221, - "y": 43, - "z": -104 - }, - { - "x": -185, - "y": 41, - "z": -108 - }, - { - "x": -141, - "y": 41, - "z": -120 - }, - { - "x": -157, - "y": 39, - "z": -116 - }, - { - "x": -153, - "y": 40, - "z": -100 - }, - { - "x": -209, - "y": 43, - "z": -120 - }, - { - "x": -129, - "y": 39, - "z": -108 - }, - { - "x": -189, - "y": 43, - "z": -100 - }, - { - "x": -141, - "y": 42, - "z": -100 - }, - { - "x": -133, - "y": 40, - "z": -108 - }, - { - "x": -209, - "y": 42, - "z": -104 - }, - { - "x": -173, - "y": 41, - "z": -100 - }, - { - "x": -189, - "y": 43, - "z": -112 - }, - { - "x": -145, - "y": 40, - "z": -108 - }, - { - "x": -217, - "y": 42, - "z": -108 - }, - { - "x": -169, - "y": 41, - "z": -120 - }, - { - "x": -165, - "y": 43, - "z": -109 - }, - { - "x": -145, - "y": 42, - "z": -116 - }, - { - "x": -165, - "y": 42, - "z": -104 - }, - { - "x": -181, - "y": 40, - "z": -112 - }, - { - "x": -193, - "y": 41, - "z": -108 - }, - { - "x": -201, - "y": 40, - "z": -96 - }, - { - "x": -137, - "y": 41, - "z": -124 - }, - { - "x": -173, - "y": 43, - "z": -108 - }, - { - "x": -133, - "y": 40, - "z": -100 - }, - { - "x": -201, - "y": 40, - "z": -116 - }, - { - "x": -185, - "y": 41, - "z": -108 - }, - { - "x": -125, - "y": 39, - "z": -108 - }, - { - "x": -161, - "y": 42, - "z": -112 - }, - { - "x": -165, - "y": 40, - "z": -96 - }, - { - "x": -141, - "y": 39, - "z": -112 - }, - { - "x": -177, - "y": 39, - "z": -92 - }, - { - "x": -213, - "y": 41, - "z": -112 - }, - { - "x": -153, - "y": 42, - "z": -108 - }, - { - "x": -205, - "y": 42, - "z": -120 - }, - { - "x": -197, - "y": 43, - "z": -112 - }, - { - "x": -181, - "y": 42, - "z": -104 - }, - { - "x": -165, - "y": 41, - "z": -100 - }, - { - "x": -193, - "y": 42, - "z": -96 - }, - { - "x": -133, - "y": 40, - "z": -120 - }, - { - "x": -185, - "y": 41, - "z": -100 - }, - { - "x": -165, - "y": 41, - "z": -124 - }, - { - "x": -177, - "y": 40, - "z": -104 - }, - { - "x": -157, - "y": 40, - "z": -96 - }, - { - "x": -205, - "y": 41, - "z": -116 - }, - { - "x": -181, - "y": 40, - "z": -96 - }, - { - "x": -201, - "y": 43, - "z": -108 - }, - { - "x": -185, - "y": 41, - "z": -116 - } - ] - }, - { - "name": "Turbulator Parkour", - "waypoints": [ - { - "x": -302, - "y": 34, - "z": -107 - }, - { - "x": -304, - "y": 52, - "z": -109 - }, - { - "x": -306, - "y": 16, - "z": -107 - }, - { - "x": -304, - "y": 12, - "z": -107 - }, - { - "x": -308, - "y": 6, - "z": -105 - }, - { - "x": -302, - "y": 44, - "z": -107 - }, - { - "x": -306, - "y": 24, - "z": -109 - }, - { - "x": -302, - "y": 18, - "z": -111 - }, - { - "x": -300, - "y": 36, - "z": -109 - }, - { - "x": -304, - "y": 30, - "z": -103 - }, - { - "x": -302, - "y": 26, - "z": -111 - }, - { - "x": -308, - "y": 14, - "z": -103 - }, - { - "x": -300, - "y": 46, - "z": -103 - }, - { - "x": -300, - "y": 10, - "z": -111 - }, - { - "x": -300, - "y": 20, - "z": -107 - }, - { - "x": -306, - "y": 54, - "z": -111 - }, - { - "x": -306, - "y": 4, - "z": -103 - }, - { - "x": -300, - "y": 28, - "z": -107 - }, - { - "x": -306, - "y": 42, - "z": -111 - }, - { - "x": -308, - "y": 50, - "z": -105 - }, - { - "x": -304, - "y": 48, - "z": -107 - }, - { - "x": -302, - "y": 38, - "z": -105 - }, - { - "x": -304, - "y": 22, - "z": -111 - }, - { - "x": -304, - "y": 2, - "z": -107 - }, - { - "x": -304, - "y": 40, - "z": -107 - }, - { - "x": -306, - "y": 32, - "z": -105 - }, - { - "x": -304, - "y": 8, - "z": -109 - } - ] - } - ] -} \ No newline at end of file diff --git a/src/main/resources/assets/skyblocker/rift/enigma_soul_waypoints.json b/src/main/resources/assets/skyblocker/rift/enigma_soul_waypoints.json new file mode 100644 index 00000000..5c428fed --- /dev/null +++ b/src/main/resources/assets/skyblocker/rift/enigma_soul_waypoints.json @@ -0,0 +1,215 @@ +{ + "credit": "Official Hypixel Wiki - https://wiki.hypixel.net", + "waypoints": [ + { + "x": -15, + "y": 91, + "z": 94 + }, + { + "x": -27, + "y": 71, + "z": 90 + }, + { + "x": -6, + "y": 60, + "z": 226 + }, + { + "x": -142, + "y": 68, + "z": 174 + }, + { + "x": -137, + "y": 51, + "z": 120 + }, + { + "x": -129, + "y": 72, + "z": 77 + }, + { + "x": -27, + "y": 89, + "z": 136 + }, + { + "x": -137, + "y": 133, + "z": 156 + }, + { + "x": -108, + "y": 117, + "z": 123 + }, + { + "x": -115, + "y": 69, + "z": 61 + }, + { + "x": 43, + "y": 91, + "z": 56 + }, + { + "x": -168, + "y": 81, + "z": 12 + }, + { + "x": -204, + "y": 75, + "z": 49 + }, + { + "x": -93, + "y": 73, + "z": 36 + }, + { + "x": -102, + "y": 72, + "z": -103 + }, + { + "x": -34, + "y": 71, + "z": -88 + }, + { + "x": -106, + "y": 78, + "z": -101 + }, + { + "x": -95, + "y": 76, + "z": -82 + }, + { + "x": -94, + "y": 70, + "z": -84 + }, + { + "x": -38, + "y": 44, + "z": 130 + }, + { + "x": -88, + "y": 79, + "z": -102 + }, + { + "x": -76, + "y": 90, + "z": -149 + }, + { + "x": -106, + "y": 249, + "z": -149 + }, + { + "x": -74, + "y": 65, + "z": -119 + }, + { + "x": -77, + "y": 72, + "z": -176 + }, + { + "x": -21, + "y": 72, + "z": -18 + }, + { + "x": -88, + "y": 20, + "z": 0 + }, + { + "x": 27, + "y": 71, + "z": -77 + }, + { + "x": 42, + "y": 88, + "z": -91 + }, + { + "x": 47, + "y": 68, + "z": -59 + }, + { + "x": -34, + "y": 66, + "z": -25 + }, + { + "x": -23, + "y": 84, + "z": -92 + }, + { + "x": 40, + "y": 70, + "z": 27 + }, + { + "x": 38, + "y": 63, + "z": -198 + }, + { + "x": 3, + "y": 68, + "z": -204 + }, + { + "x": -161, + "y": 98, + "z": -72 + }, + { + "x": 255, + "y": 74, + "z": 160 + }, + { + "x": 262, + "y": 118, + "z": 94 + }, + { + "x": 182, + "y": 92, + "z": 124 + }, + { + "x": 266, + "y": 60, + "z": 145 + }, + { + "x": 232, + "y": 94, + "z": 168 + }, + { + "x": 256, + "y": 130, + "z": 75 + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/skyblocker/rift/mirrorverse_waypoints.json b/src/main/resources/assets/skyblocker/rift/mirrorverse_waypoints.json new file mode 100644 index 00000000..2bc0296e --- /dev/null +++ b/src/main/resources/assets/skyblocker/rift/mirrorverse_waypoints.json @@ -0,0 +1,1019 @@ +{ + "sections": [ + { + "name": "Lava Path", + "waypoints": [ + { + "x": -101, + "y": 52, + "z": -116 + }, + { + "x": -99, + "y": 52, + "z": -110 + }, + { + "x": -95, + "y": 52, + "z": -108 + }, + { + "x": -88, + "y": 52, + "z": -107 + }, + { + "x": -95, + "y": 52, + "z": -114 + }, + { + "x": -95, + "y": 52, + "z": -109 + }, + { + "x": -84, + "y": 52, + "z": -112 + }, + { + "x": -91, + "y": 52, + "z": -108 + }, + { + "x": -94, + "y": 52, + "z": -116 + }, + { + "x": -88, + "y": 52, + "z": -112 + }, + { + "x": -101, + "y": 52, + "z": -108 + }, + { + "x": -94, + "y": 52, + "z": -114 + }, + { + "x": -85, + "y": 52, + "z": -112 + }, + { + "x": -88, + "y": 52, + "z": -114 + }, + { + "x": -90, + "y": 52, + "z": -110 + }, + { + "x": -84, + "y": 52, + "z": -113 + }, + { + "x": -90, + "y": 52, + "z": -116 + }, + { + "x": -105, + "y": 52, + "z": -113 + }, + { + "x": -82, + "y": 52, + "z": -112 + }, + { + "x": -90, + "y": 52, + "z": -112 + }, + { + "x": -88, + "y": 52, + "z": -111 + }, + { + "x": -82, + "y": 52, + "z": -111 + }, + { + "x": -104, + "y": 52, + "z": -112 + }, + { + "x": -87, + "y": 52, + "z": -107 + }, + { + "x": -100, + "y": 52, + "z": -108 + }, + { + "x": -86, + "y": 52, + "z": -109 + }, + { + "x": -91, + "y": 52, + "z": -110 + }, + { + "x": -96, + "y": 52, + "z": -108 + }, + { + "x": -102, + "y": 52, + "z": -111 + }, + { + "x": -96, + "y": 52, + "z": -115 + }, + { + "x": -97, + "y": 52, + "z": -116 + }, + { + "x": -83, + "y": 52, + "z": -111 + }, + { + "x": -84, + "y": 52, + "z": -107 + }, + { + "x": -90, + "y": 52, + "z": -115 + }, + { + "x": -86, + "y": 52, + "z": -107 + }, + { + "x": -97, + "y": 52, + "z": -112 + }, + { + "x": -86, + "y": 52, + "z": -113 + }, + { + "x": -92, + "y": 52, + "z": -110 + }, + { + "x": -95, + "y": 52, + "z": -111 + }, + { + "x": -90, + "y": 52, + "z": -114 + }, + { + "x": -93, + "y": 52, + "z": -108 + }, + { + "x": -98, + "y": 52, + "z": -116 + }, + { + "x": -98, + "y": 52, + "z": -115 + }, + { + "x": -90, + "y": 52, + "z": -107 + }, + { + "x": -98, + "y": 52, + "z": -112 + }, + { + "x": -98, + "y": 52, + "z": -109 + }, + { + "x": -98, + "y": 52, + "z": -113 + }, + { + "x": -100, + "y": 52, + "z": -116 + }, + { + "x": -96, + "y": 52, + "z": -114 + }, + { + "x": -86, + "y": 52, + "z": -110 + }, + { + "x": -93, + "y": 52, + "z": -109 + }, + { + "x": -88, + "y": 52, + "z": -110 + }, + { + "x": -94, + "y": 52, + "z": -115 + }, + { + "x": -84, + "y": 52, + "z": -111 + }, + { + "x": -84, + "y": 52, + "z": -108 + }, + { + "x": -86, + "y": 52, + "z": -115 + }, + { + "x": -98, + "y": 52, + "z": -110 + }, + { + "x": -102, + "y": 52, + "z": -108 + }, + { + "x": -92, + "y": 52, + "z": -114 + }, + { + "x": -102, + "y": 52, + "z": -114 + }, + { + "x": -85, + "y": 52, + "z": -109 + }, + { + "x": -86, + "y": 52, + "z": -112 + }, + { + "x": -104, + "y": 52, + "z": -113 + }, + { + "x": -105, + "y": 52, + "z": -112 + }, + { + "x": -91, + "y": 52, + "z": -114 + }, + { + "x": -100, + "y": 52, + "z": -112 + }, + { + "x": -93, + "y": 52, + "z": -110 + }, + { + "x": -91, + "y": 52, + "z": -112 + }, + { + "x": -101, + "y": 52, + "z": -112 + }, + { + "x": -92, + "y": 52, + "z": -108 + }, + { + "x": -82, + "y": 52, + "z": -113 + }, + { + "x": -87, + "y": 52, + "z": -115 + }, + { + "x": -84, + "y": 52, + "z": -109 + }, + { + "x": -88, + "y": 52, + "z": -113 + }, + { + "x": -92, + "y": 52, + "z": -116 + }, + { + "x": -96, + "y": 52, + "z": -111 + }, + { + "x": -96, + "y": 52, + "z": -116 + }, + { + "x": -98, + "y": 52, + "z": -108 + }, + { + "x": -98, + "y": 52, + "z": -114 + }, + { + "x": -96, + "y": 52, + "z": -112 + }, + { + "x": -85, + "y": 52, + "z": -107 + }, + { + "x": -102, + "y": 52, + "z": -115 + }, + { + "x": -87, + "y": 52, + "z": -110 + }, + { + "x": -100, + "y": 52, + "z": -113 + }, + { + "x": -103, + "y": 52, + "z": -114 + }, + { + "x": -102, + "y": 52, + "z": -116 + }, + { + "x": -95, + "y": 52, + "z": -110 + }, + { + "x": -89, + "y": 52, + "z": -107 + }, + { + "x": -92, + "y": 52, + "z": -113 + }, + { + "x": -100, + "y": 52, + "z": -110 + }, + { + "x": -100, + "y": 52, + "z": -115 + }, + { + "x": -86, + "y": 52, + "z": -114 + }, + { + "x": -88, + "y": 52, + "z": -115 + }, + { + "x": -92, + "y": 52, + "z": -112 + }, + { + "x": -100, + "y": 52, + "z": -114 + }, + { + "x": -91, + "y": 52, + "z": -116 + }, + { + "x": -102, + "y": 52, + "z": -110 + }, + { + "x": -102, + "y": 52, + "z": -112 + }, + { + "x": -93, + "y": 52, + "z": -116 + }, + { + "x": -90, + "y": 52, + "z": -111 + }, + { + "x": -104, + "y": 52, + "z": -114 + }, + { + "x": -83, + "y": 52, + "z": -112 + }, + { + "x": -83, + "y": 52, + "z": -113 + }, + { + "x": -100, + "y": 52, + "z": -109 + }, + { + "x": -102, + "y": 52, + "z": -109 + }, + { + "x": -90, + "y": 52, + "z": -108 + }, + { + "x": -97, + "y": 52, + "z": -108 + } + ] + }, + { + "name": "Upside Down Parkour", + "waypoints": [ + { + "x": -137, + "y": 39, + "z": -104 + }, + { + "x": -169, + "y": 42, + "z": -116 + }, + { + "x": -173, + "y": 43, + "z": -112 + }, + { + "x": -197, + "y": 39, + "z": -92 + }, + { + "x": -161, + "y": 39, + "z": -92 + }, + { + "x": -137, + "y": 40, + "z": -116 + }, + { + "x": -213, + "y": 41, + "z": -116 + }, + { + "x": -173, + "y": 41, + "z": -96 + }, + { + "x": -205, + "y": 41, + "z": -100 + }, + { + "x": -205, + "y": 43, + "z": -108 + }, + { + "x": -137, + "y": 41, + "z": -96 + }, + { + "x": -145, + "y": 40, + "z": -104 + }, + { + "x": -149, + "y": 43, + "z": -112 + }, + { + "x": -189, + "y": 42, + "z": -120 + }, + { + "x": -157, + "y": 41, + "z": -104 + }, + { + "x": -189, + "y": 43, + "z": -116 + }, + { + "x": -193, + "y": 42, + "z": -104 + }, + { + "x": -161, + "y": 40, + "z": -120 + }, + { + "x": -221, + "y": 43, + "z": -104 + }, + { + "x": -185, + "y": 41, + "z": -108 + }, + { + "x": -141, + "y": 41, + "z": -120 + }, + { + "x": -157, + "y": 39, + "z": -116 + }, + { + "x": -153, + "y": 40, + "z": -100 + }, + { + "x": -209, + "y": 43, + "z": -120 + }, + { + "x": -129, + "y": 39, + "z": -108 + }, + { + "x": -189, + "y": 43, + "z": -100 + }, + { + "x": -141, + "y": 42, + "z": -100 + }, + { + "x": -133, + "y": 40, + "z": -108 + }, + { + "x": -209, + "y": 42, + "z": -104 + }, + { + "x": -173, + "y": 41, + "z": -100 + }, + { + "x": -189, + "y": 43, + "z": -112 + }, + { + "x": -145, + "y": 40, + "z": -108 + }, + { + "x": -217, + "y": 42, + "z": -108 + }, + { + "x": -169, + "y": 41, + "z": -120 + }, + { + "x": -165, + "y": 43, + "z": -109 + }, + { + "x": -145, + "y": 42, + "z": -116 + }, + { + "x": -165, + "y": 42, + "z": -104 + }, + { + "x": -181, + "y": 40, + "z": -112 + }, + { + "x": -193, + "y": 41, + "z": -108 + }, + { + "x": -201, + "y": 40, + "z": -96 + }, + { + "x": -137, + "y": 41, + "z": -124 + }, + { + "x": -173, + "y": 43, + "z": -108 + }, + { + "x": -133, + "y": 40, + "z": -100 + }, + { + "x": -201, + "y": 40, + "z": -116 + }, + { + "x": -185, + "y": 41, + "z": -108 + }, + { + "x": -125, + "y": 39, + "z": -108 + }, + { + "x": -161, + "y": 42, + "z": -112 + }, + { + "x": -165, + "y": 40, + "z": -96 + }, + { + "x": -141, + "y": 39, + "z": -112 + }, + { + "x": -177, + "y": 39, + "z": -92 + }, + { + "x": -213, + "y": 41, + "z": -112 + }, + { + "x": -153, + "y": 42, + "z": -108 + }, + { + "x": -205, + "y": 42, + "z": -120 + }, + { + "x": -197, + "y": 43, + "z": -112 + }, + { + "x": -181, + "y": 42, + "z": -104 + }, + { + "x": -165, + "y": 41, + "z": -100 + }, + { + "x": -193, + "y": 42, + "z": -96 + }, + { + "x": -133, + "y": 40, + "z": -120 + }, + { + "x": -185, + "y": 41, + "z": -100 + }, + { + "x": -165, + "y": 41, + "z": -124 + }, + { + "x": -177, + "y": 40, + "z": -104 + }, + { + "x": -157, + "y": 40, + "z": -96 + }, + { + "x": -205, + "y": 41, + "z": -116 + }, + { + "x": -181, + "y": 40, + "z": -96 + }, + { + "x": -201, + "y": 43, + "z": -108 + }, + { + "x": -185, + "y": 41, + "z": -116 + } + ] + }, + { + "name": "Turbulator Parkour", + "waypoints": [ + { + "x": -302, + "y": 34, + "z": -107 + }, + { + "x": -304, + "y": 52, + "z": -109 + }, + { + "x": -306, + "y": 16, + "z": -107 + }, + { + "x": -304, + "y": 12, + "z": -107 + }, + { + "x": -308, + "y": 6, + "z": -105 + }, + { + "x": -302, + "y": 44, + "z": -107 + }, + { + "x": -306, + "y": 24, + "z": -109 + }, + { + "x": -302, + "y": 18, + "z": -111 + }, + { + "x": -300, + "y": 36, + "z": -109 + }, + { + "x": -304, + "y": 30, + "z": -103 + }, + { + "x": -302, + "y": 26, + "z": -111 + }, + { + "x": -308, + "y": 14, + "z": -103 + }, + { + "x": -300, + "y": 46, + "z": -103 + }, + { + "x": -300, + "y": 10, + "z": -111 + }, + { + "x": -300, + "y": 20, + "z": -107 + }, + { + "x": -306, + "y": 54, + "z": -111 + }, + { + "x": -306, + "y": 4, + "z": -103 + }, + { + "x": -300, + "y": 28, + "z": -107 + }, + { + "x": -306, + "y": 42, + "z": -111 + }, + { + "x": -308, + "y": 50, + "z": -105 + }, + { + "x": -304, + "y": 48, + "z": -107 + }, + { + "x": -302, + "y": 38, + "z": -105 + }, + { + "x": -304, + "y": 22, + "z": -111 + }, + { + "x": -304, + "y": 2, + "z": -107 + }, + { + "x": -304, + "y": 40, + "z": -107 + }, + { + "x": -306, + "y": 32, + "z": -105 + }, + { + "x": -304, + "y": 8, + "z": -109 + } + ] + } + ] +} \ No newline at end of file -- cgit From 1e5a48a9c3a2b252d308d6cb97b471543c565665 Mon Sep 17 00:00:00 2001 From: Aaron <51387595+AzureAaron@users.noreply.github.com> Date: Sun, 22 Oct 2023 20:22:10 -0400 Subject: Credit Tyler --- src/main/resources/assets/skyblocker/rift/mirrorverse_waypoints.json | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/resources/assets/skyblocker/rift/mirrorverse_waypoints.json b/src/main/resources/assets/skyblocker/rift/mirrorverse_waypoints.json index 2bc0296e..4c8f1007 100644 --- a/src/main/resources/assets/skyblocker/rift/mirrorverse_waypoints.json +++ b/src/main/resources/assets/skyblocker/rift/mirrorverse_waypoints.json @@ -1,4 +1,5 @@ { + "credit": "TylertheTurtled", "sections": [ { "name": "Lava Path", -- cgit From c1b48b603318cc419f14ed56070a3c71996ffdba Mon Sep 17 00:00:00 2001 From: Aaron <51387595+AzureAaron@users.noreply.github.com> Date: Sun, 22 Oct 2023 20:27:33 -0400 Subject: Don't rely on class load order --- .../skyblock/rift/MirrorverseWaypoints.java | 63 +++++++++++----------- .../de/hysky/skyblocker/skyblock/rift/TheRift.java | 1 + 2 files changed, 32 insertions(+), 32 deletions(-) diff --git a/src/main/java/de/hysky/skyblocker/skyblock/rift/MirrorverseWaypoints.java b/src/main/java/de/hysky/skyblocker/skyblock/rift/MirrorverseWaypoints.java index d6e3f427..e7c62629 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/rift/MirrorverseWaypoints.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/rift/MirrorverseWaypoints.java @@ -17,61 +17,60 @@ import org.slf4j.LoggerFactory; import java.io.BufferedReader; import java.io.IOException; +import java.util.concurrent.CompletableFuture; public class MirrorverseWaypoints { private static final Logger LOGGER = LoggerFactory.getLogger("skyblocker"); - private static final MinecraftClient CLIENT = MinecraftClient.getInstance(); private static final Identifier WAYPOINTS_JSON = new Identifier(SkyblockerMod.NAMESPACE, "rift/mirrorverse_waypoints.json"); private static final BlockPos[] LAVA_PATH_WAYPOINTS = new BlockPos[107]; private static final BlockPos[] UPSIDE_DOWN_WAYPOINTS = new BlockPos[66]; private static final BlockPos[] TURBULATOR_WAYPOINTS = new BlockPos[27]; private static final float[] COLOR_COMPONENTS = DyeColor.RED.getColorComponents(); - - static { - loadWaypoints(); - } + + private static CompletableFuture waypointsLoaded; /** * Loads the waypoint locations into memory */ - private static void loadWaypoints() { - try (BufferedReader reader = CLIENT.getResourceManager().openAsReader(WAYPOINTS_JSON)) { - JsonObject file = JsonParser.parseReader(reader).getAsJsonObject(); - JsonArray sections = file.get("sections").getAsJsonArray(); + static void load(MinecraftClient client) { + waypointsLoaded = CompletableFuture.runAsync(() -> { + try (BufferedReader reader = client.getResourceManager().openAsReader(WAYPOINTS_JSON)) { + JsonObject file = JsonParser.parseReader(reader).getAsJsonObject(); + JsonArray sections = file.get("sections").getAsJsonArray(); - /// Lava Path - JsonArray lavaPathWaypoints = sections.get(0).getAsJsonObject().get("waypoints").getAsJsonArray(); + /// Lava Path + JsonArray lavaPathWaypoints = sections.get(0).getAsJsonObject().get("waypoints").getAsJsonArray(); - for (int i = 0; i < lavaPathWaypoints.size(); i++) { - JsonObject point = lavaPathWaypoints.get(i).getAsJsonObject(); - LAVA_PATH_WAYPOINTS[i] = new BlockPos(point.get("x").getAsInt(), point.get("y").getAsInt(), point.get("z").getAsInt()); - } + for (int i = 0; i < lavaPathWaypoints.size(); i++) { + JsonObject point = lavaPathWaypoints.get(i).getAsJsonObject(); + LAVA_PATH_WAYPOINTS[i] = new BlockPos(point.get("x").getAsInt(), point.get("y").getAsInt(), point.get("z").getAsInt()); + } - /// Upside Down Parkour - JsonArray upsideDownParkourWaypoints = sections.get(1).getAsJsonObject().get("waypoints").getAsJsonArray(); + /// Upside Down Parkour + JsonArray upsideDownParkourWaypoints = sections.get(1).getAsJsonObject().get("waypoints").getAsJsonArray(); - for (int i = 0; i < upsideDownParkourWaypoints.size(); i++) { - JsonObject point = upsideDownParkourWaypoints.get(i).getAsJsonObject(); - UPSIDE_DOWN_WAYPOINTS[i] = new BlockPos(point.get("x").getAsInt(), point.get("y").getAsInt(), point.get("z").getAsInt()); - } + for (int i = 0; i < upsideDownParkourWaypoints.size(); i++) { + JsonObject point = upsideDownParkourWaypoints.get(i).getAsJsonObject(); + UPSIDE_DOWN_WAYPOINTS[i] = new BlockPos(point.get("x").getAsInt(), point.get("y").getAsInt(), point.get("z").getAsInt()); + } - /// Turbulator Parkour - JsonArray turbulatorParkourWaypoints = sections.get(2).getAsJsonObject().get("waypoints").getAsJsonArray(); + /// Turbulator Parkour + JsonArray turbulatorParkourWaypoints = sections.get(2).getAsJsonObject().get("waypoints").getAsJsonArray(); - for (int i = 0; i < turbulatorParkourWaypoints.size(); i++) { - JsonObject point = turbulatorParkourWaypoints.get(i).getAsJsonObject(); - TURBULATOR_WAYPOINTS[i] = new BlockPos(point.get("x").getAsInt(), point.get("y").getAsInt(), point.get("z").getAsInt()); + for (int i = 0; i < turbulatorParkourWaypoints.size(); i++) { + JsonObject point = turbulatorParkourWaypoints.get(i).getAsJsonObject(); + TURBULATOR_WAYPOINTS[i] = new BlockPos(point.get("x").getAsInt(), point.get("y").getAsInt(), point.get("z").getAsInt()); + } + } catch (IOException e) { + LOGGER.info("[Skyblocker] Mirrorverse Waypoints failed to load ;("); + e.printStackTrace(); } - - } catch (IOException e) { - LOGGER.info("[Skyblocker] Mirrorverse Waypoints failed to load ;("); - e.printStackTrace(); - } + }); } protected static void render(WorldRenderContext wrc) { //I would also check for the mirrorverse location but the scoreboard stuff is not performant at all... - if (Utils.isInTheRift() && SkyblockerConfigManager.get().locations.rift.mirrorverseWaypoints) { + if (Utils.isInTheRift() && SkyblockerConfigManager.get().locations.rift.mirrorverseWaypoints && waypointsLoaded.isDone()) { for (BlockPos pos : LAVA_PATH_WAYPOINTS) { RenderHelper.renderFilledIfVisible(wrc, pos, COLOR_COMPONENTS, 0.5f); } diff --git a/src/main/java/de/hysky/skyblocker/skyblock/rift/TheRift.java b/src/main/java/de/hysky/skyblocker/skyblock/rift/TheRift.java index 95a2ecf4..02b694b6 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/rift/TheRift.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/rift/TheRift.java @@ -17,6 +17,7 @@ public class TheRift { WorldRenderEvents.AFTER_TRANSLUCENT.register(MirrorverseWaypoints::render); WorldRenderEvents.AFTER_TRANSLUCENT.register(EffigyWaypoints::render); WorldRenderEvents.AFTER_TRANSLUCENT.register(EnigmaSouls::render); + ClientLifecycleEvents.CLIENT_STARTED.register(MirrorverseWaypoints::load); ClientLifecycleEvents.CLIENT_STARTED.register(EnigmaSouls::load); ClientLifecycleEvents.CLIENT_STOPPING.register(EnigmaSouls::save); ClientReceiveMessageEvents.GAME.register(EnigmaSouls::onMessage); -- cgit From 4e3c09b51dff976a7680d887c487830e2445684b Mon Sep 17 00:00:00 2001 From: Aaron <51387595+AzureAaron@users.noreply.github.com> Date: Sun, 22 Oct 2023 22:34:38 -0400 Subject: Change order of redstone skull to be logical This way it doesn't disappear when you pick up an item --- .../skyblocker/dungeons/secretlocations.json | 28 +++++++++++----------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/main/resources/assets/skyblocker/dungeons/secretlocations.json b/src/main/resources/assets/skyblocker/dungeons/secretlocations.json index 5972659f..4c3ca15b 100644 --- a/src/main/resources/assets/skyblocker/dungeons/secretlocations.json +++ b/src/main/resources/assets/skyblocker/dungeons/secretlocations.json @@ -1719,13 +1719,6 @@ } ], "Redstone-Key-3":[ - { - "secretName":"1 - Redstone Skull (right click)", - "category":"lever", - "x":10, - "y":70, - "z":26 - }, { "secretName":"1 - Superboom", "category":"superboom", @@ -1733,13 +1726,6 @@ "y":68, "z":7 }, - { - "secretName":"1 - Redstone Skull (right click)", - "category":"lever", - "x":19, - "y":66, - "z":7 - }, { "secretName":"1 - Lever behind Crypt", "category":"lever", @@ -1754,6 +1740,20 @@ "y":69, "z":6 }, + { + "secretName":"2 - Redstone Skull (right click)", + "category":"lever", + "x":10, + "y":70, + "z":26 + }, + { + "secretName":"2 - Redstone Skull (right click)", + "category":"lever", + "x":19, + "y":66, + "z":7 + }, { "secretName":"2 - Place Skull", "category":"lever", -- cgit From a9d8ff4284abe0342970e3a4b6a19c19d944564e Mon Sep 17 00:00:00 2001 From: Kevinthegreat <92656833+kevinthegreat1@users.noreply.github.com> Date: Sun, 22 Oct 2023 22:35:01 -0400 Subject: Refactor EnigmaSouls and MirrorverseWaypoints --- .../skyblocker/skyblock/rift/EnigmaSouls.java | 63 +++++++++++----------- .../skyblock/rift/MirrorverseWaypoints.java | 5 +- 2 files changed, 33 insertions(+), 35 deletions(-) diff --git a/src/main/java/de/hysky/skyblocker/skyblock/rift/EnigmaSouls.java b/src/main/java/de/hysky/skyblocker/skyblock/rift/EnigmaSouls.java index 3a0651ef..744edd4c 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/rift/EnigmaSouls.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/rift/EnigmaSouls.java @@ -52,66 +52,66 @@ public class EnigmaSouls { private static final Object2ObjectOpenHashMap> FOUND_SOULS = new Object2ObjectOpenHashMap<>(); private static final float[] GREEN = DyeColor.GREEN.getColorComponents(); private static final float[] RED = DyeColor.RED.getColorComponents(); - + private static CompletableFuture soulsLoaded; - + static void load(MinecraftClient client) { //Load waypoints soulsLoaded = CompletableFuture.runAsync(() -> { try (BufferedReader reader = client.getResourceManager().openAsReader(WAYPOINTS_JSON)) { JsonObject file = JsonParser.parseReader(reader).getAsJsonObject(); JsonArray waypoints = file.get("waypoints").getAsJsonArray(); - + for (int i = 0; i < waypoints.size(); i++) { JsonObject waypoint = waypoints.get(i).getAsJsonObject(); SOUL_WAYPOINTS[i] = new BlockPos(waypoint.get("x").getAsInt(), waypoint.get("y").getAsInt(), waypoint.get("z").getAsInt()); } - + } catch (IOException e) { - LOGGER.error("[Skyblocker] There was an error while loading enigma soul waypoints! Exception: {}", e); + LOGGER.error("[Skyblocker] There was an error while loading enigma soul waypoints!", e); } - + //Load found souls try (BufferedReader reader = Files.newBufferedReader(FOUND_SOULS_FILE)) { for (Map.Entry profile : JsonParser.parseReader(reader).getAsJsonObject().asMap().entrySet()) { ObjectOpenHashSet foundSoulsOnProfile = new ObjectOpenHashSet<>(); - + for (JsonElement foundSoul : profile.getValue().getAsJsonArray().asList()) { foundSoulsOnProfile.add(PosUtils.parsePosString(foundSoul.getAsString())); } - + FOUND_SOULS.put(profile.getKey(), foundSoulsOnProfile); } } catch (NoSuchFileException ignored) { } catch (IOException e) { - LOGGER.error("[Skyblocker] There was an error while loading found enigma souls! Exception: {}", e); + LOGGER.error("[Skyblocker] There was an error while loading found enigma souls!", e); } }); } - + static void save(MinecraftClient client) { JsonObject json = new JsonObject(); - + for (Map.Entry> foundSoulsForProfile : FOUND_SOULS.entrySet()) { JsonArray foundSoulsJson = new JsonArray(); - + for (BlockPos foundSoul : foundSoulsForProfile.getValue()) { foundSoulsJson.add(PosUtils.getPosString(foundSoul)); } - + json.add(foundSoulsForProfile.getKey(), foundSoulsJson); } - + try (BufferedWriter writer = Files.newBufferedWriter(FOUND_SOULS_FILE)) { SkyblockerMod.GSON.toJson(json, writer); } catch (IOException e) { - LOGGER.error("[Skyblocker] There was an error while saving found enigma souls! Exception: {}", e); + LOGGER.error("[Skyblocker] There was an error while saving found enigma souls!", e); } } - + static void render(WorldRenderContext wrc) { SkyblockerConfig.Rift config = SkyblockerConfigManager.get().locations.rift; - + if (Utils.isInTheRift() && config.enigmaSoulWaypoints && soulsLoaded.isDone()) { for (BlockPos pos : SOUL_WAYPOINTS) { if (isSoulMissing(pos)) { @@ -122,15 +122,15 @@ public class EnigmaSouls { } } } - + static void onMessage(Text text, boolean overlay) { if (Utils.isInTheRift() && !overlay) { String message = text.getString(); - + if (message.equals("You have already found that Enigma Soul!") || Formatting.strip(message).equals("SOUL! You unlocked an Enigma Soul!")) markClosestSoulAsFound(); } } - + static void registerCommands(CommandDispatcher dispatcher, CommandRegistryAccess registryAccess) { dispatcher.register(literal(SkyblockerMod.NAMESPACE) .then(literal("rift") @@ -138,23 +138,22 @@ public class EnigmaSouls { .then(literal("markAllFound").executes(context -> { markAllFound(); context.getSource().sendFeedback(Constants.PREFIX.get().append(Text.translatable("skyblocker.rift.enigmaSouls.markAllFound"))); - + return Command.SINGLE_SUCCESS; })) .then(literal("markAllMissing").executes(context -> { markAllMissing(); context.getSource().sendFeedback(Constants.PREFIX.get().append(Text.translatable("skyblocker.rift.enigmaSouls.markAllMissing"))); - + return Command.SINGLE_SUCCESS; }))))); } - - @SuppressWarnings("resource") + private static void markClosestSoulAsFound() { - if (!soulsLoaded.isDone()) return; - ClientPlayerEntity player = MinecraftClient.getInstance().player; - + + if (!soulsLoaded.isDone() || player == null) return; + Arrays.stream(SOUL_WAYPOINTS) .filter(EnigmaSouls::isSoulMissing) .min(Comparator.comparingDouble(soulPos -> soulPos.getSquaredDistance(player.getPos()))) @@ -164,21 +163,21 @@ public class EnigmaSouls { FOUND_SOULS.get(Utils.getProfile()).add(soulPos); }); } - + private static boolean isSoulMissing(BlockPos soulPos) { ObjectOpenHashSet foundSoulsOnProfile = FOUND_SOULS.get(Utils.getProfile()); - + return foundSoulsOnProfile == null || !foundSoulsOnProfile.contains(soulPos); } - + private static void markAllFound() { FOUND_SOULS.computeIfAbsent(Utils.getProfile(), profile -> new ObjectOpenHashSet<>()); FOUND_SOULS.get(Utils.getProfile()).addAll(List.of(SOUL_WAYPOINTS)); } - + private static void markAllMissing() { ObjectOpenHashSet foundSoulsOnProfile = FOUND_SOULS.get(Utils.getProfile()); - + if (foundSoulsOnProfile != null) foundSoulsOnProfile.clear(); } } diff --git a/src/main/java/de/hysky/skyblocker/skyblock/rift/MirrorverseWaypoints.java b/src/main/java/de/hysky/skyblocker/skyblock/rift/MirrorverseWaypoints.java index e7c62629..7dda741f 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/rift/MirrorverseWaypoints.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/rift/MirrorverseWaypoints.java @@ -26,7 +26,7 @@ public class MirrorverseWaypoints { private static final BlockPos[] UPSIDE_DOWN_WAYPOINTS = new BlockPos[66]; private static final BlockPos[] TURBULATOR_WAYPOINTS = new BlockPos[27]; private static final float[] COLOR_COMPONENTS = DyeColor.RED.getColorComponents(); - + private static CompletableFuture waypointsLoaded; /** @@ -62,8 +62,7 @@ public class MirrorverseWaypoints { TURBULATOR_WAYPOINTS[i] = new BlockPos(point.get("x").getAsInt(), point.get("y").getAsInt(), point.get("z").getAsInt()); } } catch (IOException e) { - LOGGER.info("[Skyblocker] Mirrorverse Waypoints failed to load ;("); - e.printStackTrace(); + LOGGER.error("[Skyblocker] Mirrorverse Waypoints failed to load ;(", e); } }); } -- cgit From 12d3086e9506e6e120c492ea99dcc6e84738ce3b Mon Sep 17 00:00:00 2001 From: Kevinthegreat <92656833+kevinthegreat1@users.noreply.github.com> Date: Sun, 22 Oct 2023 22:02:05 -0400 Subject: Refactor DungeonSecrets --- .../skyblock/dungeon/secrets/DungeonSecrets.java | 66 ++++++++++------------ .../skyblocker/skyblock/dungeon/secrets/Room.java | 48 +++++++++------- .../resources/assets/skyblocker/lang/en_us.json | 3 +- 3 files changed, 60 insertions(+), 57 deletions(-) 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 96b4a7c9..07cb0395 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 @@ -7,18 +7,14 @@ import com.mojang.brigadier.Command; import com.mojang.brigadier.arguments.IntegerArgumentType; import com.mojang.brigadier.builder.ArgumentBuilder; import com.mojang.brigadier.builder.RequiredArgumentBuilder; - -import it.unimi.dsi.fastutil.ints.IntRBTreeSet; -import it.unimi.dsi.fastutil.ints.IntSortedSet; -import it.unimi.dsi.fastutil.ints.IntSortedSets; -import it.unimi.dsi.fastutil.objects.Object2ByteMap; -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 it.unimi.dsi.fastutil.objects.Object2ByteMap; +import it.unimi.dsi.fastutil.objects.Object2ByteOpenHashMap; +import it.unimi.dsi.fastutil.objects.ObjectIntPair; import net.fabricmc.fabric.api.client.command.v2.ClientCommandRegistrationCallback; import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource; import net.fabricmc.fabric.api.client.message.v1.ClientReceiveMessageEvents; @@ -156,8 +152,8 @@ public class DungeonSecrets { ClientCommandRegistrationCallback.EVENT.register((dispatcher, registryAccess) -> dispatcher.register(literal(SkyblockerMod.NAMESPACE).then(literal("dungeons").then(literal("secrets") .then(literal("markAsFound").then(markSecretsCommand(true))) .then(literal("markAsMissing").then(markSecretsCommand(false))) - .then(literal("getPos").executes(context -> registerPosCommand(context.getSource(), false))) - .then(literal("getFacingPos").executes(context -> registerPosCommand(context.getSource(), true))))))); + .then(literal("getRelativePos").executes(context -> getRelativePos(context.getSource()))) + .then(literal("getRelativeTargetPos").executes(context -> getRelativeTargetPos(context.getSource()))))))); ClientPlayConnectionEvents.JOIN.register(((handler, sender, client) -> reset())); } @@ -212,8 +208,9 @@ public class DungeonSecrets { /** * Loads the json from the given {@link BufferedReader} into the given {@link Map}. + * * @param reader the reader to read the json from - * @param map the map to load into + * @param map the map to load into */ private static void loadJson(BufferedReader reader, Map map) { SkyblockerMod.GSON.fromJson(reader, JsonObject.class).asMap().forEach((room, jsonElement) -> map.put(room.toLowerCase().replaceAll(" ", "-"), jsonElement)); @@ -230,30 +227,27 @@ public class DungeonSecrets { return Command.SINGLE_SUCCESS; }); } - - //TODO This logic can be split into a separate method for when we want to allow for adding custom waypoints - private static int registerPosCommand(FabricClientCommandSource source, boolean facing) { - if (currentRoom != null && currentRoom.getDirection() != null) { - MinecraftClient client = MinecraftClient.getInstance(); - - if (facing && (client.crosshairTarget == null || client.crosshairTarget.getType() != HitResult.Type.BLOCK)) { - source.sendError(Constants.PREFIX.get().append(Text.translatable("skyblocker.dungeons.secrets.unableToFindPos"))); - - return Command.SINGLE_SUCCESS; - } - BlockPos blockToCheck = facing && client.crosshairTarget instanceof BlockHitResult blockHitResult ? blockHitResult.getBlockPos() : client.player.getBlockPos(); - IntSortedSet segmentsX = IntSortedSets.unmodifiable(new IntRBTreeSet(currentRoom.getSegments().stream().mapToInt(Vector2ic::x).toArray())); - IntSortedSet segmentsY = IntSortedSets.unmodifiable(new IntRBTreeSet(currentRoom.getSegments().stream().mapToInt(Vector2ic::y).toArray())); - Vector2ic physicalCornerPos = DungeonMapUtils.getPhysicalCornerPos(currentRoom.getDirection(), segmentsX, segmentsY); + private static int getRelativePos(FabricClientCommandSource source) { + return getRelativePos(source, source.getPlayer().getBlockPos()); + } - BlockPos relativePos = DungeonMapUtils.actualToRelative(currentRoom.getDirection(), physicalCornerPos, blockToCheck); + private static int getRelativeTargetPos(FabricClientCommandSource source) { + if (MinecraftClient.getInstance().crosshairTarget instanceof BlockHitResult blockHitResult && blockHitResult.getType() == HitResult.Type.BLOCK) { + return getRelativePos(source, blockHitResult.getBlockPos()); + } else { + source.sendError(Constants.PREFIX.get().append(Text.translatable("skyblocker.dungeons.secrets.noTarget"))); + } + return Command.SINGLE_SUCCESS; + } + private static int getRelativePos(FabricClientCommandSource source, BlockPos pos) { + if (isCurrentRoomMatched()) { + BlockPos relativePos = DungeonMapUtils.actualToRelative(currentRoom.getDirection(), currentRoom.getPhysicalCornerPos(), pos); source.sendFeedback(Constants.PREFIX.get().append(Text.translatable("skyblocker.dungeons.secrets.posMessage", currentRoom.getName(), relativePos.getX(), relativePos.getY(), relativePos.getZ()))); - } else { - source.sendError(Constants.PREFIX.get().append(Text.translatable("skyblocker.dungeons.secrets.unableToFindPos"))); - } - + } else { + source.sendError(Constants.PREFIX.get().append(Text.translatable("skyblocker.dungeons.secrets.notMatched"))); + } return Command.SINGLE_SUCCESS; } @@ -374,16 +368,16 @@ public class DungeonSecrets { * Used to detect when all secrets in a room are found. */ private static void onChatMessage(Text text, boolean overlay) { + String message = text.getString(); + if (overlay && isCurrentRoomMatched()) { - currentRoom.onChatMessage(text.getString()); + currentRoom.onChatMessage(message); } - String message = text.getString(); - if (message.equals("[BOSS] Bonzo: Gratz for making it this far, but I'm basically unbeatable.") || message.equals("[BOSS] Scarf: This is where the journey ends for you, Adventurers.") - || message.equals("[BOSS] The Professor: I was burdened with terrible news recently...") || message.equals("[BOSS] Thorn: Welcome Adventurers! I am Thorn, the Spirit! And host of the Vegan Trials!") - || message.equals("[BOSS] Livid: Welcome, you've arrived right on time. I am Livid, the Master of Shadows.") || message.equals("[BOSS] Sadan: So you made it all the way here... Now you wish to defy me? Sadan?!") - || message.equals("[BOSS] Maxor: WELL! WELL! WELL! LOOK WHO'S HERE!")) reset(); + || message.equals("[BOSS] The Professor: I was burdened with terrible news recently...") || message.equals("[BOSS] Thorn: Welcome Adventurers! I am Thorn, the Spirit! And host of the Vegan Trials!") + || message.equals("[BOSS] Livid: Welcome, you've arrived right on time. I am Livid, the Master of Shadows.") || message.equals("[BOSS] Sadan: So you made it all the way here... Now you wish to defy me? Sadan?!") + || message.equals("[BOSS] Maxor: WELL! WELL! WELL! LOOK WHO'S HERE!")) reset(); } /** diff --git a/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/Room.java b/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/Room.java index 79b13d3b..8d8d0757 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/Room.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/Room.java @@ -5,10 +5,10 @@ import com.google.common.collect.ImmutableTable; import com.google.common.collect.Table; import com.google.gson.JsonElement; import com.google.gson.JsonObject; +import de.hysky.skyblocker.utils.scheduler.Scheduler; import it.unimi.dsi.fastutil.ints.IntRBTreeSet; import it.unimi.dsi.fastutil.ints.IntSortedSet; import it.unimi.dsi.fastutil.ints.IntSortedSets; -import de.hysky.skyblocker.utils.scheduler.Scheduler; import net.fabricmc.fabric.api.client.rendering.v1.WorldRenderContext; import net.fabricmc.fabric.api.util.TriState; import net.minecraft.block.BlockState; @@ -28,7 +28,6 @@ import net.minecraft.world.World; import org.apache.commons.lang3.tuple.MutableTriple; import org.apache.commons.lang3.tuple.Triple; import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; import org.joml.Vector2i; import org.joml.Vector2ic; @@ -73,8 +72,10 @@ public class Room { */ private TriState matched = TriState.DEFAULT; private Table secretWaypoints; - private Direction direction = null; - private String name = null; + private String name; + private Direction direction; + + private Vector2ic physicalCornerPos; public Room(@NotNull Type type, @NotNull Vector2ic... physicalPositions) { this.type = type; @@ -91,23 +92,29 @@ public class Room { return type; } - @NotNull - public Set getSegments() { - return segments; - } - public boolean isMatched() { return matched == TriState.TRUE; } - - @Nullable + + /** + * Not null if {@link #isMatched()}. + */ + public String getName() { + return name; + } + + /** + * Not null if {@link #isMatched()}. + */ public Direction getDirection() { return direction; } - - @Nullable - public String getName() { - return name; + + /** + * Not null if {@link #isMatched()}. + */ + public Vector2ic getPhysicalCornerPos() { + return physicalCornerPos; } @Override @@ -235,7 +242,7 @@ public class Room { * *
  • If there are exactly one room matching:
  • *
      - *
    • Call {@link #roomMatched(String, Direction, Vector2ic)}.
    • + *
    • Call {@link #roomMatched()}.
    • *
    • Discard the no longer needed fields to save memory.
    • *
    • Return {@code true}
    • *
    @@ -274,7 +281,10 @@ public class Room { // If one room matches, load the secrets for that room and discard the no longer needed fields. for (Triple> directionRooms : possibleRooms) { if (directionRooms.getRight().size() == 1) { - roomMatched(directionRooms.getRight().get(0), directionRooms.getLeft(), directionRooms.getMiddle()); + name = directionRooms.getRight().get(0); + direction = directionRooms.getLeft(); + physicalCornerPos = directionRooms.getMiddle(); + roomMatched(); discard(); return true; } @@ -304,7 +314,7 @@ public class Room { * @param directionRooms the direction, position, and name of the room */ @SuppressWarnings("JavadocReference") - private void roomMatched(String name, Direction direction, Vector2ic physicalCornerPos) { + private void roomMatched() { Table secretWaypointsMutable = HashBasedTable.create(); for (JsonElement waypointElement : DungeonSecrets.getRoomWaypoints(name)) { JsonObject waypoint = waypointElement.getAsJsonObject(); @@ -315,8 +325,6 @@ public class Room { } secretWaypoints = ImmutableTable.copyOf(secretWaypointsMutable); matched = TriState.TRUE; - this.direction = direction; - this.name = name; DungeonSecrets.LOGGER.info("[Skyblocker] Room {} matched after checking {} block(s)", name, checkedBlocks.size()); } diff --git a/src/main/resources/assets/skyblocker/lang/en_us.json b/src/main/resources/assets/skyblocker/lang/en_us.json index a6bf6b49..b6edb5f8 100644 --- a/src/main/resources/assets/skyblocker/lang/en_us.json +++ b/src/main/resources/assets/skyblocker/lang/en_us.json @@ -276,7 +276,8 @@ "skyblocker.dungeons.secrets.markSecretFoundUnable": "§cUnable to mark secret #%d as found.", "skyblocker.dungeons.secrets.markSecretMissingUnable": "§cUnable to mark secret #%d as missing.", "skyblocker.dungeons.secrets.posMessage": "§rRoom: %s, X: %d, Y: %d, Z: %d", - "skyblocker.dungeons.secrets.unableToFindPos": "§cUnable to find room position! (Are you in a dungeon room, are you facing a block?)", + "skyblocker.dungeons.secrets.noTarget": "§cNo target block found! (Are you pointing at a block in range?)", + "skyblocker.dungeons.secrets.notMatched": "§cThe current room is not matched! (Are you in a dungeon room?)", "skyblocker.fishing.reelNow": "Reel in now!", "skyblocker.rift.healNow": "Heal now!", -- cgit From 308f27220be48de40c33627d1217698e993a1615 Mon Sep 17 00:00:00 2001 From: Aaron <51387595+AzureAaron@users.noreply.github.com> Date: Sun, 22 Oct 2023 22:48:01 -0400 Subject: Tweak Pressure Plates Stonk 6 Waypoint --- src/main/resources/assets/skyblocker/dungeons/secretlocations.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/assets/skyblocker/dungeons/secretlocations.json b/src/main/resources/assets/skyblocker/dungeons/secretlocations.json index 4c3ca15b..e31167ae 100644 --- a/src/main/resources/assets/skyblocker/dungeons/secretlocations.json +++ b/src/main/resources/assets/skyblocker/dungeons/secretlocations.json @@ -2952,7 +2952,7 @@ { "secretName":"6 - Stonk", "category":"stonk", - "x":17, + "x":18, "y":70, "z":14 }, -- cgit From d88b9f6e80028eef5b0c7dc5ee0ed2a9df6f3cad Mon Sep 17 00:00:00 2001 From: Aaron <51387595+AzureAaron@users.noreply.github.com> Date: Sun, 22 Oct 2023 22:51:31 -0400 Subject: Add AOTV and Pearl waypoint for Marker --- .../assets/skyblocker/dungeons/secretlocations.json | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/main/resources/assets/skyblocker/dungeons/secretlocations.json b/src/main/resources/assets/skyblocker/dungeons/secretlocations.json index e31167ae..d8ff69c9 100644 --- a/src/main/resources/assets/skyblocker/dungeons/secretlocations.json +++ b/src/main/resources/assets/skyblocker/dungeons/secretlocations.json @@ -4880,6 +4880,13 @@ "y":81, "z":52 }, + { + "secretName":"2 - AOTV", + "category":"aotv", + "x":45, + "y":78, + "z":47 + }, { "secretName":"2 - Chest", "category":"chest", @@ -4915,6 +4922,13 @@ "y":85, "z":41 }, + { + "secretName":"5 - Pearl", + "category":"pearl", + "x":15, + "y":84, + "z":56 + }, { "secretName":"5 - Stonk", "category":"stonk", -- cgit From fbecc8104bc5f398f5e712cd035c4eb82324fb67 Mon Sep 17 00:00:00 2001 From: Aaron <51387595+AzureAaron@users.noreply.github.com> Date: Sun, 22 Oct 2023 22:53:33 -0400 Subject: Add Blue Skulls Pearl waypoint --- src/main/resources/assets/skyblocker/dungeons/secretlocations.json | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/resources/assets/skyblocker/dungeons/secretlocations.json b/src/main/resources/assets/skyblocker/dungeons/secretlocations.json index d8ff69c9..df939537 100644 --- a/src/main/resources/assets/skyblocker/dungeons/secretlocations.json +++ b/src/main/resources/assets/skyblocker/dungeons/secretlocations.json @@ -262,6 +262,13 @@ "y":77, "z":21 }, + { + "secretName":"1 - Pearl", + "category":"pearl", + "x":25, + "y":75, + "z":27 + }, { "secretName":"1 - Item", "category":"item", -- cgit From aebb4196e7071f6ad6c53f40818e1395b631a654 Mon Sep 17 00:00:00 2001 From: Aaron <51387595+AzureAaron@users.noreply.github.com> Date: Sun, 22 Oct 2023 22:56:21 -0400 Subject: Add Atlas AOTV waypoint --- src/main/resources/assets/skyblocker/dungeons/secretlocations.json | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/resources/assets/skyblocker/dungeons/secretlocations.json b/src/main/resources/assets/skyblocker/dungeons/secretlocations.json index df939537..a0a97c67 100644 --- a/src/main/resources/assets/skyblocker/dungeons/secretlocations.json +++ b/src/main/resources/assets/skyblocker/dungeons/secretlocations.json @@ -3834,6 +3834,13 @@ "y":81, "z":51 }, + { + "secretName":"5 - AOTV", + "category":"aotv", + "x":16, + "y":81, + "z":53 + }, { "secretName":"5 - Chest", "category":"chest", -- cgit From 54bf37cc7860ce0d8467a058d81cbcf07af2bd7d Mon Sep 17 00:00:00 2001 From: Kevinthegreat <92656833+kevinthegreat1@users.noreply.github.com> Date: Sun, 22 Oct 2023 22:02:05 -0400 Subject: Refactor DungeonSecrets --- .../skyblock/dungeon/secrets/DungeonMapUtils.java | 3 +- .../skyblock/dungeon/secrets/DungeonSecrets.java | 19 ++++++++++-- .../skyblocker/skyblock/dungeon/secrets/Room.java | 34 ++++++++++------------ 3 files changed, 34 insertions(+), 22 deletions(-) diff --git a/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/DungeonMapUtils.java b/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/DungeonMapUtils.java index 259cc3f3..73d4a452 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/DungeonMapUtils.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/DungeonMapUtils.java @@ -7,7 +7,6 @@ import net.minecraft.block.MapColor; import net.minecraft.item.map.MapIcon; import net.minecraft.item.map.MapState; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.Vec3d; import net.minecraft.util.math.Vec3i; import org.jetbrains.annotations.NotNull; @@ -173,7 +172,7 @@ public class DungeonMapUtils { @NotNull public static Vector2ic getPhysicalRoomPos(double x, double z) { Vector2i physicalPos = new Vector2i(x + 8.5, z + 8.5, RoundingMode.TRUNCATE); - return physicalPos.sub(MathHelper.floorMod(physicalPos.x(), 32), MathHelper.floorMod(physicalPos.y(), 32)).sub(8, 8); + return physicalPos.sub(Math.floorMod(physicalPos.x(), 32), Math.floorMod(physicalPos.y(), 32)).sub(8, 8); } public static Vector2ic[] getPhysicalPosFromMap(Vector2ic mapEntrancePos, int mapRoomSize, Vector2ic physicalEntrancePos, Vector2ic... mapPositions) { 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 07cb0395..08b84852 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 @@ -40,6 +40,7 @@ import net.minecraft.util.hit.BlockHitResult; import net.minecraft.util.hit.HitResult; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.Vec3i; import net.minecraft.world.World; import org.jetbrains.annotations.Contract; import org.jetbrains.annotations.NotNull; @@ -242,8 +243,9 @@ public class DungeonSecrets { } private static int getRelativePos(FabricClientCommandSource source, BlockPos pos) { - if (isCurrentRoomMatched()) { - BlockPos relativePos = DungeonMapUtils.actualToRelative(currentRoom.getDirection(), currentRoom.getPhysicalCornerPos(), pos); + Room room = getRoomAtPhysical(pos); + if (isRoomMatched(room)) { + BlockPos relativePos = currentRoom.actualToRelative(pos); source.sendFeedback(Constants.PREFIX.get().append(Text.translatable("skyblocker.dungeons.secrets.posMessage", currentRoom.getName(), relativePos.getX(), relativePos.getY(), relativePos.getZ()))); } else { source.sendError(Constants.PREFIX.get().append(Text.translatable("skyblocker.dungeons.secrets.notMatched"))); @@ -445,6 +447,19 @@ public class DungeonSecrets { return rooms.get(DungeonMapUtils.getPhysicalRoomPos(pos)); } + /** + * Gets the room at the given physical position. + * + * @param pos the physical position + * @return the room at the given physical position, or null if there is no room at the given physical position + * @see #rooms + * @see DungeonMapUtils#getPhysicalRoomPos(Vec3i) + */ + @Nullable + private static Room getRoomAtPhysical(Vec3i pos) { + return rooms.get(DungeonMapUtils.getPhysicalRoomPos(pos)); + } + /** * Calls {@link #isRoomMatched(Room)} on {@link #currentRoom}. * diff --git a/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/Room.java b/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/Room.java index 8d8d0757..0d7a444f 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/Room.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/Room.java @@ -23,7 +23,6 @@ import net.minecraft.entity.mob.AmbientEntity; import net.minecraft.registry.Registries; import net.minecraft.util.hit.BlockHitResult; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.MathHelper; import net.minecraft.world.World; import org.apache.commons.lang3.tuple.MutableTriple; import org.apache.commons.lang3.tuple.Triple; @@ -74,7 +73,6 @@ public class Room { private Table secretWaypoints; private String name; private Direction direction; - private Vector2ic physicalCornerPos; public Room(@NotNull Type type, @NotNull Vector2ic... physicalPositions) { @@ -103,20 +101,6 @@ public class Room { return name; } - /** - * Not null if {@link #isMatched()}. - */ - public Direction getDirection() { - return direction; - } - - /** - * Not null if {@link #isMatched()}. - */ - public Vector2ic getPhysicalCornerPos() { - return physicalCornerPos; - } - @Override public String toString() { return "Room{type=" + type + ", shape=" + shape + ", matched=" + matched + ", segments=" + Arrays.toString(segments.toArray()) + "}"; @@ -211,8 +195,8 @@ public class Room { if (pos.getY() < 66 || pos.getY() > 73) { return true; } - int x = MathHelper.floorMod(pos.getX() - 8, 32); - int z = MathHelper.floorMod(pos.getZ() - 8, 32); + int x = Math.floorMod(pos.getX() - 8, 32); + int z = Math.floorMod(pos.getZ() - 8, 32); return (x < 13 || x > 17 || z > 2 && z < 28) && (z < 13 || z > 17 || x > 2 && x < 28); } @@ -351,6 +335,20 @@ public class Room { doubleCheckBlocks = 0; } + /** + * Fails if !{@link #isMatched()} + */ + protected BlockPos actualToRelative(BlockPos pos) { + return DungeonMapUtils.actualToRelative(direction, physicalCornerPos, pos); + } + + /** + * Fails if !{@link #isMatched()} + */ + protected BlockPos relativeToActual(BlockPos pos) { + return DungeonMapUtils.relativeToActual(direction, physicalCornerPos, pos); + } + /** * Calls {@link SecretWaypoint#render(WorldRenderContext)} on {@link #secretWaypoints all secret waypoints}. */ -- cgit From 27b4bdb40ecf0d2e95616b6bf431b7948bc5bdc7 Mon Sep 17 00:00:00 2001 From: Kevinthegreat <92656833+kevinthegreat1@users.noreply.github.com> Date: Sun, 24 Sep 2023 00:13:12 -0400 Subject: Add MythologicalRitual --- .../java/de/hysky/skyblocker/SkyblockerMod.java | 2 + .../mixin/ClientPlayNetworkHandlerMixin.java | 9 ++- src/main/java/de/hysky/skyblocker/utils/Utils.java | 11 ++++ .../skyblock/diana/MythologicalRitual.java | 75 ++++++++++++++++++++++ 4 files changed, 96 insertions(+), 1 deletion(-) create mode 100644 src/main/java/me/xmrvizzy/skyblocker/skyblock/diana/MythologicalRitual.java diff --git a/src/main/java/de/hysky/skyblocker/SkyblockerMod.java b/src/main/java/de/hysky/skyblocker/SkyblockerMod.java index 115f90ec..6cdb507f 100644 --- a/src/main/java/de/hysky/skyblocker/SkyblockerMod.java +++ b/src/main/java/de/hysky/skyblocker/SkyblockerMod.java @@ -3,6 +3,7 @@ package de.hysky.skyblocker; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import de.hysky.skyblocker.skyblock.*; +import de.hysky.skyblocker.skyblock.diana.MythologicalRitual; import de.hysky.skyblocker.skyblock.dungeon.*; import de.hysky.skyblocker.skyblock.dungeon.secrets.DungeonSecrets; import de.hysky.skyblocker.skyblock.item.*; @@ -76,6 +77,7 @@ public class SkyblockerMod implements ClientModInitializer { WikiLookup.init(); FairySouls.init(); Relics.init(); + MythologicalRitual.init(); BackpackPreview.init(); QuickNav.init(); ItemCooldowns.init(); diff --git a/src/main/java/de/hysky/skyblocker/mixin/ClientPlayNetworkHandlerMixin.java b/src/main/java/de/hysky/skyblocker/mixin/ClientPlayNetworkHandlerMixin.java index fff534b2..f8f71512 100644 --- a/src/main/java/de/hysky/skyblocker/mixin/ClientPlayNetworkHandlerMixin.java +++ b/src/main/java/de/hysky/skyblocker/mixin/ClientPlayNetworkHandlerMixin.java @@ -2,14 +2,16 @@ package de.hysky.skyblocker.mixin; import com.llamalad7.mixinextras.injector.WrapWithCondition; import com.llamalad7.mixinextras.sugar.Local; -import de.hysky.skyblocker.skyblock.dungeon.secrets.DungeonSecrets; import dev.cbyrne.betterinject.annotations.Inject; import de.hysky.skyblocker.skyblock.FishingHelper; +import de.hysky.skyblocker.skyblock.diana.MythologicalRitual; +import de.hysky.skyblocker.skyblock.dungeon.secrets.DungeonSecrets; import de.hysky.skyblocker.utils.Utils; import net.minecraft.client.MinecraftClient; import net.minecraft.client.network.ClientPlayNetworkHandler; import net.minecraft.entity.ItemEntity; import net.minecraft.entity.LivingEntity; +import net.minecraft.network.packet.s2c.play.ParticleS2CPacket; import net.minecraft.network.packet.s2c.play.PlaySoundS2CPacket; import org.slf4j.Logger; import org.spongepowered.asm.mixin.Mixin; @@ -45,4 +47,9 @@ public abstract class ClientPlayNetworkHandlerMixin { private boolean skyblocker$cancelTeamWarning(Logger instance, String format, Object... arg) { return !Utils.isOnHypixel(); } + + @Inject(method = "onParticle", at = @At("RETURN")) + private void skyblocker$onParticle(ParticleS2CPacket packet) { + MythologicalRitual.onParticle(packet); + } } diff --git a/src/main/java/de/hysky/skyblocker/utils/Utils.java b/src/main/java/de/hysky/skyblocker/utils/Utils.java index c1b4223f..bbfd1101 100644 --- a/src/main/java/de/hysky/skyblocker/utils/Utils.java +++ b/src/main/java/de/hysky/skyblocker/utils/Utils.java @@ -19,6 +19,7 @@ import net.minecraft.client.network.PlayerListEntry; import net.minecraft.scoreboard.*; import net.minecraft.text.Text; import net.minecraft.util.Formatting; +import org.jetbrains.annotations.NotNull; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -40,10 +41,15 @@ public class Utils { * The following fields store data returned from /locraw: {@link #profile}, {@link #server}, {@link #gameType}, {@link #locationRaw}, and {@link #map}. */ @SuppressWarnings("JavadocDeclaration") + @NotNull private static String profile = ""; + @NotNull private static String server = ""; + @NotNull private static String gameType = ""; + @NotNull private static String locationRaw = ""; + @NotNull private static String map = ""; private static long clientWorldJoinTime = 0; private static boolean sentLocRaw = false; @@ -78,6 +84,7 @@ public class Utils { /** * @return the profile parsed from the player list. */ + @NotNull public static String getProfile() { return profile; } @@ -85,6 +92,7 @@ public class Utils { /** * @return the server parsed from /locraw. */ + @NotNull public static String getServer() { return server; } @@ -92,6 +100,7 @@ public class Utils { /** * @return the game type parsed from /locraw. */ + @NotNull public static String getGameType() { return gameType; } @@ -99,6 +108,7 @@ public class Utils { /** * @return the location raw parsed from /locraw. */ + @NotNull public static String getLocationRaw() { return locationRaw; } @@ -106,6 +116,7 @@ public class Utils { /** * @return the map parsed from /locraw. */ + @NotNull public static String getMap() { return map; } diff --git a/src/main/java/me/xmrvizzy/skyblocker/skyblock/diana/MythologicalRitual.java b/src/main/java/me/xmrvizzy/skyblocker/skyblock/diana/MythologicalRitual.java new file mode 100644 index 00000000..a70fa172 --- /dev/null +++ b/src/main/java/me/xmrvizzy/skyblocker/skyblock/diana/MythologicalRitual.java @@ -0,0 +1,75 @@ +package me.xmrvizzy.skyblocker.skyblock.diana; + +import com.mojang.brigadier.Command; +import it.unimi.dsi.fastutil.booleans.BooleanBooleanMutablePair; +import me.xmrvizzy.skyblocker.SkyblockerMod; +import me.xmrvizzy.skyblocker.config.SkyblockerConfig; +import me.xmrvizzy.skyblocker.utils.Utils; +import me.xmrvizzy.skyblocker.utils.render.RenderHelper; +import net.fabricmc.fabric.api.client.command.v2.ClientCommandRegistrationCallback; +import net.fabricmc.fabric.api.client.rendering.v1.WorldRenderContext; +import net.fabricmc.fabric.api.client.rendering.v1.WorldRenderEvents; +import net.fabricmc.fabric.api.event.player.AttackBlockCallback; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.network.packet.s2c.play.ParticleS2CPacket; +import net.minecraft.particle.ParticleTypes; +import net.minecraft.util.ActionResult; +import net.minecraft.util.DyeColor; +import net.minecraft.util.Hand; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Direction; +import net.minecraft.world.World; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + +import static net.fabricmc.fabric.api.client.command.v2.ClientCommandManager.literal; + +public class MythologicalRitual { + private static final Map particlesMap = new HashMap<>(); + private static final Set griffinBurrows = new HashSet<>(); + + public static void init() { + WorldRenderEvents.AFTER_TRANSLUCENT.register(MythologicalRitual::render); + AttackBlockCallback.EVENT.register(MythologicalRitual::onAttackBlock); + ClientCommandRegistrationCallback.EVENT.register((dispatcher, registryAccess) -> dispatcher.register( + literal(SkyblockerMod.NAMESPACE).then(literal("diana").then(literal("clearGriffinBurrows").executes(context -> { + griffinBurrows.clear(); + return Command.SINGLE_SUCCESS; + })))) + ); + } + + public static void onParticle(ParticleS2CPacket packet) { + if (isActive()&& ParticleTypes.CRIT.equals(packet.getParameters().getType()) || ParticleTypes.ENCHANT.equals(packet.getParameters().getType())) { + BlockPos pos = BlockPos.ofFloored(packet.getX(), packet.getY(), packet.getZ()); + BooleanBooleanMutablePair particlesAtPos = particlesMap.computeIfAbsent(pos, pos1 -> BooleanBooleanMutablePair.of(false, false)); + particlesAtPos.left(particlesAtPos.leftBoolean() || ParticleTypes.CRIT.equals(packet.getParameters().getType())); + particlesAtPos.right(particlesAtPos.rightBoolean() || ParticleTypes.ENCHANT.equals(packet.getParameters().getType())); + if (particlesAtPos.leftBoolean() && particlesAtPos.rightBoolean()) { + griffinBurrows.add(pos); + } + } + } + + public static void render(WorldRenderContext context) { + if (isActive()) { + for (BlockPos griffinBorrow : griffinBurrows) { + RenderHelper.renderFilledThroughWallsWithBeaconBeam(context, griffinBorrow, DyeColor.GREEN.getColorComponents(), 0.5F); + } + } + } + + public static ActionResult onAttackBlock(PlayerEntity player, World world, Hand hand, BlockPos pos, Direction direction) { + if (isActive()) { + griffinBurrows.remove(pos); + } + return ActionResult.PASS; + } + + private static boolean isActive() { + return SkyblockerConfig.get().general.fairySouls.enableFairySoulsHelper && Utils.getLocationRaw().equals("hub") ; // TODO Change to actual config option + } +} -- cgit From 3d59588b658c0c9e4cb90960b7390b27077ea516 Mon Sep 17 00:00:00 2001 From: Kevinthegreat <92656833+kevinthegreat1@users.noreply.github.com> Date: Sun, 24 Sep 2023 21:57:35 -0400 Subject: Fix warnings --- src/main/java/de/hysky/skyblocker/SkyblockerMod.java | 2 +- .../java/de/hysky/skyblocker/mixin/ClientPlayNetworkHandlerMixin.java | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/de/hysky/skyblocker/SkyblockerMod.java b/src/main/java/de/hysky/skyblocker/SkyblockerMod.java index 6cdb507f..e18a8c83 100644 --- a/src/main/java/de/hysky/skyblocker/SkyblockerMod.java +++ b/src/main/java/de/hysky/skyblocker/SkyblockerMod.java @@ -40,7 +40,7 @@ import java.nio.file.Path; * this class. */ public class SkyblockerMod implements ClientModInitializer { - public static final String VERSION = FabricLoader.getInstance().getModContainer("skyblocker").get().getMetadata().getVersion().getFriendlyString(); + public static final String VERSION = FabricLoader.getInstance().getModContainer("skyblocker").orElseThrow().getMetadata().getVersion().getFriendlyString(); public static final String NAMESPACE = "skyblocker"; public static final Path CONFIG_DIR = FabricLoader.getInstance().getConfigDir().resolve(NAMESPACE); public static final Gson GSON = new GsonBuilder().setPrettyPrinting().create(); diff --git a/src/main/java/de/hysky/skyblocker/mixin/ClientPlayNetworkHandlerMixin.java b/src/main/java/de/hysky/skyblocker/mixin/ClientPlayNetworkHandlerMixin.java index f8f71512..7615a8e1 100644 --- a/src/main/java/de/hysky/skyblocker/mixin/ClientPlayNetworkHandlerMixin.java +++ b/src/main/java/de/hysky/skyblocker/mixin/ClientPlayNetworkHandlerMixin.java @@ -26,7 +26,6 @@ public abstract class ClientPlayNetworkHandlerMixin { FishingHelper.onSound(packet); } - @SuppressWarnings("resource") @ModifyVariable(method = "onItemPickupAnimation", at = @At(value = "STORE", ordinal = 0)) private ItemEntity skyblocker$onItemPickup(ItemEntity itemEntity, @Local LivingEntity collector) { DungeonSecrets.onItemPickup(itemEntity, collector, collector == MinecraftClient.getInstance().player); -- cgit From 0314c406d18d49ac00998c4a33bfdeea4e10280f Mon Sep 17 00:00:00 2001 From: Kevinthegreat <92656833+kevinthegreat1@users.noreply.github.com> Date: Wed, 27 Sep 2023 00:58:08 -0400 Subject: Update burrow finish detection --- .../skyblock/diana/MythologicalRitual.java | 71 +++++++++++++++++----- 1 file changed, 55 insertions(+), 16 deletions(-) diff --git a/src/main/java/me/xmrvizzy/skyblocker/skyblock/diana/MythologicalRitual.java b/src/main/java/me/xmrvizzy/skyblocker/skyblock/diana/MythologicalRitual.java index a70fa172..c74d5e77 100644 --- a/src/main/java/me/xmrvizzy/skyblocker/skyblock/diana/MythologicalRitual.java +++ b/src/main/java/me/xmrvizzy/skyblocker/skyblock/diana/MythologicalRitual.java @@ -2,74 +2,113 @@ package me.xmrvizzy.skyblocker.skyblock.diana; import com.mojang.brigadier.Command; import it.unimi.dsi.fastutil.booleans.BooleanBooleanMutablePair; +import it.unimi.dsi.fastutil.objects.Object2LongMap; +import it.unimi.dsi.fastutil.objects.Object2LongOpenHashMap; import me.xmrvizzy.skyblocker.SkyblockerMod; import me.xmrvizzy.skyblocker.config.SkyblockerConfig; import me.xmrvizzy.skyblocker.utils.Utils; import me.xmrvizzy.skyblocker.utils.render.RenderHelper; import net.fabricmc.fabric.api.client.command.v2.ClientCommandRegistrationCallback; +import net.fabricmc.fabric.api.client.message.v1.ClientReceiveMessageEvents; import net.fabricmc.fabric.api.client.rendering.v1.WorldRenderContext; import net.fabricmc.fabric.api.client.rendering.v1.WorldRenderEvents; import net.fabricmc.fabric.api.event.player.AttackBlockCallback; +import net.fabricmc.fabric.api.event.player.UseBlockCallback; +import net.minecraft.block.Blocks; +import net.minecraft.client.MinecraftClient; +import net.minecraft.command.argument.BlockPosArgumentType; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.network.packet.s2c.play.ParticleS2CPacket; import net.minecraft.particle.ParticleTypes; +import net.minecraft.text.Text; import net.minecraft.util.ActionResult; import net.minecraft.util.DyeColor; import net.minecraft.util.Hand; +import net.minecraft.util.hit.BlockHitResult; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Direction; import net.minecraft.world.World; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; import java.util.HashMap; -import java.util.HashSet; import java.util.Map; -import java.util.Set; +import java.util.regex.Pattern; +import static net.fabricmc.fabric.api.client.command.v2.ClientCommandManager.argument; import static net.fabricmc.fabric.api.client.command.v2.ClientCommandManager.literal; public class MythologicalRitual { + private static final Pattern GRIFFIN_BURROW_DUG = Pattern.compile("(?You dug out a Griffin Burrow!|You finished the Griffin burrow chain!) \\((?\\d)/4\\)"); private static final Map particlesMap = new HashMap<>(); - private static final Set griffinBurrows = new HashSet<>(); + private static final Object2LongMap griffinBurrows = new Object2LongOpenHashMap<>(); + @Nullable + private static BlockPos lastDugBurrowPos; public static void init() { WorldRenderEvents.AFTER_TRANSLUCENT.register(MythologicalRitual::render); AttackBlockCallback.EVENT.register(MythologicalRitual::onAttackBlock); - ClientCommandRegistrationCallback.EVENT.register((dispatcher, registryAccess) -> dispatcher.register( - literal(SkyblockerMod.NAMESPACE).then(literal("diana").then(literal("clearGriffinBurrows").executes(context -> { + UseBlockCallback.EVENT.register(MythologicalRitual::onUseBlock); + ClientReceiveMessageEvents.GAME.register(MythologicalRitual::onChatMessage); + ClientCommandRegistrationCallback.EVENT.register((dispatcher, registryAccess) -> dispatcher.register(literal(SkyblockerMod.NAMESPACE).then(literal("diana") + .then(literal("clearGriffinBurrows").executes(context -> { griffinBurrows.clear(); return Command.SINGLE_SUCCESS; - })))) - ); + })) + .then(literal("clearGriffinBurrow").then(argument("pos", BlockPosArgumentType.blockPos()).executes(context -> { + griffinBurrows.removeLong(context.getArgument("pos", BlockPos.class)); + return Command.SINGLE_SUCCESS; + })))))); } public static void onParticle(ParticleS2CPacket packet) { - if (isActive()&& ParticleTypes.CRIT.equals(packet.getParameters().getType()) || ParticleTypes.ENCHANT.equals(packet.getParameters().getType())) { - BlockPos pos = BlockPos.ofFloored(packet.getX(), packet.getY(), packet.getZ()); + if (isActive() && ParticleTypes.CRIT.equals(packet.getParameters().getType()) || ParticleTypes.ENCHANT.equals(packet.getParameters().getType())) { + BlockPos pos = BlockPos.ofFloored(packet.getX(), packet.getY(), packet.getZ()).down(); + if (MinecraftClient.getInstance().world == null || !MinecraftClient.getInstance().world.getBlockState(pos).isOf(Blocks.GRASS_BLOCK)) { + return; + } BooleanBooleanMutablePair particlesAtPos = particlesMap.computeIfAbsent(pos, pos1 -> BooleanBooleanMutablePair.of(false, false)); particlesAtPos.left(particlesAtPos.leftBoolean() || ParticleTypes.CRIT.equals(packet.getParameters().getType())); particlesAtPos.right(particlesAtPos.rightBoolean() || ParticleTypes.ENCHANT.equals(packet.getParameters().getType())); - if (particlesAtPos.leftBoolean() && particlesAtPos.rightBoolean()) { - griffinBurrows.add(pos); + if (particlesAtPos.leftBoolean() && particlesAtPos.rightBoolean() && griffinBurrows.getLong(pos) + 1000 < System.currentTimeMillis()) { + griffinBurrows.put(pos, 0); } } } public static void render(WorldRenderContext context) { if (isActive()) { - for (BlockPos griffinBorrow : griffinBurrows) { - RenderHelper.renderFilledThroughWallsWithBeaconBeam(context, griffinBorrow, DyeColor.GREEN.getColorComponents(), 0.5F); + for (Object2LongMap.Entry griffinBorrow : griffinBurrows.object2LongEntrySet()) { + if (griffinBorrow.getLongValue() <= 0) { + RenderHelper.renderFilledThroughWallsWithBeaconBeam(context, griffinBorrow.getKey(), DyeColor.GREEN.getColorComponents(), 0.5F); + } } } } public static ActionResult onAttackBlock(PlayerEntity player, World world, Hand hand, BlockPos pos, Direction direction) { - if (isActive()) { - griffinBurrows.remove(pos); + return onInteractBlock(pos); + } + + public static ActionResult onUseBlock(PlayerEntity player, World world, Hand hand, BlockHitResult hitResult) { + return onInteractBlock(hitResult.getBlockPos()); + } + + @NotNull + private static ActionResult onInteractBlock(BlockPos pos) { + if (isActive() && griffinBurrows.containsKey(pos)) { + lastDugBurrowPos = pos; } return ActionResult.PASS; } + public static void onChatMessage(Text message, boolean overlay) { + if (isActive() && GRIFFIN_BURROW_DUG.matcher(message.getString()).matches()) { + griffinBurrows.put(lastDugBurrowPos, System.currentTimeMillis()); + } + } + private static boolean isActive() { - return SkyblockerConfig.get().general.fairySouls.enableFairySoulsHelper && Utils.getLocationRaw().equals("hub") ; // TODO Change to actual config option + return SkyblockerConfig.get().general.fairySouls.enableFairySoulsHelper && Utils.getLocationRaw().equals("hub"); // TODO Change to actual config option } } -- cgit From 58e43eee5c02efbe6144bfd6e4b1a95101d24576 Mon Sep 17 00:00:00 2001 From: Kevinthegreat <92656833+kevinthegreat1@users.noreply.github.com> Date: Thu, 28 Sep 2023 15:40:22 -0400 Subject: Add next burrow direction detection --- build.gradle | 9 ++- gradle.properties | 9 ++- .../skyblock/diana/MythologicalRitual.java | 89 ++++++++++++++++------ 3 files changed, 80 insertions(+), 27 deletions(-) diff --git a/build.gradle b/build.gradle index 66c56e21..fde768d5 100644 --- a/build.gradle +++ b/build.gradle @@ -72,14 +72,17 @@ dependencies { // BetterInject (https://github.com/caoimhebyrne/BetterInject) include implementation(annotationProcessor("com.github.cbyrneee:BetterInject:${project.betterinject_version}")) - // https://mvnrepository.com/artifact/org.eclipse.jgit/org.eclipse.jgit used pull data from the NEU item repo - include implementation("org.eclipse.jgit:org.eclipse.jgit:6.4.0.202211300538-r") - // Occlusion Culling (https://github.com/LogisticsCraft/OcclusionCulling) include implementation("com.logisticscraft:occlusionculling:${project.occlusionculling_version}") // NEU RepoParser include implementation("moe.nea:neurepoparser:${project.repoparser_version}") + + // JGit used pull data from the NEU item repo + include implementation("org.eclipse.jgit:org.eclipse.jgit:${project.jgit_version}") + + // Apache Commons Math + include implementation("org.apache.commons:commons-math3:${project.commons_math_version}") } loom { diff --git a/gradle.properties b/gradle.properties index c5794079..42529261 100644 --- a/gradle.properties +++ b/gradle.properties @@ -11,7 +11,7 @@ loader_version=0.14.22 ## 1.20 fabric_api_version=0.89.1+1.20.2 -# Dependencies +# Minecraft Mods ## YACL (https://github.com/isXander/YetAnotherConfigLib) yacl_version=3.2.1+1.20.2 ## Mod Menu (https://modrinth.com/mod/modmenu/versions) @@ -23,6 +23,7 @@ emi_version = 1.0.22+1.20.2 ## Renderer (https://github.com/0x3C50/Renderer) renderer_version = master-SNAPSHOT +# Minecraft and Related Libraries ## Mixin Extras (https://github.com/LlamaLad7/MixinExtras) mixin_extras_version = 0.2.0 ## Better Inject (https://github.com/caoimhebyrne/BetterInject) @@ -32,6 +33,12 @@ occlusionculling_version = 0.0.7-SNAPSHOT ## neu repoparser (https://repo.nea.moe/#/releases/moe/nea/neurepoparser/) repoparser_version = 1.4.0 +# Other Libraries +## JGit (https://mvnrepository.com/artifact/org.eclipse.jgit/org.eclipse.jgit) +jgit_version = 6.7.0.202309050840-r +## Apache Commons Math (https://mvnrepository.com/artifact/org.apache.commons/commons-math3) +commons_math_version = 3.6.1 + # Mod Properties mod_version = 1.15.0 maven_group = de.hysky diff --git a/src/main/java/me/xmrvizzy/skyblocker/skyblock/diana/MythologicalRitual.java b/src/main/java/me/xmrvizzy/skyblocker/skyblock/diana/MythologicalRitual.java index c74d5e77..ba27845a 100644 --- a/src/main/java/me/xmrvizzy/skyblocker/skyblock/diana/MythologicalRitual.java +++ b/src/main/java/me/xmrvizzy/skyblocker/skyblock/diana/MythologicalRitual.java @@ -1,9 +1,6 @@ package me.xmrvizzy.skyblocker.skyblock.diana; import com.mojang.brigadier.Command; -import it.unimi.dsi.fastutil.booleans.BooleanBooleanMutablePair; -import it.unimi.dsi.fastutil.objects.Object2LongMap; -import it.unimi.dsi.fastutil.objects.Object2LongOpenHashMap; import me.xmrvizzy.skyblocker.SkyblockerMod; import me.xmrvizzy.skyblocker.config.SkyblockerConfig; import me.xmrvizzy.skyblocker.utils.Utils; @@ -14,6 +11,7 @@ import net.fabricmc.fabric.api.client.rendering.v1.WorldRenderContext; import net.fabricmc.fabric.api.client.rendering.v1.WorldRenderEvents; import net.fabricmc.fabric.api.event.player.AttackBlockCallback; import net.fabricmc.fabric.api.event.player.UseBlockCallback; +import net.fabricmc.fabric.api.util.TriState; import net.minecraft.block.Blocks; import net.minecraft.client.MinecraftClient; import net.minecraft.command.argument.BlockPosArgumentType; @@ -27,7 +25,9 @@ import net.minecraft.util.Hand; import net.minecraft.util.hit.BlockHitResult; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Direction; +import net.minecraft.util.math.Vec3d; import net.minecraft.world.World; +import org.apache.commons.math3.stat.regression.SimpleRegression; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -40,10 +40,11 @@ import static net.fabricmc.fabric.api.client.command.v2.ClientCommandManager.lit public class MythologicalRitual { private static final Pattern GRIFFIN_BURROW_DUG = Pattern.compile("(?You dug out a Griffin Burrow!|You finished the Griffin burrow chain!) \\((?\\d)/4\\)"); - private static final Map particlesMap = new HashMap<>(); - private static final Object2LongMap griffinBurrows = new Object2LongOpenHashMap<>(); + private static final float[] WHITE_COLOR_COMPONENTS = {1.0f, 1.0f, 1.0f}; + private static final Map griffinBurrows = new HashMap<>(); @Nullable private static BlockPos lastDugBurrowPos; + private static GriffinBurrow previousBurrow; public static void init() { WorldRenderEvents.AFTER_TRANSLUCENT.register(MythologicalRitual::render); @@ -55,32 +56,57 @@ public class MythologicalRitual { griffinBurrows.clear(); return Command.SINGLE_SUCCESS; })) - .then(literal("clearGriffinBurrow").then(argument("pos", BlockPosArgumentType.blockPos()).executes(context -> { - griffinBurrows.removeLong(context.getArgument("pos", BlockPos.class)); - return Command.SINGLE_SUCCESS; - })))))); + .then(literal("clearGriffinBurrow") + .then(argument("pos", BlockPosArgumentType.blockPos()).executes(context -> { + griffinBurrows.remove(context.getArgument("pos", BlockPos.class)); + return Command.SINGLE_SUCCESS; + })) + ) + ))); } public static void onParticle(ParticleS2CPacket packet) { - if (isActive() && ParticleTypes.CRIT.equals(packet.getParameters().getType()) || ParticleTypes.ENCHANT.equals(packet.getParameters().getType())) { - BlockPos pos = BlockPos.ofFloored(packet.getX(), packet.getY(), packet.getZ()).down(); - if (MinecraftClient.getInstance().world == null || !MinecraftClient.getInstance().world.getBlockState(pos).isOf(Blocks.GRASS_BLOCK)) { - return; - } - BooleanBooleanMutablePair particlesAtPos = particlesMap.computeIfAbsent(pos, pos1 -> BooleanBooleanMutablePair.of(false, false)); - particlesAtPos.left(particlesAtPos.leftBoolean() || ParticleTypes.CRIT.equals(packet.getParameters().getType())); - particlesAtPos.right(particlesAtPos.rightBoolean() || ParticleTypes.ENCHANT.equals(packet.getParameters().getType())); - if (particlesAtPos.leftBoolean() && particlesAtPos.rightBoolean() && griffinBurrows.getLong(pos) + 1000 < System.currentTimeMillis()) { - griffinBurrows.put(pos, 0); + if (isActive()) { + if (ParticleTypes.CRIT.equals(packet.getParameters().getType()) || ParticleTypes.ENCHANT.equals(packet.getParameters().getType())) { + BlockPos pos = BlockPos.ofFloored(packet.getX(), packet.getY(), packet.getZ()).down(); + if (MinecraftClient.getInstance().world == null || !MinecraftClient.getInstance().world.getBlockState(pos).isOf(Blocks.GRASS_BLOCK)) { + return; + } + GriffinBurrow burrow = griffinBurrows.computeIfAbsent(pos, pos1 -> new GriffinBurrow()); + if (ParticleTypes.CRIT.equals(packet.getParameters().getType())) burrow.critParticle++; + if (ParticleTypes.ENCHANT.equals(packet.getParameters().getType())) burrow.enchantParticle++; + if (burrow.critParticle >= 5 && burrow.enchantParticle >= 5 && burrow.confirmed == TriState.FALSE) { + griffinBurrows.get(pos).init(); + } + } else if (ParticleTypes.DUST.equals(packet.getParameters().getType())) { + BlockPos pos = BlockPos.ofFloored(packet.getX(), packet.getY(), packet.getZ()).down(2); + GriffinBurrow burrow = griffinBurrows.get(pos); + if (burrow == null) { + return; + } + burrow.regression.addData(packet.getX(), packet.getZ()); + double slope = burrow.regression.getSlope(); + if (Double.isNaN(slope)) { + return; + } + Vec3d nextBurrowDirection = new Vec3d(100, 2, slope * 100).normalize().multiply(500); + burrow.nextBurrowPlane = new Vec3d[]{ + Vec3d.of(pos).add(nextBurrowDirection), + Vec3d.of(pos).subtract(nextBurrowDirection) + }; } } } public static void render(WorldRenderContext context) { if (isActive()) { - for (Object2LongMap.Entry griffinBorrow : griffinBurrows.object2LongEntrySet()) { - if (griffinBorrow.getLongValue() <= 0) { - RenderHelper.renderFilledThroughWallsWithBeaconBeam(context, griffinBorrow.getKey(), DyeColor.GREEN.getColorComponents(), 0.5F); + for (Map.Entry burrowEntry : griffinBurrows.entrySet()) { + GriffinBurrow burrow = burrowEntry.getValue(); + if (burrow.confirmed == TriState.TRUE) { + RenderHelper.renderFilledThroughWallsWithBeaconBeam(context, burrowEntry.getKey(), DyeColor.GREEN.getColorComponents(), 0.5F); + } + if (burrow.confirmed != TriState.FALSE && burrow.nextBurrowPlane != null) { // TODO try before debug render? + RenderHelper.renderLinesFromPoints(context, burrow.nextBurrowPlane, WHITE_COLOR_COMPONENTS, 1, 5); } } } @@ -104,11 +130,28 @@ public class MythologicalRitual { public static void onChatMessage(Text message, boolean overlay) { if (isActive() && GRIFFIN_BURROW_DUG.matcher(message.getString()).matches()) { - griffinBurrows.put(lastDugBurrowPos, System.currentTimeMillis()); + if (previousBurrow != null) { + previousBurrow.confirmed = TriState.FALSE; + } + previousBurrow = griffinBurrows.get(lastDugBurrowPos); + previousBurrow.confirmed = TriState.DEFAULT; } } private static boolean isActive() { return SkyblockerConfig.get().general.fairySouls.enableFairySoulsHelper && Utils.getLocationRaw().equals("hub"); // TODO Change to actual config option } + + private static class GriffinBurrow { + private int critParticle; + private int enchantParticle; + private TriState confirmed = TriState.FALSE; + private final SimpleRegression regression = new SimpleRegression(); + private Vec3d[] nextBurrowPlane; + + private void init() { + confirmed = TriState.TRUE; + regression.clear(); + } + } } -- cgit From 5ff7319a944232c643a3641c759902256e12584d Mon Sep 17 00:00:00 2001 From: Kevinthegreat <92656833+kevinthegreat1@users.noreply.github.com> Date: Sat, 30 Sep 2023 13:15:55 -0400 Subject: Add echo detection --- .../skyblocker/utils/render/RenderHelper.java | 58 +++++++++++++++------- .../skyblock/diana/MythologicalRitual.java | 58 +++++++++++++++++----- 2 files changed, 86 insertions(+), 30 deletions(-) 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 5ab698a7..14e6d103 100644 --- a/src/main/java/de/hysky/skyblocker/utils/render/RenderHelper.java +++ b/src/main/java/de/hysky/skyblocker/utils/render/RenderHelper.java @@ -22,7 +22,6 @@ import net.minecraft.util.math.Box; import net.minecraft.util.math.Vec3d; import org.joml.Matrix3f; import org.joml.Matrix4f; -import org.joml.Vector3f; import org.lwjgl.opengl.GL11; import java.awt.*; @@ -111,6 +110,8 @@ public class RenderHelper { * Draws lines from point to point.

    *

    * Tip: To draw lines from the center of a block, offset the X, Y and Z each by 0.5 + *

    + * Note: This is super messed up when drawing long lines. Tried different normals and {@link DrawMode#LINES} but nothing worked. * * @param context The WorldRenderContext which supplies the matrices and tick delta * @param points The points from which to draw lines between @@ -127,7 +128,7 @@ public class RenderHelper { Tessellator tessellator = RenderSystem.renderThreadTesselator(); BufferBuilder buffer = tessellator.getBuffer(); - Matrix4f projectionMatrix = matrices.peek().getPositionMatrix(); + Matrix4f positionMatrix = matrices.peek().getPositionMatrix(); Matrix3f normalMatrix = matrices.peek().getNormalMatrix(); GL11.glEnable(GL11.GL_LINE_SMOOTH); @@ -144,14 +145,11 @@ public class RenderHelper { buffer.begin(DrawMode.LINE_STRIP, VertexFormats.LINES); for (int i = 0; i < points.length; i++) { - Vec3d point = points[i]; - Vec3d nextPoint = (i + 1 == points.length) ? points[i - 1] : points[i + 1]; - Vector3f normalVec = new Vector3f((float) nextPoint.getX(), (float) nextPoint.getY(), (float) nextPoint.getZ()).sub((float) point.getX(), (float) point.getY(), (float) point.getZ()).normalize(); - + Vec3d normalVec = points[(i + 1) % points.length].subtract(points[i]).normalize(); buffer - .vertex(projectionMatrix, (float) point.getX(), (float) point.getY(), (float) point.getZ()) + .vertex(positionMatrix, (float) points[i].getX(), (float) points[i].getY(), (float) points[i].getZ()) .color(colorComponents[0], colorComponents[1], colorComponents[2], alpha) - .normal(normalMatrix, normalVec.x, normalVec.y, normalVec.z) + .normal(normalMatrix, (float) normalVec.x, (float) normalVec.y, (float) normalVec.z) .next(); } @@ -166,24 +164,50 @@ public class RenderHelper { RenderSystem.disableDepthTest(); } - public static void renderText(WorldRenderContext context, Text text, Vec3d pos, boolean seeThrough) { - renderText(context, text, pos, 1, seeThrough); + public static void renderQuad(WorldRenderContext context, Vec3d[] points, float[] colorComponents, float alpha, boolean throughWalls) { + Vec3d camera = context.camera().getPos(); + MatrixStack matrices = context.matrixStack(); + + matrices.push(); + matrices.translate(-camera.x, -camera.y, -camera.z); + + Tessellator tessellator = RenderSystem.renderThreadTesselator(); + BufferBuilder buffer = tessellator.getBuffer(); + Matrix4f positionMatrix = matrices.peek().getPositionMatrix(); + + RenderSystem.setShader(GameRenderer::getPositionColorProgram); + RenderSystem.setShaderColor(1f, 1f, 1f, 1f); + RenderSystem.depthFunc(throughWalls ? GL11.GL_ALWAYS : GL11.GL_LEQUAL); + + buffer.begin(DrawMode.QUADS, VertexFormats.POSITION_COLOR); + for (int i = 0; i < 4; i++) { + buffer.vertex(positionMatrix, (float) points[i].getX(), (float) points[i].getY(), (float) points[i].getZ()).color(colorComponents[0], colorComponents[1], colorComponents[2], alpha).next(); + } + tessellator.draw(); + + RenderSystem.depthFunc(GL11.GL_LEQUAL); + + matrices.pop(); + } + + public static void renderText(WorldRenderContext context, Text text, Vec3d pos, boolean throughWalls) { + renderText(context, text, pos, 1, throughWalls); } - public static void renderText(WorldRenderContext context, Text text, Vec3d pos, float scale, boolean seeThrough) { - renderText(context, text, pos, scale, 0, seeThrough); + public static void renderText(WorldRenderContext context, Text text, Vec3d pos, float scale, boolean throughWalls) { + renderText(context, text, pos, scale, 0, throughWalls); } - public static void renderText(WorldRenderContext context, Text text, Vec3d pos, float scale, float yOffset, boolean seeThrough) { - renderText(context, text.asOrderedText(), pos, scale, yOffset, seeThrough); + public static void renderText(WorldRenderContext context, Text text, Vec3d pos, float scale, float yOffset, boolean throughWalls) { + renderText(context, text.asOrderedText(), pos, scale, yOffset, throughWalls); } /** * Renders text in the world space. * - * @param seeThrough Whether the text should be able to be seen through walls or not. + * @param throughWalls whether the text should be able to be seen through walls or not. */ - public static void renderText(WorldRenderContext context, OrderedText text, Vec3d pos, float scale, float yOffset, boolean seeThrough) { + public static void renderText(WorldRenderContext context, OrderedText text, Vec3d pos, float scale, float yOffset, boolean throughWalls) { MatrixStack matrices = context.matrixStack(); Vec3d camera = context.camera().getPos(); TextRenderer textRenderer = client.textRenderer; @@ -203,7 +227,7 @@ public class RenderHelper { BufferBuilder buffer = tessellator.getBuffer(); VertexConsumerProvider.Immediate consumers = VertexConsumerProvider.immediate(buffer); - RenderSystem.depthFunc(seeThrough ? GL11.GL_ALWAYS : GL11.GL_LEQUAL); + RenderSystem.depthFunc(throughWalls ? GL11.GL_ALWAYS : GL11.GL_LEQUAL); textRenderer.draw(text, xOffset, yOffset, 0xFFFFFFFF, false, positionMatrix, consumers, TextRenderer.TextLayerType.SEE_THROUGH, 0, LightmapTextureManager.MAX_LIGHT_COORDINATE); consumers.draw(); diff --git a/src/main/java/me/xmrvizzy/skyblocker/skyblock/diana/MythologicalRitual.java b/src/main/java/me/xmrvizzy/skyblocker/skyblock/diana/MythologicalRitual.java index ba27845a..62462f56 100644 --- a/src/main/java/me/xmrvizzy/skyblocker/skyblock/diana/MythologicalRitual.java +++ b/src/main/java/me/xmrvizzy/skyblocker/skyblock/diana/MythologicalRitual.java @@ -40,11 +40,11 @@ import static net.fabricmc.fabric.api.client.command.v2.ClientCommandManager.lit public class MythologicalRitual { private static final Pattern GRIFFIN_BURROW_DUG = Pattern.compile("(?You dug out a Griffin Burrow!|You finished the Griffin burrow chain!) \\((?\\d)/4\\)"); - private static final float[] WHITE_COLOR_COMPONENTS = {1.0f, 1.0f, 1.0f}; + private static final float[] ORANGE_COLOR_COMPONENTS = DyeColor.ORANGE.getColorComponents(); private static final Map griffinBurrows = new HashMap<>(); @Nullable private static BlockPos lastDugBurrowPos; - private static GriffinBurrow previousBurrow; + private static GriffinBurrow previousBurrow = new GriffinBurrow(); public static void init() { WorldRenderEvents.AFTER_TRANSLUCENT.register(MythologicalRitual::render); @@ -63,6 +63,10 @@ public class MythologicalRitual { })) ) ))); + + // Put a root burrow so echo detection works without a previous burrow + previousBurrow.confirmed = TriState.DEFAULT; + griffinBurrows.put(BlockPos.ORIGIN, previousBurrow); } public static void onParticle(ParticleS2CPacket packet) { @@ -89,24 +93,51 @@ public class MythologicalRitual { if (Double.isNaN(slope)) { return; } - Vec3d nextBurrowDirection = new Vec3d(100, 2, slope * 100).normalize().multiply(500); - burrow.nextBurrowPlane = new Vec3d[]{ - Vec3d.of(pos).add(nextBurrowDirection), - Vec3d.of(pos).subtract(nextBurrowDirection) - }; + Vec3d nextBurrowDirection = new Vec3d(100, 0, slope * 100).normalize().multiply(100); + if (burrow.nextBurrowPlane == null) { + burrow.nextBurrowPlane = new Vec3d[4]; + } + burrow.nextBurrowPlane[0] = Vec3d.of(pos).add(nextBurrowDirection).subtract(0, 50, 0); + burrow.nextBurrowPlane[1] = Vec3d.of(pos).subtract(nextBurrowDirection).subtract(0, 50, 0); + burrow.nextBurrowPlane[2] = burrow.nextBurrowPlane[1].add(0, 100, 0); + burrow.nextBurrowPlane[3] = burrow.nextBurrowPlane[0].add(0, 100, 0); + } else if (ParticleTypes.DRIPPING_LAVA.equals(packet.getParameters().getType())) { + if (previousBurrow.echoBurrowDirection == null) { + previousBurrow.echoBurrowDirection = new Vec3d[2]; + } + previousBurrow.echoBurrowDirection[0] = previousBurrow.echoBurrowDirection[1]; + previousBurrow.echoBurrowDirection[1] = new Vec3d(packet.getX(), packet.getY(), packet.getZ()); + if (previousBurrow.echoBurrowDirection[0] == null || previousBurrow.echoBurrowDirection[1] == null) { + return; + } + Vec3d echoBurrowDirection = previousBurrow.echoBurrowDirection[1].subtract(previousBurrow.echoBurrowDirection[0]).normalize().multiply(100); + if (previousBurrow.echoBurrowPlane == null) { + previousBurrow.echoBurrowPlane = new Vec3d[4]; + } + previousBurrow.echoBurrowPlane[0] = previousBurrow.echoBurrowDirection[0].add(echoBurrowDirection).subtract(0, 50, 0); + previousBurrow.echoBurrowPlane[1] = previousBurrow.echoBurrowDirection[0].subtract(echoBurrowDirection).subtract(0, 50, 0); + previousBurrow.echoBurrowPlane[2] = previousBurrow.echoBurrowPlane[0].add(0, 100, 0); + previousBurrow.echoBurrowPlane[3] = previousBurrow.echoBurrowPlane[1].add(0, 100, 0); } } } public static void render(WorldRenderContext context) { + RenderHelper.renderLinesFromPoints(context, new Vec3d[]{new Vec3d(0, 96, -100), new Vec3d(0, 96, 100)}, ORANGE_COLOR_COMPONENTS, 0.25F, 5); // TODO debug + RenderHelper.renderQuad(context, new Vec3d[]{new Vec3d(0, 100, -100), new Vec3d(0, 100, 100), new Vec3d(0, 200, 100), new Vec3d(0, 200, -100)}, ORANGE_COLOR_COMPONENTS, 0.25F, true); // TODO debug if (isActive()) { for (Map.Entry burrowEntry : griffinBurrows.entrySet()) { GriffinBurrow burrow = burrowEntry.getValue(); if (burrow.confirmed == TriState.TRUE) { - RenderHelper.renderFilledThroughWallsWithBeaconBeam(context, burrowEntry.getKey(), DyeColor.GREEN.getColorComponents(), 0.5F); + RenderHelper.renderFilledThroughWallsWithBeaconBeam(context, burrowEntry.getKey(), ORANGE_COLOR_COMPONENTS, 0.25F); } - if (burrow.confirmed != TriState.FALSE && burrow.nextBurrowPlane != null) { // TODO try before debug render? - RenderHelper.renderLinesFromPoints(context, burrow.nextBurrowPlane, WHITE_COLOR_COMPONENTS, 1, 5); + if (burrow.confirmed != TriState.FALSE) { + if (burrow.nextBurrowPlane != null) { + RenderHelper.renderLinesFromPoints(context, burrow.nextBurrowPlane, ORANGE_COLOR_COMPONENTS, 0.25F, 5); + } + if (burrow.echoBurrowPlane != null) { + RenderHelper.renderLinesFromPoints(context, burrow.echoBurrowPlane, ORANGE_COLOR_COMPONENTS, 0.25F, 5); + } } } } @@ -130,9 +161,7 @@ public class MythologicalRitual { public static void onChatMessage(Text message, boolean overlay) { if (isActive() && GRIFFIN_BURROW_DUG.matcher(message.getString()).matches()) { - if (previousBurrow != null) { - previousBurrow.confirmed = TriState.FALSE; - } + previousBurrow.confirmed = TriState.FALSE; previousBurrow = griffinBurrows.get(lastDugBurrowPos); previousBurrow.confirmed = TriState.DEFAULT; } @@ -148,6 +177,9 @@ public class MythologicalRitual { private TriState confirmed = TriState.FALSE; private final SimpleRegression regression = new SimpleRegression(); private Vec3d[] nextBurrowPlane; + @Nullable + private Vec3d[] echoBurrowDirection; + private Vec3d[] echoBurrowPlane; private void init() { confirmed = TriState.TRUE; -- cgit From 594f1d34b51cc49cea90003262f77e0974e5b62d Mon Sep 17 00:00:00 2001 From: Kevinthegreat <92656833+kevinthegreat1@users.noreply.github.com> Date: Sun, 1 Oct 2023 00:17:04 -0400 Subject: Add config option --- .../java/de/hysky/skyblocker/config/SkyblockerConfig.java | 9 ++++++++- .../hysky/skyblocker/config/categories/GeneralCategory.java | 13 +++++++++++++ .../skyblocker/skyblock/diana/MythologicalRitual.java | 4 ++-- src/main/resources/assets/skyblocker/lang/en_us.json | 2 ++ 4 files changed, 25 insertions(+), 3 deletions(-) diff --git a/src/main/java/de/hysky/skyblocker/config/SkyblockerConfig.java b/src/main/java/de/hysky/skyblocker/config/SkyblockerConfig.java index d7279bc8..5f8f47d0 100644 --- a/src/main/java/de/hysky/skyblocker/config/SkyblockerConfig.java +++ b/src/main/java/de/hysky/skyblocker/config/SkyblockerConfig.java @@ -176,6 +176,9 @@ public class SkyblockerConfig { @SerialEntry public FairySouls fairySouls = new FairySouls(); + @SerialEntry + public MythologicalRitual mythologicalRitual = new MythologicalRitual(); + @SerialEntry public ItemCooldown itemCooldown = new ItemCooldown(); @@ -322,6 +325,11 @@ public class SkyblockerConfig { public boolean highlightOnlyNearbySouls = false; } + public static class MythologicalRitual { + @SerialEntry + public boolean enableMythologicalRitualHelper = true; + } + public static class ItemCooldown { @SerialEntry public boolean enableItemCooldowns = true; @@ -653,7 +661,6 @@ public class SkyblockerConfig { @SerialEntry public Formatting incompleteColor = Formatting.BLUE; - } public static class LividColor { 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 30bdbd3f..60deedd2 100644 --- a/src/main/java/de/hysky/skyblocker/config/categories/GeneralCategory.java +++ b/src/main/java/de/hysky/skyblocker/config/categories/GeneralCategory.java @@ -200,6 +200,19 @@ public class GeneralCategory { .build()) .build()) + //Mythological Ritual + .group(OptionGroup.createBuilder() + .name(Text.translatable("text.autoconfig.skyblocker.option.general.mythologicalRitual")) + .collapsed(true) + .option(Option.createBuilder() + .name(Text.translatable("text.autoconfig.skyblocker.option.general.mythologicalRitual.enableMythologicalRitualHelper")) + .binding(defaults.general.mythologicalRitual.enableMythologicalRitualHelper, + () -> config.general.mythologicalRitual.enableMythologicalRitualHelper, + newValue -> config.general.mythologicalRitual.enableMythologicalRitualHelper = newValue) + .controller(BooleanControllerBuilder::create) + .build()) + .build()) + //Item Cooldown .group(OptionGroup.createBuilder() .name(Text.translatable("text.autoconfig.skyblocker.option.general.itemCooldown")) diff --git a/src/main/java/me/xmrvizzy/skyblocker/skyblock/diana/MythologicalRitual.java b/src/main/java/me/xmrvizzy/skyblocker/skyblock/diana/MythologicalRitual.java index 62462f56..72607037 100644 --- a/src/main/java/me/xmrvizzy/skyblocker/skyblock/diana/MythologicalRitual.java +++ b/src/main/java/me/xmrvizzy/skyblocker/skyblock/diana/MythologicalRitual.java @@ -2,7 +2,7 @@ package me.xmrvizzy.skyblocker.skyblock.diana; import com.mojang.brigadier.Command; import me.xmrvizzy.skyblocker.SkyblockerMod; -import me.xmrvizzy.skyblocker.config.SkyblockerConfig; +import me.xmrvizzy.skyblocker.config.SkyblockerConfigManager; import me.xmrvizzy.skyblocker.utils.Utils; import me.xmrvizzy.skyblocker.utils.render.RenderHelper; import net.fabricmc.fabric.api.client.command.v2.ClientCommandRegistrationCallback; @@ -168,7 +168,7 @@ public class MythologicalRitual { } private static boolean isActive() { - return SkyblockerConfig.get().general.fairySouls.enableFairySoulsHelper && Utils.getLocationRaw().equals("hub"); // TODO Change to actual config option + return SkyblockerConfigManager.get().general.mythologicalRitual.enableMythologicalRitualHelper && Utils.getLocationRaw().equals("hub"); } private static class GriffinBurrow { diff --git a/src/main/resources/assets/skyblocker/lang/en_us.json b/src/main/resources/assets/skyblocker/lang/en_us.json index f02eb319..aaa21814 100644 --- a/src/main/resources/assets/skyblocker/lang/en_us.json +++ b/src/main/resources/assets/skyblocker/lang/en_us.json @@ -38,6 +38,8 @@ "text.autoconfig.skyblocker.option.general.fairySouls.highlightFoundSouls": "Highlight found fairy souls", "text.autoconfig.skyblocker.option.general.fairySouls.highlightOnlyNearbySouls": "Only highlight nearby fairy souls", "text.autoconfig.skyblocker.option.general.fairySouls.highlightOnlyNearbySouls.@Tooltip": "When enabled only fairy souls in a radius of 50 blocks are highlighted", + "text.autoconfig.skyblocker.option.general.mythologicalRitual": "Mythological Ritual Helper", + "text.autoconfig.skyblocker.option.general.mythologicalRitual.enableMythologicalRitualHelper": "Enable Mythological Ritual Helper", "text.autoconfig.skyblocker.option.general.itemCooldown": "Item Cooldown", "text.autoconfig.skyblocker.option.general.itemCooldown.enableItemCooldowns": "Enable Item Cooldown", "text.autoconfig.skyblocker.option.general.shortcuts": "Shortcuts", -- cgit From cd3ebd6e9411bdd909bcd68ab6c33aad5b52f07e Mon Sep 17 00:00:00 2001 From: Kevinthegreat <92656833+kevinthegreat1@users.noreply.github.com> Date: Thu, 5 Oct 2023 10:53:26 -0400 Subject: Fix RenderHelper#renderQuad --- .../java/de/hysky/skyblocker/utils/render/RenderHelper.java | 11 +++++------ .../skyblocker/skyblock/diana/MythologicalRitual.java | 6 ++---- 2 files changed, 7 insertions(+), 10 deletions(-) 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 14e6d103..ec03b05f 100644 --- a/src/main/java/de/hysky/skyblocker/utils/render/RenderHelper.java +++ b/src/main/java/de/hysky/skyblocker/utils/render/RenderHelper.java @@ -1,7 +1,5 @@ package de.hysky.skyblocker.utils.render; -import com.mojang.blaze3d.platform.GlStateManager.DstFactor; -import com.mojang.blaze3d.platform.GlStateManager.SrcFactor; import com.mojang.blaze3d.systems.RenderSystem; import de.hysky.skyblocker.mixin.accessor.BeaconBlockEntityRendererInvoker; import me.x150.renderer.render.Renderer3d; @@ -138,7 +136,7 @@ public class RenderHelper { RenderSystem.setShaderColor(1f, 1f, 1f, 1f); RenderSystem.lineWidth(lineWidth); RenderSystem.enableBlend(); - RenderSystem.blendFunc(SrcFactor.SRC_ALPHA, DstFactor.ONE_MINUS_SRC_ALPHA); + RenderSystem.defaultBlendFunc(); RenderSystem.disableCull(); RenderSystem.enableDepthTest(); @@ -158,10 +156,7 @@ public class RenderHelper { matrices.pop(); GL11.glDisable(GL11.GL_LINE_SMOOTH); RenderSystem.lineWidth(1f); - RenderSystem.disableBlend(); - RenderSystem.defaultBlendFunc(); RenderSystem.enableCull(); - RenderSystem.disableDepthTest(); } public static void renderQuad(WorldRenderContext context, Vec3d[] points, float[] colorComponents, float alpha, boolean throughWalls) { @@ -177,6 +172,9 @@ public class RenderHelper { RenderSystem.setShader(GameRenderer::getPositionColorProgram); RenderSystem.setShaderColor(1f, 1f, 1f, 1f); + RenderSystem.enableBlend(); + RenderSystem.defaultBlendFunc(); + RenderSystem.disableCull(); RenderSystem.depthFunc(throughWalls ? GL11.GL_ALWAYS : GL11.GL_LEQUAL); buffer.begin(DrawMode.QUADS, VertexFormats.POSITION_COLOR); @@ -185,6 +183,7 @@ public class RenderHelper { } tessellator.draw(); + RenderSystem.enableCull(); RenderSystem.depthFunc(GL11.GL_LEQUAL); matrices.pop(); diff --git a/src/main/java/me/xmrvizzy/skyblocker/skyblock/diana/MythologicalRitual.java b/src/main/java/me/xmrvizzy/skyblocker/skyblock/diana/MythologicalRitual.java index 72607037..f17d4195 100644 --- a/src/main/java/me/xmrvizzy/skyblocker/skyblock/diana/MythologicalRitual.java +++ b/src/main/java/me/xmrvizzy/skyblocker/skyblock/diana/MythologicalRitual.java @@ -123,8 +123,6 @@ public class MythologicalRitual { } public static void render(WorldRenderContext context) { - RenderHelper.renderLinesFromPoints(context, new Vec3d[]{new Vec3d(0, 96, -100), new Vec3d(0, 96, 100)}, ORANGE_COLOR_COMPONENTS, 0.25F, 5); // TODO debug - RenderHelper.renderQuad(context, new Vec3d[]{new Vec3d(0, 100, -100), new Vec3d(0, 100, 100), new Vec3d(0, 200, 100), new Vec3d(0, 200, -100)}, ORANGE_COLOR_COMPONENTS, 0.25F, true); // TODO debug if (isActive()) { for (Map.Entry burrowEntry : griffinBurrows.entrySet()) { GriffinBurrow burrow = burrowEntry.getValue(); @@ -133,10 +131,10 @@ public class MythologicalRitual { } if (burrow.confirmed != TriState.FALSE) { if (burrow.nextBurrowPlane != null) { - RenderHelper.renderLinesFromPoints(context, burrow.nextBurrowPlane, ORANGE_COLOR_COMPONENTS, 0.25F, 5); + RenderHelper.renderQuad(context, burrow.nextBurrowPlane, ORANGE_COLOR_COMPONENTS, 0.25F, true); } if (burrow.echoBurrowPlane != null) { - RenderHelper.renderLinesFromPoints(context, burrow.echoBurrowPlane, ORANGE_COLOR_COMPONENTS, 0.25F, 5); + RenderHelper.renderQuad(context, burrow.echoBurrowPlane, ORANGE_COLOR_COMPONENTS, 0.25F, true); } } } -- cgit From fe3d568ae318f608e28ca29df6d028768c545e0a Mon Sep 17 00:00:00 2001 From: Kevinthegreat <92656833+kevinthegreat1@users.noreply.github.com> Date: Thu, 5 Oct 2023 11:13:30 -0400 Subject: Update boolean controller --- .../java/de/hysky/skyblocker/config/categories/GeneralCategory.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 60deedd2..f1f64130 100644 --- a/src/main/java/de/hysky/skyblocker/config/categories/GeneralCategory.java +++ b/src/main/java/de/hysky/skyblocker/config/categories/GeneralCategory.java @@ -209,7 +209,7 @@ public class GeneralCategory { .binding(defaults.general.mythologicalRitual.enableMythologicalRitualHelper, () -> config.general.mythologicalRitual.enableMythologicalRitualHelper, newValue -> config.general.mythologicalRitual.enableMythologicalRitualHelper = newValue) - .controller(BooleanControllerBuilder::create) + .controller(ConfigUtils::createBooleanController) .build()) .build()) -- cgit From b7a13ad892135540a4512afbadf9d5233a329e74 Mon Sep 17 00:00:00 2001 From: Kevinthegreat <92656833+kevinthegreat1@users.noreply.github.com> Date: Tue, 10 Oct 2023 10:46:59 -0400 Subject: Update group name --- .../java/de/hysky/skyblocker/SkyblockerMod.java | 6 +- .../skyblock/diana/MythologicalRitual.java | 187 +++++++++++++++++++++ .../skyblock/diana/MythologicalRitual.java | 187 --------------------- 3 files changed, 190 insertions(+), 190 deletions(-) create mode 100644 src/main/java/de/hysky/skyblocker/skyblock/diana/MythologicalRitual.java delete mode 100644 src/main/java/me/xmrvizzy/skyblocker/skyblock/diana/MythologicalRitual.java diff --git a/src/main/java/de/hysky/skyblocker/SkyblockerMod.java b/src/main/java/de/hysky/skyblocker/SkyblockerMod.java index e18a8c83..dc8896cf 100644 --- a/src/main/java/de/hysky/skyblocker/SkyblockerMod.java +++ b/src/main/java/de/hysky/skyblocker/SkyblockerMod.java @@ -2,14 +2,13 @@ package de.hysky.skyblocker; import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import de.hysky.skyblocker.config.SkyblockerConfigManager; import de.hysky.skyblocker.skyblock.*; import de.hysky.skyblocker.skyblock.diana.MythologicalRitual; import de.hysky.skyblocker.skyblock.dungeon.*; import de.hysky.skyblocker.skyblock.dungeon.secrets.DungeonSecrets; -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.item.*; import de.hysky.skyblocker.skyblock.itemlist.ItemRepository; import de.hysky.skyblocker.skyblock.quicknav.QuickNav; import de.hysky.skyblocker.skyblock.rift.TheRift; @@ -17,6 +16,7 @@ import de.hysky.skyblocker.skyblock.shortcut.Shortcuts; 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.screenbuilder.ScreenMaster; import de.hysky.skyblocker.skyblock.tabhud.util.PlayerListMgr; import de.hysky.skyblocker.utils.NEURepoManager; import de.hysky.skyblocker.utils.Utils; diff --git a/src/main/java/de/hysky/skyblocker/skyblock/diana/MythologicalRitual.java b/src/main/java/de/hysky/skyblocker/skyblock/diana/MythologicalRitual.java new file mode 100644 index 00000000..ea7b39cf --- /dev/null +++ b/src/main/java/de/hysky/skyblocker/skyblock/diana/MythologicalRitual.java @@ -0,0 +1,187 @@ +package de.hysky.skyblocker.skyblock.diana; + +import com.mojang.brigadier.Command; +import de.hysky.skyblocker.SkyblockerMod; +import de.hysky.skyblocker.config.SkyblockerConfigManager; +import de.hysky.skyblocker.utils.Utils; +import de.hysky.skyblocker.utils.render.RenderHelper; +import net.fabricmc.fabric.api.client.command.v2.ClientCommandRegistrationCallback; +import net.fabricmc.fabric.api.client.message.v1.ClientReceiveMessageEvents; +import net.fabricmc.fabric.api.client.rendering.v1.WorldRenderContext; +import net.fabricmc.fabric.api.client.rendering.v1.WorldRenderEvents; +import net.fabricmc.fabric.api.event.player.AttackBlockCallback; +import net.fabricmc.fabric.api.event.player.UseBlockCallback; +import net.fabricmc.fabric.api.util.TriState; +import net.minecraft.block.Blocks; +import net.minecraft.client.MinecraftClient; +import net.minecraft.command.argument.BlockPosArgumentType; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.network.packet.s2c.play.ParticleS2CPacket; +import net.minecraft.particle.ParticleTypes; +import net.minecraft.text.Text; +import net.minecraft.util.ActionResult; +import net.minecraft.util.DyeColor; +import net.minecraft.util.Hand; +import net.minecraft.util.hit.BlockHitResult; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Direction; +import net.minecraft.util.math.Vec3d; +import net.minecraft.world.World; +import org.apache.commons.math3.stat.regression.SimpleRegression; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.HashMap; +import java.util.Map; +import java.util.regex.Pattern; + +import static net.fabricmc.fabric.api.client.command.v2.ClientCommandManager.argument; +import static net.fabricmc.fabric.api.client.command.v2.ClientCommandManager.literal; + +public class MythologicalRitual { + private static final Pattern GRIFFIN_BURROW_DUG = Pattern.compile("(?You dug out a Griffin Burrow!|You finished the Griffin burrow chain!) \\((?\\d)/4\\)"); + private static final float[] ORANGE_COLOR_COMPONENTS = DyeColor.ORANGE.getColorComponents(); + private static final Map griffinBurrows = new HashMap<>(); + @Nullable + private static BlockPos lastDugBurrowPos; + private static GriffinBurrow previousBurrow = new GriffinBurrow(); + + public static void init() { + WorldRenderEvents.AFTER_TRANSLUCENT.register(MythologicalRitual::render); + AttackBlockCallback.EVENT.register(MythologicalRitual::onAttackBlock); + UseBlockCallback.EVENT.register(MythologicalRitual::onUseBlock); + ClientReceiveMessageEvents.GAME.register(MythologicalRitual::onChatMessage); + ClientCommandRegistrationCallback.EVENT.register((dispatcher, registryAccess) -> dispatcher.register(literal(SkyblockerMod.NAMESPACE).then(literal("diana") + .then(literal("clearGriffinBurrows").executes(context -> { + griffinBurrows.clear(); + return Command.SINGLE_SUCCESS; + })) + .then(literal("clearGriffinBurrow") + .then(argument("pos", BlockPosArgumentType.blockPos()).executes(context -> { + griffinBurrows.remove(context.getArgument("pos", BlockPos.class)); + return Command.SINGLE_SUCCESS; + })) + ) + ))); + + // Put a root burrow so echo detection works without a previous burrow + previousBurrow.confirmed = TriState.DEFAULT; + griffinBurrows.put(BlockPos.ORIGIN, previousBurrow); + } + + public static void onParticle(ParticleS2CPacket packet) { + if (isActive()) { + if (ParticleTypes.CRIT.equals(packet.getParameters().getType()) || ParticleTypes.ENCHANT.equals(packet.getParameters().getType())) { + BlockPos pos = BlockPos.ofFloored(packet.getX(), packet.getY(), packet.getZ()).down(); + if (MinecraftClient.getInstance().world == null || !MinecraftClient.getInstance().world.getBlockState(pos).isOf(Blocks.GRASS_BLOCK)) { + return; + } + GriffinBurrow burrow = griffinBurrows.computeIfAbsent(pos, pos1 -> new GriffinBurrow()); + if (ParticleTypes.CRIT.equals(packet.getParameters().getType())) burrow.critParticle++; + if (ParticleTypes.ENCHANT.equals(packet.getParameters().getType())) burrow.enchantParticle++; + if (burrow.critParticle >= 5 && burrow.enchantParticle >= 5 && burrow.confirmed == TriState.FALSE) { + griffinBurrows.get(pos).init(); + } + } else if (ParticleTypes.DUST.equals(packet.getParameters().getType())) { + BlockPos pos = BlockPos.ofFloored(packet.getX(), packet.getY(), packet.getZ()).down(2); + GriffinBurrow burrow = griffinBurrows.get(pos); + if (burrow == null) { + return; + } + burrow.regression.addData(packet.getX(), packet.getZ()); + double slope = burrow.regression.getSlope(); + if (Double.isNaN(slope)) { + return; + } + Vec3d nextBurrowDirection = new Vec3d(100, 0, slope * 100).normalize().multiply(100); + if (burrow.nextBurrowPlane == null) { + burrow.nextBurrowPlane = new Vec3d[4]; + } + burrow.nextBurrowPlane[0] = Vec3d.of(pos).add(nextBurrowDirection).subtract(0, 50, 0); + burrow.nextBurrowPlane[1] = Vec3d.of(pos).subtract(nextBurrowDirection).subtract(0, 50, 0); + burrow.nextBurrowPlane[2] = burrow.nextBurrowPlane[1].add(0, 100, 0); + burrow.nextBurrowPlane[3] = burrow.nextBurrowPlane[0].add(0, 100, 0); + } else if (ParticleTypes.DRIPPING_LAVA.equals(packet.getParameters().getType())) { + if (previousBurrow.echoBurrowDirection == null) { + previousBurrow.echoBurrowDirection = new Vec3d[2]; + } + previousBurrow.echoBurrowDirection[0] = previousBurrow.echoBurrowDirection[1]; + previousBurrow.echoBurrowDirection[1] = new Vec3d(packet.getX(), packet.getY(), packet.getZ()); + if (previousBurrow.echoBurrowDirection[0] == null || previousBurrow.echoBurrowDirection[1] == null) { + return; + } + Vec3d echoBurrowDirection = previousBurrow.echoBurrowDirection[1].subtract(previousBurrow.echoBurrowDirection[0]).normalize().multiply(100); + if (previousBurrow.echoBurrowPlane == null) { + previousBurrow.echoBurrowPlane = new Vec3d[4]; + } + previousBurrow.echoBurrowPlane[0] = previousBurrow.echoBurrowDirection[0].add(echoBurrowDirection).subtract(0, 50, 0); + previousBurrow.echoBurrowPlane[1] = previousBurrow.echoBurrowDirection[0].subtract(echoBurrowDirection).subtract(0, 50, 0); + previousBurrow.echoBurrowPlane[2] = previousBurrow.echoBurrowPlane[0].add(0, 100, 0); + previousBurrow.echoBurrowPlane[3] = previousBurrow.echoBurrowPlane[1].add(0, 100, 0); + } + } + } + + public static void render(WorldRenderContext context) { + if (isActive()) { + for (Map.Entry burrowEntry : griffinBurrows.entrySet()) { + GriffinBurrow burrow = burrowEntry.getValue(); + if (burrow.confirmed == TriState.TRUE) { + RenderHelper.renderFilledThroughWallsWithBeaconBeam(context, burrowEntry.getKey(), ORANGE_COLOR_COMPONENTS, 0.25F); + } + if (burrow.confirmed != TriState.FALSE) { + if (burrow.nextBurrowPlane != null) { + RenderHelper.renderQuad(context, burrow.nextBurrowPlane, ORANGE_COLOR_COMPONENTS, 0.25F, true); + } + if (burrow.echoBurrowPlane != null) { + RenderHelper.renderQuad(context, burrow.echoBurrowPlane, ORANGE_COLOR_COMPONENTS, 0.25F, true); + } + } + } + } + } + + public static ActionResult onAttackBlock(PlayerEntity player, World world, Hand hand, BlockPos pos, Direction direction) { + return onInteractBlock(pos); + } + + public static ActionResult onUseBlock(PlayerEntity player, World world, Hand hand, BlockHitResult hitResult) { + return onInteractBlock(hitResult.getBlockPos()); + } + + @NotNull + private static ActionResult onInteractBlock(BlockPos pos) { + if (isActive() && griffinBurrows.containsKey(pos)) { + lastDugBurrowPos = pos; + } + return ActionResult.PASS; + } + + public static void onChatMessage(Text message, boolean overlay) { + if (isActive() && GRIFFIN_BURROW_DUG.matcher(message.getString()).matches()) { + previousBurrow.confirmed = TriState.FALSE; + previousBurrow = griffinBurrows.get(lastDugBurrowPos); + previousBurrow.confirmed = TriState.DEFAULT; + } + } + + private static boolean isActive() { + return SkyblockerConfigManager.get().general.mythologicalRitual.enableMythologicalRitualHelper && Utils.getLocationRaw().equals("hub"); + } + + private static class GriffinBurrow { + private int critParticle; + private int enchantParticle; + private TriState confirmed = TriState.FALSE; + private final SimpleRegression regression = new SimpleRegression(); + private Vec3d[] nextBurrowPlane; + @Nullable + private Vec3d[] echoBurrowDirection; + private Vec3d[] echoBurrowPlane; + + private void init() { + confirmed = TriState.TRUE; + regression.clear(); + } + } +} diff --git a/src/main/java/me/xmrvizzy/skyblocker/skyblock/diana/MythologicalRitual.java b/src/main/java/me/xmrvizzy/skyblocker/skyblock/diana/MythologicalRitual.java deleted file mode 100644 index f17d4195..00000000 --- a/src/main/java/me/xmrvizzy/skyblocker/skyblock/diana/MythologicalRitual.java +++ /dev/null @@ -1,187 +0,0 @@ -package me.xmrvizzy.skyblocker.skyblock.diana; - -import com.mojang.brigadier.Command; -import me.xmrvizzy.skyblocker.SkyblockerMod; -import me.xmrvizzy.skyblocker.config.SkyblockerConfigManager; -import me.xmrvizzy.skyblocker.utils.Utils; -import me.xmrvizzy.skyblocker.utils.render.RenderHelper; -import net.fabricmc.fabric.api.client.command.v2.ClientCommandRegistrationCallback; -import net.fabricmc.fabric.api.client.message.v1.ClientReceiveMessageEvents; -import net.fabricmc.fabric.api.client.rendering.v1.WorldRenderContext; -import net.fabricmc.fabric.api.client.rendering.v1.WorldRenderEvents; -import net.fabricmc.fabric.api.event.player.AttackBlockCallback; -import net.fabricmc.fabric.api.event.player.UseBlockCallback; -import net.fabricmc.fabric.api.util.TriState; -import net.minecraft.block.Blocks; -import net.minecraft.client.MinecraftClient; -import net.minecraft.command.argument.BlockPosArgumentType; -import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.network.packet.s2c.play.ParticleS2CPacket; -import net.minecraft.particle.ParticleTypes; -import net.minecraft.text.Text; -import net.minecraft.util.ActionResult; -import net.minecraft.util.DyeColor; -import net.minecraft.util.Hand; -import net.minecraft.util.hit.BlockHitResult; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Direction; -import net.minecraft.util.math.Vec3d; -import net.minecraft.world.World; -import org.apache.commons.math3.stat.regression.SimpleRegression; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -import java.util.HashMap; -import java.util.Map; -import java.util.regex.Pattern; - -import static net.fabricmc.fabric.api.client.command.v2.ClientCommandManager.argument; -import static net.fabricmc.fabric.api.client.command.v2.ClientCommandManager.literal; - -public class MythologicalRitual { - private static final Pattern GRIFFIN_BURROW_DUG = Pattern.compile("(?You dug out a Griffin Burrow!|You finished the Griffin burrow chain!) \\((?\\d)/4\\)"); - private static final float[] ORANGE_COLOR_COMPONENTS = DyeColor.ORANGE.getColorComponents(); - private static final Map griffinBurrows = new HashMap<>(); - @Nullable - private static BlockPos lastDugBurrowPos; - private static GriffinBurrow previousBurrow = new GriffinBurrow(); - - public static void init() { - WorldRenderEvents.AFTER_TRANSLUCENT.register(MythologicalRitual::render); - AttackBlockCallback.EVENT.register(MythologicalRitual::onAttackBlock); - UseBlockCallback.EVENT.register(MythologicalRitual::onUseBlock); - ClientReceiveMessageEvents.GAME.register(MythologicalRitual::onChatMessage); - ClientCommandRegistrationCallback.EVENT.register((dispatcher, registryAccess) -> dispatcher.register(literal(SkyblockerMod.NAMESPACE).then(literal("diana") - .then(literal("clearGriffinBurrows").executes(context -> { - griffinBurrows.clear(); - return Command.SINGLE_SUCCESS; - })) - .then(literal("clearGriffinBurrow") - .then(argument("pos", BlockPosArgumentType.blockPos()).executes(context -> { - griffinBurrows.remove(context.getArgument("pos", BlockPos.class)); - return Command.SINGLE_SUCCESS; - })) - ) - ))); - - // Put a root burrow so echo detection works without a previous burrow - previousBurrow.confirmed = TriState.DEFAULT; - griffinBurrows.put(BlockPos.ORIGIN, previousBurrow); - } - - public static void onParticle(ParticleS2CPacket packet) { - if (isActive()) { - if (ParticleTypes.CRIT.equals(packet.getParameters().getType()) || ParticleTypes.ENCHANT.equals(packet.getParameters().getType())) { - BlockPos pos = BlockPos.ofFloored(packet.getX(), packet.getY(), packet.getZ()).down(); - if (MinecraftClient.getInstance().world == null || !MinecraftClient.getInstance().world.getBlockState(pos).isOf(Blocks.GRASS_BLOCK)) { - return; - } - GriffinBurrow burrow = griffinBurrows.computeIfAbsent(pos, pos1 -> new GriffinBurrow()); - if (ParticleTypes.CRIT.equals(packet.getParameters().getType())) burrow.critParticle++; - if (ParticleTypes.ENCHANT.equals(packet.getParameters().getType())) burrow.enchantParticle++; - if (burrow.critParticle >= 5 && burrow.enchantParticle >= 5 && burrow.confirmed == TriState.FALSE) { - griffinBurrows.get(pos).init(); - } - } else if (ParticleTypes.DUST.equals(packet.getParameters().getType())) { - BlockPos pos = BlockPos.ofFloored(packet.getX(), packet.getY(), packet.getZ()).down(2); - GriffinBurrow burrow = griffinBurrows.get(pos); - if (burrow == null) { - return; - } - burrow.regression.addData(packet.getX(), packet.getZ()); - double slope = burrow.regression.getSlope(); - if (Double.isNaN(slope)) { - return; - } - Vec3d nextBurrowDirection = new Vec3d(100, 0, slope * 100).normalize().multiply(100); - if (burrow.nextBurrowPlane == null) { - burrow.nextBurrowPlane = new Vec3d[4]; - } - burrow.nextBurrowPlane[0] = Vec3d.of(pos).add(nextBurrowDirection).subtract(0, 50, 0); - burrow.nextBurrowPlane[1] = Vec3d.of(pos).subtract(nextBurrowDirection).subtract(0, 50, 0); - burrow.nextBurrowPlane[2] = burrow.nextBurrowPlane[1].add(0, 100, 0); - burrow.nextBurrowPlane[3] = burrow.nextBurrowPlane[0].add(0, 100, 0); - } else if (ParticleTypes.DRIPPING_LAVA.equals(packet.getParameters().getType())) { - if (previousBurrow.echoBurrowDirection == null) { - previousBurrow.echoBurrowDirection = new Vec3d[2]; - } - previousBurrow.echoBurrowDirection[0] = previousBurrow.echoBurrowDirection[1]; - previousBurrow.echoBurrowDirection[1] = new Vec3d(packet.getX(), packet.getY(), packet.getZ()); - if (previousBurrow.echoBurrowDirection[0] == null || previousBurrow.echoBurrowDirection[1] == null) { - return; - } - Vec3d echoBurrowDirection = previousBurrow.echoBurrowDirection[1].subtract(previousBurrow.echoBurrowDirection[0]).normalize().multiply(100); - if (previousBurrow.echoBurrowPlane == null) { - previousBurrow.echoBurrowPlane = new Vec3d[4]; - } - previousBurrow.echoBurrowPlane[0] = previousBurrow.echoBurrowDirection[0].add(echoBurrowDirection).subtract(0, 50, 0); - previousBurrow.echoBurrowPlane[1] = previousBurrow.echoBurrowDirection[0].subtract(echoBurrowDirection).subtract(0, 50, 0); - previousBurrow.echoBurrowPlane[2] = previousBurrow.echoBurrowPlane[0].add(0, 100, 0); - previousBurrow.echoBurrowPlane[3] = previousBurrow.echoBurrowPlane[1].add(0, 100, 0); - } - } - } - - public static void render(WorldRenderContext context) { - if (isActive()) { - for (Map.Entry burrowEntry : griffinBurrows.entrySet()) { - GriffinBurrow burrow = burrowEntry.getValue(); - if (burrow.confirmed == TriState.TRUE) { - RenderHelper.renderFilledThroughWallsWithBeaconBeam(context, burrowEntry.getKey(), ORANGE_COLOR_COMPONENTS, 0.25F); - } - if (burrow.confirmed != TriState.FALSE) { - if (burrow.nextBurrowPlane != null) { - RenderHelper.renderQuad(context, burrow.nextBurrowPlane, ORANGE_COLOR_COMPONENTS, 0.25F, true); - } - if (burrow.echoBurrowPlane != null) { - RenderHelper.renderQuad(context, burrow.echoBurrowPlane, ORANGE_COLOR_COMPONENTS, 0.25F, true); - } - } - } - } - } - - public static ActionResult onAttackBlock(PlayerEntity player, World world, Hand hand, BlockPos pos, Direction direction) { - return onInteractBlock(pos); - } - - public static ActionResult onUseBlock(PlayerEntity player, World world, Hand hand, BlockHitResult hitResult) { - return onInteractBlock(hitResult.getBlockPos()); - } - - @NotNull - private static ActionResult onInteractBlock(BlockPos pos) { - if (isActive() && griffinBurrows.containsKey(pos)) { - lastDugBurrowPos = pos; - } - return ActionResult.PASS; - } - - public static void onChatMessage(Text message, boolean overlay) { - if (isActive() && GRIFFIN_BURROW_DUG.matcher(message.getString()).matches()) { - previousBurrow.confirmed = TriState.FALSE; - previousBurrow = griffinBurrows.get(lastDugBurrowPos); - previousBurrow.confirmed = TriState.DEFAULT; - } - } - - private static boolean isActive() { - return SkyblockerConfigManager.get().general.mythologicalRitual.enableMythologicalRitualHelper && Utils.getLocationRaw().equals("hub"); - } - - private static class GriffinBurrow { - private int critParticle; - private int enchantParticle; - private TriState confirmed = TriState.FALSE; - private final SimpleRegression regression = new SimpleRegression(); - private Vec3d[] nextBurrowPlane; - @Nullable - private Vec3d[] echoBurrowDirection; - private Vec3d[] echoBurrowPlane; - - private void init() { - confirmed = TriState.TRUE; - regression.clear(); - } - } -} -- cgit From 99a4bbc07ad8d916476ba87304aec9015cdcbbdb Mon Sep 17 00:00:00 2001 From: Kevinthegreat <92656833+kevinthegreat1@users.noreply.github.com> Date: Tue, 10 Oct 2023 10:56:58 -0400 Subject: Refactor imports --- src/main/java/de/hysky/skyblocker/config/SkyblockerConfig.java | 4 ++-- .../java/de/hysky/skyblocker/config/categories/GeneralCategory.java | 4 ++-- .../java/de/hysky/skyblocker/mixin/ClientPlayNetworkHandlerMixin.java | 2 +- src/main/java/de/hysky/skyblocker/utils/render/RenderHelper.java | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/de/hysky/skyblocker/config/SkyblockerConfig.java b/src/main/java/de/hysky/skyblocker/config/SkyblockerConfig.java index 5f8f47d0..9d5e95f5 100644 --- a/src/main/java/de/hysky/skyblocker/config/SkyblockerConfig.java +++ b/src/main/java/de/hysky/skyblocker/config/SkyblockerConfig.java @@ -1,11 +1,11 @@ package de.hysky.skyblocker.config; +import de.hysky.skyblocker.skyblock.item.CustomArmorTrims; +import de.hysky.skyblocker.utils.chat.ChatFilterResult; import dev.isxander.yacl3.config.v2.api.SerialEntry; import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap; import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet; -import de.hysky.skyblocker.skyblock.item.CustomArmorTrims; -import de.hysky.skyblocker.utils.chat.ChatFilterResult; import net.minecraft.client.resource.language.I18n; import net.minecraft.text.Text; import net.minecraft.util.Formatting; 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 f1f64130..a20f962d 100644 --- a/src/main/java/de/hysky/skyblocker/config/categories/GeneralCategory.java +++ b/src/main/java/de/hysky/skyblocker/config/categories/GeneralCategory.java @@ -2,12 +2,12 @@ package de.hysky.skyblocker.config.categories; import de.hysky.skyblocker.config.ConfigUtils; import de.hysky.skyblocker.config.SkyblockerConfig; +import de.hysky.skyblocker.skyblock.shortcut.ShortcutsConfigScreen; +import de.hysky.skyblocker.utils.render.title.TitleContainerConfigScreen; import dev.isxander.yacl3.api.*; import dev.isxander.yacl3.api.controller.FloatFieldControllerBuilder; import dev.isxander.yacl3.api.controller.FloatSliderControllerBuilder; import dev.isxander.yacl3.api.controller.IntegerSliderControllerBuilder; -import de.hysky.skyblocker.skyblock.shortcut.ShortcutsConfigScreen; -import de.hysky.skyblocker.utils.render.title.TitleContainerConfigScreen; import net.minecraft.client.MinecraftClient; import net.minecraft.text.Text; diff --git a/src/main/java/de/hysky/skyblocker/mixin/ClientPlayNetworkHandlerMixin.java b/src/main/java/de/hysky/skyblocker/mixin/ClientPlayNetworkHandlerMixin.java index 7615a8e1..f68a4e94 100644 --- a/src/main/java/de/hysky/skyblocker/mixin/ClientPlayNetworkHandlerMixin.java +++ b/src/main/java/de/hysky/skyblocker/mixin/ClientPlayNetworkHandlerMixin.java @@ -2,11 +2,11 @@ package de.hysky.skyblocker.mixin; import com.llamalad7.mixinextras.injector.WrapWithCondition; import com.llamalad7.mixinextras.sugar.Local; -import dev.cbyrne.betterinject.annotations.Inject; import de.hysky.skyblocker.skyblock.FishingHelper; import de.hysky.skyblocker.skyblock.diana.MythologicalRitual; import de.hysky.skyblocker.skyblock.dungeon.secrets.DungeonSecrets; import de.hysky.skyblocker.utils.Utils; +import dev.cbyrne.betterinject.annotations.Inject; import net.minecraft.client.MinecraftClient; import net.minecraft.client.network.ClientPlayNetworkHandler; import net.minecraft.entity.ItemEntity; 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 ec03b05f..4cfaef8f 100644 --- a/src/main/java/de/hysky/skyblocker/utils/render/RenderHelper.java +++ b/src/main/java/de/hysky/skyblocker/utils/render/RenderHelper.java @@ -2,10 +2,10 @@ package de.hysky.skyblocker.utils.render; import com.mojang.blaze3d.systems.RenderSystem; import de.hysky.skyblocker.mixin.accessor.BeaconBlockEntityRendererInvoker; -import me.x150.renderer.render.Renderer3d; import de.hysky.skyblocker.utils.render.culling.OcclusionCulling; import de.hysky.skyblocker.utils.render.title.Title; import de.hysky.skyblocker.utils.render.title.TitleContainer; +import me.x150.renderer.render.Renderer3d; import net.fabricmc.fabric.api.client.rendering.v1.WorldRenderContext; import net.minecraft.client.MinecraftClient; import net.minecraft.client.font.TextRenderer; -- cgit From 993e8fd81ab90042b921e597353eb57d67ee56ff Mon Sep 17 00:00:00 2001 From: Kevinthegreat <92656833+kevinthegreat1@users.noreply.github.com> Date: Sun, 22 Oct 2023 23:20:43 -0400 Subject: Fix indents --- .../config/categories/GeneralCategory.java | 24 +++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) 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 a20f962d..10b21891 100644 --- a/src/main/java/de/hysky/skyblocker/config/categories/GeneralCategory.java +++ b/src/main/java/de/hysky/skyblocker/config/categories/GeneralCategory.java @@ -200,18 +200,18 @@ public class GeneralCategory { .build()) .build()) - //Mythological Ritual - .group(OptionGroup.createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.general.mythologicalRitual")) - .collapsed(true) - .option(Option.createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.general.mythologicalRitual.enableMythologicalRitualHelper")) - .binding(defaults.general.mythologicalRitual.enableMythologicalRitualHelper, - () -> config.general.mythologicalRitual.enableMythologicalRitualHelper, - newValue -> config.general.mythologicalRitual.enableMythologicalRitualHelper = newValue) - .controller(ConfigUtils::createBooleanController) - .build()) - .build()) + //Mythological Ritual + .group(OptionGroup.createBuilder() + .name(Text.translatable("text.autoconfig.skyblocker.option.general.mythologicalRitual")) + .collapsed(true) + .option(Option.createBuilder() + .name(Text.translatable("text.autoconfig.skyblocker.option.general.mythologicalRitual.enableMythologicalRitualHelper")) + .binding(defaults.general.mythologicalRitual.enableMythologicalRitualHelper, + () -> config.general.mythologicalRitual.enableMythologicalRitualHelper, + newValue -> config.general.mythologicalRitual.enableMythologicalRitualHelper = newValue) + .controller(ConfigUtils::createBooleanController) + .build()) + .build()) //Item Cooldown .group(OptionGroup.createBuilder() -- cgit From a96eb865678e178028493be597794bba8f503bde Mon Sep 17 00:00:00 2001 From: Yasin Date: Mon, 23 Oct 2023 05:34:44 +0200 Subject: Update README.md (#382) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 18797225..d9a217c7 100644 --- a/README.md +++ b/README.md @@ -204,4 +204,4 @@ Norwegian Bokmål ([KdGaming0](https://github.com/KdGaming0)) \ Norwegian Nynorsk ([KdGaming0](https://github.com/KdGaming0)) \ Turkish ([Fix3dll](https://github.com/Fix3dll)) \ Canadian English ([AzureAaron](https://github.com/AzureAaron)) \ -Portuguese (Brazil) ([OhRetro](https://github.com/OhRetro)) \ No newline at end of file +Portuguese (Brazil) ([OhRetro](https://github.com/OhRetro) & [AurinVPK](https://github.com/AurinVPK)) \ No newline at end of file -- cgit From 879ca0fbd7abfbfecf0502deb2cde16f510b39cb Mon Sep 17 00:00:00 2001 From: Aaron <51387595+AzureAaron@users.noreply.github.com> Date: Wed, 25 Oct 2023 13:13:22 -0400 Subject: Item Rarity Backgrounds compatibility with Backpack Preview (#384) --- .../skyblocker/skyblock/item/BackpackPreview.java | 24 +++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/src/main/java/de/hysky/skyblocker/skyblock/item/BackpackPreview.java b/src/main/java/de/hysky/skyblocker/skyblock/item/BackpackPreview.java index 122ffe9b..f856a255 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/item/BackpackPreview.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/item/BackpackPreview.java @@ -2,6 +2,7 @@ package de.hysky.skyblocker.skyblock.item; import com.mojang.blaze3d.systems.RenderSystem; import de.hysky.skyblocker.SkyblockerMod; +import de.hysky.skyblocker.config.SkyblockerConfigManager; import de.hysky.skyblocker.utils.Utils; import net.fabricmc.fabric.api.client.screen.v1.ScreenEvents; import net.fabricmc.loader.api.FabricLoader; @@ -146,27 +147,36 @@ public class BackpackPreview { int x = mouseX + 184 >= screen.width ? mouseX - 188 : mouseX + 8; int y = Math.max(0, mouseY - 16); - RenderSystem.disableDepthTest(); - RenderSystem.setShaderTexture(0, TEXTURE); + MatrixStack matrices = context.getMatrices(); + matrices.push(); + matrices.translate(0f, 0f, 400f); + + RenderSystem.enableDepthTest(); context.drawTexture(TEXTURE, x, y, 0, 0, 176, 7); for (int i = 0; i < rows; ++i) { context.drawTexture(TEXTURE, x, y + i * 18 + 7, 0, 7, 176, 18); } context.drawTexture(TEXTURE, x, y + rows * 18 + 7, 0, 25, 176, 7); - RenderSystem.enableDepthTest(); - MatrixStack matrices = context.getMatrices(); TextRenderer textRenderer = MinecraftClient.getInstance().textRenderer; for (int i = 9; i < storage[index].size(); ++i) { + ItemStack currentStack = storage[index].getStack(i); int itemX = x + (i - 9) % 9 * 18 + 8; int itemY = y + (i - 9) / 9 * 18 + 8; + + if (SkyblockerConfigManager.get().general.itemInfoDisplay.itemRarityBackgrounds) { + ItemRarityBackgrounds.tryDraw(currentStack, context, itemX, itemY); + } + matrices.push(); - matrices.translate(0, 0, 200); - context.drawItem(storage[index].getStack(i), itemX, itemY); - context.drawItemInSlot(textRenderer, storage[index].getStack(i), itemX, itemY); + matrices.translate(0f, 0f, 200f); + context.drawItem(currentStack, itemX, itemY); + context.drawItemInSlot(textRenderer, currentStack, itemX, itemY); matrices.pop(); } + matrices.pop(); + return true; } -- cgit From fe1f8bc4c660c37e21db11bdb4c6d6f8cc5b6986 Mon Sep 17 00:00:00 2001 From: Kevin <92656833+kevinthegreat1@users.noreply.github.com> Date: Wed, 25 Oct 2023 13:13:27 -0400 Subject: Fix echo detection activating (#385) --- .../skyblock/diana/MythologicalRitual.java | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/src/main/java/de/hysky/skyblocker/skyblock/diana/MythologicalRitual.java b/src/main/java/de/hysky/skyblocker/skyblock/diana/MythologicalRitual.java index ea7b39cf..c407e911 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/diana/MythologicalRitual.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/diana/MythologicalRitual.java @@ -3,6 +3,7 @@ package de.hysky.skyblocker.skyblock.diana; import com.mojang.brigadier.Command; import de.hysky.skyblocker.SkyblockerMod; import de.hysky.skyblocker.config.SkyblockerConfigManager; +import de.hysky.skyblocker.utils.ItemUtils; import de.hysky.skyblocker.utils.Utils; import de.hysky.skyblocker.utils.render.RenderHelper; import net.fabricmc.fabric.api.client.command.v2.ClientCommandRegistrationCallback; @@ -11,17 +12,20 @@ import net.fabricmc.fabric.api.client.rendering.v1.WorldRenderContext; import net.fabricmc.fabric.api.client.rendering.v1.WorldRenderEvents; import net.fabricmc.fabric.api.event.player.AttackBlockCallback; import net.fabricmc.fabric.api.event.player.UseBlockCallback; +import net.fabricmc.fabric.api.event.player.UseItemCallback; import net.fabricmc.fabric.api.util.TriState; import net.minecraft.block.Blocks; import net.minecraft.client.MinecraftClient; import net.minecraft.command.argument.BlockPosArgumentType; import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.item.ItemStack; import net.minecraft.network.packet.s2c.play.ParticleS2CPacket; import net.minecraft.particle.ParticleTypes; import net.minecraft.text.Text; import net.minecraft.util.ActionResult; import net.minecraft.util.DyeColor; import net.minecraft.util.Hand; +import net.minecraft.util.TypedActionResult; import net.minecraft.util.hit.BlockHitResult; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Direction; @@ -41,6 +45,7 @@ import static net.fabricmc.fabric.api.client.command.v2.ClientCommandManager.lit public class MythologicalRitual { private static final Pattern GRIFFIN_BURROW_DUG = Pattern.compile("(?You dug out a Griffin Burrow!|You finished the Griffin burrow chain!) \\((?\\d)/4\\)"); private static final float[] ORANGE_COLOR_COMPONENTS = DyeColor.ORANGE.getColorComponents(); + private static long lastEchoTime; private static final Map griffinBurrows = new HashMap<>(); @Nullable private static BlockPos lastDugBurrowPos; @@ -50,6 +55,7 @@ public class MythologicalRitual { WorldRenderEvents.AFTER_TRANSLUCENT.register(MythologicalRitual::render); AttackBlockCallback.EVENT.register(MythologicalRitual::onAttackBlock); UseBlockCallback.EVENT.register(MythologicalRitual::onUseBlock); + UseItemCallback.EVENT.register(MythologicalRitual::onUseItem); ClientReceiveMessageEvents.GAME.register(MythologicalRitual::onChatMessage); ClientCommandRegistrationCallback.EVENT.register((dispatcher, registryAccess) -> dispatcher.register(literal(SkyblockerMod.NAMESPACE).then(literal("diana") .then(literal("clearGriffinBurrows").executes(context -> { @@ -102,6 +108,9 @@ public class MythologicalRitual { burrow.nextBurrowPlane[2] = burrow.nextBurrowPlane[1].add(0, 100, 0); burrow.nextBurrowPlane[3] = burrow.nextBurrowPlane[0].add(0, 100, 0); } else if (ParticleTypes.DRIPPING_LAVA.equals(packet.getParameters().getType())) { + if (System.currentTimeMillis() > lastEchoTime + 10_000) { + return; + } if (previousBurrow.echoBurrowDirection == null) { previousBurrow.echoBurrowDirection = new Vec3d[2]; } @@ -116,8 +125,8 @@ public class MythologicalRitual { } previousBurrow.echoBurrowPlane[0] = previousBurrow.echoBurrowDirection[0].add(echoBurrowDirection).subtract(0, 50, 0); previousBurrow.echoBurrowPlane[1] = previousBurrow.echoBurrowDirection[0].subtract(echoBurrowDirection).subtract(0, 50, 0); - previousBurrow.echoBurrowPlane[2] = previousBurrow.echoBurrowPlane[0].add(0, 100, 0); - previousBurrow.echoBurrowPlane[3] = previousBurrow.echoBurrowPlane[1].add(0, 100, 0); + previousBurrow.echoBurrowPlane[2] = previousBurrow.echoBurrowPlane[1].add(0, 100, 0); + previousBurrow.echoBurrowPlane[3] = previousBurrow.echoBurrowPlane[0].add(0, 100, 0); } } } @@ -157,6 +166,14 @@ public class MythologicalRitual { return ActionResult.PASS; } + public static TypedActionResult onUseItem(PlayerEntity player, World world, Hand hand) { + ItemStack stack = player.getStackInHand(hand); + if (isActive() && ItemUtils.getItemId(stack).equals("ANCESTRAL_SPADE")) { + lastEchoTime = System.currentTimeMillis(); + } + return TypedActionResult.pass(stack); + } + public static void onChatMessage(Text message, boolean overlay) { if (isActive() && GRIFFIN_BURROW_DUG.matcher(message.getString()).matches()) { previousBurrow.confirmed = TriState.FALSE; -- cgit From 292567ff8a77dfb8bae100ab74bc77ab01f76482 Mon Sep 17 00:00:00 2001 From: Kevinthegreat <92656833+kevinthegreat1@users.noreply.github.com> Date: Wed, 25 Oct 2023 09:27:15 -0400 Subject: Update backpack preview background --- .../hysky/skyblocker/skyblock/item/BackpackPreview.java | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/main/java/de/hysky/skyblocker/skyblock/item/BackpackPreview.java b/src/main/java/de/hysky/skyblocker/skyblock/item/BackpackPreview.java index f856a255..79432bd4 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/item/BackpackPreview.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/item/BackpackPreview.java @@ -1,7 +1,6 @@ package de.hysky.skyblocker.skyblock.item; import com.mojang.blaze3d.systems.RenderSystem; -import de.hysky.skyblocker.SkyblockerMod; import de.hysky.skyblocker.config.SkyblockerConfigManager; import de.hysky.skyblocker.utils.Utils; import net.fabricmc.fabric.api.client.screen.v1.ScreenEvents; @@ -24,12 +23,13 @@ import java.io.File; import java.nio.file.Path; import java.util.ArrayList; import java.util.List; +import java.util.Objects; import java.util.regex.Matcher; import java.util.regex.Pattern; public class BackpackPreview { private static final Logger LOGGER = LoggerFactory.getLogger(BackpackPreview.class); - private static final Identifier TEXTURE = new Identifier(SkyblockerMod.NAMESPACE, "textures/gui/inventory_background.png"); + private static final Identifier TEXTURE = new Identifier("textures/gui/container/generic_54.png"); private static final Pattern ECHEST_PATTERN = Pattern.compile("Ender Chest.*\\((\\d+)/\\d+\\)"); private static final Pattern BACKPACK_PATTERN = Pattern.compile("Backpack.*\\(Slot #(\\d+)\\)"); private static final int STORAGE_SIZE = 27; @@ -56,7 +56,7 @@ public class BackpackPreview { // update save dir based on uuid and sb profile String uuid = MinecraftClient.getInstance().getSession().getUuidOrNull().toString().replaceAll("-", ""); String profile = Utils.getProfile(); - if (profile != null && !profile.isEmpty()) { + if (!profile.isEmpty()) { save_dir = FabricLoader.getInstance().getConfigDir().resolve("skyblocker/backpack-preview/" + uuid + "/" + profile); save_dir.toFile().mkdirs(); if (loaded.equals(uuid + "/" + profile)) { @@ -84,7 +84,7 @@ public class BackpackPreview { if (file.isFile()) { try { NbtCompound root = NbtIo.read(file); - storage[index] = new DummyInventory(root); + storage[index] = new DummyInventory(Objects.requireNonNull(root)); } catch (Exception e) { LOGGER.error("Failed to load backpack preview file: " + file.getName(), e); } @@ -152,11 +152,8 @@ public class BackpackPreview { matrices.translate(0f, 0f, 400f); RenderSystem.enableDepthTest(); - context.drawTexture(TEXTURE, x, y, 0, 0, 176, 7); - for (int i = 0; i < rows; ++i) { - context.drawTexture(TEXTURE, x, y + i * 18 + 7, 0, 7, 176, 18); - } - context.drawTexture(TEXTURE, x, y + rows * 18 + 7, 0, 25, 176, 7); + context.drawTexture(TEXTURE, x, y, 0, 0, 176, rows * 18 + 17); + context.drawTexture(TEXTURE, x, y + rows * 18 + 17, 0, 126, 176, 96); TextRenderer textRenderer = MinecraftClient.getInstance().textRenderer; for (int i = 9; i < storage[index].size(); ++i) { -- cgit From 7f447a6c341ce3268a6fcff89e4ef54955cdd626 Mon Sep 17 00:00:00 2001 From: Kevinthegreat <92656833+kevinthegreat1@users.noreply.github.com> Date: Wed, 25 Oct 2023 12:47:08 -0400 Subject: Update backpack preview background --- src/main/java/de/hysky/skyblocker/skyblock/item/BackpackPreview.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/de/hysky/skyblocker/skyblock/item/BackpackPreview.java b/src/main/java/de/hysky/skyblocker/skyblock/item/BackpackPreview.java index 79432bd4..19ef99b8 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/item/BackpackPreview.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/item/BackpackPreview.java @@ -152,8 +152,9 @@ public class BackpackPreview { matrices.translate(0f, 0f, 400f); RenderSystem.enableDepthTest(); - context.drawTexture(TEXTURE, x, y, 0, 0, 176, rows * 18 + 17); - context.drawTexture(TEXTURE, x, y + rows * 18 + 17, 0, 126, 176, 96); + context.drawTexture(TEXTURE, x, y, 0, 0, 176, 7); + context.drawTexture(TEXTURE, x, y + 7, 0, 17, 176, rows * 18); + context.drawTexture(TEXTURE, x, y + rows * 18 + 7, 0, 215, 176, 7); TextRenderer textRenderer = MinecraftClient.getInstance().textRenderer; for (int i = 9; i < storage[index].size(); ++i) { -- cgit From 44a35dee12a033cfbaf14801d412a3359a065628 Mon Sep 17 00:00:00 2001 From: Kevinthegreat <92656833+kevinthegreat1@users.noreply.github.com> Date: Wed, 25 Oct 2023 19:44:22 -0400 Subject: Add storage name --- .../skyblocker/skyblock/item/BackpackPreview.java | 177 ++++++++++++--------- 1 file changed, 100 insertions(+), 77 deletions(-) diff --git a/src/main/java/de/hysky/skyblocker/skyblock/item/BackpackPreview.java b/src/main/java/de/hysky/skyblocker/skyblock/item/BackpackPreview.java index 19ef99b8..cabb72f1 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/item/BackpackPreview.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/item/BackpackPreview.java @@ -34,8 +34,7 @@ public class BackpackPreview { private static final Pattern BACKPACK_PATTERN = Pattern.compile("Backpack.*\\(Slot #(\\d+)\\)"); private static final int STORAGE_SIZE = 27; - private static final Inventory[] storage = new Inventory[STORAGE_SIZE]; - private static final boolean[] dirty = new boolean[STORAGE_SIZE]; + private static final Storage[] storages = new Storage[STORAGE_SIZE]; private static String loaded = ""; // uuid + sb profile currently loaded private static Path save_dir = null; @@ -58,13 +57,14 @@ public class BackpackPreview { String profile = Utils.getProfile(); if (!profile.isEmpty()) { save_dir = FabricLoader.getInstance().getConfigDir().resolve("skyblocker/backpack-preview/" + uuid + "/" + profile); + //noinspection ResultOfMethodCallIgnored save_dir.toFile().mkdirs(); if (loaded.equals(uuid + "/" + profile)) { // mark currently opened storage as dirty if (MinecraftClient.getInstance().currentScreen != null) { String title = MinecraftClient.getInstance().currentScreen.getTitle().getString(); int index = getStorageIndexFromTitle(title); - if (index != -1) dirty[index] = true; + if (index != -1) storages[index].markDirty(); } } else { // load storage again because uuid/profile changed @@ -78,13 +78,12 @@ public class BackpackPreview { public static void loadStorage() { assert (save_dir != null); for (int index = 0; index < STORAGE_SIZE; ++index) { - storage[index] = null; - dirty[index] = false; + storages[index] = null; File file = save_dir.resolve(index + ".nbt").toFile(); if (file.isFile()) { try { NbtCompound root = NbtIo.read(file); - storage[index] = new DummyInventory(Objects.requireNonNull(root)); + storages[index] = new Storage(new DummyInventory(Objects.requireNonNull(root)), root.getString("name")); } catch (Exception e) { LOGGER.error("Failed to load backpack preview file: " + file.getName(), e); } @@ -95,31 +94,30 @@ public class BackpackPreview { private static void saveStorage() { assert (save_dir != null); for (int index = 0; index < STORAGE_SIZE; ++index) { - if (dirty[index]) { - if (storage[index] != null) { - try { - NbtCompound root = new NbtCompound(); - NbtList list = new NbtList(); - for (int i = 9; i < storage[index].size(); ++i) { - ItemStack stack = storage[index].getStack(i); - NbtCompound item = new NbtCompound(); - if (stack.isEmpty()) { - item.put("id", NbtString.of("minecraft:air")); - item.put("Count", NbtInt.of(1)); - } else { - item.put("id", NbtString.of(stack.getItem().toString())); - item.put("Count", NbtInt.of(stack.getCount())); - item.put("tag", stack.getNbt()); - } - list.add(item); + if (storages[index] != null && storages[index].dirty) { + try { + NbtCompound root = new NbtCompound(); + NbtList list = new NbtList(); + for (int i = 9; i < storages[index].inventory.size(); ++i) { + ItemStack stack = storages[index].inventory.getStack(i); + NbtCompound item = new NbtCompound(); + if (stack.isEmpty()) { + item.put("id", NbtString.of("minecraft:air")); + item.put("Count", NbtInt.of(1)); + } else { + item.put("id", NbtString.of(stack.getItem().toString())); + item.put("Count", NbtInt.of(stack.getCount())); + item.put("tag", stack.getNbt()); } - root.put("list", list); - root.put("size", NbtInt.of(storage[index].size() - 9)); - NbtIo.write(root, save_dir.resolve(index + ".nbt").toFile()); - dirty[index] = false; - } catch (Exception e) { - LOGGER.error("Failed to save backpack preview file: " + index + ".nbt", e); + list.add(item); } + root.put("list", list); + root.put("size", NbtInt.of(storages[index].inventory.size() - 9)); + root.putString("name", storages[index].name); + NbtIo.write(root, save_dir.resolve(index + ".nbt").toFile()); + storages[index].markClean(); + } catch (Exception e) { + LOGGER.error("Failed to save backpack preview file: " + index + ".nbt", e); } } } @@ -129,8 +127,7 @@ public class BackpackPreview { String title = screen.getTitle().getString(); int index = getStorageIndexFromTitle(title); if (index != -1) { - storage[index] = screen.getScreenHandler().slots.get(0).inventory; - dirty[index] = true; + storages[index] = new Storage(screen.getScreenHandler().slots.get(0).inventory, title, true); } } @@ -139,8 +136,8 @@ public class BackpackPreview { else if (index >= 27 && index < 45) index -= 18; else return false; - if (storage[index] == null) return false; - int rows = (storage[index].size() - 9) / 9; + if (storages[index] == null) return false; + int rows = (storages[index].inventory.size() - 9) / 9; Screen screen = MinecraftClient.getInstance().currentScreen; if (screen == null) return false; @@ -157,8 +154,10 @@ public class BackpackPreview { context.drawTexture(TEXTURE, x, y + rows * 18 + 7, 0, 215, 176, 7); TextRenderer textRenderer = MinecraftClient.getInstance().textRenderer; - for (int i = 9; i < storage[index].size(); ++i) { - ItemStack currentStack = storage[index].getStack(i); + context.drawText(textRenderer, storages[index].name, x + 8, y + 6, 0x404040, false); + + for (int i = 9; i < storages[index].inventory.size(); ++i) { + ItemStack currentStack = storages[index].inventory.getStack(i); int itemX = x + (i - 9) % 9 * 18 + 8; int itemY = y + (i - 9) / 9 * 18 + 8; @@ -185,59 +184,83 @@ public class BackpackPreview { if (backpack.find()) return Integer.parseInt(backpack.group(1)) + 8; return -1; } -} -class DummyInventory implements Inventory { - private final List stacks; + static class Storage { + private final Inventory inventory; + private final String name; + private boolean dirty; - public DummyInventory(NbtCompound root) { - stacks = new ArrayList<>(root.getInt("size") + 9); - for (int i = 0; i < 9; ++i) stacks.add(ItemStack.EMPTY); - root.getList("list", NbtCompound.COMPOUND_TYPE).forEach(item -> - stacks.add(ItemStack.fromNbt((NbtCompound) item)) - ); - } + public Storage(Inventory inventory, String name) { + this(inventory, name, false); + } - @Override - public int size() { - return stacks.size(); - } + public Storage(Inventory inventory, String name, boolean dirty) { + this.inventory = inventory; + this.name = name; + this.dirty = dirty; + } - @Override - public boolean isEmpty() { - return false; - } + public void markDirty() { + dirty = true; + } - @Override - public ItemStack getStack(int slot) { - return stacks.get(slot); + public void markClean() { + dirty = false; + } } - @Override - public ItemStack removeStack(int slot, int amount) { - return null; - } + static class DummyInventory implements Inventory { + private final List stacks; - @Override - public ItemStack removeStack(int slot) { - return null; - } + public DummyInventory(NbtCompound root) { + stacks = new ArrayList<>(root.getInt("size") + 9); + for (int i = 0; i < 9; ++i) stacks.add(ItemStack.EMPTY); + root.getList("list", NbtCompound.COMPOUND_TYPE).forEach(item -> + stacks.add(ItemStack.fromNbt((NbtCompound) item)) + ); + } - @Override - public void setStack(int slot, ItemStack stack) { - stacks.set(slot, stack); - } + @Override + public int size() { + return stacks.size(); + } - @Override - public void markDirty() { - } + @Override + public boolean isEmpty() { + return false; + } - @Override - public boolean canPlayerUse(PlayerEntity player) { - return false; - } + @Override + public ItemStack getStack(int slot) { + return stacks.get(slot); + } + + @Override + public ItemStack removeStack(int slot, int amount) { + return null; + } + + @Override + public ItemStack removeStack(int slot) { + return null; + } - @Override - public void clear() { + @Override + public void setStack(int slot, ItemStack stack) { + stacks.set(slot, stack); + } + + @Override + public void markDirty() { + } + + @Override + public boolean canPlayerUse(PlayerEntity player) { + return false; + } + + @Override + public void clear() { + } } } -- cgit From 6c8b6dfa0186c0a50f28562c718a237336b8dfb4 Mon Sep 17 00:00:00 2001 From: Kevinthegreat <92656833+kevinthegreat1@users.noreply.github.com> Date: Wed, 25 Oct 2023 20:28:34 -0400 Subject: Refactor Backpack Preview --- .../hysky/skyblocker/mixin/HandledScreenMixin.java | 31 ++-- .../skyblocker/skyblock/item/BackpackPreview.java | 160 ++++++++------------- 2 files changed, 72 insertions(+), 119 deletions(-) diff --git a/src/main/java/de/hysky/skyblocker/mixin/HandledScreenMixin.java b/src/main/java/de/hysky/skyblocker/mixin/HandledScreenMixin.java index e65bc576..597faa3d 100644 --- a/src/main/java/de/hysky/skyblocker/mixin/HandledScreenMixin.java +++ b/src/main/java/de/hysky/skyblocker/mixin/HandledScreenMixin.java @@ -41,15 +41,15 @@ import java.util.regex.Matcher; @Mixin(HandledScreen.class) public abstract class HandledScreenMixin extends Screen { /** - * This is the slot id returned for when a click is outside of the screen's bounds + * This is the slot id returned for when a click is outside the screen's bounds */ @Unique private static final int OUT_OF_BOUNDS_SLOT = -999; - + @Shadow @Nullable protected Slot focusedSlot; - + @Shadow @Final protected T handler; @@ -78,7 +78,7 @@ public abstract class HandledScreenMixin extends Screen // Backpack Preview boolean shiftDown = SkyblockerConfigManager.get().general.backpackPreviewWithoutShift ^ Screen.hasShiftDown(); - if (shiftDown && getTitle().getString().equals("Storage") && focusedSlot.inventory != client.player.getInventory() && BackpackPreview.renderPreview(context, focusedSlot.getIndex(), x, y)) { + if (shiftDown && getTitle().getString().equals("Storage") && focusedSlot.inventory != client.player.getInventory() && BackpackPreview.renderPreview(context, this, focusedSlot.getIndex(), x, y)) { ci.cancel(); } @@ -133,21 +133,21 @@ public abstract class HandledScreenMixin extends Screen } } } - + /** * The naming of this method in yarn is half true, its mostly to handle slot/item interactions (which are mouse or keyboard clicks) * For example, using the drop key bind while hovering over an item will invoke this method to drop the players item */ @Inject(method = "onMouseClick(Lnet/minecraft/screen/slot/Slot;IILnet/minecraft/screen/slot/SlotActionType;)V", at = @At("HEAD"), cancellable = true) private void skyblocker$onSlotInteract(Slot slot, int slotId, int button, SlotActionType actionType, CallbackInfo ci) { - if (Utils.isOnSkyblock()) { + if (Utils.isOnSkyblock()) { // When you try and drop the item by picking it up then clicking outside of the screen if (slotId == OUT_OF_BOUNDS_SLOT) { ItemStack cursorStack = this.handler.getCursorStack(); if (ItemProtection.isItemProtected(cursorStack)) ci.cancel(); } - + if (slot != null) { // When you click your drop key while hovering over an item if (actionType == SlotActionType.THROW) { @@ -155,35 +155,36 @@ public abstract class HandledScreenMixin extends Screen if (ItemProtection.isItemProtected(stack)) ci.cancel(); } - + //Prevent salvaging if (this.getTitle().getString().equals("Salvage Items")) { ItemStack stack = slot.getStack(); if (ItemProtection.isItemProtected(stack)) ci.cancel(); } - + //Prevent selling to NPC shops if (this.client != null && this.handler instanceof GenericContainerScreenHandler genericContainerScreenHandler && genericContainerScreenHandler.getRows() == 6) { ItemStack sellItem = this.handler.slots.get(49).getStack(); - + if (sellItem.getName().getString().equals("Sell Item") || skyblocker$doesLoreContain(sellItem, this.client, "buyback")) { ItemStack stack = slot.getStack(); - + if (ItemProtection.isItemProtected(stack)) ci.cancel(); } } } - } + } } - + //TODO make this a util method somewhere else, eventually private static boolean skyblocker$doesLoreContain(ItemStack stack, MinecraftClient client, String searchString) { return stack.getTooltip(client.player, TooltipContext.BASIC).stream().map(Text::getString).anyMatch(line -> line.contains(searchString)); } - + @Inject(method = "drawSlot", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/DrawContext;drawItem(Lnet/minecraft/item/ItemStack;III)V")) private void skyblocker$drawItemRarityBackground(DrawContext context, Slot slot, CallbackInfo ci) { - if (Utils.isOnSkyblock() && SkyblockerConfigManager.get().general.itemInfoDisplay.itemRarityBackgrounds) ItemRarityBackgrounds.tryDraw(slot.getStack(), context, slot.x, slot.y); + if (Utils.isOnSkyblock() && SkyblockerConfigManager.get().general.itemInfoDisplay.itemRarityBackgrounds) + ItemRarityBackgrounds.tryDraw(slot.getStack(), context, slot.x, slot.y); } } diff --git a/src/main/java/de/hysky/skyblocker/skyblock/item/BackpackPreview.java b/src/main/java/de/hysky/skyblocker/skyblock/item/BackpackPreview.java index cabb72f1..18acbaf7 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/item/BackpackPreview.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/item/BackpackPreview.java @@ -11,18 +11,17 @@ import net.minecraft.client.gui.DrawContext; import net.minecraft.client.gui.screen.Screen; import net.minecraft.client.gui.screen.ingame.HandledScreen; import net.minecraft.client.util.math.MatrixStack; -import net.minecraft.entity.player.PlayerEntity; import net.minecraft.inventory.Inventory; +import net.minecraft.inventory.SimpleInventory; import net.minecraft.item.ItemStack; import net.minecraft.nbt.*; import net.minecraft.util.Identifier; +import org.jetbrains.annotations.NotNull; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.File; import java.nio.file.Path; -import java.util.ArrayList; -import java.util.List; import java.util.Objects; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -51,15 +50,16 @@ public class BackpackPreview { Utils.update(); // force update isOnSkyblock to prevent crash on disconnect if (Utils.isOnSkyblock()) { // save all dirty storages - saveStorage(); + saveStorages(); // update save dir based on uuid and sb profile String uuid = MinecraftClient.getInstance().getSession().getUuidOrNull().toString().replaceAll("-", ""); - String profile = Utils.getProfile(); + String profile = Utils.getProfile(); //TODO switch to profile id if (!profile.isEmpty()) { - save_dir = FabricLoader.getInstance().getConfigDir().resolve("skyblocker/backpack-preview/" + uuid + "/" + profile); + String loading = uuid + "/" + profile; + save_dir = FabricLoader.getInstance().getConfigDir().resolve("skyblocker/backpack-preview/" + loading); //noinspection ResultOfMethodCallIgnored save_dir.toFile().mkdirs(); - if (loaded.equals(uuid + "/" + profile)) { + if (loaded.equals(loading)) { // mark currently opened storage as dirty if (MinecraftClient.getInstance().currentScreen != null) { String title = MinecraftClient.getInstance().currentScreen.getTitle().getString(); @@ -68,22 +68,20 @@ public class BackpackPreview { } } else { // load storage again because uuid/profile changed - loaded = uuid + "/" + profile; - loadStorage(); + loaded = loading; + loadStorages(); } } } } - public static void loadStorage() { + public static void loadStorages() { assert (save_dir != null); for (int index = 0; index < STORAGE_SIZE; ++index) { - storages[index] = null; File file = save_dir.resolve(index + ".nbt").toFile(); if (file.isFile()) { try { - NbtCompound root = NbtIo.read(file); - storages[index] = new Storage(new DummyInventory(Objects.requireNonNull(root)), root.getString("name")); + storages[index] = Storage.fromNbt(Objects.requireNonNull(NbtIo.read(file))); } catch (Exception e) { LOGGER.error("Failed to load backpack preview file: " + file.getName(), e); } @@ -91,38 +89,24 @@ public class BackpackPreview { } } - private static void saveStorage() { + private static void saveStorages() { assert (save_dir != null); for (int index = 0; index < STORAGE_SIZE; ++index) { if (storages[index] != null && storages[index].dirty) { - try { - NbtCompound root = new NbtCompound(); - NbtList list = new NbtList(); - for (int i = 9; i < storages[index].inventory.size(); ++i) { - ItemStack stack = storages[index].inventory.getStack(i); - NbtCompound item = new NbtCompound(); - if (stack.isEmpty()) { - item.put("id", NbtString.of("minecraft:air")); - item.put("Count", NbtInt.of(1)); - } else { - item.put("id", NbtString.of(stack.getItem().toString())); - item.put("Count", NbtInt.of(stack.getCount())); - item.put("tag", stack.getNbt()); - } - list.add(item); - } - root.put("list", list); - root.put("size", NbtInt.of(storages[index].inventory.size() - 9)); - root.putString("name", storages[index].name); - NbtIo.write(root, save_dir.resolve(index + ".nbt").toFile()); - storages[index].markClean(); - } catch (Exception e) { - LOGGER.error("Failed to save backpack preview file: " + index + ".nbt", e); - } + saveStorage(index); } } } + private static void saveStorage(int index) { + try { + NbtIo.write(storages[index].toNbt(), save_dir.resolve(index + ".nbt").toFile()); + storages[index].markClean(); + } catch (Exception e) { + LOGGER.error("Failed to save backpack preview file: " + index + ".nbt", e); + } + } + public static void updateStorage(HandledScreen screen) { String title = screen.getTitle().getString(); int index = getStorageIndexFromTitle(title); @@ -131,16 +115,14 @@ public class BackpackPreview { } } - public static boolean renderPreview(DrawContext context, int index, int mouseX, int mouseY) { + public static boolean renderPreview(DrawContext context, Screen screen, int index, int mouseX, int mouseY) { if (index >= 9 && index < 18) index -= 9; else if (index >= 27 && index < 45) index -= 18; else return false; if (storages[index] == null) return false; - int rows = (storages[index].inventory.size() - 9) / 9; + int rows = (storages[index].size() - 9) / 9; - Screen screen = MinecraftClient.getInstance().currentScreen; - if (screen == null) return false; int x = mouseX + 184 >= screen.width ? mouseX - 188 : mouseX + 8; int y = Math.max(0, mouseY - 16); @@ -149,27 +131,24 @@ public class BackpackPreview { matrices.translate(0f, 0f, 400f); RenderSystem.enableDepthTest(); - context.drawTexture(TEXTURE, x, y, 0, 0, 176, 7); - context.drawTexture(TEXTURE, x, y + 7, 0, 17, 176, rows * 18); - context.drawTexture(TEXTURE, x, y + rows * 18 + 7, 0, 215, 176, 7); + context.drawTexture(TEXTURE, x, y, 0, 0, 176, rows * 18 + 17); + context.drawTexture(TEXTURE, x, y + rows * 18 + 17, 0, 215, 176, 7); TextRenderer textRenderer = MinecraftClient.getInstance().textRenderer; context.drawText(textRenderer, storages[index].name, x + 8, y + 6, 0x404040, false); - for (int i = 9; i < storages[index].inventory.size(); ++i) { - ItemStack currentStack = storages[index].inventory.getStack(i); + matrices.translate(0f, 0f, 200f); + for (int i = 9; i < storages[index].size(); ++i) { + ItemStack currentStack = storages[index].getStack(i); int itemX = x + (i - 9) % 9 * 18 + 8; - int itemY = y + (i - 9) / 9 * 18 + 8; + int itemY = y + (i - 9) / 9 * 18 + 18; if (SkyblockerConfigManager.get().general.itemInfoDisplay.itemRarityBackgrounds) { ItemRarityBackgrounds.tryDraw(currentStack, context, itemX, itemY); } - matrices.push(); - matrices.translate(0f, 0f, 200f); context.drawItem(currentStack, itemX, itemY); context.drawItemInSlot(textRenderer, currentStack, itemX, itemY); - matrices.pop(); } matrices.pop(); @@ -190,77 +169,50 @@ public class BackpackPreview { private final String name; private boolean dirty; - public Storage(Inventory inventory, String name) { + private Storage(Inventory inventory, String name) { this(inventory, name, false); } - public Storage(Inventory inventory, String name, boolean dirty) { + private Storage(Inventory inventory, String name, boolean dirty) { this.inventory = inventory; this.name = name; this.dirty = dirty; } - public void markDirty() { - dirty = true; - } - - public void markClean() { - dirty = false; - } - } - - static class DummyInventory implements Inventory { - private final List stacks; - - public DummyInventory(NbtCompound root) { - stacks = new ArrayList<>(root.getInt("size") + 9); - for (int i = 0; i < 9; ++i) stacks.add(ItemStack.EMPTY); - root.getList("list", NbtCompound.COMPOUND_TYPE).forEach(item -> - stacks.add(ItemStack.fromNbt((NbtCompound) item)) - ); - } - - @Override - public int size() { - return stacks.size(); + private int size() { + return inventory.size(); } - @Override - public boolean isEmpty() { - return false; + private ItemStack getStack(int index) { + return inventory.getStack(index); } - @Override - public ItemStack getStack(int slot) { - return stacks.get(slot); - } - - @Override - public ItemStack removeStack(int slot, int amount) { - return null; - } - - @Override - public ItemStack removeStack(int slot) { - return null; - } - - @Override - public void setStack(int slot, ItemStack stack) { - stacks.set(slot, stack); + private void markDirty() { + dirty = true; } - @Override - public void markDirty() { + private void markClean() { + dirty = false; } - @Override - public boolean canPlayerUse(PlayerEntity player) { - return false; + @NotNull + private static Storage fromNbt(NbtCompound root) { + SimpleInventory inventory = new SimpleInventory(root.getInt("size")); + inventory.readNbtList(root.getList("list", NbtCompound.COMPOUND_TYPE)); + return new Storage(inventory, root.getString("name")); } - @Override - public void clear() { + @NotNull + private NbtCompound toNbt() { + NbtCompound root = new NbtCompound(); + NbtList list = new NbtList(); + for (int i = 0; i < size(); ++i) { + list.add(getStack(i).writeNbt(new NbtCompound())); + } + root.put("list", list); + root.put("size", NbtInt.of(size())); + root.putString("name", name); + return root; } } } -- cgit From 1a737c461c0d861028612c0a2615d3f5c0487d74 Mon Sep 17 00:00:00 2001 From: Kevinthegreat <92656833+kevinthegreat1@users.noreply.github.com> Date: Wed, 25 Oct 2023 21:01:06 -0400 Subject: Use profile id --- .../skyblocker/skyblock/item/BackpackPreview.java | 26 ++++++++++----------- src/main/java/de/hysky/skyblocker/utils/Utils.java | 14 ++++++++++- .../textures/gui/inventory_background.png | Bin 577 -> 0 bytes 3 files changed, 26 insertions(+), 14 deletions(-) delete mode 100644 src/main/resources/assets/skyblocker/textures/gui/inventory_background.png diff --git a/src/main/java/de/hysky/skyblocker/skyblock/item/BackpackPreview.java b/src/main/java/de/hysky/skyblocker/skyblock/item/BackpackPreview.java index 18acbaf7..d510d65a 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/item/BackpackPreview.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/item/BackpackPreview.java @@ -14,7 +14,10 @@ import net.minecraft.client.util.math.MatrixStack; import net.minecraft.inventory.Inventory; import net.minecraft.inventory.SimpleInventory; import net.minecraft.item.ItemStack; -import net.minecraft.nbt.*; +import net.minecraft.nbt.NbtCompound; +import net.minecraft.nbt.NbtInt; +import net.minecraft.nbt.NbtIo; +import net.minecraft.nbt.NbtList; import net.minecraft.util.Identifier; import org.jetbrains.annotations.NotNull; import org.slf4j.Logger; @@ -35,7 +38,7 @@ public class BackpackPreview { private static final Storage[] storages = new Storage[STORAGE_SIZE]; - private static String loaded = ""; // uuid + sb profile currently loaded + private static String loaded = ""; // profile id currently loaded private static Path save_dir = null; public static void init() { @@ -51,15 +54,13 @@ public class BackpackPreview { if (Utils.isOnSkyblock()) { // save all dirty storages saveStorages(); - // update save dir based on uuid and sb profile - String uuid = MinecraftClient.getInstance().getSession().getUuidOrNull().toString().replaceAll("-", ""); - String profile = Utils.getProfile(); //TODO switch to profile id - if (!profile.isEmpty()) { - String loading = uuid + "/" + profile; - save_dir = FabricLoader.getInstance().getConfigDir().resolve("skyblocker/backpack-preview/" + loading); + // update save dir based on sb profile id + String profileId = Utils.getProfileId(); + if (!profileId.isEmpty()) { + save_dir = FabricLoader.getInstance().getConfigDir().resolve("skyblocker/backpack-preview/" + profileId); //noinspection ResultOfMethodCallIgnored save_dir.toFile().mkdirs(); - if (loaded.equals(loading)) { + if (loaded.equals(profileId)) { // mark currently opened storage as dirty if (MinecraftClient.getInstance().currentScreen != null) { String title = MinecraftClient.getInstance().currentScreen.getTitle().getString(); @@ -67,8 +68,8 @@ public class BackpackPreview { if (index != -1) storages[index].markDirty(); } } else { - // load storage again because uuid/profile changed - loaded = loading; + // load storage again because profile id changed + loaded = profileId; loadStorages(); } } @@ -197,8 +198,7 @@ public class BackpackPreview { @NotNull private static Storage fromNbt(NbtCompound root) { - SimpleInventory inventory = new SimpleInventory(root.getInt("size")); - inventory.readNbtList(root.getList("list", NbtCompound.COMPOUND_TYPE)); + SimpleInventory inventory = new SimpleInventory(root.getList("list", NbtCompound.COMPOUND_TYPE).stream().map(NbtCompound.class::cast).map(ItemStack::fromNbt).toArray(ItemStack[]::new)); return new Storage(inventory, root.getString("name")); } diff --git a/src/main/java/de/hysky/skyblocker/utils/Utils.java b/src/main/java/de/hysky/skyblocker/utils/Utils.java index bbfd1101..f09d16ed 100644 --- a/src/main/java/de/hysky/skyblocker/utils/Utils.java +++ b/src/main/java/de/hysky/skyblocker/utils/Utils.java @@ -44,6 +44,8 @@ public class Utils { @NotNull private static String profile = ""; @NotNull + private static String profileId = ""; + @NotNull private static String server = ""; @NotNull private static String gameType = ""; @@ -89,6 +91,11 @@ public class Utils { return profile; } + @NotNull + public static String getProfileId() { + return profileId; + } + /** * @return the server parsed from /locraw. */ @@ -323,7 +330,7 @@ public class Utils { } /** - * Parses the /locraw reply from the server + * Parses the /locraw reply from the server and updates the player's profile id * * @return not display the message in chat is the command is sent by the mod */ @@ -349,6 +356,11 @@ public class Utils { return shouldFilter; } } + + if (isOnSkyblock && message.startsWith("Profile ID: ")) { + profileId = message.replace("Profile ID: ", ""); + } + return true; } diff --git a/src/main/resources/assets/skyblocker/textures/gui/inventory_background.png b/src/main/resources/assets/skyblocker/textures/gui/inventory_background.png deleted file mode 100644 index fb588907..00000000 Binary files a/src/main/resources/assets/skyblocker/textures/gui/inventory_background.png and /dev/null differ -- cgit From 5faf45a7f7d265b68b852516326b50be8ff64b52 Mon Sep 17 00:00:00 2001 From: Kevinthegreat <92656833+kevinthegreat1@users.noreply.github.com> Date: Wed, 25 Oct 2023 21:17:26 -0400 Subject: Refactor updating storage --- .../skyblocker/skyblock/item/BackpackPreview.java | 61 ++++++++-------------- 1 file changed, 23 insertions(+), 38 deletions(-) diff --git a/src/main/java/de/hysky/skyblocker/skyblock/item/BackpackPreview.java b/src/main/java/de/hysky/skyblocker/skyblock/item/BackpackPreview.java index d510d65a..736356cc 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/item/BackpackPreview.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/item/BackpackPreview.java @@ -38,13 +38,16 @@ public class BackpackPreview { private static final Storage[] storages = new Storage[STORAGE_SIZE]; - private static String loaded = ""; // profile id currently loaded - private static Path save_dir = null; + /** + * The profile id of the currently loaded backpack preview. + */ + private static String loaded; + private static Path saveDir; public static void init() { ScreenEvents.AFTER_INIT.register((client, screen, scaledWidth, scaledHeight) -> { if (screen instanceof HandledScreen handledScreen) { - updateStorage(handledScreen); + ScreenEvents.remove(screen).register(screen1 -> updateStorage(handledScreen)); } }); } @@ -56,42 +59,32 @@ public class BackpackPreview { saveStorages(); // update save dir based on sb profile id String profileId = Utils.getProfileId(); - if (!profileId.isEmpty()) { - save_dir = FabricLoader.getInstance().getConfigDir().resolve("skyblocker/backpack-preview/" + profileId); + if (!profileId.equals(loaded)) { + saveDir = FabricLoader.getInstance().getConfigDir().resolve("skyblocker/backpack-preview/" + profileId); //noinspection ResultOfMethodCallIgnored - save_dir.toFile().mkdirs(); - if (loaded.equals(profileId)) { - // mark currently opened storage as dirty - if (MinecraftClient.getInstance().currentScreen != null) { - String title = MinecraftClient.getInstance().currentScreen.getTitle().getString(); - int index = getStorageIndexFromTitle(title); - if (index != -1) storages[index].markDirty(); - } - } else { - // load storage again because profile id changed - loaded = profileId; - loadStorages(); - } + saveDir.toFile().mkdirs(); + // load storage again because profile id changed + loaded = profileId; + loadStorages(); } } } - public static void loadStorages() { - assert (save_dir != null); + private static void loadStorages() { for (int index = 0; index < STORAGE_SIZE; ++index) { - File file = save_dir.resolve(index + ".nbt").toFile(); - if (file.isFile()) { + storages[index] = null; + File storageFile = saveDir.resolve(index + ".nbt").toFile(); + if (storageFile.isFile()) { try { - storages[index] = Storage.fromNbt(Objects.requireNonNull(NbtIo.read(file))); + storages[index] = Storage.fromNbt(Objects.requireNonNull(NbtIo.read(storageFile))); } catch (Exception e) { - LOGGER.error("Failed to load backpack preview file: " + file.getName(), e); + LOGGER.error("Failed to load backpack preview file: " + storageFile.getName(), e); } } } } private static void saveStorages() { - assert (save_dir != null); for (int index = 0; index < STORAGE_SIZE; ++index) { if (storages[index] != null && storages[index].dirty) { saveStorage(index); @@ -101,18 +94,18 @@ public class BackpackPreview { private static void saveStorage(int index) { try { - NbtIo.write(storages[index].toNbt(), save_dir.resolve(index + ".nbt").toFile()); + NbtIo.write(storages[index].toNbt(), saveDir.resolve(index + ".nbt").toFile()); storages[index].markClean(); } catch (Exception e) { LOGGER.error("Failed to save backpack preview file: " + index + ".nbt", e); } } - public static void updateStorage(HandledScreen screen) { - String title = screen.getTitle().getString(); + private static void updateStorage(HandledScreen handledScreen) { + String title = handledScreen.getTitle().getString(); int index = getStorageIndexFromTitle(title); if (index != -1) { - storages[index] = new Storage(screen.getScreenHandler().slots.get(0).inventory, title, true); + storages[index] = new Storage(handledScreen.getScreenHandler().slots.get(0).inventory, title, true); } } @@ -170,10 +163,6 @@ public class BackpackPreview { private final String name; private boolean dirty; - private Storage(Inventory inventory, String name) { - this(inventory, name, false); - } - private Storage(Inventory inventory, String name, boolean dirty) { this.inventory = inventory; this.name = name; @@ -188,10 +177,6 @@ public class BackpackPreview { return inventory.getStack(index); } - private void markDirty() { - dirty = true; - } - private void markClean() { dirty = false; } @@ -199,7 +184,7 @@ public class BackpackPreview { @NotNull private static Storage fromNbt(NbtCompound root) { SimpleInventory inventory = new SimpleInventory(root.getList("list", NbtCompound.COMPOUND_TYPE).stream().map(NbtCompound.class::cast).map(ItemStack::fromNbt).toArray(ItemStack[]::new)); - return new Storage(inventory, root.getString("name")); + return new Storage(inventory, root.getString("name"), false); } @NotNull -- cgit From 2d506f220676ce01c590cd32d66f98c5c43d63fe Mon Sep 17 00:00:00 2001 From: Kevinthegreat <92656833+kevinthegreat1@users.noreply.github.com> Date: Wed, 25 Oct 2023 23:24:01 -0400 Subject: Fix identifier --- .../java/de/hysky/skyblocker/skyblock/item/BackpackPreview.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/de/hysky/skyblocker/skyblock/item/BackpackPreview.java b/src/main/java/de/hysky/skyblocker/skyblock/item/BackpackPreview.java index 736356cc..afe134b5 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/item/BackpackPreview.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/item/BackpackPreview.java @@ -58,13 +58,13 @@ public class BackpackPreview { // save all dirty storages saveStorages(); // update save dir based on sb profile id - String profileId = Utils.getProfileId(); - if (!profileId.equals(loaded)) { - saveDir = FabricLoader.getInstance().getConfigDir().resolve("skyblocker/backpack-preview/" + profileId); + String id = MinecraftClient.getInstance().getSession().getUuidOrNull() + "/" + Utils.getProfileId(); + if (!id.equals(loaded)) { + saveDir = FabricLoader.getInstance().getConfigDir().resolve("skyblocker/backpack-preview/" + id); //noinspection ResultOfMethodCallIgnored saveDir.toFile().mkdirs(); // load storage again because profile id changed - loaded = profileId; + loaded = id; loadStorages(); } } -- cgit From 53bfa6e90fc1a80cf701b3ae2cbc5bbfe0f31ccd Mon Sep 17 00:00:00 2001 From: Kevinthegreat <92656833+kevinthegreat1@users.noreply.github.com> Date: Wed, 25 Oct 2023 23:31:24 -0400 Subject: Update Javadocs --- src/main/java/de/hysky/skyblocker/utils/Utils.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/java/de/hysky/skyblocker/utils/Utils.java b/src/main/java/de/hysky/skyblocker/utils/Utils.java index f09d16ed..1205c71b 100644 --- a/src/main/java/de/hysky/skyblocker/utils/Utils.java +++ b/src/main/java/de/hysky/skyblocker/utils/Utils.java @@ -38,13 +38,19 @@ public class Utils { private static boolean isInDungeons = false; private static boolean isInjected = false; /** - * The following fields store data returned from /locraw: {@link #profile}, {@link #server}, {@link #gameType}, {@link #locationRaw}, and {@link #map}. + * The profile name parsed from the player list. */ - @SuppressWarnings("JavadocDeclaration") @NotNull private static String profile = ""; + /** + * The profile id parsed from the chat. + */ @NotNull private static String profileId = ""; + /** + * The following fields store data returned from /locraw: {@link #server}, {@link #gameType}, {@link #locationRaw}, and {@link #map}. + */ + @SuppressWarnings("JavadocDeclaration") @NotNull private static String server = ""; @NotNull -- cgit From 1a8465eae0e1d212c8f36eacae173a12cf7ec014 Mon Sep 17 00:00:00 2001 From: Aaron <51387595+AzureAaron@users.noreply.github.com> Date: Wed, 25 Oct 2023 23:51:24 -0400 Subject: Trim Player UUIDs --- src/main/java/de/hysky/skyblocker/skyblock/item/BackpackPreview.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/de/hysky/skyblocker/skyblock/item/BackpackPreview.java b/src/main/java/de/hysky/skyblocker/skyblock/item/BackpackPreview.java index afe134b5..d621d388 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/item/BackpackPreview.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/item/BackpackPreview.java @@ -58,7 +58,7 @@ public class BackpackPreview { // save all dirty storages saveStorages(); // update save dir based on sb profile id - String id = MinecraftClient.getInstance().getSession().getUuidOrNull() + "/" + Utils.getProfileId(); + String id = MinecraftClient.getInstance().getSession().getUuidOrNull().toString().replaceAll("-", "") + "/" + Utils.getProfileId(); if (!id.equals(loaded)) { saveDir = FabricLoader.getInstance().getConfigDir().resolve("skyblocker/backpack-preview/" + id); //noinspection ResultOfMethodCallIgnored -- cgit From 31cfd39b39915bea976f6179ee75edec437c9e2e Mon Sep 17 00:00:00 2001 From: Aaron <51387595+AzureAaron@users.noreply.github.com> Date: Thu, 26 Oct 2023 00:41:21 -0400 Subject: Hypixel Api Proxy + Profile Id Caching (#386) --- src/main/java/de/hysky/skyblocker/utils/Http.java | 48 +++++++++++++++++++++-- 1 file changed, 44 insertions(+), 4 deletions(-) diff --git a/src/main/java/de/hysky/skyblocker/utils/Http.java b/src/main/java/de/hysky/skyblocker/utils/Http.java index ee500b5a..94506b05 100644 --- a/src/main/java/de/hysky/skyblocker/utils/Http.java +++ b/src/main/java/de/hysky/skyblocker/utils/Http.java @@ -5,6 +5,7 @@ import java.io.InputStream; import java.io.UncheckedIOException; import java.net.URI; import java.net.http.HttpClient; +import java.net.http.HttpClient.Redirect; import java.net.http.HttpClient.Version; import java.net.http.HttpHeaders; import java.net.http.HttpRequest; @@ -15,6 +16,8 @@ import java.time.Duration; import java.util.zip.GZIPInputStream; import java.util.zip.InflaterInputStream; +import org.jetbrains.annotations.NotNull; + import de.hysky.skyblocker.SkyblockerMod; import net.minecraft.SharedConstants; @@ -22,12 +25,19 @@ import net.minecraft.SharedConstants; * @implNote All http requests are sent using HTTP 2 */ public class Http { + private static final String NAME_2_UUID = "https://api.minecraftservices.com/minecraft/profile/lookup/name/"; + private static final String HYPIXEL_PROXY = "https://api.azureaaron.net/hypixel/"; private static final String USER_AGENT = "Skyblocker/" + SkyblockerMod.VERSION + " (" + SharedConstants.getGameVersion().getName() + ")"; private static final HttpClient HTTP_CLIENT = HttpClient.newBuilder() .connectTimeout(Duration.ofSeconds(10)) + .followRedirects(Redirect.NORMAL) .build(); public static String sendGetRequest(String url) throws IOException, InterruptedException { + return sendCacheableGetRequest(url).content(); + } + + private static ApiResponse sendCacheableGetRequest(String url) throws IOException, InterruptedException { HttpRequest request = HttpRequest.newBuilder() .GET() .header("Accept", "application/json") @@ -41,7 +51,7 @@ public class Http { InputStream decodedInputStream = getDecodedInputStream(response); String body = new String(decodedInputStream.readAllBytes()); - return body; + return new ApiResponse(body, getCacheStatus(response.headers())); } public static HttpHeaders sendHeadRequest(String url) throws IOException, InterruptedException { @@ -56,8 +66,21 @@ public class Http { return response.headers(); } + public static String sendName2UuidRequest(String name) throws IOException, InterruptedException { + return sendGetRequest(NAME_2_UUID + name); + } + + /** + * @param endpoint the endpoint - do not include any leading or trailing slashes + * @param query the query string - use empty string if n/a + * @return the requested data with zero pre-processing applied + */ + public static ApiResponse sendHypixelRequest(String endpoint, @NotNull String query) throws IOException, InterruptedException { + return sendCacheableGetRequest(HYPIXEL_PROXY + endpoint + query); + } + private static InputStream getDecodedInputStream(HttpResponse response) { - String encoding = getContentEncoding(response); + String encoding = getContentEncoding(response.headers()); try { switch (encoding) { @@ -75,8 +98,8 @@ public class Http { } } - private static String getContentEncoding(HttpResponse response) { - return response.headers().firstValue("Content-Encoding").orElse(""); + private static String getContentEncoding(HttpHeaders headers) { + return headers.firstValue("Content-Encoding").orElse(""); } public static String getEtag(HttpHeaders headers) { @@ -86,4 +109,21 @@ public class Http { public static String getLastModified(HttpHeaders headers) { return headers.firstValue("Last-Modified").orElse(""); } + + /** + * Returns the cache status of the resource + * + * @see Cloudflare Cache Docs + */ + public static String getCacheStatus(HttpHeaders headers) { + return headers.firstValue("CF-Cache-Status").orElse("UNKNOWN"); + } + + //TODO If ever needed, we could just replace cache status with the response headers and go from there + public record ApiResponse(String content, String cacheStatus) { + + public boolean cached() { + return cacheStatus.equals("HIT"); + } + } } -- cgit From 2903241fe145137f6c1c925ed508c5673228a8d7 Mon Sep 17 00:00:00 2001 From: Aaron <51387595+AzureAaron@users.noreply.github.com> Date: Fri, 27 Oct 2023 23:53:11 -0400 Subject: Museum Item Cache --- .../java/de/hysky/skyblocker/SkyblockerMod.java | 1 + .../skyblocker/skyblock/item/MuseumItemCache.java | 146 +++++++++++++++++++++ src/main/java/de/hysky/skyblocker/utils/Http.java | 8 +- src/main/java/de/hysky/skyblocker/utils/Utils.java | 3 + 4 files changed, 156 insertions(+), 2 deletions(-) create mode 100644 src/main/java/de/hysky/skyblocker/skyblock/item/MuseumItemCache.java diff --git a/src/main/java/de/hysky/skyblocker/SkyblockerMod.java b/src/main/java/de/hysky/skyblocker/SkyblockerMod.java index dc8896cf..5e23e2e2 100644 --- a/src/main/java/de/hysky/skyblocker/SkyblockerMod.java +++ b/src/main/java/de/hysky/skyblocker/SkyblockerMod.java @@ -106,6 +106,7 @@ public class SkyblockerMod implements ClientModInitializer { ItemProtection.init(); CreeperBeams.init(); ItemRarityBackgrounds.init(); + MuseumItemCache.init(); containerSolverManager.init(); statusBarTracker.init(); Scheduler.INSTANCE.scheduleCyclic(Utils::update, 20); diff --git a/src/main/java/de/hysky/skyblocker/skyblock/item/MuseumItemCache.java b/src/main/java/de/hysky/skyblocker/skyblock/item/MuseumItemCache.java new file mode 100644 index 00000000..cb11d702 --- /dev/null +++ b/src/main/java/de/hysky/skyblocker/skyblock/item/MuseumItemCache.java @@ -0,0 +1,146 @@ +package de.hysky.skyblocker.skyblock.item; + +import java.io.ByteArrayInputStream; +import java.io.BufferedReader; +import java.io.BufferedWriter; +import java.io.IOException; +import java.lang.reflect.Type; +import java.nio.file.Files; +import java.nio.file.NoSuchFileException; +import java.nio.file.Path; +import java.util.Base64; +import java.util.Map; +import java.util.concurrent.CompletableFuture; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParser; +import com.google.gson.reflect.TypeToken; +import com.mojang.util.UndashedUuid; + +import de.hysky.skyblocker.SkyblockerMod; +import de.hysky.skyblocker.utils.Http; +import de.hysky.skyblocker.utils.Http.ApiResponse; +import de.hysky.skyblocker.utils.Utils; +import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; +import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet; +import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientLifecycleEvents; +import net.minecraft.client.MinecraftClient; +import net.minecraft.nbt.NbtCompound; +import net.minecraft.nbt.NbtElement; +import net.minecraft.nbt.NbtIo; +import net.minecraft.nbt.NbtList; +import net.minecraft.util.Util; + +public class MuseumItemCache { + private static final Logger LOGGER = LoggerFactory.getLogger(MuseumItemCache.class); + private static final Path CACHE_FILE = SkyblockerMod.CONFIG_DIR.resolve("museum_item_cache.json"); + private static final Object2ObjectOpenHashMap> MUSEUM_ITEM_CACHE = new Object2ObjectOpenHashMap<>(); + private static final Type MAP_TYPE = new TypeToken>>() {}.getType(); + + private static CompletableFuture loaded; + + public static void init() { + ClientLifecycleEvents.CLIENT_STARTED.register(MuseumItemCache::load); + } + + private static void load(MinecraftClient client) { + loaded = CompletableFuture.runAsync(() -> { + try (BufferedReader reader = Files.newBufferedReader(CACHE_FILE)) { + Object2ObjectOpenHashMap> cachedData = SkyblockerMod.GSON.fromJson(reader, MAP_TYPE); + + MUSEUM_ITEM_CACHE.putAll(cachedData); + LOGGER.info("[Skyblocker] Loaded museum items cache"); + } catch (NoSuchFileException ignored) { + } catch (IOException e) { + LOGGER.error("[Skyblocker] Failed to load cached museum items", e); + } + }); + } + + private static void save() { + CompletableFuture.runAsync(() -> { + try (BufferedWriter writer = Files.newBufferedWriter(CACHE_FILE)) { + SkyblockerMod.GSON.toJson(MUSEUM_ITEM_CACHE, writer); + } catch (IOException e) { + LOGGER.error("[Skyblocker] Failed to save cached museum items!", e); + } + }); + } + + private static void updateData4ProfileMember(String uuid, String profileId) { + CompletableFuture.runAsync(() -> { + try { + ApiResponse response = Http.sendHypixelRequest("skyblock/museum", "?profile=" + profileId); + + //The request was successful + if (response.ok()) { + JsonObject profileData = JsonParser.parseString(response.content()).getAsJsonObject(); + JsonObject memberData = profileData.get("members").getAsJsonObject().get(uuid).getAsJsonObject(); + + //We call them sets because it could either be a singular item or an entire armour set + Map donatedSets = memberData.get("items").getAsJsonObject().asMap(); + + //Set of all found item ids on profile + ObjectOpenHashSet itemIds = new ObjectOpenHashSet<>(); + + for (Map.Entry donatedSet : donatedSets.entrySet()) { + //Item is plural here because the nbt is a list + String itemsData = donatedSet.getValue().getAsJsonObject().get("items").getAsJsonObject().get("data").getAsString(); + NbtList items = NbtIo.readCompressed(new ByteArrayInputStream(Base64.getDecoder().decode(itemsData))).getList("i", NbtElement.COMPOUND_TYPE); + + for (int i = 0; i < items.size(); i++) { + NbtCompound tag = items.getCompound(i).getCompound("tag"); + + if (tag.contains("ExtraAttributes")) { + NbtCompound extraAttributes = tag.getCompound("ExtraAttributes"); + + if (extraAttributes.contains("id")) itemIds.add(extraAttributes.getString("id")); + } + } + } + + MUSEUM_ITEM_CACHE.get(uuid).put(profileId, new ProfileMuseumData(System.currentTimeMillis(), itemIds)); + save(); + + LOGGER.info("[Skyblocker] Successfully updated museum item cache for profile {}", profileId); + } + } catch (Exception e) { + LOGGER.error("[Skyblocker] Failed to refresh museum item data for profile {}", profileId, e); + } + }); + } + + /** + * The cache is ticked upon switching skyblock servers + */ + public static void tick(String profileId) { + if (loaded.isDone()) { + String uuid = UndashedUuid.toString(MinecraftClient.getInstance().getSession().getUuidOrNull()); + Object2ObjectOpenHashMap playerData = MUSEUM_ITEM_CACHE.computeIfAbsent(uuid, uuid1 -> Util.make(new Object2ObjectOpenHashMap<>(), map -> { + map.put(profileId, ProfileMuseumData.EMPTY); + })); + + if (playerData.get(profileId).stale()) updateData4ProfileMember(uuid, profileId); + } + } + + public static boolean hasItemInMuseum(String id) { + String uuid = UndashedUuid.toString(MinecraftClient.getInstance().getSession().getUuidOrNull()); + ObjectOpenHashSet collectedItemIds = MUSEUM_ITEM_CACHE.get(uuid).get(Utils.getProfileId()).collectedItemIds(); + + return collectedItemIds != null && collectedItemIds.contains(id); + } + + private record ProfileMuseumData(long lastUpdated, ObjectOpenHashSet collectedItemIds) { + private static final ProfileMuseumData EMPTY = new ProfileMuseumData(0L, null); + private static final long MAX_AGE = 86_400_000; + + private boolean stale() { + return System.currentTimeMillis() > lastUpdated + MAX_AGE; + } + } +} diff --git a/src/main/java/de/hysky/skyblocker/utils/Http.java b/src/main/java/de/hysky/skyblocker/utils/Http.java index 94506b05..7e3a7a27 100644 --- a/src/main/java/de/hysky/skyblocker/utils/Http.java +++ b/src/main/java/de/hysky/skyblocker/utils/Http.java @@ -51,7 +51,7 @@ public class Http { InputStream decodedInputStream = getDecodedInputStream(response); String body = new String(decodedInputStream.readAllBytes()); - return new ApiResponse(body, getCacheStatus(response.headers())); + return new ApiResponse(body, response.statusCode(), getCacheStatus(response.headers())); } public static HttpHeaders sendHeadRequest(String url) throws IOException, InterruptedException { @@ -120,7 +120,11 @@ public class Http { } //TODO If ever needed, we could just replace cache status with the response headers and go from there - public record ApiResponse(String content, String cacheStatus) { + public record ApiResponse(String content, int statusCode, String cacheStatus) { + + public boolean ok() { + return statusCode == 200; + } public boolean cached() { return cacheStatus.equals("HIT"); diff --git a/src/main/java/de/hysky/skyblocker/utils/Utils.java b/src/main/java/de/hysky/skyblocker/utils/Utils.java index 1205c71b..ff406b61 100644 --- a/src/main/java/de/hysky/skyblocker/utils/Utils.java +++ b/src/main/java/de/hysky/skyblocker/utils/Utils.java @@ -3,6 +3,7 @@ package de.hysky.skyblocker.utils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; import de.hysky.skyblocker.events.SkyblockEvents; +import de.hysky.skyblocker.skyblock.item.MuseumItemCache; import de.hysky.skyblocker.skyblock.item.PriceInfoTooltip; import de.hysky.skyblocker.skyblock.rift.TheRift; import de.hysky.skyblocker.utils.scheduler.MessageScheduler; @@ -365,6 +366,8 @@ public class Utils { if (isOnSkyblock && message.startsWith("Profile ID: ")) { profileId = message.replace("Profile ID: ", ""); + + MuseumItemCache.tick(profileId); } return true; -- cgit From b3aa62a6d1f51f39021172f2c81b27236f7ebaa3 Mon Sep 17 00:00:00 2001 From: Aaron <51387595+AzureAaron@users.noreply.github.com> Date: Sat, 28 Oct 2023 00:16:22 -0400 Subject: Vanilla over Renderer --- build.gradle | 6 ++-- .../hysky/skyblocker/skyblock/TeleportOverlay.java | 7 ---- .../skyblocker/utils/render/RenderHelper.java | 42 ++++++++++++++++------ 3 files changed, 35 insertions(+), 20 deletions(-) diff --git a/build.gradle b/build.gradle index fde768d5..bf122cf2 100644 --- a/build.gradle +++ b/build.gradle @@ -60,9 +60,9 @@ dependencies { modLocalRuntime "dev.emi:emi-fabric:${project.emi_version}" // Renderer (https://github.com/0x3C50/Renderer) - include modImplementation("com.github.0x3C50:Renderer:${project.renderer_version}") { - exclude group: "io.github.ladysnake" exclude module: "satin" - } + //include modImplementation("com.github.0x3C50:Renderer:${project.renderer_version}") { + //exclude group: "io.github.ladysnake" exclude module: "satin" + //} include modImplementation("meteordevelopment:discord-ipc:1.1") diff --git a/src/main/java/de/hysky/skyblocker/skyblock/TeleportOverlay.java b/src/main/java/de/hysky/skyblocker/skyblock/TeleportOverlay.java index 5ea5513e..36e25d5c 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/TeleportOverlay.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/TeleportOverlay.java @@ -1,6 +1,5 @@ package de.hysky.skyblocker.skyblock; -import com.mojang.blaze3d.systems.RenderSystem; import de.hysky.skyblocker.config.SkyblockerConfigManager; import de.hysky.skyblocker.skyblock.item.PriceInfoTooltip; import de.hysky.skyblocker.utils.ItemUtils; @@ -103,13 +102,7 @@ public class TeleportOverlay { @SuppressWarnings("DataFlowIssue") BlockState state = client.world.getBlockState(pos); if (!state.isAir() && client.world.getBlockState(pos.up()).isAir() && client.world.getBlockState(pos.up(2)).isAir()) { - RenderSystem.polygonOffset(-1f, -10f); - RenderSystem.enablePolygonOffset(); - RenderHelper.renderFilledIfVisible(wrc, pos, COLOR_COMPONENTS, 0.5f); - - RenderSystem.polygonOffset(0f, 0f); - RenderSystem.disablePolygonOffset(); } } } 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 4cfaef8f..6c36107b 100644 --- a/src/main/java/de/hysky/skyblocker/utils/render/RenderHelper.java +++ b/src/main/java/de/hysky/skyblocker/utils/render/RenderHelper.java @@ -5,7 +5,6 @@ import de.hysky.skyblocker.mixin.accessor.BeaconBlockEntityRendererInvoker; import de.hysky.skyblocker.utils.render.culling.OcclusionCulling; import de.hysky.skyblocker.utils.render.title.Title; import de.hysky.skyblocker.utils.render.title.TitleContainer; -import me.x150.renderer.render.Renderer3d; import net.fabricmc.fabric.api.client.rendering.v1.WorldRenderContext; import net.minecraft.client.MinecraftClient; import net.minecraft.client.font.TextRenderer; @@ -22,8 +21,6 @@ import org.joml.Matrix3f; import org.joml.Matrix4f; import org.lwjgl.opengl.GL11; -import java.awt.*; - public class RenderHelper { private static final Vec3d ONE = new Vec3d(1, 1, 1); private static final int MAX_OVERWORLD_BUILD_HEIGHT = 319; @@ -36,20 +33,45 @@ public class RenderHelper { public static void renderFilledThroughWalls(WorldRenderContext context, BlockPos pos, float[] colorComponents, float alpha) { if (FrustumUtils.isVisible(pos.getX(), pos.getY(), pos.getZ(), pos.getX() + 1, pos.getY() + 1, pos.getZ() + 1)) { - Renderer3d.renderThroughWalls(); - renderFilled(context, pos, colorComponents, alpha); - Renderer3d.stopRenderThroughWalls(); + renderFilled(context, Vec3d.of(pos), ONE, colorComponents, alpha, true); } } public static void renderFilledIfVisible(WorldRenderContext context, BlockPos pos, float[] colorComponents, float alpha) { if (OcclusionCulling.isVisible(pos.getX(), pos.getY(), pos.getZ(), pos.getX() + 1, pos.getY() + 1, pos.getZ() + 1)) { - renderFilled(context, pos, colorComponents, alpha); + renderFilled(context, Vec3d.of(pos), ONE, colorComponents, alpha, false); } } - - private static void renderFilled(WorldRenderContext context, BlockPos pos, float[] colorComponents, float alpha) { - Renderer3d.renderFilled(context.matrixStack(), new Color(colorComponents[0], colorComponents[1], colorComponents[2], alpha), Vec3d.of(pos), ONE); + + private static void renderFilled(WorldRenderContext context, Vec3d pos, Vec3d dimensions, float[] colorComponents, float alpha, boolean throughWalls) { + MatrixStack matrices = context.matrixStack(); + Vec3d camera = context.camera().getPos(); + Tessellator tessellator = RenderSystem.renderThreadTesselator(); + BufferBuilder buffer = tessellator.getBuffer(); + + matrices.push(); + matrices.translate(-camera.x, -camera.y, -camera.z); + + RenderSystem.setShader(GameRenderer::getPositionColorProgram); + RenderSystem.setShaderColor(1f, 1f, 1f, 1f); + RenderSystem.polygonOffset(-1f, -10f); + RenderSystem.enablePolygonOffset(); + RenderSystem.enableBlend(); + RenderSystem.defaultBlendFunc(); + RenderSystem.enableDepthTest(); + RenderSystem.depthFunc(throughWalls ? GL11.GL_ALWAYS : GL11.GL_LEQUAL); + RenderSystem.disableCull(); + + buffer.begin(DrawMode.TRIANGLE_STRIP, VertexFormats.POSITION_COLOR); + WorldRenderer.renderFilledBox(matrices, buffer, pos.x, pos.y, pos.z, pos.x + dimensions.x, pos.y + dimensions.y, pos.z + dimensions.z, colorComponents[0], colorComponents[1], colorComponents[2], alpha); + tessellator.draw(); + + matrices.pop(); + RenderSystem.polygonOffset(0f, 0f); + RenderSystem.disablePolygonOffset(); + RenderSystem.disableBlend(); + RenderSystem.disableDepthTest(); + RenderSystem.enableCull(); } private static void renderBeaconBeam(WorldRenderContext context, BlockPos pos, float[] colorComponents) { -- cgit From aae70a4160761465b03d310ca5c5dd8b31df17d5 Mon Sep 17 00:00:00 2001 From: Aaron <51387595+AzureAaron@users.noreply.github.com> Date: Sat, 28 Oct 2023 00:38:45 -0400 Subject: Remove renderer --- build.gradle | 5 ----- gradle.properties | 2 -- 2 files changed, 7 deletions(-) diff --git a/build.gradle b/build.gradle index bf122cf2..72432203 100644 --- a/build.gradle +++ b/build.gradle @@ -59,11 +59,6 @@ dependencies { modCompileOnly "dev.emi:emi-fabric:${project.emi_version}:api" modLocalRuntime "dev.emi:emi-fabric:${project.emi_version}" - // Renderer (https://github.com/0x3C50/Renderer) - //include modImplementation("com.github.0x3C50:Renderer:${project.renderer_version}") { - //exclude group: "io.github.ladysnake" exclude module: "satin" - //} - include modImplementation("meteordevelopment:discord-ipc:1.1") // Mixin Extras (https://github.com/LlamaLad7/MixinExtras) diff --git a/gradle.properties b/gradle.properties index 42529261..6c364898 100644 --- a/gradle.properties +++ b/gradle.properties @@ -20,8 +20,6 @@ mod_menu_version = 8.0.0 rei_version = 13.0.666 ## EMI (https://modrinth.com/mod/emi/versions) emi_version = 1.0.22+1.20.2 -## Renderer (https://github.com/0x3C50/Renderer) -renderer_version = master-SNAPSHOT # Minecraft and Related Libraries ## Mixin Extras (https://github.com/LlamaLad7/MixinExtras) -- cgit From 1cbf455f1b065db83a9b2f433a68fb99d0647494 Mon Sep 17 00:00:00 2001 From: Aaron <51387595+AzureAaron@users.noreply.github.com> Date: Sat, 28 Oct 2023 00:48:51 -0400 Subject: Restore LEQUAL depth test --- src/main/java/de/hysky/skyblocker/utils/render/RenderHelper.java | 1 + 1 file changed, 1 insertion(+) 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 6c36107b..064b564c 100644 --- a/src/main/java/de/hysky/skyblocker/utils/render/RenderHelper.java +++ b/src/main/java/de/hysky/skyblocker/utils/render/RenderHelper.java @@ -71,6 +71,7 @@ public class RenderHelper { RenderSystem.disablePolygonOffset(); RenderSystem.disableBlend(); RenderSystem.disableDepthTest(); + RenderSystem.depthFunc(GL11.GL_LEQUAL); RenderSystem.enableCull(); } -- cgit From 158782dabf00a009d7a431f20d4cb2227ffc4298 Mon Sep 17 00:00:00 2001 From: Aaron <51387595+AzureAaron@users.noreply.github.com> Date: Sat, 28 Oct 2023 00:50:26 -0400 Subject: Use Api Redirect (#388) Redirects to api.azureaaron.net --- src/main/java/de/hysky/skyblocker/utils/Http.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/de/hysky/skyblocker/utils/Http.java b/src/main/java/de/hysky/skyblocker/utils/Http.java index 94506b05..c961b56f 100644 --- a/src/main/java/de/hysky/skyblocker/utils/Http.java +++ b/src/main/java/de/hysky/skyblocker/utils/Http.java @@ -26,7 +26,7 @@ import net.minecraft.SharedConstants; */ public class Http { private static final String NAME_2_UUID = "https://api.minecraftservices.com/minecraft/profile/lookup/name/"; - private static final String HYPIXEL_PROXY = "https://api.azureaaron.net/hypixel/"; + private static final String HYPIXEL_PROXY = "https://hysky.de/api/hypixel/"; private static final String USER_AGENT = "Skyblocker/" + SkyblockerMod.VERSION + " (" + SharedConstants.getGameVersion().getName() + ")"; private static final HttpClient HTTP_CLIENT = HttpClient.newBuilder() .connectTimeout(Duration.ofSeconds(10)) -- cgit From e00501cda9bec3da79896f098279c2f2a0f1a926 Mon Sep 17 00:00:00 2001 From: Kevinthegreat <92656833+kevinthegreat1@users.noreply.github.com> Date: Mon, 23 Oct 2023 14:51:57 -0400 Subject: Abstract Waypoint --- .../hysky/skyblocker/config/SkyblockerConfig.java | 22 +---- .../config/categories/DungeonsCategory.java | 4 +- .../skyblock/dungeon/secrets/SecretWaypoint.java | 48 +++-------- .../hysky/skyblocker/utils/waypoint/Waypoint.java | 95 ++++++++++++++++++++++ 4 files changed, 112 insertions(+), 57 deletions(-) create mode 100644 src/main/java/de/hysky/skyblocker/utils/waypoint/Waypoint.java diff --git a/src/main/java/de/hysky/skyblocker/config/SkyblockerConfig.java b/src/main/java/de/hysky/skyblocker/config/SkyblockerConfig.java index 51f3f098..8905644f 100644 --- a/src/main/java/de/hysky/skyblocker/config/SkyblockerConfig.java +++ b/src/main/java/de/hysky/skyblocker/config/SkyblockerConfig.java @@ -2,6 +2,7 @@ package de.hysky.skyblocker.config; import de.hysky.skyblocker.skyblock.item.CustomArmorTrims; import de.hysky.skyblocker.utils.chat.ChatFilterResult; +import de.hysky.skyblocker.utils.waypoint.Waypoint; import dev.isxander.yacl3.config.v2.api.SerialEntry; import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap; import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; @@ -582,7 +583,7 @@ public class SkyblockerConfig { public boolean noInitSecretWaypoints = false; @SerialEntry - public WaypointType waypointType = WaypointType.WAYPOINT; + public Waypoint.Type waypointType = Waypoint.Type.WAYPOINT; @SerialEntry public boolean showSecretText = true; @@ -623,25 +624,6 @@ public class SkyblockerConfig { @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 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 2cdde89d..fdb13892 100644 --- a/src/main/java/de/hysky/skyblocker/config/categories/DungeonsCategory.java +++ b/src/main/java/de/hysky/skyblocker/config/categories/DungeonsCategory.java @@ -2,7 +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 de.hysky.skyblocker.utils.waypoint.Waypoint.Type; import dev.isxander.yacl3.api.ButtonOption; import dev.isxander.yacl3.api.ConfigCategory; import dev.isxander.yacl3.api.Option; @@ -44,7 +44,7 @@ public class DungeonsCategory { .controller(ConfigUtils::createBooleanController) .flag(OptionFlag.GAME_RESTART) .build()) - .option(Option.createBuilder() + .option(Option.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, 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 a520c73f..72cc5ad8 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 @@ -4,37 +4,35 @@ import com.google.gson.JsonObject; import de.hysky.skyblocker.config.SkyblockerConfig; import de.hysky.skyblocker.config.SkyblockerConfigManager; import de.hysky.skyblocker.utils.render.RenderHelper; +import de.hysky.skyblocker.utils.waypoint.Waypoint; import net.fabricmc.fabric.api.client.rendering.v1.WorldRenderContext; import net.minecraft.client.MinecraftClient; 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; import java.util.function.Predicate; +import java.util.function.Supplier; import java.util.function.ToDoubleFunction; -public class SecretWaypoint { - private static final float HIGHLIGHT_ALPHA = 0.5f; - private static final float LINE_WIDTH = 5f; +public class SecretWaypoint extends Waypoint { static final List SECRET_ITEMS = List.of("Decoy", "Defuse Kit", "Dungeon Chest Key", "Healing VIII", "Inflatable Jerry", "Spirit Leap", "Training Weights", "Trap", "Treasure Talisman"); + private static final SkyblockerConfig.SecretWaypoints config = SkyblockerConfigManager.get().locations.dungeons.secretWaypoints; + private static final Supplier typeSupplier = () -> config.waypointType; final int secretIndex; final Category category; private final Text name; - private final BlockPos pos; private final Vec3d centerPos; - private boolean missing; SecretWaypoint(int secretIndex, JsonObject waypoint, String name, BlockPos pos) { + super(pos, typeSupplier, Category.get(waypoint).colorComponents); this.secretIndex = secretIndex; this.category = Category.get(waypoint); this.name = Text.of(name); - this.pos = pos; this.centerPos = pos.toCenterPos(); - this.missing = true; } static ToDoubleFunction getSquaredDistanceToFunction(Entity entity) { @@ -45,8 +43,9 @@ public class SecretWaypoint { return secretWaypoint -> entity.squaredDistanceTo(secretWaypoint.centerPos) <= 36D; } - boolean shouldRender() { - return category.isEnabled() && missing; + @Override + protected boolean shouldRender() { + return super.shouldRender() && category.isEnabled(); } boolean needsInteraction() { @@ -65,34 +64,13 @@ public class SecretWaypoint { return category.isBat(); } - void setFound() { - this.missing = false; - } - - void setMissing() { - this.missing = true; - } - /** * Renders the secret waypoint, including a filled cube, a beacon beam, the name, and the distance from the player. */ - void render(WorldRenderContext context) { - 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); - } + @Override + protected void render(WorldRenderContext context) { + //TODO In the future, shrink the box for wither essence and items so its more realistic + super.render(context); if (config.showSecretText) { Vec3d posUp = centerPos.add(0, 1, 0); diff --git a/src/main/java/de/hysky/skyblocker/utils/waypoint/Waypoint.java b/src/main/java/de/hysky/skyblocker/utils/waypoint/Waypoint.java new file mode 100644 index 00000000..2cb37e6b --- /dev/null +++ b/src/main/java/de/hysky/skyblocker/utils/waypoint/Waypoint.java @@ -0,0 +1,95 @@ +package de.hysky.skyblocker.utils.waypoint; + +import de.hysky.skyblocker.utils.render.RenderHelper; +import net.fabricmc.fabric.api.client.rendering.v1.WorldRenderContext; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Box; + +import java.util.function.Supplier; + +public class Waypoint { + protected static final float DEFAULT_HIGHLIGHT_ALPHA = 0.5f; + protected static final float DEFAULT_LINE_WIDTH = 5f; + protected final BlockPos pos; + protected final Box box; + protected final Supplier typeSupplier; + protected final float[] colorComponents; + protected final float alpha; + protected final float lineWidth; + protected final boolean throughWalls; + protected boolean shouldRender; + + protected Waypoint(BlockPos pos, Supplier typeSupplier, float[] colorComponents) { + this(pos, typeSupplier, colorComponents, DEFAULT_HIGHLIGHT_ALPHA); + } + + protected Waypoint(BlockPos pos, Supplier typeSupplier, float[] colorComponents, float alpha) { + this(pos, typeSupplier, colorComponents, alpha, DEFAULT_LINE_WIDTH); + } + + protected Waypoint(BlockPos pos, Supplier typeSupplier, float[] colorComponents, float alpha, float lineWidth) { + this(pos, typeSupplier, colorComponents, alpha, lineWidth, true); + } + + protected Waypoint(BlockPos pos, Supplier typeSupplier, float[] colorComponents, float alpha, float lineWidth, boolean throughWalls) { + this(pos, typeSupplier, colorComponents, alpha, lineWidth, throughWalls, true); + } + + protected Waypoint(BlockPos pos, Supplier typeSupplier, float[] colorComponents, float alpha, float lineWidth, boolean throughWalls, boolean shouldRender) { + this.pos = pos; + this.box = new Box(pos); + this.typeSupplier = typeSupplier; + this.colorComponents = colorComponents; + this.alpha = alpha; + this.lineWidth = lineWidth; + this.throughWalls = throughWalls; + this.shouldRender = shouldRender; + } + + protected boolean shouldRender() { + return shouldRender; + } + + public void setFound() { + this.shouldRender = false; + } + + public void setMissing() { + this.shouldRender = true; + } + + protected void render(WorldRenderContext context) { + switch (typeSupplier.get()) { + case WAYPOINT -> RenderHelper.renderFilledThroughWallsWithBeaconBeam(context, pos, colorComponents, alpha); + case OUTLINED_WAYPOINT -> { + RenderHelper.renderFilledThroughWallsWithBeaconBeam(context, pos, colorComponents, alpha); + RenderHelper.renderOutline(context, box, colorComponents, lineWidth, throughWalls); + } + case HIGHLIGHT -> RenderHelper.renderFilledThroughWalls(context, pos, colorComponents, alpha); + case OUTLINED_HIGHLIGHT -> { + RenderHelper.renderFilledThroughWalls(context, pos, colorComponents, alpha); + RenderHelper.renderOutline(context, box, colorComponents, lineWidth, throughWalls); + } + case OUTLINE -> RenderHelper.renderOutline(context, box, colorComponents, lineWidth, throughWalls); + } + } + + public enum Type { + 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"; + }; + } + } +} -- cgit From 4d9329a9388bd366d6853615efbce5cb5c328643 Mon Sep 17 00:00:00 2001 From: Kevinthegreat <92656833+kevinthegreat1@users.noreply.github.com> Date: Mon, 23 Oct 2023 21:44:48 -0400 Subject: Abstract MythologicalRitual Waypoints --- .../skyblock/diana/MythologicalRitual.java | 23 +++++++++++++++------- .../skyblock/dungeon/secrets/SecretWaypoint.java | 4 ++-- .../hysky/skyblocker/utils/waypoint/Waypoint.java | 22 ++++++++++++--------- 3 files changed, 31 insertions(+), 18 deletions(-) diff --git a/src/main/java/de/hysky/skyblocker/skyblock/diana/MythologicalRitual.java b/src/main/java/de/hysky/skyblocker/skyblock/diana/MythologicalRitual.java index c407e911..e2962702 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/diana/MythologicalRitual.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/diana/MythologicalRitual.java @@ -6,6 +6,7 @@ import de.hysky.skyblocker.config.SkyblockerConfigManager; import de.hysky.skyblocker.utils.ItemUtils; import de.hysky.skyblocker.utils.Utils; import de.hysky.skyblocker.utils.render.RenderHelper; +import de.hysky.skyblocker.utils.waypoint.Waypoint; import net.fabricmc.fabric.api.client.command.v2.ClientCommandRegistrationCallback; import net.fabricmc.fabric.api.client.message.v1.ClientReceiveMessageEvents; import net.fabricmc.fabric.api.client.rendering.v1.WorldRenderContext; @@ -49,7 +50,7 @@ public class MythologicalRitual { private static final Map griffinBurrows = new HashMap<>(); @Nullable private static BlockPos lastDugBurrowPos; - private static GriffinBurrow previousBurrow = new GriffinBurrow(); + private static GriffinBurrow previousBurrow = new GriffinBurrow(BlockPos.ORIGIN); public static void init() { WorldRenderEvents.AFTER_TRANSLUCENT.register(MythologicalRitual::render); @@ -82,7 +83,7 @@ public class MythologicalRitual { if (MinecraftClient.getInstance().world == null || !MinecraftClient.getInstance().world.getBlockState(pos).isOf(Blocks.GRASS_BLOCK)) { return; } - GriffinBurrow burrow = griffinBurrows.computeIfAbsent(pos, pos1 -> new GriffinBurrow()); + GriffinBurrow burrow = griffinBurrows.computeIfAbsent(pos, GriffinBurrow::new); if (ParticleTypes.CRIT.equals(packet.getParameters().getType())) burrow.critParticle++; if (ParticleTypes.ENCHANT.equals(packet.getParameters().getType())) burrow.enchantParticle++; if (burrow.critParticle >= 5 && burrow.enchantParticle >= 5 && burrow.confirmed == TriState.FALSE) { @@ -133,10 +134,9 @@ public class MythologicalRitual { public static void render(WorldRenderContext context) { if (isActive()) { - for (Map.Entry burrowEntry : griffinBurrows.entrySet()) { - GriffinBurrow burrow = burrowEntry.getValue(); - if (burrow.confirmed == TriState.TRUE) { - RenderHelper.renderFilledThroughWallsWithBeaconBeam(context, burrowEntry.getKey(), ORANGE_COLOR_COMPONENTS, 0.25F); + for (GriffinBurrow burrow : griffinBurrows.values()) { + if (burrow.shouldRender()) { + burrow.render(context); } if (burrow.confirmed != TriState.FALSE) { if (burrow.nextBurrowPlane != null) { @@ -186,7 +186,7 @@ public class MythologicalRitual { return SkyblockerConfigManager.get().general.mythologicalRitual.enableMythologicalRitualHelper && Utils.getLocationRaw().equals("hub"); } - private static class GriffinBurrow { + private static class GriffinBurrow extends Waypoint { private int critParticle; private int enchantParticle; private TriState confirmed = TriState.FALSE; @@ -196,9 +196,18 @@ public class MythologicalRitual { private Vec3d[] echoBurrowDirection; private Vec3d[] echoBurrowPlane; + private GriffinBurrow(BlockPos pos) { + super(pos, Type.WAYPOINT, ORANGE_COLOR_COMPONENTS, 0.25F); + } + private void init() { confirmed = TriState.TRUE; regression.clear(); } + + @Override + public boolean shouldRender() { + return super.shouldRender() && confirmed == TriState.TRUE; + } } } 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 72cc5ad8..ab6d6f7d 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 @@ -44,7 +44,7 @@ public class SecretWaypoint extends Waypoint { } @Override - protected boolean shouldRender() { + public boolean shouldRender() { return super.shouldRender() && category.isEnabled(); } @@ -68,7 +68,7 @@ public class SecretWaypoint extends Waypoint { * Renders the secret waypoint, including a filled cube, a beacon beam, the name, and the distance from the player. */ @Override - protected void render(WorldRenderContext context) { + public void render(WorldRenderContext context) { //TODO In the future, shrink the box for wither essence and items so its more realistic super.render(context); diff --git a/src/main/java/de/hysky/skyblocker/utils/waypoint/Waypoint.java b/src/main/java/de/hysky/skyblocker/utils/waypoint/Waypoint.java index 2cb37e6b..26190d60 100644 --- a/src/main/java/de/hysky/skyblocker/utils/waypoint/Waypoint.java +++ b/src/main/java/de/hysky/skyblocker/utils/waypoint/Waypoint.java @@ -11,18 +11,22 @@ public class Waypoint { protected static final float DEFAULT_HIGHLIGHT_ALPHA = 0.5f; protected static final float DEFAULT_LINE_WIDTH = 5f; protected final BlockPos pos; - protected final Box box; - protected final Supplier typeSupplier; - protected final float[] colorComponents; - protected final float alpha; - protected final float lineWidth; - protected final boolean throughWalls; - protected boolean shouldRender; + private final Box box; + private final Supplier typeSupplier; + private final float[] colorComponents; + private final float alpha; + private final float lineWidth; + private final boolean throughWalls; + private boolean shouldRender; protected Waypoint(BlockPos pos, Supplier typeSupplier, float[] colorComponents) { this(pos, typeSupplier, colorComponents, DEFAULT_HIGHLIGHT_ALPHA); } + protected Waypoint(BlockPos pos, Type type, float[] colorComponents, float alpha) { + this(pos, () -> type, colorComponents, alpha); + } + protected Waypoint(BlockPos pos, Supplier typeSupplier, float[] colorComponents, float alpha) { this(pos, typeSupplier, colorComponents, alpha, DEFAULT_LINE_WIDTH); } @@ -46,7 +50,7 @@ public class Waypoint { this.shouldRender = shouldRender; } - protected boolean shouldRender() { + public boolean shouldRender() { return shouldRender; } @@ -58,7 +62,7 @@ public class Waypoint { this.shouldRender = true; } - protected void render(WorldRenderContext context) { + public void render(WorldRenderContext context) { switch (typeSupplier.get()) { case WAYPOINT -> RenderHelper.renderFilledThroughWallsWithBeaconBeam(context, pos, colorComponents, alpha); case OUTLINED_WAYPOINT -> { -- cgit From 739eeb014e31aec54ad12b4ef14f95eca4bc2dea Mon Sep 17 00:00:00 2001 From: Kevinthegreat <92656833+kevinthegreat1@users.noreply.github.com> Date: Mon, 23 Oct 2023 22:47:15 -0400 Subject: Support for adding custom waypoints --- .../skyblock/dungeon/secrets/DungeonSecrets.java | 51 +++++++++++++- .../skyblock/dungeon/secrets/SecretWaypoint.java | 80 +++++++++++++--------- 2 files changed, 98 insertions(+), 33 deletions(-) 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 08b84852..38dc1060 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 @@ -5,13 +5,16 @@ import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.mojang.brigadier.Command; import com.mojang.brigadier.arguments.IntegerArgumentType; +import com.mojang.brigadier.arguments.StringArgumentType; import com.mojang.brigadier.builder.ArgumentBuilder; import com.mojang.brigadier.builder.RequiredArgumentBuilder; +import com.mojang.brigadier.context.CommandContext; 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 de.hysky.skyblocker.utils.waypoint.Waypoint; import it.unimi.dsi.fastutil.objects.Object2ByteMap; import it.unimi.dsi.fastutil.objects.Object2ByteOpenHashMap; import it.unimi.dsi.fastutil.objects.ObjectIntPair; @@ -24,6 +27,8 @@ import net.fabricmc.fabric.api.client.rendering.v1.WorldRenderEvents; import net.fabricmc.fabric.api.event.player.UseBlockCallback; import net.minecraft.client.MinecraftClient; import net.minecraft.client.network.ClientPlayerEntity; +import net.minecraft.command.argument.BlockPosArgumentType; +import net.minecraft.command.argument.PosArgument; import net.minecraft.entity.ItemEntity; import net.minecraft.entity.LivingEntity; import net.minecraft.entity.mob.AmbientEntity; @@ -33,6 +38,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.item.Items; import net.minecraft.item.map.MapState; import net.minecraft.resource.Resource; +import net.minecraft.server.command.ServerCommandSource; import net.minecraft.text.Text; import net.minecraft.util.ActionResult; import net.minecraft.util.Identifier; @@ -101,6 +107,7 @@ public class DungeonSecrets { private static final Map rooms = new HashMap<>(); private static final Map roomsJson = new HashMap<>(); private static final Map waypointsJson = new HashMap<>(); + private static final Map customWaypoints = new HashMap<>(); @Nullable private static CompletableFuture roomsLoaded; /** @@ -154,7 +161,10 @@ public class DungeonSecrets { .then(literal("markAsFound").then(markSecretsCommand(true))) .then(literal("markAsMissing").then(markSecretsCommand(false))) .then(literal("getRelativePos").executes(context -> getRelativePos(context.getSource()))) - .then(literal("getRelativeTargetPos").executes(context -> getRelativeTargetPos(context.getSource()))))))); + .then(literal("getRelativeTargetPos").executes(context -> getRelativeTargetPos(context.getSource()))) + .then(literal("addWaypoint").then(addWaypointCommand(false))) + .then(literal("addWaypointRelatively").then(addWaypointCommand(true))) + )))); ClientPlayConnectionEvents.JOIN.register(((handler, sender, client) -> reset())); } @@ -253,6 +263,42 @@ public class DungeonSecrets { return Command.SINGLE_SUCCESS; } + private static ArgumentBuilder> addWaypointCommand(boolean relative) { + return argument("pos", BlockPosArgumentType.blockPos()) + .then(argument("secretIndex", IntegerArgumentType.integer()) + .then(argument("category", SecretWaypoint.Category.CategoryArgumentType.category()) + .then(argument("name", StringArgumentType.greedyString()).executes(context -> { + // TODO Less hacky way with custom ClientBlockPosArgumentType + BlockPos pos = context.getArgument("pos", PosArgument.class).toAbsoluteBlockPos(new ServerCommandSource(null, context.getSource().getPosition(), context.getSource().getRotation(), null, 0, null, null, null, null)); + return relative ? addWaypointRelative(context, pos) : addWaypoint(context, pos); + })) + ) + ); + } + + private static int addWaypoint(CommandContext context, BlockPos pos) { + Room room = getRoomAtPhysical(pos); + if (isRoomMatched(room)) { + addWaypointRelative(context, room, room.actualToRelative(pos)); + } else { + context.getSource().sendError(Constants.PREFIX.get().append(Text.translatable("skyblocker.dungeons.secrets.notMatched"))); + } + return Command.SINGLE_SUCCESS; + } + + private static int addWaypointRelative(CommandContext context, BlockPos pos) { + if (isCurrentRoomMatched()) { + addWaypointRelative(context, currentRoom, pos); + } else { + context.getSource().sendError(Constants.PREFIX.get().append(Text.translatable("skyblocker.dungeons.secrets.notMatched"))); + } + return Command.SINGLE_SUCCESS; + } + + private static void addWaypointRelative(CommandContext context, Room room, BlockPos pos) { + customWaypoints.put(room.getName(), new SecretWaypoint(IntegerArgumentType.getInteger(context, "secretIndex"), SecretWaypoint.Category.CategoryArgumentType.getCategory(context, "category"), StringArgumentType.getString(context, "name"), pos)); + } + /** * Updates the dungeon. The general idea is similar to the Dungeon Rooms Mod. *

    @@ -326,7 +372,8 @@ public class DungeonSecrets { } switch (type) { case ENTRANCE, PUZZLE, TRAP, MINIBOSS, FAIRY, BLOOD -> room = newRoom(type, physicalPos); - case ROOM -> room = newRoom(type, DungeonMapUtils.getPhysicalPosFromMap(mapEntrancePos, mapRoomSize, physicalEntrancePos, DungeonMapUtils.getRoomSegments(map, mapPos, mapRoomSize, type.color))); + case ROOM -> + room = newRoom(type, DungeonMapUtils.getPhysicalPosFromMap(mapEntrancePos, mapRoomSize, physicalEntrancePos, DungeonMapUtils.getRoomSegments(map, mapPos, mapRoomSize, type.color))); } } if (room != null && currentRoom != room) { 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 ab6d6f7d..5fbce68a 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,15 +1,20 @@ package de.hysky.skyblocker.skyblock.dungeon.secrets; import com.google.gson.JsonObject; +import com.mojang.brigadier.context.CommandContext; +import com.mojang.serialization.Codec; +import com.mojang.serialization.JsonOps; import de.hysky.skyblocker.config.SkyblockerConfig; import de.hysky.skyblocker.config.SkyblockerConfigManager; import de.hysky.skyblocker.utils.render.RenderHelper; import de.hysky.skyblocker.utils.waypoint.Waypoint; import net.fabricmc.fabric.api.client.rendering.v1.WorldRenderContext; import net.minecraft.client.MinecraftClient; +import net.minecraft.command.argument.EnumArgumentType; import net.minecraft.entity.Entity; import net.minecraft.text.Text; import net.minecraft.util.Formatting; +import net.minecraft.util.StringIdentifiable; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Vec3d; @@ -28,9 +33,13 @@ public class SecretWaypoint extends Waypoint { private final Vec3d centerPos; SecretWaypoint(int secretIndex, JsonObject waypoint, String name, BlockPos pos) { - super(pos, typeSupplier, Category.get(waypoint).colorComponents); + this(secretIndex, Category.get(waypoint), name, pos); + } + + SecretWaypoint(int secretIndex, Category category, String name, BlockPos pos) { + super(pos, typeSupplier, category.colorComponents); this.secretIndex = secretIndex; - this.category = Category.get(waypoint); + this.category = category; this.name = Text.of(name); this.centerPos = pos.toCenterPos(); } @@ -80,23 +89,26 @@ public class SecretWaypoint extends Waypoint { } } - enum Category { - ENTRANCE(secretWaypoints -> secretWaypoints.enableEntranceWaypoints, 0, 255, 0), - SUPERBOOM(secretWaypoints -> secretWaypoints.enableSuperboomWaypoints, 255, 0, 0), - CHEST(secretWaypoints -> secretWaypoints.enableChestWaypoints, 2, 213, 250), - ITEM(secretWaypoints -> secretWaypoints.enableItemWaypoints, 2, 64, 250), - BAT(secretWaypoints -> secretWaypoints.enableBatWaypoints, 142, 66, 0), - WITHER(secretWaypoints -> secretWaypoints.enableWitherWaypoints, 30, 30, 30), - LEVER(secretWaypoints -> secretWaypoints.enableLeverWaypoints, 250, 217, 2), - FAIRYSOUL(secretWaypoints -> secretWaypoints.enableFairySoulWaypoints, 255, 85, 255), - STONK(secretWaypoints -> secretWaypoints.enableStonkWaypoints, 146, 52, 235), - AOTV(secretWaypoints -> secretWaypoints.enableAotvWaypoints, 252, 98, 3), - PEARL(secretWaypoints -> secretWaypoints.enablePearlWaypoints, 57, 117, 125), - DEFAULT(secretWaypoints -> secretWaypoints.enableDefaultWaypoints, 190, 255, 252); + enum Category implements StringIdentifiable { + ENTRANCE("entrance", secretWaypoints -> secretWaypoints.enableEntranceWaypoints, 0, 255, 0), + SUPERBOOM("superboom", secretWaypoints -> secretWaypoints.enableSuperboomWaypoints, 255, 0, 0), + CHEST("chest", secretWaypoints -> secretWaypoints.enableChestWaypoints, 2, 213, 250), + ITEM("item", secretWaypoints -> secretWaypoints.enableItemWaypoints, 2, 64, 250), + BAT("bat", secretWaypoints -> secretWaypoints.enableBatWaypoints, 142, 66, 0), + WITHER("wither", secretWaypoints -> secretWaypoints.enableWitherWaypoints, 30, 30, 30), + LEVER("lever", secretWaypoints -> secretWaypoints.enableLeverWaypoints, 250, 217, 2), + FAIRYSOUL("fairysoul", secretWaypoints -> secretWaypoints.enableFairySoulWaypoints, 255, 85, 255), + STONK("stonk", secretWaypoints -> secretWaypoints.enableStonkWaypoints, 146, 52, 235), + AOTV("aotv", secretWaypoints -> secretWaypoints.enableAotvWaypoints, 252, 98, 3), + PEARL("pearl", secretWaypoints -> secretWaypoints.enablePearlWaypoints, 57, 117, 125), + DEFAULT("default", secretWaypoints -> secretWaypoints.enableDefaultWaypoints, 190, 255, 252); + private static final Codec CODEC = StringIdentifiable.createCodec(Category::values); + private final String name; private final Predicate enabledPredicate; private final float[] colorComponents; - Category(Predicate enabledPredicate, int... intColorComponents) { + Category(String name, Predicate enabledPredicate, int... intColorComponents) { + this.name = name; this.enabledPredicate = enabledPredicate; colorComponents = new float[intColorComponents.length]; for (int i = 0; i < intColorComponents.length; i++) { @@ -104,21 +116,8 @@ public class SecretWaypoint extends Waypoint { } } - private static Category get(JsonObject categoryJson) { - return switch (categoryJson.get("category").getAsString()) { - case "entrance" -> Category.ENTRANCE; - case "superboom" -> Category.SUPERBOOM; - case "chest" -> Category.CHEST; - case "item" -> Category.ITEM; - case "bat" -> Category.BAT; - case "wither" -> Category.WITHER; - case "lever" -> Category.LEVER; - case "fairysoul" -> Category.FAIRYSOUL; - case "stonk" -> Category.STONK; - case "aotv" -> Category.AOTV; - case "pearl" -> Category.PEARL; - default -> Category.DEFAULT; - }; + private static Category get(JsonObject waypointJson) { + return CODEC.parse(JsonOps.INSTANCE, waypointJson.get("category")).resultOrPartial(DungeonSecrets.LOGGER::error).orElseThrow(); } boolean needsInteraction() { @@ -140,5 +139,24 @@ public class SecretWaypoint extends Waypoint { boolean isEnabled() { return enabledPredicate.test(SkyblockerConfigManager.get().locations.dungeons.secretWaypoints); } + + @Override + public String asString() { + return name; + } + + static class CategoryArgumentType extends EnumArgumentType { + public CategoryArgumentType() { + super(Category.CODEC, Category::values); + } + + public static CategoryArgumentType category() { + return new CategoryArgumentType(); + } + + public static Category getCategory(CommandContext context, String name) { + return context.getArgument(name, Category.class); + } + } } } -- cgit From 47d80b6fabe48b5e5aab3ec800046e8cc3b2fdf5 Mon Sep 17 00:00:00 2001 From: Kevinthegreat <92656833+kevinthegreat1@users.noreply.github.com> Date: Mon, 23 Oct 2023 23:20:17 -0400 Subject: Render custom waypoints --- .../skyblocker/skyblock/dungeon/secrets/DungeonSecrets.java | 9 +++++++-- .../java/de/hysky/skyblocker/skyblock/dungeon/secrets/Room.java | 3 +++ src/main/java/de/hysky/skyblocker/utils/waypoint/Waypoint.java | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) 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 38dc1060..45eed595 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 @@ -1,5 +1,7 @@ package de.hysky.skyblocker.skyblock.dungeon.secrets; +import com.google.common.collect.Multimap; +import com.google.common.collect.MultimapBuilder; import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -14,7 +16,6 @@ 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 de.hysky.skyblocker.utils.waypoint.Waypoint; import it.unimi.dsi.fastutil.objects.Object2ByteMap; import it.unimi.dsi.fastutil.objects.Object2ByteOpenHashMap; import it.unimi.dsi.fastutil.objects.ObjectIntPair; @@ -107,7 +108,7 @@ public class DungeonSecrets { private static final Map rooms = new HashMap<>(); private static final Map roomsJson = new HashMap<>(); private static final Map waypointsJson = new HashMap<>(); - private static final Map customWaypoints = new HashMap<>(); + private static final Multimap customWaypoints = MultimapBuilder.hashKeys().arrayListValues().build(); @Nullable private static CompletableFuture roomsLoaded; /** @@ -139,6 +140,10 @@ public class DungeonSecrets { return waypointsJson.get(room).getAsJsonArray(); } + public static Collection getCustomWaypoints(String room) { + return customWaypoints.get(room); + } + /** * Loads the dungeon secrets asynchronously from {@code /assets/skyblocker/dungeons}. * Use {@link #isRoomsLoaded()} to check for completion of loading. diff --git a/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/Room.java b/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/Room.java index 0d7a444f..0840c727 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/Room.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/Room.java @@ -307,6 +307,9 @@ public class Room { BlockPos pos = DungeonMapUtils.relativeToActual(direction, physicalCornerPos, waypoint); secretWaypointsMutable.put(secretIndex, pos, new SecretWaypoint(secretIndex, waypoint, secretName, pos)); } + for (SecretWaypoint customWaypoint : DungeonSecrets.getCustomWaypoints(name)) { + secretWaypointsMutable.put(customWaypoint.secretIndex, customWaypoint.pos, customWaypoint); + } secretWaypoints = ImmutableTable.copyOf(secretWaypointsMutable); matched = TriState.TRUE; diff --git a/src/main/java/de/hysky/skyblocker/utils/waypoint/Waypoint.java b/src/main/java/de/hysky/skyblocker/utils/waypoint/Waypoint.java index 26190d60..e7858f05 100644 --- a/src/main/java/de/hysky/skyblocker/utils/waypoint/Waypoint.java +++ b/src/main/java/de/hysky/skyblocker/utils/waypoint/Waypoint.java @@ -10,7 +10,7 @@ import java.util.function.Supplier; public class Waypoint { protected static final float DEFAULT_HIGHLIGHT_ALPHA = 0.5f; protected static final float DEFAULT_LINE_WIDTH = 5f; - protected final BlockPos pos; + public final BlockPos pos; private final Box box; private final Supplier typeSupplier; private final float[] colorComponents; -- cgit From 1f358759f30925726756afa21405396a4ffc23d4 Mon Sep 17 00:00:00 2001 From: Kevinthegreat <92656833+kevinthegreat1@users.noreply.github.com> Date: Tue, 24 Oct 2023 00:08:44 -0400 Subject: Apply custom waypoint to existing rooms --- .../skyblock/dungeon/secrets/DungeonSecrets.java | 21 +++++++++++------- .../skyblocker/skyblock/dungeon/secrets/Room.java | 25 +++++++++++++++++----- .../skyblock/dungeon/secrets/SecretWaypoint.java | 8 +++++-- 3 files changed, 39 insertions(+), 15 deletions(-) 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 45eed595..461cbf68 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 @@ -61,6 +61,7 @@ import java.io.IOException; import java.io.ObjectInputStream; import java.util.*; import java.util.concurrent.CompletableFuture; +import java.util.stream.Stream; import java.util.zip.InflaterInputStream; import static net.fabricmc.fabric.api.client.command.v2.ClientCommandManager.argument; @@ -131,6 +132,10 @@ public class DungeonSecrets { return roomsLoaded != null && roomsLoaded.isDone(); } + public static Stream getRoomsStream() { + return rooms.values().stream(); + } + @SuppressWarnings("unused") public static JsonObject getRoomMetadata(String room) { return roomsJson.get(room).getAsJsonObject(); @@ -144,6 +149,11 @@ public class DungeonSecrets { return customWaypoints.get(room); } + @SuppressWarnings("UnusedReturnValue") + public static boolean addCustomWaypoint(String room, SecretWaypoint waypoint) { + return customWaypoints.put(room, waypoint); + } + /** * Loads the dungeon secrets asynchronously from {@code /assets/skyblocker/dungeons}. * Use {@link #isRoomsLoaded()} to check for completion of loading. @@ -284,7 +294,7 @@ public class DungeonSecrets { private static int addWaypoint(CommandContext context, BlockPos pos) { Room room = getRoomAtPhysical(pos); if (isRoomMatched(room)) { - addWaypointRelative(context, room, room.actualToRelative(pos)); + room.addWaypoint(context, room.actualToRelative(pos)); } else { context.getSource().sendError(Constants.PREFIX.get().append(Text.translatable("skyblocker.dungeons.secrets.notMatched"))); } @@ -293,17 +303,13 @@ public class DungeonSecrets { private static int addWaypointRelative(CommandContext context, BlockPos pos) { if (isCurrentRoomMatched()) { - addWaypointRelative(context, currentRoom, pos); + currentRoom.addWaypoint(context, pos); } else { context.getSource().sendError(Constants.PREFIX.get().append(Text.translatable("skyblocker.dungeons.secrets.notMatched"))); } return Command.SINGLE_SUCCESS; } - private static void addWaypointRelative(CommandContext context, Room room, BlockPos pos) { - customWaypoints.put(room.getName(), new SecretWaypoint(IntegerArgumentType.getInteger(context, "secretIndex"), SecretWaypoint.Category.CategoryArgumentType.getCategory(context, "category"), StringArgumentType.getString(context, "name"), pos)); - } - /** * Updates the dungeon. The general idea is similar to the Dungeon Rooms Mod. *

    @@ -377,8 +383,7 @@ public class DungeonSecrets { } switch (type) { case ENTRANCE, PUZZLE, TRAP, MINIBOSS, FAIRY, BLOOD -> room = newRoom(type, physicalPos); - case ROOM -> - room = newRoom(type, DungeonMapUtils.getPhysicalPosFromMap(mapEntrancePos, mapRoomSize, physicalEntrancePos, DungeonMapUtils.getRoomSegments(map, mapPos, mapRoomSize, type.color))); + case ROOM -> room = newRoom(type, DungeonMapUtils.getPhysicalPosFromMap(mapEntrancePos, mapRoomSize, physicalEntrancePos, DungeonMapUtils.getRoomSegments(map, mapPos, mapRoomSize, type.color))); } } if (room != null && currentRoom != room) { diff --git a/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/Room.java b/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/Room.java index 0840c727..c5b374a9 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/Room.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/Room.java @@ -1,14 +1,17 @@ package de.hysky.skyblocker.skyblock.dungeon.secrets; import com.google.common.collect.HashBasedTable; -import com.google.common.collect.ImmutableTable; import com.google.common.collect.Table; import com.google.gson.JsonElement; import com.google.gson.JsonObject; +import com.mojang.brigadier.arguments.IntegerArgumentType; +import com.mojang.brigadier.arguments.StringArgumentType; +import com.mojang.brigadier.context.CommandContext; import de.hysky.skyblocker.utils.scheduler.Scheduler; import it.unimi.dsi.fastutil.ints.IntRBTreeSet; import it.unimi.dsi.fastutil.ints.IntSortedSet; import it.unimi.dsi.fastutil.ints.IntSortedSets; +import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource; import net.fabricmc.fabric.api.client.rendering.v1.WorldRenderContext; import net.fabricmc.fabric.api.util.TriState; import net.minecraft.block.BlockState; @@ -153,6 +156,17 @@ public class Room { }; } + protected void addWaypoint(CommandContext context, BlockPos pos) { + String roomName = getName(); + SecretWaypoint secretWaypoint = new SecretWaypoint(IntegerArgumentType.getInteger(context, "secretIndex"), SecretWaypoint.Category.CategoryArgumentType.getCategory(context, "category"), StringArgumentType.getString(context, "name"), pos); + DungeonSecrets.addCustomWaypoint(roomName, secretWaypoint); + DungeonSecrets.getRoomsStream().filter(r -> roomName.equals(r.getName())).forEach(r -> { + BlockPos actualPos = r.relativeToActual(pos); + SecretWaypoint actualWaypoint = new SecretWaypoint(secretWaypoint.secretIndex, secretWaypoint.category, secretWaypoint.name, actualPos); + r.secretWaypoints.put(secretWaypoint.secretIndex, actualPos, actualWaypoint); + }); + } + /** * Updates the room. *

    @@ -299,18 +313,19 @@ public class Room { */ @SuppressWarnings("JavadocReference") private void roomMatched() { - Table secretWaypointsMutable = HashBasedTable.create(); + secretWaypoints = HashBasedTable.create(); for (JsonElement waypointElement : DungeonSecrets.getRoomWaypoints(name)) { JsonObject waypoint = waypointElement.getAsJsonObject(); String secretName = waypoint.get("secretName").getAsString(); int secretIndex = Integer.parseInt(secretName.substring(0, Character.isDigit(secretName.charAt(1)) ? 2 : 1)); BlockPos pos = DungeonMapUtils.relativeToActual(direction, physicalCornerPos, waypoint); - secretWaypointsMutable.put(secretIndex, pos, new SecretWaypoint(secretIndex, waypoint, secretName, pos)); + secretWaypoints.put(secretIndex, pos, new SecretWaypoint(secretIndex, waypoint, secretName, pos)); } for (SecretWaypoint customWaypoint : DungeonSecrets.getCustomWaypoints(name)) { - secretWaypointsMutable.put(customWaypoint.secretIndex, customWaypoint.pos, customWaypoint); + BlockPos actualPos = relativeToActual(customWaypoint.pos); + SecretWaypoint actualWaypoint = new SecretWaypoint(customWaypoint.secretIndex, customWaypoint.category, customWaypoint.name, actualPos); + secretWaypoints.put(customWaypoint.secretIndex, actualPos, actualWaypoint); } - secretWaypoints = ImmutableTable.copyOf(secretWaypointsMutable); matched = TriState.TRUE; DungeonSecrets.LOGGER.info("[Skyblocker] Room {} matched after checking {} block(s)", name, checkedBlocks.size()); 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 5fbce68a..d896bf35 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 @@ -29,7 +29,7 @@ public class SecretWaypoint extends Waypoint { private static final Supplier typeSupplier = () -> config.waypointType; final int secretIndex; final Category category; - private final Text name; + final Text name; private final Vec3d centerPos; SecretWaypoint(int secretIndex, JsonObject waypoint, String name, BlockPos pos) { @@ -37,10 +37,14 @@ public class SecretWaypoint extends Waypoint { } SecretWaypoint(int secretIndex, Category category, String name, BlockPos pos) { + this(secretIndex, category, Text.of(name), pos); + } + + SecretWaypoint(int secretIndex, Category category, Text name, BlockPos pos) { super(pos, typeSupplier, category.colorComponents); this.secretIndex = secretIndex; this.category = category; - this.name = Text.of(name); + this.name = name; this.centerPos = pos.toCenterPos(); } -- cgit From f29e54360776c0dffbaf4d23b6250e40edcdb2f6 Mon Sep 17 00:00:00 2001 From: Kevinthegreat <92656833+kevinthegreat1@users.noreply.github.com> Date: Tue, 24 Oct 2023 21:50:11 -0400 Subject: Refactor and add Javadocs --- .../skyblock/dungeon/secrets/DungeonSecrets.java | 19 ++++++--- .../skyblocker/skyblock/dungeon/secrets/Room.java | 45 +++++++++++++++------- .../skyblock/dungeon/secrets/SecretWaypoint.java | 16 +++++--- 3 files changed, 56 insertions(+), 24 deletions(-) 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 461cbf68..215fa33a 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 @@ -109,6 +109,9 @@ public class DungeonSecrets { private static final Map rooms = new HashMap<>(); private static final Map roomsJson = new HashMap<>(); private static final Map waypointsJson = new HashMap<>(); + /** + * The map of dungeon room names to custom waypoints relative to the room. + */ private static final Multimap customWaypoints = MultimapBuilder.hashKeys().arrayListValues().build(); @Nullable private static CompletableFuture roomsLoaded; @@ -145,10 +148,16 @@ public class DungeonSecrets { return waypointsJson.get(room).getAsJsonArray(); } + /** + * @see #customWaypoints + */ public static Collection getCustomWaypoints(String room) { return customWaypoints.get(room); } + /** + * @see #customWaypoints + */ @SuppressWarnings("UnusedReturnValue") public static boolean addCustomWaypoint(String room, SecretWaypoint waypoint) { return customWaypoints.put(room, waypoint); @@ -285,25 +294,25 @@ public class DungeonSecrets { .then(argument("name", StringArgumentType.greedyString()).executes(context -> { // TODO Less hacky way with custom ClientBlockPosArgumentType BlockPos pos = context.getArgument("pos", PosArgument.class).toAbsoluteBlockPos(new ServerCommandSource(null, context.getSource().getPosition(), context.getSource().getRotation(), null, 0, null, null, null, null)); - return relative ? addWaypointRelative(context, pos) : addWaypoint(context, pos); + return relative ? addCustomWaypointRelative(context, pos) : addCustomWaypoint(context, pos); })) ) ); } - private static int addWaypoint(CommandContext context, BlockPos pos) { + private static int addCustomWaypoint(CommandContext context, BlockPos pos) { Room room = getRoomAtPhysical(pos); if (isRoomMatched(room)) { - room.addWaypoint(context, room.actualToRelative(pos)); + room.addCustomWaypoint(context, room.actualToRelative(pos)); } else { context.getSource().sendError(Constants.PREFIX.get().append(Text.translatable("skyblocker.dungeons.secrets.notMatched"))); } return Command.SINGLE_SUCCESS; } - private static int addWaypointRelative(CommandContext context, BlockPos pos) { + private static int addCustomWaypointRelative(CommandContext context, BlockPos pos) { if (isCurrentRoomMatched()) { - currentRoom.addWaypoint(context, pos); + currentRoom.addCustomWaypoint(context, pos); } else { context.getSource().sendError(Constants.PREFIX.get().append(Text.translatable("skyblocker.dungeons.secrets.notMatched"))); } diff --git a/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/Room.java b/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/Room.java index c5b374a9..7430fc0b 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/Room.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/Room.java @@ -156,15 +156,36 @@ public class Room { }; } - protected void addWaypoint(CommandContext context, BlockPos pos) { - String roomName = getName(); - SecretWaypoint secretWaypoint = new SecretWaypoint(IntegerArgumentType.getInteger(context, "secretIndex"), SecretWaypoint.Category.CategoryArgumentType.getCategory(context, "category"), StringArgumentType.getString(context, "name"), pos); - DungeonSecrets.addCustomWaypoint(roomName, secretWaypoint); - DungeonSecrets.getRoomsStream().filter(r -> roomName.equals(r.getName())).forEach(r -> { - BlockPos actualPos = r.relativeToActual(pos); - SecretWaypoint actualWaypoint = new SecretWaypoint(secretWaypoint.secretIndex, secretWaypoint.category, secretWaypoint.name, actualPos); - r.secretWaypoints.put(secretWaypoint.secretIndex, actualPos, actualWaypoint); - }); + /** + * @see #addCustomWaypoint(int, SecretWaypoint.Category, String, BlockPos) + */ + protected void addCustomWaypoint(CommandContext context, BlockPos pos) { + addCustomWaypoint(IntegerArgumentType.getInteger(context, "secretIndex"), SecretWaypoint.Category.CategoryArgumentType.getCategory(context, "category"), StringArgumentType.getString(context, "name"), pos); + } + + /** + * Adds a custom waypoint relative to this room to {@link DungeonSecrets#customWaypoints} and all existing instances of this room. + * + * @param secretIndex the index of the secret waypoint + * @param category the category of the secret waypoint + * @param waypointName the name of the secret waypoint + * @param pos the position of the secret waypoint relative to this room + */ + @SuppressWarnings("JavadocReference") + private void addCustomWaypoint(int secretIndex, SecretWaypoint.Category category, String waypointName, BlockPos pos) { + SecretWaypoint waypoint = new SecretWaypoint(secretIndex, category, waypointName, pos); + DungeonSecrets.addCustomWaypoint(name, waypoint); + DungeonSecrets.getRoomsStream().filter(r -> name.equals(r.getName())).forEach(r -> r.addCustomWaypoint(waypoint)); + } + + /** + * Adds a custom waypoint relative to this room to this room. + * + * @param relativeWaypoint the secret waypoint relative to this room to add + */ + private void addCustomWaypoint(SecretWaypoint relativeWaypoint) { + SecretWaypoint actualWaypoint = relativeWaypoint.relativeToActual(this); + secretWaypoints.put(actualWaypoint.secretIndex, actualWaypoint.pos, actualWaypoint); } /** @@ -321,11 +342,7 @@ public class Room { BlockPos pos = DungeonMapUtils.relativeToActual(direction, physicalCornerPos, waypoint); secretWaypoints.put(secretIndex, pos, new SecretWaypoint(secretIndex, waypoint, secretName, pos)); } - for (SecretWaypoint customWaypoint : DungeonSecrets.getCustomWaypoints(name)) { - BlockPos actualPos = relativeToActual(customWaypoint.pos); - SecretWaypoint actualWaypoint = new SecretWaypoint(customWaypoint.secretIndex, customWaypoint.category, customWaypoint.name, actualPos); - secretWaypoints.put(customWaypoint.secretIndex, actualPos, actualWaypoint); - } + DungeonSecrets.getCustomWaypoints(name).forEach(this::addCustomWaypoint); matched = TriState.TRUE; DungeonSecrets.LOGGER.info("[Skyblocker] Room {} matched after checking {} block(s)", name, checkedBlocks.size()); 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 d896bf35..cb32e638 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 @@ -17,6 +17,7 @@ import net.minecraft.util.Formatting; import net.minecraft.util.StringIdentifiable; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Vec3d; +import org.jetbrains.annotations.NotNull; import java.util.List; import java.util.function.Predicate; @@ -25,8 +26,8 @@ import java.util.function.ToDoubleFunction; public class SecretWaypoint extends Waypoint { static final List SECRET_ITEMS = List.of("Decoy", "Defuse Kit", "Dungeon Chest Key", "Healing VIII", "Inflatable Jerry", "Spirit Leap", "Training Weights", "Trap", "Treasure Talisman"); - private static final SkyblockerConfig.SecretWaypoints config = SkyblockerConfigManager.get().locations.dungeons.secretWaypoints; - private static final Supplier typeSupplier = () -> config.waypointType; + private static final SkyblockerConfig.SecretWaypoints CONFIG = SkyblockerConfigManager.get().locations.dungeons.secretWaypoints; + private static final Supplier TYPE_SUPPLIER = () -> CONFIG.waypointType; final int secretIndex; final Category category; final Text name; @@ -41,7 +42,7 @@ public class SecretWaypoint extends Waypoint { } SecretWaypoint(int secretIndex, Category category, Text name, BlockPos pos) { - super(pos, typeSupplier, category.colorComponents); + super(pos, TYPE_SUPPLIER, category.colorComponents); this.secretIndex = secretIndex; this.category = category; this.name = name; @@ -85,7 +86,7 @@ public class SecretWaypoint extends Waypoint { //TODO In the future, shrink the box for wither essence and items so its more realistic super.render(context); - if (config.showSecretText) { + if (CONFIG.showSecretText) { Vec3d posUp = centerPos.add(0, 1, 0); RenderHelper.renderText(context, name, posUp, true); double distance = context.camera().getPos().distanceTo(centerPos); @@ -93,6 +94,11 @@ public class SecretWaypoint extends Waypoint { } } + @NotNull + SecretWaypoint relativeToActual(Room room) { + return new SecretWaypoint(secretIndex, category, name, room.relativeToActual(pos)); + } + enum Category implements StringIdentifiable { ENTRANCE("entrance", secretWaypoints -> secretWaypoints.enableEntranceWaypoints, 0, 255, 0), SUPERBOOM("superboom", secretWaypoints -> secretWaypoints.enableSuperboomWaypoints, 255, 0, 0), @@ -158,7 +164,7 @@ public class SecretWaypoint extends Waypoint { return new CategoryArgumentType(); } - public static Category getCategory(CommandContext context, String name) { + public static Category getCategory(CommandContext context, String name) { return context.getArgument(name, Category.class); } } -- cgit From 0af4be135ad0b5739a53cea9911cf011bc7d5c21 Mon Sep 17 00:00:00 2001 From: Kevinthegreat <92656833+kevinthegreat1@users.noreply.github.com> Date: Wed, 25 Oct 2023 09:14:33 -0400 Subject: Adding custom waypoint feedback --- .../java/de/hysky/skyblocker/skyblock/dungeon/secrets/Room.java | 7 ++++++- .../hysky/skyblocker/skyblock/dungeon/secrets/SecretWaypoint.java | 5 +++++ src/main/resources/assets/skyblocker/lang/en_us.json | 1 + 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/Room.java b/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/Room.java index 7430fc0b..f553fbda 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/Room.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/Room.java @@ -24,6 +24,7 @@ import net.minecraft.entity.ItemEntity; import net.minecraft.entity.LivingEntity; import net.minecraft.entity.mob.AmbientEntity; import net.minecraft.registry.Registries; +import net.minecraft.text.Text; import net.minecraft.util.hit.BlockHitResult; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; @@ -160,7 +161,11 @@ public class Room { * @see #addCustomWaypoint(int, SecretWaypoint.Category, String, BlockPos) */ protected void addCustomWaypoint(CommandContext context, BlockPos pos) { - addCustomWaypoint(IntegerArgumentType.getInteger(context, "secretIndex"), SecretWaypoint.Category.CategoryArgumentType.getCategory(context, "category"), StringArgumentType.getString(context, "name"), pos); + int secretIndex = IntegerArgumentType.getInteger(context, "secretIndex"); + SecretWaypoint.Category category = SecretWaypoint.Category.CategoryArgumentType.getCategory(context, "category"); + String waypointName = StringArgumentType.getString(context, "name"); + addCustomWaypoint(secretIndex, category, waypointName, pos); + context.getSource().sendFeedback(Text.translatable("skyblocker.dungeons.secrets.customWaypointAdded", pos.getX(), pos.getY(), pos.getZ(), name, secretIndex, category, waypointName)); } /** 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 cb32e638..aa700cad 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 @@ -150,6 +150,11 @@ public class SecretWaypoint extends Waypoint { return enabledPredicate.test(SkyblockerConfigManager.get().locations.dungeons.secretWaypoints); } + @Override + public String toString() { + return name; + } + @Override public String asString() { return name; diff --git a/src/main/resources/assets/skyblocker/lang/en_us.json b/src/main/resources/assets/skyblocker/lang/en_us.json index 1d000825..3ead2954 100644 --- a/src/main/resources/assets/skyblocker/lang/en_us.json +++ b/src/main/resources/assets/skyblocker/lang/en_us.json @@ -273,6 +273,7 @@ "skyblocker.dungeons.secrets.markSecretFoundUnable": "§cUnable to mark secret #%d as found.", "skyblocker.dungeons.secrets.markSecretMissingUnable": "§cUnable to mark secret #%d as missing.", "skyblocker.dungeons.secrets.posMessage": "§rRoom: %s, X: %d, Y: %d, Z: %d", + "skyblocker.dungeons.secrets.customWaypointAdded": "§rAdded a custom waypoint at X: %d, Y: %d, Z: %d for room %s secret #%d of category %s with name '%s'.", "skyblocker.dungeons.secrets.noTarget": "§cNo target block found! (Are you pointing at a block in range?)", "skyblocker.dungeons.secrets.notMatched": "§cThe current room is not matched! (Are you in a dungeon room?)", -- cgit From 789a87322687a9172522f371ea919f656554a40b Mon Sep 17 00:00:00 2001 From: Kevinthegreat <92656833+kevinthegreat1@users.noreply.github.com> Date: Thu, 26 Oct 2023 19:33:55 -0400 Subject: Add custom secret waypoints saving and loading --- .../skyblock/dungeon/secrets/DungeonSecrets.java | 53 +++++++++++++++++----- .../skyblock/dungeon/secrets/SecretWaypoint.java | 8 ++++ .../skyblocker/skyblock/item/BackpackPreview.java | 4 +- 3 files changed, 51 insertions(+), 14 deletions(-) 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 215fa33a..77b31929 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 @@ -11,6 +11,7 @@ import com.mojang.brigadier.arguments.StringArgumentType; import com.mojang.brigadier.builder.ArgumentBuilder; import com.mojang.brigadier.builder.RequiredArgumentBuilder; import com.mojang.brigadier.context.CommandContext; +import com.mojang.serialization.JsonOps; import de.hysky.skyblocker.SkyblockerMod; import de.hysky.skyblocker.config.SkyblockerConfigManager; import de.hysky.skyblocker.utils.Constants; @@ -21,6 +22,7 @@ import it.unimi.dsi.fastutil.objects.Object2ByteOpenHashMap; import it.unimi.dsi.fastutil.objects.ObjectIntPair; import net.fabricmc.fabric.api.client.command.v2.ClientCommandRegistrationCallback; import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource; +import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientLifecycleEvents; import net.fabricmc.fabric.api.client.message.v1.ClientReceiveMessageEvents; import net.fabricmc.fabric.api.client.networking.v1.ClientPlayConnectionEvents; import net.fabricmc.fabric.api.client.rendering.v1.WorldRenderContext; @@ -57,8 +59,11 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.BufferedReader; +import java.io.BufferedWriter; import java.io.IOException; import java.io.ObjectInputStream; +import java.nio.file.Files; +import java.nio.file.Path; import java.util.*; import java.util.concurrent.CompletableFuture; import java.util.stream.Stream; @@ -70,6 +75,7 @@ import static net.fabricmc.fabric.api.client.command.v2.ClientCommandManager.lit public class DungeonSecrets { protected static final Logger LOGGER = LoggerFactory.getLogger(DungeonSecrets.class); private static final String DUNGEONS_PATH = "dungeons"; + private static final Path CUSTOM_WAYPOINTS_DIR = SkyblockerMod.CONFIG_DIR.resolve("custom_secret_waypoints.json"); /** * Maps the block identifier string to a custom numeric block id used in dungeon rooms data. * @@ -173,9 +179,10 @@ public class DungeonSecrets { } // Execute with MinecraftClient as executor since we need to wait for MinecraftClient#resourceManager to be set CompletableFuture.runAsync(DungeonSecrets::load, MinecraftClient.getInstance()).exceptionally(e -> { - LOGGER.error("[Skyblocker] Failed to load dungeon secrets", e); + LOGGER.error("[Skyblocker Dungeon Secrets] Failed to load dungeon secrets", e); return null; }); + ClientLifecycleEvents.CLIENT_STOPPING.register(DungeonSecrets::saveCustomWaypoints); Scheduler.INSTANCE.scheduleCyclic(DungeonSecrets::update, 10); WorldRenderEvents.AFTER_TRANSLUCENT.register(DungeonSecrets::render); ClientReceiveMessageEvents.GAME.register(DungeonSecrets::onChatMessage); @@ -198,7 +205,7 @@ public class DungeonSecrets { for (Map.Entry resourceEntry : MinecraftClient.getInstance().getResourceManager().findResources(DUNGEONS_PATH, id -> id.getPath().endsWith(".skeleton")).entrySet()) { String[] path = resourceEntry.getKey().getPath().split("/"); if (path.length != 4) { - LOGGER.error("[Skyblocker] Failed to load dungeon secrets, invalid resource identifier {}", resourceEntry.getKey()); + LOGGER.error("[Skyblocker Dungeon Secrets] Failed to load dungeon secrets, invalid resource identifier {}", resourceEntry.getKey()); break; } String dungeon = path[1]; @@ -211,9 +218,9 @@ public class DungeonSecrets { synchronized (roomsMap) { roomsMap.put(room, rooms); } - LOGGER.debug("[Skyblocker] Loaded dungeon secrets dungeon {} room shape {} room {}", dungeon, roomShape, room); + LOGGER.debug("[Skyblocker Dungeon Secrets] Loaded dungeon secrets dungeon {} room shape {} room {}", dungeon, roomShape, room); }).exceptionally(e -> { - LOGGER.error("[Skyblocker] Failed to load dungeon secrets dungeon {} room shape {} room {}", dungeon, roomShape, room, e); + LOGGER.error("[Skyblocker Dungeon Secrets] Failed to load dungeon secrets dungeon {} room shape {} room {}", dungeon, roomShape, room, e); return null; })); } @@ -221,16 +228,37 @@ public class DungeonSecrets { try (BufferedReader roomsReader = MinecraftClient.getInstance().getResourceManager().openAsReader(new Identifier(SkyblockerMod.NAMESPACE, "dungeons/dungeonrooms.json")); BufferedReader waypointsReader = MinecraftClient.getInstance().getResourceManager().openAsReader(new Identifier(SkyblockerMod.NAMESPACE, "dungeons/secretlocations.json"))) { loadJson(roomsReader, roomsJson); loadJson(waypointsReader, waypointsJson); - LOGGER.debug("[Skyblocker] Loaded dungeon secrets json"); + LOGGER.debug("[Skyblocker Dungeon Secrets] Loaded dungeon secret waypoints json"); } catch (Exception e) { - LOGGER.error("[Skyblocker] Failed to load dungeon secrets json", e); + LOGGER.error("[Skyblocker Dungeon Secrets] Failed to load dungeon secret waypoints json", e); } })); - roomsLoaded = CompletableFuture.allOf(dungeonFutures.toArray(CompletableFuture[]::new)).thenRun(() -> LOGGER.info("[Skyblocker] Loaded dungeon secrets for {} dungeon(s), {} room shapes, and {} rooms total in {} ms", ROOMS_DATA.size(), ROOMS_DATA.values().stream().mapToInt(Map::size).sum(), ROOMS_DATA.values().stream().map(Map::values).flatMap(Collection::stream).mapToInt(Map::size).sum(), System.currentTimeMillis() - startTime)).exceptionally(e -> { - LOGGER.error("[Skyblocker] Failed to load dungeon secrets", e); + dungeonFutures.add(CompletableFuture.runAsync(() -> { + try (BufferedReader customWaypointsReader = Files.newBufferedReader(CUSTOM_WAYPOINTS_DIR)) { + SkyblockerMod.GSON.fromJson(customWaypointsReader, JsonObject.class).asMap().forEach( + (room, jsonElement) -> addCustomWaypoint(room, SecretWaypoint.CODEC.parse(JsonOps.INSTANCE, jsonElement).resultOrPartial(LOGGER::error).orElseThrow()) + ); + LOGGER.debug("[Skyblocker Dungeon Secrets] Loaded custom dungeon secret waypoints"); + } catch (Exception e) { + LOGGER.error("[Skyblocker Dungeon Secrets] Failed to load custom dungeon secret waypoints", e); + } + })); + roomsLoaded = CompletableFuture.allOf(dungeonFutures.toArray(CompletableFuture[]::new)).thenRun(() -> LOGGER.info("[Skyblocker Dungeon Secrets] Loaded dungeon secrets for {} dungeon(s), {} room shapes, {} rooms, and {} custom secret waypoints total in {} ms", ROOMS_DATA.size(), ROOMS_DATA.values().stream().mapToInt(Map::size).sum(), ROOMS_DATA.values().stream().map(Map::values).flatMap(Collection::stream).mapToInt(Map::size).sum(), customWaypoints.size(), System.currentTimeMillis() - startTime)).exceptionally(e -> { + LOGGER.error("[Skyblocker Dungeon Secrets] Failed to load dungeon secrets", e); return null; }); - LOGGER.info("[Skyblocker] Started loading dungeon secrets in (blocked main thread for) {} ms", System.currentTimeMillis() - startTime); + LOGGER.info("[Skyblocker Dungeon Secrets] Started loading dungeon secrets in (blocked main thread for) {} ms", System.currentTimeMillis() - startTime); + } + + private static void saveCustomWaypoints(MinecraftClient client) { + try (BufferedWriter writer = Files.newBufferedWriter(CUSTOM_WAYPOINTS_DIR)) { + JsonArray customWaypointsArray = new JsonArray(); + customWaypoints.forEach((room, waypoint) -> customWaypointsArray.add(SecretWaypoint.CODEC.encodeStart(JsonOps.INSTANCE, waypoint).resultOrPartial(LOGGER::error).orElseThrow())); + SkyblockerMod.GSON.toJson(customWaypointsArray, writer); + LOGGER.info("[Skyblocker Dungeon Secrets] Saved custom dungeon secret waypoints"); + } catch (Exception e) { + LOGGER.error("[Skyblocker Dungeon Secrets] Failed to save custom dungeon secret waypoints", e); + } } private static int[] readRoom(Resource resource) throws RuntimeException { @@ -379,7 +407,7 @@ public class DungeonSecrets { } mapEntrancePos = mapEntrancePosAndSize.left(); mapRoomSize = mapEntrancePosAndSize.rightInt(); - LOGGER.info("[Skyblocker] Started dungeon with map room size {}, map entrance pos {}, player pos {}, and physical entrance pos {}", mapRoomSize, mapEntrancePos, client.player.getPos(), physicalEntrancePos); + LOGGER.info("[Skyblocker Dungeon Secrets] Started dungeon with map room size {}, map entrance pos {}, player pos {}, and physical entrance pos {}", mapRoomSize, mapEntrancePos, client.player.getPos(), physicalEntrancePos); } Vector2ic physicalPos = DungeonMapUtils.getPhysicalRoomPos(client.player.getPos()); @@ -392,7 +420,8 @@ public class DungeonSecrets { } switch (type) { case ENTRANCE, PUZZLE, TRAP, MINIBOSS, FAIRY, BLOOD -> room = newRoom(type, physicalPos); - case ROOM -> room = newRoom(type, DungeonMapUtils.getPhysicalPosFromMap(mapEntrancePos, mapRoomSize, physicalEntrancePos, DungeonMapUtils.getRoomSegments(map, mapPos, mapRoomSize, type.color))); + case ROOM -> + room = newRoom(type, DungeonMapUtils.getPhysicalPosFromMap(mapEntrancePos, mapRoomSize, physicalEntrancePos, DungeonMapUtils.getRoomSegments(map, mapPos, mapRoomSize, type.color))); } } if (room != null && currentRoom != room) { @@ -417,7 +446,7 @@ public class DungeonSecrets { } return newRoom; } catch (IllegalArgumentException e) { - LOGGER.error("[Skyblocker] Failed to create room", e); + LOGGER.error("[Skyblocker Dungeon Secrets] Failed to create room", e); } return null; } 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 aa700cad..96d81a30 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 @@ -4,6 +4,7 @@ import com.google.gson.JsonObject; import com.mojang.brigadier.context.CommandContext; import com.mojang.serialization.Codec; import com.mojang.serialization.JsonOps; +import com.mojang.serialization.codecs.RecordCodecBuilder; import de.hysky.skyblocker.config.SkyblockerConfig; import de.hysky.skyblocker.config.SkyblockerConfigManager; import de.hysky.skyblocker.utils.render.RenderHelper; @@ -15,6 +16,7 @@ import net.minecraft.entity.Entity; import net.minecraft.text.Text; import net.minecraft.util.Formatting; import net.minecraft.util.StringIdentifiable; +import net.minecraft.util.dynamic.Codecs; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Vec3d; import org.jetbrains.annotations.NotNull; @@ -25,6 +27,12 @@ import java.util.function.Supplier; import java.util.function.ToDoubleFunction; public class SecretWaypoint extends Waypoint { + public static final Codec CODEC = RecordCodecBuilder.create(instance -> instance.group( + Codec.INT.fieldOf("secretIndex").forGetter(secretWaypoint -> secretWaypoint.secretIndex), + Category.CODEC.fieldOf("category").forGetter(secretWaypoint -> secretWaypoint.category), + Codecs.TEXT.fieldOf("name").forGetter(secretWaypoint -> secretWaypoint.name), + BlockPos.CODEC.fieldOf("pos").forGetter(secretWaypoint -> secretWaypoint.pos) + ).apply(instance, SecretWaypoint::new)); static final List SECRET_ITEMS = List.of("Decoy", "Defuse Kit", "Dungeon Chest Key", "Healing VIII", "Inflatable Jerry", "Spirit Leap", "Training Weights", "Trap", "Treasure Talisman"); private static final SkyblockerConfig.SecretWaypoints CONFIG = SkyblockerConfigManager.get().locations.dungeons.secretWaypoints; private static final Supplier TYPE_SUPPLIER = () -> CONFIG.waypointType; diff --git a/src/main/java/de/hysky/skyblocker/skyblock/item/BackpackPreview.java b/src/main/java/de/hysky/skyblocker/skyblock/item/BackpackPreview.java index d621d388..8782440c 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/item/BackpackPreview.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/item/BackpackPreview.java @@ -1,10 +1,10 @@ package de.hysky.skyblocker.skyblock.item; import com.mojang.blaze3d.systems.RenderSystem; +import de.hysky.skyblocker.SkyblockerMod; import de.hysky.skyblocker.config.SkyblockerConfigManager; import de.hysky.skyblocker.utils.Utils; import net.fabricmc.fabric.api.client.screen.v1.ScreenEvents; -import net.fabricmc.loader.api.FabricLoader; import net.minecraft.client.MinecraftClient; import net.minecraft.client.font.TextRenderer; import net.minecraft.client.gui.DrawContext; @@ -60,7 +60,7 @@ public class BackpackPreview { // update save dir based on sb profile id String id = MinecraftClient.getInstance().getSession().getUuidOrNull().toString().replaceAll("-", "") + "/" + Utils.getProfileId(); if (!id.equals(loaded)) { - saveDir = FabricLoader.getInstance().getConfigDir().resolve("skyblocker/backpack-preview/" + id); + saveDir = SkyblockerMod.CONFIG_DIR.resolve("backpack-preview/" + id); //noinspection ResultOfMethodCallIgnored saveDir.toFile().mkdirs(); // load storage again because profile id changed -- cgit From 58ba4ddfdca59d359100c0e42c97a0e6727ea9fa Mon Sep 17 00:00:00 2001 From: Kevinthegreat <92656833+kevinthegreat1@users.noreply.github.com> Date: Fri, 27 Oct 2023 11:41:56 -0400 Subject: Fix serialization --- .../skyblock/dungeon/secrets/DungeonSecrets.java | 49 +++++++++++++--------- .../skyblocker/skyblock/dungeon/secrets/Room.java | 5 ++- .../skyblock/dungeon/secrets/SecretWaypoint.java | 1 + 3 files changed, 34 insertions(+), 21 deletions(-) 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 77b31929..81e73e1a 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 @@ -1,7 +1,7 @@ package de.hysky.skyblocker.skyblock.dungeon.secrets; -import com.google.common.collect.Multimap; -import com.google.common.collect.MultimapBuilder; +import com.google.common.collect.HashBasedTable; +import com.google.common.collect.Table; import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -118,7 +118,7 @@ public class DungeonSecrets { /** * The map of dungeon room names to custom waypoints relative to the room. */ - private static final Multimap customWaypoints = MultimapBuilder.hashKeys().arrayListValues().build(); + private static final Table customWaypoints = HashBasedTable.create(); @Nullable private static CompletableFuture roomsLoaded; /** @@ -157,16 +157,25 @@ public class DungeonSecrets { /** * @see #customWaypoints */ - public static Collection getCustomWaypoints(String room) { - return customWaypoints.get(room); + public static Map getCustomWaypoints(String room) { + return customWaypoints.row(room); } /** * @see #customWaypoints */ @SuppressWarnings("UnusedReturnValue") - public static boolean addCustomWaypoint(String room, SecretWaypoint waypoint) { - return customWaypoints.put(room, waypoint); + public static SecretWaypoint addCustomWaypoint(String room, SecretWaypoint waypoint) { + return customWaypoints.put(room, waypoint.pos, waypoint); + } + + /** + * @see #customWaypoints + */ + public static void addCustomWaypoints(String room, Collection waypoints) { + for (SecretWaypoint waypoint : waypoints) { + addCustomWaypoint(room, waypoint); + } } /** @@ -191,8 +200,8 @@ public class DungeonSecrets { ClientCommandRegistrationCallback.EVENT.register((dispatcher, registryAccess) -> dispatcher.register(literal(SkyblockerMod.NAMESPACE).then(literal("dungeons").then(literal("secrets") .then(literal("markAsFound").then(markSecretsCommand(true))) .then(literal("markAsMissing").then(markSecretsCommand(false))) - .then(literal("getRelativePos").executes(context -> getRelativePos(context.getSource()))) - .then(literal("getRelativeTargetPos").executes(context -> getRelativeTargetPos(context.getSource()))) + .then(literal("getRelativePos").executes(DungeonSecrets::getRelativePos)) + .then(literal("getRelativeTargetPos").executes(DungeonSecrets::getRelativeTargetPos)) .then(literal("addWaypoint").then(addWaypointCommand(false))) .then(literal("addWaypointRelatively").then(addWaypointCommand(true))) )))); @@ -235,8 +244,8 @@ public class DungeonSecrets { })); dungeonFutures.add(CompletableFuture.runAsync(() -> { try (BufferedReader customWaypointsReader = Files.newBufferedReader(CUSTOM_WAYPOINTS_DIR)) { - SkyblockerMod.GSON.fromJson(customWaypointsReader, JsonObject.class).asMap().forEach( - (room, jsonElement) -> addCustomWaypoint(room, SecretWaypoint.CODEC.parse(JsonOps.INSTANCE, jsonElement).resultOrPartial(LOGGER::error).orElseThrow()) + SkyblockerMod.GSON.fromJson(customWaypointsReader, JsonObject.class).asMap().forEach((room, waypointsJson) -> + addCustomWaypoints(room, SecretWaypoint.LIST_CODEC.parse(JsonOps.INSTANCE, waypointsJson).resultOrPartial(LOGGER::error).orElseThrow()) ); LOGGER.debug("[Skyblocker Dungeon Secrets] Loaded custom dungeon secret waypoints"); } catch (Exception e) { @@ -252,9 +261,11 @@ public class DungeonSecrets { private static void saveCustomWaypoints(MinecraftClient client) { try (BufferedWriter writer = Files.newBufferedWriter(CUSTOM_WAYPOINTS_DIR)) { - JsonArray customWaypointsArray = new JsonArray(); - customWaypoints.forEach((room, waypoint) -> customWaypointsArray.add(SecretWaypoint.CODEC.encodeStart(JsonOps.INSTANCE, waypoint).resultOrPartial(LOGGER::error).orElseThrow())); - SkyblockerMod.GSON.toJson(customWaypointsArray, writer); + JsonObject customWaypointsJson = new JsonObject(); + customWaypoints.rowMap().forEach((room, waypoints) -> + customWaypointsJson.add(room, SecretWaypoint.LIST_CODEC.encodeStart(JsonOps.INSTANCE, new ArrayList<>(waypoints.values())).resultOrPartial(LOGGER::error).orElseThrow()) + ); + SkyblockerMod.GSON.toJson(customWaypointsJson, writer); LOGGER.info("[Skyblocker Dungeon Secrets] Saved custom dungeon secret waypoints"); } catch (Exception e) { LOGGER.error("[Skyblocker Dungeon Secrets] Failed to save custom dungeon secret waypoints", e); @@ -291,15 +302,15 @@ public class DungeonSecrets { }); } - private static int getRelativePos(FabricClientCommandSource source) { - return getRelativePos(source, source.getPlayer().getBlockPos()); + private static int getRelativePos(CommandContext context) { + return getRelativePos(context.getSource(), context.getSource().getPlayer().getBlockPos()); } - private static int getRelativeTargetPos(FabricClientCommandSource source) { + private static int getRelativeTargetPos(CommandContext context) { if (MinecraftClient.getInstance().crosshairTarget instanceof BlockHitResult blockHitResult && blockHitResult.getType() == HitResult.Type.BLOCK) { - return getRelativePos(source, blockHitResult.getBlockPos()); + return getRelativePos(context.getSource(), blockHitResult.getBlockPos()); } else { - source.sendError(Constants.PREFIX.get().append(Text.translatable("skyblocker.dungeons.secrets.noTarget"))); + context.getSource().sendError(Constants.PREFIX.get().append(Text.translatable("skyblocker.dungeons.secrets.noTarget"))); } return Command.SINGLE_SUCCESS; } diff --git a/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/Room.java b/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/Room.java index f553fbda..7b7fe4c0 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/Room.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/Room.java @@ -7,6 +7,7 @@ import com.google.gson.JsonObject; import com.mojang.brigadier.arguments.IntegerArgumentType; import com.mojang.brigadier.arguments.StringArgumentType; import com.mojang.brigadier.context.CommandContext; +import de.hysky.skyblocker.utils.Constants; import de.hysky.skyblocker.utils.scheduler.Scheduler; import it.unimi.dsi.fastutil.ints.IntRBTreeSet; import it.unimi.dsi.fastutil.ints.IntSortedSet; @@ -165,7 +166,7 @@ public class Room { SecretWaypoint.Category category = SecretWaypoint.Category.CategoryArgumentType.getCategory(context, "category"); String waypointName = StringArgumentType.getString(context, "name"); addCustomWaypoint(secretIndex, category, waypointName, pos); - context.getSource().sendFeedback(Text.translatable("skyblocker.dungeons.secrets.customWaypointAdded", pos.getX(), pos.getY(), pos.getZ(), name, secretIndex, category, waypointName)); + context.getSource().sendFeedback(Constants.PREFIX.get().append(Text.translatable("skyblocker.dungeons.secrets.customWaypointAdded", pos.getX(), pos.getY(), pos.getZ(), name, secretIndex, category, waypointName))); } /** @@ -347,7 +348,7 @@ public class Room { BlockPos pos = DungeonMapUtils.relativeToActual(direction, physicalCornerPos, waypoint); secretWaypoints.put(secretIndex, pos, new SecretWaypoint(secretIndex, waypoint, secretName, pos)); } - DungeonSecrets.getCustomWaypoints(name).forEach(this::addCustomWaypoint); + DungeonSecrets.getCustomWaypoints(name).values().forEach(this::addCustomWaypoint); matched = TriState.TRUE; DungeonSecrets.LOGGER.info("[Skyblocker] Room {} matched after checking {} block(s)", name, checkedBlocks.size()); 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 96d81a30..0c2d1b34 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 @@ -33,6 +33,7 @@ public class SecretWaypoint extends Waypoint { Codecs.TEXT.fieldOf("name").forGetter(secretWaypoint -> secretWaypoint.name), BlockPos.CODEC.fieldOf("pos").forGetter(secretWaypoint -> secretWaypoint.pos) ).apply(instance, SecretWaypoint::new)); + public static final Codec> LIST_CODEC = CODEC.listOf(); static final List SECRET_ITEMS = List.of("Decoy", "Defuse Kit", "Dungeon Chest Key", "Healing VIII", "Inflatable Jerry", "Spirit Leap", "Training Weights", "Trap", "Treasure Talisman"); private static final SkyblockerConfig.SecretWaypoints CONFIG = SkyblockerConfigManager.get().locations.dungeons.secretWaypoints; private static final Supplier TYPE_SUPPLIER = () -> CONFIG.waypointType; -- cgit From 16467d786b89cc628e932b7e2091ab304d1b6b46 Mon Sep 17 00:00:00 2001 From: Kevinthegreat <92656833+kevinthegreat1@users.noreply.github.com> Date: Fri, 27 Oct 2023 12:53:38 -0400 Subject: Add custom waypoints removing --- .../skyblock/dungeon/secrets/DungeonSecrets.java | 55 ++++++++++++++++++---- .../skyblocker/skyblock/dungeon/secrets/Room.java | 47 ++++++++++++++++-- .../resources/assets/skyblocker/lang/en_us.json | 4 +- 3 files changed, 91 insertions(+), 15 deletions(-) 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 81e73e1a..eda08cf6 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 @@ -7,7 +7,6 @@ import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.mojang.brigadier.Command; import com.mojang.brigadier.arguments.IntegerArgumentType; -import com.mojang.brigadier.arguments.StringArgumentType; import com.mojang.brigadier.builder.ArgumentBuilder; import com.mojang.brigadier.builder.RequiredArgumentBuilder; import com.mojang.brigadier.context.CommandContext; @@ -32,6 +31,7 @@ import net.minecraft.client.MinecraftClient; import net.minecraft.client.network.ClientPlayerEntity; import net.minecraft.command.argument.BlockPosArgumentType; import net.minecraft.command.argument.PosArgument; +import net.minecraft.command.argument.TextArgumentType; import net.minecraft.entity.ItemEntity; import net.minecraft.entity.LivingEntity; import net.minecraft.entity.mob.AmbientEntity; @@ -178,6 +178,14 @@ public class DungeonSecrets { } } + /** + * @see #customWaypoints + */ + @Nullable + public static SecretWaypoint removeCustomWaypoint(String room, BlockPos pos) { + return customWaypoints.remove(room, pos); + } + /** * Loads the dungeon secrets asynchronously from {@code /assets/skyblocker/dungeons}. * Use {@link #isRoomsLoaded()} to check for completion of loading. @@ -202,8 +210,10 @@ public class DungeonSecrets { .then(literal("markAsMissing").then(markSecretsCommand(false))) .then(literal("getRelativePos").executes(DungeonSecrets::getRelativePos)) .then(literal("getRelativeTargetPos").executes(DungeonSecrets::getRelativeTargetPos)) - .then(literal("addWaypoint").then(addWaypointCommand(false))) - .then(literal("addWaypointRelatively").then(addWaypointCommand(true))) + .then(literal("addWaypoint").then(addCustomWaypointCommand(false))) + .then(literal("addWaypointRelatively").then(addCustomWaypointCommand(true))) + .then(literal("removeWaypoint").then(removeCustomWaypointCommand(false))) + .then(literal("removeWaypointRelatively").then(removeCustomWaypointCommand(true))) )))); ClientPlayConnectionEvents.JOIN.register(((handler, sender, client) -> reset())); } @@ -291,8 +301,8 @@ public class DungeonSecrets { } private static ArgumentBuilder> markSecretsCommand(boolean found) { - return argument("secret", IntegerArgumentType.integer()).executes(context -> { - int secretIndex = IntegerArgumentType.getInteger(context, "secret"); + return argument("secretIndex", IntegerArgumentType.integer()).executes(context -> { + int secretIndex = IntegerArgumentType.getInteger(context, "secretIndex"); if (markSecrets(secretIndex, found)) { context.getSource().sendFeedback(Constants.PREFIX.get().append(Text.translatable(found ? "skyblocker.dungeons.secrets.markSecretFound" : "skyblocker.dungeons.secrets.markSecretMissing", secretIndex))); } else { @@ -326,11 +336,11 @@ public class DungeonSecrets { return Command.SINGLE_SUCCESS; } - private static ArgumentBuilder> addWaypointCommand(boolean relative) { + private static ArgumentBuilder> addCustomWaypointCommand(boolean relative) { return argument("pos", BlockPosArgumentType.blockPos()) .then(argument("secretIndex", IntegerArgumentType.integer()) .then(argument("category", SecretWaypoint.Category.CategoryArgumentType.category()) - .then(argument("name", StringArgumentType.greedyString()).executes(context -> { + .then(argument("name", TextArgumentType.text()).executes(context -> { // TODO Less hacky way with custom ClientBlockPosArgumentType BlockPos pos = context.getArgument("pos", PosArgument.class).toAbsoluteBlockPos(new ServerCommandSource(null, context.getSource().getPosition(), context.getSource().getRotation(), null, 0, null, null, null, null)); return relative ? addCustomWaypointRelative(context, pos) : addCustomWaypoint(context, pos); @@ -358,6 +368,34 @@ public class DungeonSecrets { return Command.SINGLE_SUCCESS; } + private static ArgumentBuilder> removeCustomWaypointCommand(boolean relative) { + return argument("pos", BlockPosArgumentType.blockPos()) + .executes(context -> { + // TODO Less hacky way with custom ClientBlockPosArgumentType + BlockPos pos = context.getArgument("pos", PosArgument.class).toAbsoluteBlockPos(new ServerCommandSource(null, context.getSource().getPosition(), context.getSource().getRotation(), null, 0, null, null, null, null)); + return relative ? removeCustomWaypointRelative(context, pos) : removeCustomWaypoint(context, pos); + }); + } + + private static int removeCustomWaypoint(CommandContext context, BlockPos pos) { + Room room = getRoomAtPhysical(pos); + if (isRoomMatched(room)) { + room.removeCustomWaypoint(context, room.actualToRelative(pos)); + } else { + context.getSource().sendError(Constants.PREFIX.get().append(Text.translatable("skyblocker.dungeons.secrets.notMatched"))); + } + return Command.SINGLE_SUCCESS; + } + + private static int removeCustomWaypointRelative(CommandContext context, BlockPos pos) { + if (isCurrentRoomMatched()) { + currentRoom.removeCustomWaypoint(context, pos); + } else { + context.getSource().sendError(Constants.PREFIX.get().append(Text.translatable("skyblocker.dungeons.secrets.notMatched"))); + } + return Command.SINGLE_SUCCESS; + } + /** * Updates the dungeon. The general idea is similar to the Dungeon Rooms Mod. *

    @@ -431,8 +469,7 @@ public class DungeonSecrets { } switch (type) { case ENTRANCE, PUZZLE, TRAP, MINIBOSS, FAIRY, BLOOD -> room = newRoom(type, physicalPos); - case ROOM -> - room = newRoom(type, DungeonMapUtils.getPhysicalPosFromMap(mapEntrancePos, mapRoomSize, physicalEntrancePos, DungeonMapUtils.getRoomSegments(map, mapPos, mapRoomSize, type.color))); + case ROOM -> room = newRoom(type, DungeonMapUtils.getPhysicalPosFromMap(mapEntrancePos, mapRoomSize, physicalEntrancePos, DungeonMapUtils.getRoomSegments(map, mapPos, mapRoomSize, type.color))); } } if (room != null && currentRoom != room) { diff --git a/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/Room.java b/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/Room.java index 7b7fe4c0..ecfcf496 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/Room.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/Room.java @@ -5,7 +5,6 @@ import com.google.common.collect.Table; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.mojang.brigadier.arguments.IntegerArgumentType; -import com.mojang.brigadier.arguments.StringArgumentType; import com.mojang.brigadier.context.CommandContext; import de.hysky.skyblocker.utils.Constants; import de.hysky.skyblocker.utils.scheduler.Scheduler; @@ -32,6 +31,7 @@ import net.minecraft.world.World; import org.apache.commons.lang3.tuple.MutableTriple; import org.apache.commons.lang3.tuple.Triple; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; import org.joml.Vector2i; import org.joml.Vector2ic; @@ -159,12 +159,12 @@ public class Room { } /** - * @see #addCustomWaypoint(int, SecretWaypoint.Category, String, BlockPos) + * @see #addCustomWaypoint(int, SecretWaypoint.Category, Text, BlockPos) */ protected void addCustomWaypoint(CommandContext context, BlockPos pos) { int secretIndex = IntegerArgumentType.getInteger(context, "secretIndex"); SecretWaypoint.Category category = SecretWaypoint.Category.CategoryArgumentType.getCategory(context, "category"); - String waypointName = StringArgumentType.getString(context, "name"); + Text waypointName = context.getArgument("name", Text.class); addCustomWaypoint(secretIndex, category, waypointName, pos); context.getSource().sendFeedback(Constants.PREFIX.get().append(Text.translatable("skyblocker.dungeons.secrets.customWaypointAdded", pos.getX(), pos.getY(), pos.getZ(), name, secretIndex, category, waypointName))); } @@ -178,14 +178,14 @@ public class Room { * @param pos the position of the secret waypoint relative to this room */ @SuppressWarnings("JavadocReference") - private void addCustomWaypoint(int secretIndex, SecretWaypoint.Category category, String waypointName, BlockPos pos) { + private void addCustomWaypoint(int secretIndex, SecretWaypoint.Category category, Text waypointName, BlockPos pos) { SecretWaypoint waypoint = new SecretWaypoint(secretIndex, category, waypointName, pos); DungeonSecrets.addCustomWaypoint(name, waypoint); DungeonSecrets.getRoomsStream().filter(r -> name.equals(r.getName())).forEach(r -> r.addCustomWaypoint(waypoint)); } /** - * Adds a custom waypoint relative to this room to this room. + * Adds a custom waypoint relative to this room to this instance of the room. * * @param relativeWaypoint the secret waypoint relative to this room to add */ @@ -194,6 +194,43 @@ public class Room { secretWaypoints.put(actualWaypoint.secretIndex, actualWaypoint.pos, actualWaypoint); } + /** + * @see #removeCustomWaypoint(BlockPos) + */ + protected void removeCustomWaypoint(CommandContext context, BlockPos pos) { + SecretWaypoint waypoint = removeCustomWaypoint(pos); + if (waypoint != null) { + context.getSource().sendFeedback(Constants.PREFIX.get().append(Text.translatable("skyblocker.dungeons.secrets.customWaypointRemoved", pos.getX(), pos.getY(), pos.getZ(), name, waypoint.secretIndex, waypoint.category, waypoint.name))); + } else { + context.getSource().sendFeedback(Constants.PREFIX.get().append(Text.translatable("skyblocker.dungeons.secrets.customWaypointNotFound", pos.getX(), pos.getY(), pos.getZ(), name))); + } + } + + /** + * Removes a custom waypoint relative to this room from {@link DungeonSecrets#customWaypoints} and all existing instances of this room. + * @param pos the position of the secret waypoint relative to this room + * @return the removed secret waypoint or {@code null} if there was no secret waypoint at the given position + */ + @SuppressWarnings("JavadocReference") + @Nullable + private SecretWaypoint removeCustomWaypoint(BlockPos pos) { + SecretWaypoint waypoint = DungeonSecrets.removeCustomWaypoint(name, pos); + if (waypoint != null) { + DungeonSecrets.getRoomsStream().filter(r -> name.equals(r.getName())).forEach(r -> r.removeCustomWaypoint(waypoint.secretIndex, pos)); + } + return waypoint; + } + + /** + * Removes a custom waypoint relative to this room from this instance of the room. + * @param secretIndex the index of the secret waypoint + * @param relativePos the position of the secret waypoint relative to this room + */ + private void removeCustomWaypoint(int secretIndex, BlockPos relativePos) { + BlockPos actualPos = relativeToActual(relativePos); + secretWaypoints.remove(secretIndex, actualPos); + } + /** * Updates the room. *

    diff --git a/src/main/resources/assets/skyblocker/lang/en_us.json b/src/main/resources/assets/skyblocker/lang/en_us.json index 3ead2954..8665ce45 100644 --- a/src/main/resources/assets/skyblocker/lang/en_us.json +++ b/src/main/resources/assets/skyblocker/lang/en_us.json @@ -273,9 +273,11 @@ "skyblocker.dungeons.secrets.markSecretFoundUnable": "§cUnable to mark secret #%d as found.", "skyblocker.dungeons.secrets.markSecretMissingUnable": "§cUnable to mark secret #%d as missing.", "skyblocker.dungeons.secrets.posMessage": "§rRoom: %s, X: %d, Y: %d, Z: %d", - "skyblocker.dungeons.secrets.customWaypointAdded": "§rAdded a custom waypoint at X: %d, Y: %d, Z: %d for room %s secret #%d of category %s with name '%s'.", "skyblocker.dungeons.secrets.noTarget": "§cNo target block found! (Are you pointing at a block in range?)", "skyblocker.dungeons.secrets.notMatched": "§cThe current room is not matched! (Are you in a dungeon room?)", + "skyblocker.dungeons.secrets.customWaypointAdded": "§rAdded a custom waypoint at X: %d, Y: %d, Z: %d for room %s secret #%d of category %s with name '%s'.", + "skyblocker.dungeons.secrets.customWaypointRemoved": "§rRemoved custom waypoint at X: %d, Y: %d, Z: %d for room %s secret #%d of category %s with name '%s'.", + "skyblocker.dungeons.secrets.customWaypointNotFound": "§cNo custom waypoint found at X: %d, Y: %d, Z: %d for room %s.", "skyblocker.fishing.reelNow": "Reel in now!", "skyblocker.rift.healNow": "Heal now!", -- cgit From 38039bd23d1275f177b3623661dea517ce84b97f Mon Sep 17 00:00:00 2001 From: msg-programs <64542860+msg-programs@users.noreply.github.com> Date: Mon, 30 Oct 2023 05:23:16 +0100 Subject: Fix maxed garden skills and milestone crops with spaces (#391) --- .../skyblock/tabhud/widget/GardenSkillsWidget.java | 23 ++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/src/main/java/de/hysky/skyblocker/skyblock/tabhud/widget/GardenSkillsWidget.java b/src/main/java/de/hysky/skyblocker/skyblock/tabhud/widget/GardenSkillsWidget.java index e7058fd6..41eee8d6 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/tabhud/widget/GardenSkillsWidget.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/tabhud/widget/GardenSkillsWidget.java @@ -24,9 +24,11 @@ public class GardenSkillsWidget extends Widget { // group 1: skill name and level // group 2: progress to next level (without "%") private static final Pattern SKILL_PATTERN = Pattern - .compile("\\S*: (?[A-Za-z]* [0-9]*): (?\\S*)%"); - // same, but with leading space - private static final Pattern MS_PATTERN = Pattern.compile("\\S*: (?[A-Za-z]* [0-9]*): (?\\S*)%"); + .compile("Skills: (?[A-Za-z]* [0-9]*): (?[0-9.MAX]*)%?"); + + // same, more or less + private static final Pattern MS_PATTERN = Pattern + .compile("Milestone: (?[A-Za-z ]* [0-9]*): (?[0-9.]*)%"); public GardenSkillsWidget() { super(TITLE, Formatting.YELLOW.getColorValue()); @@ -43,9 +45,14 @@ public class GardenSkillsWidget extends Widget { String strpcnt = m.group("progress"); String skill = m.group("skill"); - float pcnt = Float.parseFloat(strpcnt); - pc = new ProgressComponent(Ico.LANTERN, Text.of(skill), pcnt, - Formatting.GOLD.getColorValue()); + if (strpcnt.equals("MAX")) { + pc = new ProgressComponent(Ico.LANTERN, Text.of(skill), Text.of("MAX"), 100f, + Formatting.RED.getColorValue()); + } else { + float pcnt = Float.parseFloat(strpcnt); + pc = new ProgressComponent(Ico.LANTERN, Text.of(skill), pcnt, + Formatting.GOLD.getColorValue()); + } } this.addComponent(pc); @@ -66,10 +73,10 @@ public class GardenSkillsWidget extends Widget { pc2 = new ProgressComponent(); } else { String strpcnt = m.group("progress"); - String skill = m.group("skill"); + String milestone = m.group("milestone"); float pcnt = Float.parseFloat(strpcnt); - pc2 = new ProgressComponent(Ico.MILESTONE, Text.of(skill), pcnt, + pc2 = new ProgressComponent(Ico.MILESTONE, Text.of(milestone), pcnt, Formatting.GREEN.getColorValue()); } -- cgit From 24a77b37e8035e2b5e7c6d0f76adf13810ec2a26 Mon Sep 17 00:00:00 2001 From: StyStatic <97907654+stystatic@users.noreply.github.com> Date: Fri, 15 Sep 2023 17:16:12 -0700 Subject: Exotic Armor Identifier --- .../skyblocker/skyblock/item/PriceInfoTooltip.java | 43 ++ .../skyblocker/config/SkyblockerConfig.java | 650 +++++++++++++++++++++ .../skyblock/item/exotic/CheckExotic.java | 105 ++++ .../me/xmrvizzy/skyblocker/utils/Constants.java | 34 ++ .../resources/assets/skyblocker/lang/en_us.json | 8 + 5 files changed, 840 insertions(+) create mode 100644 src/main/java/me/xmrvizzy/skyblocker/config/SkyblockerConfig.java create mode 100644 src/main/java/me/xmrvizzy/skyblocker/skyblock/item/exotic/CheckExotic.java create mode 100644 src/main/java/me/xmrvizzy/skyblocker/utils/Constants.java 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 0885ae6b..667382ee 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.skyblock.item.exotic.CheckExotic; import de.hysky.skyblocker.utils.Constants; import de.hysky.skyblocker.utils.Http; import de.hysky.skyblocker.utils.ItemUtils; @@ -13,6 +14,7 @@ import net.minecraft.client.MinecraftClient; import net.minecraft.client.item.TooltipContext; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NbtCompound; +import net.minecraft.nbt.NbtElement; import net.minecraft.text.MutableText; import net.minecraft.text.Text; import net.minecraft.util.Formatting; @@ -35,6 +37,7 @@ public class PriceInfoTooltip { private static JsonObject lowestPricesJson; private static JsonObject isMuseumJson; private static JsonObject motesPricesJson; + public static JsonObject ColorApiData; private static volatile boolean nullMsgSend = false; private final static Gson gson = new Gson(); private static final Map apiAddresses; @@ -55,6 +58,45 @@ public class PriceInfoTooltip { neuName = internalID; } + if (lines.size() == 0) { + return; + } + + if (SkyblockerConfig.get().general.itemTooltip.enableExoticCheck) { + + if (ColorApiData == null) { // Only download once, don't need to waste resources on downloading every few seconds + ColorApiData = downloadPrices("color"); + } + + final NbtElement Color = stack.getNbt().getCompound("display").get("color"); + + if (Color != null) { + String colorHex = String.format("%06X", Integer.parseInt(Color.asString())); + String expectedHex = CheckExotic.getExpectedHex(internalID); + + boolean correctLine = false; + for (int i = 0; i < lines.size(); i++) { + String existingTooltip = String.valueOf(lines.get(i)); + if (existingTooltip.startsWith("Color: ")) { + correctLine = true; + + if (!colorHex.equalsIgnoreCase(expectedHex) && !CheckExotic.checkExceptions(internalID, colorHex) && !CheckExotic.intendedDyed(stack.getNbt())) { + final String type = CheckExotic.checkDyeType(colorHex); + lines.add(1, Text.literal(existingTooltip + Formatting.DARK_GRAY + " (" + CheckExotic.FormattingColor(type) + CheckExotic.getTranslatatedText(type).getString() + Formatting.DARK_GRAY + ")")); + } + break; + } + } + + if (!correctLine) { + if (!colorHex.equalsIgnoreCase(expectedHex) && !CheckExotic.checkExceptions(internalID, colorHex) && !CheckExotic.intendedDyed(stack.getNbt())) { + final String type = CheckExotic.checkDyeType(colorHex); + lines.add(1, Text.literal(Formatting.DARK_GRAY + "(" + CheckExotic.FormattingColor(type) + CheckExotic.getTranslatatedText(type).getString() + Formatting.DARK_GRAY + ")")); + } + } + } + } + int count = stack.getCount(); boolean bazaarOpened = lines.stream().anyMatch(each -> each.getString().contains("Buy price:") || each.getString().contains("Sell price:")); @@ -421,5 +463,6 @@ public class PriceInfoTooltip { apiAddresses.put("npc", "https://hysky.de/api/npcprice"); apiAddresses.put("museum", "https://hysky.de/api/museum"); apiAddresses.put("motes", "https://hysky.de/api/motesprice"); + apiAddresses.put("color", "https://hysky.de/api/color"); } } \ No newline at end of file diff --git a/src/main/java/me/xmrvizzy/skyblocker/config/SkyblockerConfig.java b/src/main/java/me/xmrvizzy/skyblocker/config/SkyblockerConfig.java new file mode 100644 index 00000000..7fc042e5 --- /dev/null +++ b/src/main/java/me/xmrvizzy/skyblocker/config/SkyblockerConfig.java @@ -0,0 +1,650 @@ +package me.xmrvizzy.skyblocker.config; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.mojang.brigadier.builder.LiteralArgumentBuilder; +import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap; +import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; +import me.shedaniel.autoconfig.AutoConfig; +import me.shedaniel.autoconfig.ConfigData; +import me.shedaniel.autoconfig.annotation.Config; +import me.shedaniel.autoconfig.annotation.ConfigEntry; +import me.shedaniel.autoconfig.serializer.ConfigSerializer; +import me.shedaniel.autoconfig.serializer.GsonConfigSerializer; +import me.xmrvizzy.skyblocker.SkyblockerMod; +import me.xmrvizzy.skyblocker.skyblock.item.CustomArmorTrims; +import me.xmrvizzy.skyblocker.utils.chat.ChatFilterResult; +import me.xmrvizzy.skyblocker.utils.scheduler.Scheduler; +import net.fabricmc.fabric.api.client.command.v2.ClientCommandRegistrationCallback; +import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource; +import net.minecraft.client.resource.language.I18n; +import net.minecraft.text.Style; +import net.minecraft.text.Text; +import net.minecraft.util.Identifier; + +import java.util.ArrayList; +import java.util.List; + +import static net.fabricmc.fabric.api.client.command.v2.ClientCommandManager.literal; + +@Config(name = "skyblocker") +public class SkyblockerConfig implements ConfigData { + + @ConfigEntry.Category("general") + @ConfigEntry.Gui.TransitiveObject + public General general = new General(); + + @ConfigEntry.Category("locations") + @ConfigEntry.Gui.TransitiveObject + public Locations locations = new Locations(); + + @ConfigEntry.Category("slayer") + @ConfigEntry.Gui.TransitiveObject + public Slayer slayer = new Slayer(); + + @ConfigEntry.Category("quickNav") + @ConfigEntry.Gui.TransitiveObject + public QuickNav quickNav = new QuickNav(); + + @ConfigEntry.Category("messages") + @ConfigEntry.Gui.TransitiveObject + public Messages messages = new Messages(); + + @ConfigEntry.Category("richPresence") + @ConfigEntry.Gui.TransitiveObject + public RichPresence richPresence = new RichPresence(); + + public static class QuickNav { + public boolean enableQuickNav = true; + + @ConfigEntry.Category("button1") + @ConfigEntry.Gui.CollapsibleObject() + public QuickNavItem button1 = new QuickNavItem(true, new ItemData("diamond_sword"), "Your Skills", "/skills"); + + @ConfigEntry.Category("button2") + @ConfigEntry.Gui.CollapsibleObject() + public QuickNavItem button2 = new QuickNavItem(true, new ItemData("painting"), "Collections", "/collection"); + + @ConfigEntry.Category("button3") + @ConfigEntry.Gui.CollapsibleObject() + public QuickNavItem button3 = new QuickNavItem(true, new ItemData("bone"), "\\Pets \\(\\d+/\\d+\\)", "/pets"); + + @ConfigEntry.Category("button4") + @ConfigEntry.Gui.CollapsibleObject() + public QuickNavItem button4 = new QuickNavItem(true, new ItemData("leather_chestplate", 1, "tag:{display:{color:8991416}}"), "Wardrobe \\([12]/2\\)", "/wardrobe"); + + @ConfigEntry.Category("button5") + @ConfigEntry.Gui.CollapsibleObject() + public QuickNavItem button5 = new QuickNavItem(true, new ItemData("player_head", 1, "tag:{SkullOwner:{Id:[I;-2081424676,-57521078,-2073572414,158072763],Properties:{textures:[{Value:\"ewogICJ0aW1lc3RhbXAiIDogMTU5MTMxMDU4NTYwOSwKICAicHJvZmlsZUlkIiA6ICI0MWQzYWJjMmQ3NDk0MDBjOTA5MGQ1NDM0ZDAzODMxYiIsCiAgInByb2ZpbGVOYW1lIiA6ICJNZWdha2xvb24iLAogICJzaWduYXR1cmVSZXF1aXJlZCIgOiB0cnVlLAogICJ0ZXh0dXJlcyIgOiB7CiAgICAiU0tJTiIgOiB7CiAgICAgICJ1cmwiIDogImh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvODBhMDc3ZTI0OGQxNDI3NzJlYTgwMDg2NGY4YzU3OGI5ZDM2ODg1YjI5ZGFmODM2YjY0YTcwNjg4MmI2ZWMxMCIKICAgIH0KICB9Cn0=\"}]}}}"), "Sack of Sacks", "/sacks"); + + @ConfigEntry.Category("button6") + @ConfigEntry.Gui.CollapsibleObject() + public QuickNavItem button6 = new QuickNavItem(true, new ItemData("ender_chest"), "(?:Rift )?Storage(?: \\(1/2\\))?", "/storage"); + + @ConfigEntry.Category("button7") + @ConfigEntry.Gui.CollapsibleObject() + public QuickNavItem button7 = new QuickNavItem(true, new ItemData("player_head", 1, "tag:{SkullOwner:{Id:[I;-300151517,-631415889,-1193921967,-1821784279],Properties:{textures:[{Value:\"e3RleHR1cmVzOntTS0lOOnt1cmw6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZDdjYzY2ODc0MjNkMDU3MGQ1NTZhYzUzZTA2NzZjYjU2M2JiZGQ5NzE3Y2Q4MjY5YmRlYmVkNmY2ZDRlN2JmOCJ9fX0=\"}]}}}"), "none", "/hub"); + + @ConfigEntry.Category("button8") + @ConfigEntry.Gui.CollapsibleObject() + public QuickNavItem button8 = new QuickNavItem(true, new ItemData("player_head", 1, "tag:{SkullOwner:{Id:[I;1605800870,415127827,-1236127084,15358548],Properties:{textures:[{Value:\"e3RleHR1cmVzOntTS0lOOnt1cmw6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNzg5MWQ1YjI3M2ZmMGJjNTBjOTYwYjJjZDg2ZWVmMWM0MGExYjk0MDMyYWU3MWU3NTQ3NWE1NjhhODI1NzQyMSJ9fX0=\"}]}}}"), "none", "/warp dungeon_hub"); + + @ConfigEntry.Category("button9") + @ConfigEntry.Gui.CollapsibleObject() + public QuickNavItem button9 = new QuickNavItem(true, new ItemData("player_head", 1, "tag:{SkullOwner:{Id:[I;-562285948,532499670,-1705302742,775653035],Properties:{textures:[{Value:\"eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYjVkZjU1NTkyNjQzMGQ1ZDc1YWRlZDIxZGQ5NjE5Yjc2YzViN2NhMmM3ZjU0MDE0NDA1MjNkNTNhOGJjZmFhYiJ9fX0=\"}]}}}"), "Visit prtl", "/visit prtl"); + + @ConfigEntry.Category("button10") + @ConfigEntry.Gui.CollapsibleObject() + public QuickNavItem button10 = new QuickNavItem(true, new ItemData("enchanting_table"), "Enchant Item", "/etable"); + + @ConfigEntry.Category("button11") + @ConfigEntry.Gui.CollapsibleObject() + public QuickNavItem button11 = new QuickNavItem(true, new ItemData("anvil"), "Anvil", "/anvil"); + + @ConfigEntry.Category("button12") + @ConfigEntry.Gui.CollapsibleObject() + public QuickNavItem button12 = new QuickNavItem(true, new ItemData("crafting_table"), "Craft Item", "/craft"); + } + + public static class QuickNavItem { + public QuickNavItem(Boolean render, ItemData itemData, String uiTitle, String clickEvent) { + this.render = render; + this.item = itemData; + this.clickEvent = clickEvent; + this.uiTitle = uiTitle; + } + + public Boolean render; + + @ConfigEntry.Category("item") + @ConfigEntry.Gui.CollapsibleObject() + public ItemData item; + + public String uiTitle; + public String clickEvent; + } + + public static class ItemData { + public ItemData(String itemName, int count, String nbt) { + this.itemName = itemName; + this.count = count; + this.nbt = nbt; + } + + public ItemData(String itemName) { + this.itemName = itemName; + this.count = 1; + this.nbt = ""; + } + + public String itemName; + public int count; + public String nbt; + } + + public static class General { + public boolean acceptReparty = true; + public boolean backpackPreviewWithoutShift = false; + public boolean hideEmptyTooltips = true; + public boolean hideStatusEffectOverlay = false; + + @ConfigEntry.Category("tabHud") + @ConfigEntry.Gui.CollapsibleObject() + public TabHudConf tabHud = new TabHudConf(); + + @ConfigEntry.Gui.Excluded + public String apiKey; + + @ConfigEntry.Category("bars") + @ConfigEntry.Gui.CollapsibleObject() + public Bars bars = new Bars(); + + @ConfigEntry.Category("experiments") + @ConfigEntry.Gui.CollapsibleObject() + public Experiments experiments = new Experiments(); + + @ConfigEntry.Category("fishing") + @ConfigEntry.Gui.CollapsibleObject() + public Fishing fishing = new Fishing(); + + @ConfigEntry.Category("fairySouls") + @ConfigEntry.Gui.CollapsibleObject() + public FairySouls fairySouls = new FairySouls(); + + @ConfigEntry.Category("shortcuts") + @ConfigEntry.Gui.CollapsibleObject() + public Shortcuts shortcuts = new Shortcuts(); + + @ConfigEntry.Category("quiverWarning") + @ConfigEntry.Gui.CollapsibleObject() + public QuiverWarning quiverWarning = new QuiverWarning(); + + @ConfigEntry.Category("itemList") + @ConfigEntry.Gui.CollapsibleObject() + public ItemList itemList = new ItemList(); + + @ConfigEntry.Category("itemTooltip") + @ConfigEntry.Gui.CollapsibleObject() + public ItemTooltip itemTooltip = new ItemTooltip(); + + @ConfigEntry.Category("itemInfoDisplay") + @ConfigEntry.Gui.CollapsibleObject + public ItemInfoDisplay itemInfoDisplay = new ItemInfoDisplay(); + + @ConfigEntry.Category("specialEffects") + @ConfigEntry.Gui.CollapsibleObject + public SpecialEffects specialEffects = new SpecialEffects(); + + @ConfigEntry.Category("hitbox") + @ConfigEntry.Gui.CollapsibleObject() + public Hitbox hitbox = new Hitbox(); + + @ConfigEntry.Gui.Tooltip() + @ConfigEntry.Category("titleContainer") + @ConfigEntry.Gui.CollapsibleObject() + public TitleContainer titleContainer = new TitleContainer(); + + @ConfigEntry.Category("Teleport Overlay") + @ConfigEntry.Gui.CollapsibleObject() + public TeleportOverlay teleportOverlay = new TeleportOverlay(); + + @ConfigEntry.Gui.Excluded + public List lockedSlots = new ArrayList<>(); + + @ConfigEntry.Gui.Excluded + public Object2ObjectOpenHashMap customItemNames = new Object2ObjectOpenHashMap<>(); + + @ConfigEntry.Gui.Excluded + public Object2IntOpenHashMap customDyeColors = new Object2IntOpenHashMap<>(); + + @ConfigEntry.Gui.Excluded + public Object2ObjectOpenHashMap customArmorTrims = new Object2ObjectOpenHashMap<>(); + } + + public static class TabHudConf { + public boolean tabHudEnabled = true; + + @ConfigEntry.BoundedDiscrete(min = 10, max = 200) + @ConfigEntry.Gui.Tooltip() + public int tabHudScale = 100; + @ConfigEntry.Gui.Tooltip + public boolean plainPlayerNames = false; + @ConfigEntry.Gui.EnumHandler(option = ConfigEntry.Gui.EnumHandler.EnumDisplayOption.BUTTON) + @ConfigEntry.Gui.Tooltip + public NameSorting nameSorting = NameSorting.DEFAULT; + } + + public enum NameSorting { + DEFAULT, + ALPHABETICAL; + + @Override + public String toString() { + return switch (this) { + case DEFAULT -> "Default"; + case ALPHABETICAL -> "Alphabetical"; + }; + } + } + + public static class Bars { + public boolean enableBars = true; + + @ConfigEntry.Category("barpositions") + @ConfigEntry.Gui.CollapsibleObject() + public BarPositions barpositions = new BarPositions(); + } + + public static class BarPositions { + @ConfigEntry.Gui.EnumHandler(option = ConfigEntry.Gui.EnumHandler.EnumDisplayOption.BUTTON) + public BarPosition healthBarPosition = BarPosition.LAYER1; + @ConfigEntry.Gui.EnumHandler(option = ConfigEntry.Gui.EnumHandler.EnumDisplayOption.BUTTON) + public BarPosition manaBarPosition = BarPosition.LAYER1; + @ConfigEntry.Gui.EnumHandler(option = ConfigEntry.Gui.EnumHandler.EnumDisplayOption.BUTTON) + public BarPosition defenceBarPosition = BarPosition.LAYER1; + @ConfigEntry.Gui.EnumHandler(option = ConfigEntry.Gui.EnumHandler.EnumDisplayOption.BUTTON) + public BarPosition experienceBarPosition = BarPosition.LAYER1; + + } + + public enum BarPosition { + LAYER1, + LAYER2, + RIGHT, + NONE; + + @Override + public String toString() { + return I18n.translate("text.autoconfig.skyblocker.option.general.bars.barpositions." + name()); + } + + public int toInt() { + return switch (this) { + case LAYER1 -> 0; + case LAYER2 -> 1; + case RIGHT -> 2; + case NONE -> -1; + }; + } + } + + public static class Experiments { + public boolean enableChronomatronSolver = true; + public boolean enableSuperpairsSolver = true; + public boolean enableUltrasequencerSolver = true; + } + + public static class Fishing { + public boolean enableFishingHelper = true; + } + + public static class FairySouls { + public boolean enableFairySoulsHelper = false; + } + + public static class Shortcuts { + @ConfigEntry.Gui.Tooltip() + public boolean enableShortcuts = true; + @ConfigEntry.Gui.Tooltip() + public boolean enableCommandShortcuts = true; + @ConfigEntry.Gui.Tooltip() + public boolean enableCommandArgShortcuts = true; + } + + public static class QuiverWarning { + public boolean enableQuiverWarning = true; + public boolean enableQuiverWarningInDungeons = true; + public boolean enableQuiverWarningAfterDungeon = true; + } + + public static class Hitbox { + public boolean oldFarmlandHitbox = true; + public boolean oldLeverHitbox = false; + } + + public static class TitleContainer { + @ConfigEntry.BoundedDiscrete(min = 30, max = 140) + public float titleContainerScale = 100; + public int x = 540; + public int y = 10; + @ConfigEntry.Gui.EnumHandler(option = ConfigEntry.Gui.EnumHandler.EnumDisplayOption.BUTTON) + public Direction direction = Direction.HORIZONTAL; + @ConfigEntry.Gui.EnumHandler(option = ConfigEntry.Gui.EnumHandler.EnumDisplayOption.DROPDOWN) + public Alignment alignment = Alignment.MIDDLE; + } + + public static class TeleportOverlay { + public boolean enableTeleportOverlays = true; + public boolean enableWeirdTransmission = true; + public boolean enableInstantTransmission = true; + public boolean enableEtherTransmission = true; + public boolean enableSinrecallTransmission = true; + public boolean enableWitherImpact = true; + } + + public enum Direction { + HORIZONTAL, + VERTICAL; + + @Override + public String toString() { + return switch (this) { + case HORIZONTAL -> "Horizontal"; + case VERTICAL -> "Vertical"; + }; + } + } + + public enum Alignment { + LEFT, + RIGHT, + MIDDLE; + + @Override + public String toString() { + return switch (this) { + case LEFT -> "Left"; + case RIGHT -> "Right"; + case MIDDLE -> "Middle"; + }; + } + } + + public static class RichPresence { + public boolean enableRichPresence = false; + @ConfigEntry.Gui.EnumHandler(option = ConfigEntry.Gui.EnumHandler.EnumDisplayOption.BUTTON) + @ConfigEntry.Gui.Tooltip() + public Info info = Info.LOCATION; + public boolean cycleMode = false; + public String customMessage = "Playing Skyblock"; + } + + public static class ItemList { + public boolean enableItemList = true; + } + + public enum Average { + ONE_DAY, + THREE_DAY, + BOTH; + + @Override + public String toString() { + return I18n.translate("text.autoconfig.skyblocker.option.general.itemTooltip.avg." + name()); + } + } + + public static class ItemTooltip { + public boolean enableExoticCheck = true; + public boolean enableNPCPrice = true; + @ConfigEntry.Gui.Tooltip + public boolean enableMotesPrice = true; + public boolean enableAvgBIN = true; + @ConfigEntry.Gui.EnumHandler(option = ConfigEntry.Gui.EnumHandler.EnumDisplayOption.BUTTON) + @ConfigEntry.Gui.Tooltip() + public Average avg = Average.THREE_DAY; + public boolean enableLowestBIN = true; + public boolean enableBazaarPrice = true; + public boolean enableMuseumDate = true; + } + + public static class ItemInfoDisplay { + @ConfigEntry.Gui.Tooltip + public boolean attributeShardInfo = true; + } + + public static class SpecialEffects { + @ConfigEntry.Gui.Tooltip + public boolean rareDungeonDropEffects = true; + } + + public static class Locations { + @ConfigEntry.Category("barn") + @ConfigEntry.Gui.CollapsibleObject() + public Barn barn = new Barn(); + + @ConfigEntry.Category("dungeons") + @ConfigEntry.Gui.CollapsibleObject() + public Dungeons dungeons = new Dungeons(); + + @ConfigEntry.Category("dwarvenmines") + @ConfigEntry.Gui.CollapsibleObject() + public DwarvenMines dwarvenMines = new DwarvenMines(); + + @ConfigEntry.Category("rift") + @ConfigEntry.Gui.CollapsibleObject() + public Rift rift = new Rift(); + } + + public static class Dungeons { + @ConfigEntry.Gui.CollapsibleObject + public SecretWaypoints secretWaypoints = new SecretWaypoints(); + @ConfigEntry.Gui.CollapsibleObject + public DungeonChestProfit dungeonChestProfit = new DungeonChestProfit(); + @ConfigEntry.Gui.Tooltip() + public boolean croesusHelper = true; + public boolean enableMap = true; + public float mapScaling = 1f; + public int mapX = 2; + public int mapY = 2; + @ConfigEntry.Gui.Tooltip + public boolean starredMobGlow = true; + public boolean solveThreeWeirdos = true; + @ConfigEntry.Gui.Tooltip + public boolean blazesolver = true; + public boolean solveTrivia = true; + @ConfigEntry.Gui.Tooltip + public boolean solveTicTacToe = true; + @ConfigEntry.Gui.CollapsibleObject + public LividColor lividColor = new LividColor(); + @ConfigEntry.Gui.CollapsibleObject() + public Terminals terminals = new Terminals(); + } + + public static class SecretWaypoints { + + public boolean enableSecretWaypoints = true; + @ConfigEntry.Gui.Tooltip() + public boolean noInitSecretWaypoints = false; + public boolean enableEntranceWaypoints = true; + public boolean enableSuperboomWaypoints = true; + public boolean enableChestWaypoints = true; + public boolean enableItemWaypoints = true; + public boolean enableBatWaypoints = true; + public boolean enableWitherWaypoints = true; + public boolean enableLeverWaypoints = true; + public boolean enableFairySoulWaypoints = true; + public boolean enableStonkWaypoints = true; + @ConfigEntry.Gui.Tooltip() + public boolean enableDefaultWaypoints = true; + } + + public static class DungeonChestProfit { + @ConfigEntry.Gui.Tooltip + public boolean enableProfitCalculator = true; + @ConfigEntry.Gui.Tooltip + public boolean includeKismet = false; + @ConfigEntry.Gui.Tooltip + public boolean includeEssence = true; + } + + public static class LividColor { + @ConfigEntry.Gui.Tooltip() + public boolean enableLividColor = true; + @ConfigEntry.Gui.Tooltip() + public String lividColorText = "The livid color is [color]"; + } + + public static class Terminals { + public boolean solveColor = true; + public boolean solveOrder = true; + public boolean solveStartsWith = true; + } + + public static class DwarvenMines { + public boolean enableDrillFuel = true; + public boolean solveFetchur = true; + public boolean solvePuzzler = true; + @ConfigEntry.Gui.CollapsibleObject() + public DwarvenHud dwarvenHud = new DwarvenHud(); + } + + public static class DwarvenHud { + public boolean enabled = true; + @ConfigEntry.Gui.EnumHandler(option = ConfigEntry.Gui.EnumHandler.EnumDisplayOption.BUTTON) + @ConfigEntry.Gui.Tooltip(count = 3) + public DwarvenHudStyle style = DwarvenHudStyle.SIMPLE; + public boolean enableBackground = true; + public int x = 10; + public int y = 10; + } + + public enum DwarvenHudStyle { + SIMPLE, + FANCY, + CLASSIC; + + @Override + public String toString() { + return switch (this) { + case SIMPLE -> "Simple"; + case FANCY -> "Fancy"; + case CLASSIC -> "Classic"; + }; + } + } + + public static class Barn { + public boolean solveHungryHiker = true; + public boolean solveTreasureHunter = true; + } + + public static class Rift { + public boolean mirrorverseWaypoints = true; + @ConfigEntry.BoundedDiscrete(min = 0, max = 5) + @ConfigEntry.Gui.Tooltip + public int mcGrubberStacks = 0; + } + + public static class Slayer { + @ConfigEntry.Category("vampire") + @ConfigEntry.Gui.CollapsibleObject() + public VampireSlayer vampireSlayer = new VampireSlayer(); + } + + public static class VampireSlayer { + public boolean enableEffigyWaypoints = true; + public boolean compactEffigyWaypoints; + @ConfigEntry.BoundedDiscrete(min = 1, max = 10) + @ConfigEntry.Gui.Tooltip() + public int effigyUpdateFrequency = 5; + public boolean enableHolyIceIndicator = true; + public int holyIceIndicatorTickDelay = 10; + @ConfigEntry.BoundedDiscrete(min = 1, max = 10) + @ConfigEntry.Gui.Tooltip() + public int holyIceUpdateFrequency = 5; + public boolean enableHealingMelonIndicator = true; + public float healingMelonHealthThreshold = 4F; + public boolean enableSteakStakeIndicator = true; + @ConfigEntry.BoundedDiscrete(min = 1, max = 10) + @ConfigEntry.Gui.Tooltip() + public int steakStakeUpdateFrequency = 5; + public boolean enableManiaIndicator = true; + @ConfigEntry.BoundedDiscrete(min = 1, max = 10) + @ConfigEntry.Gui.Tooltip() + public int maniaUpdateFrequency = 5; + } + + public static class Messages { + @ConfigEntry.Gui.EnumHandler(option = ConfigEntry.Gui.EnumHandler.EnumDisplayOption.BUTTON) + public ChatFilterResult hideAbility = ChatFilterResult.PASS; + @ConfigEntry.Gui.EnumHandler(option = ConfigEntry.Gui.EnumHandler.EnumDisplayOption.BUTTON) + public ChatFilterResult hideHeal = ChatFilterResult.PASS; + @ConfigEntry.Gui.EnumHandler(option = ConfigEntry.Gui.EnumHandler.EnumDisplayOption.BUTTON) + public ChatFilterResult hideAOTE = ChatFilterResult.PASS; + @ConfigEntry.Gui.EnumHandler(option = ConfigEntry.Gui.EnumHandler.EnumDisplayOption.BUTTON) + public ChatFilterResult hideImplosion = ChatFilterResult.PASS; + @ConfigEntry.Gui.EnumHandler(option = ConfigEntry.Gui.EnumHandler.EnumDisplayOption.BUTTON) + public ChatFilterResult hideMoltenWave = ChatFilterResult.PASS; + @ConfigEntry.Gui.EnumHandler(option = ConfigEntry.Gui.EnumHandler.EnumDisplayOption.BUTTON) + public ChatFilterResult hideAds = ChatFilterResult.PASS; + @ConfigEntry.Gui.EnumHandler(option = ConfigEntry.Gui.EnumHandler.EnumDisplayOption.BUTTON) + public ChatFilterResult hideTeleportPad = ChatFilterResult.PASS; + @ConfigEntry.Gui.EnumHandler(option = ConfigEntry.Gui.EnumHandler.EnumDisplayOption.BUTTON) + public ChatFilterResult hideCombo = ChatFilterResult.PASS; + @ConfigEntry.Gui.EnumHandler(option = ConfigEntry.Gui.EnumHandler.EnumDisplayOption.BUTTON) + public ChatFilterResult hideAutopet = ChatFilterResult.PASS; + @ConfigEntry.Gui.EnumHandler(option = ConfigEntry.Gui.EnumHandler.EnumDisplayOption.BUTTON) + @ConfigEntry.Gui.Tooltip + public ChatFilterResult hideShowOff = ChatFilterResult.PASS; + @ConfigEntry.Gui.Tooltip() + public boolean hideMana = false; + } + + public enum Info { + PURSE, + BITS, + LOCATION; + + @Override + public String toString() { + return I18n.translate("text.autoconfig.skyblocker.option.richPresence.info." + name()); + } + } + + /** + * Registers the config to AutoConfig and registers commands to open the config screen. + */ + public static void init() { + Gson gson = new GsonBuilder() + .setPrettyPrinting() + .registerTypeHierarchyAdapter(Text.class, new Text.Serializer()) + .registerTypeHierarchyAdapter(Style.class, new Style.Serializer()) + .registerTypeHierarchyAdapter(Identifier.class, new Identifier.Serializer()) + .create(); + + ConfigSerializer.Factory serializer = (cfg, cfgClass) -> new GsonConfigSerializer<>(cfg, cfgClass, gson); + + AutoConfig.register(SkyblockerConfig.class, serializer); + ClientCommandRegistrationCallback.EVENT.register(((dispatcher, registryAccess) -> dispatcher.register(literal(SkyblockerMod.NAMESPACE).then(optionsLiteral("config")).then(optionsLiteral("options"))))); + } + + /** + * Registers an options command with the given name. Used for registering both options and config as valid commands. + * + * @param name the name of the command node + * @return the command builder + */ + private static LiteralArgumentBuilder optionsLiteral(String name) { + // Don't immediately open the next screen as it will be closed by ChatScreen right after this command is executed + return literal(name).executes(Scheduler.queueOpenScreenCommand(AutoConfig.getConfigScreen(SkyblockerConfig.class, null))); + } + + public static SkyblockerConfig get() { + return AutoConfig.getConfigHolder(SkyblockerConfig.class).getConfig(); + } + + public static void save() { + AutoConfig.getConfigHolder(SkyblockerConfig.class).save(); + } +} diff --git a/src/main/java/me/xmrvizzy/skyblocker/skyblock/item/exotic/CheckExotic.java b/src/main/java/me/xmrvizzy/skyblocker/skyblock/item/exotic/CheckExotic.java new file mode 100644 index 00000000..fb22362e --- /dev/null +++ b/src/main/java/me/xmrvizzy/skyblocker/skyblock/item/exotic/CheckExotic.java @@ -0,0 +1,105 @@ +package me.xmrvizzy.skyblocker.skyblock.item.exotic; + +import me.xmrvizzy.skyblocker.skyblock.item.PriceInfoTooltip; +import me.xmrvizzy.skyblocker.utils.Constants; +import net.minecraft.nbt.NbtCompound; +import net.minecraft.text.Text; +import net.minecraft.util.Formatting; + +public class CheckExotic { + static String[] SeymourIDS = {"VELVET_TOP_HAT", "CASHMERE_JACKET", "SATIN_TROUSERS", "OXFORD_SHOES"}; + public static String getExpectedHex(String id) { + String color = PriceInfoTooltip.ColorApiData.get(id).getAsString(); + if (color != null) { + String[] RGBValues = color.split(","); + String hex = String.format("%02x%02x%02x", Integer.parseInt(RGBValues[0]), Integer.parseInt(RGBValues[1]), Integer.parseInt(RGBValues[2])); + return hex.toUpperCase(); + } else { + System.out.println("Color is null"); + return null; + } + } + + public static Boolean checkExceptions(String id, String hex) { + if (id.startsWith("LEATHER") || id.equals("GHOST_BOOTS") || ListContainsString(SeymourIDS, id)) { + return true; + } + if (id.startsWith("RANCHER")) { + return ListContainsString(Constants.Ranchers, hex); + } + if (id.contains("ADAPTIVE_CHESTPLATE")) { + return ListContainsString(Constants.AdaptiveChest, hex); + } else if (id.contains("ADAPTIVE")) { + return ListContainsString(Constants.Adaptive, hex); + } + if (id.startsWith("REAPER")) { + return ListContainsString(Constants.Reaper, hex); + } + if (id.startsWith("FAIRY")) { + return ListContainsString(Constants.FairyHexes, hex); + } + if (id.startsWith("CRYSTAL")) { + return ListContainsString(Constants.CrystalHexes, hex); + } + if (id.contains("SPOOK")) { + return ListContainsString(Constants.Spook, hex); + } + return false; + } + + public static String checkDyeType(String ActualHex) { + if (ListContainsString(Constants.CrystalHexes, ActualHex)) { + return "CRYSTAL"; + } + if (ListContainsString(Constants.FairyHexes, ActualHex)) { + return "FAIRY"; + } + if (ListContainsString(Constants.OgFairyHexes, ActualHex)) { + return "OG_FAIRY"; + } + if (ListContainsString(Constants.Spook, ActualHex)) { + return "SPOOK"; + } + if (ListContainsString(Constants.Glitched, ActualHex)) { + return "GLITCHED"; + } + return "EXOTIC"; + } + + private static Boolean ListContainsString(String[] list, String s) { + for (int i = 0; i < list.length; i++) { + if (list[i].equalsIgnoreCase(s)) { + return true; + } + } + return false; + } + + public static Boolean intendedDyed(NbtCompound ItemData) { + return ItemData.getCompound("ExtraAttributes").getKeys().contains("dye_item"); + } + + public static Formatting FormattingColor(String s) { + switch (s) { + case "CRYSTAL": return Formatting.AQUA; + case "FAIRY": return Formatting.LIGHT_PURPLE; + case "OG_FAIRY": return Formatting.DARK_PURPLE; + case "SPOOK": return Formatting.RED; + case "GLITCHED": return Formatting.BLUE; + case "EXOTIC": return Formatting.GOLD; + } + return Formatting.DARK_GRAY; + } + + public static Text getTranslatatedText(String s) { + switch (s) { + case "CRYSTAL": return Text.translatable("skyblocker.exotic.crystal"); + case "FAIRY": return Text.translatable("skyblocker.exotic.fairy"); + case "OG_FAIRY": return Text.translatable("skyblocker.exotic.og_fairy"); + case "SPOOK": return Text.translatable("skyblocker.exotic.spook"); + case "GLITCHED": return Text.translatable("skyblocker.exotic.glitched"); + case "EXOTIC": return Text.translatable("skyblocker.exotic.exotic"); + } + return null; + } +} diff --git a/src/main/java/me/xmrvizzy/skyblocker/utils/Constants.java b/src/main/java/me/xmrvizzy/skyblocker/utils/Constants.java new file mode 100644 index 00000000..23d4a43f --- /dev/null +++ b/src/main/java/me/xmrvizzy/skyblocker/utils/Constants.java @@ -0,0 +1,34 @@ +package me.xmrvizzy.skyblocker.utils; + +/** + * 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"; + + // Exotic Hexes + String[] CrystalHexes = {"1F0030", "46085E", "54146E", "5D1C78", "63237D", "6A2C82", "7E4196", "8E51A6", "9C64B3", "A875BD", + "B88BC9", "C6A3D4", "D9C1E3", "E5D1ED", "EFE1F5", "FCF3FF"}; + String[] FairyHexes = {"330066", "4C0099", "660033", "660066", "6600CC", "7F00FF", "99004C", "990099", "9933FF", "B266FF", + "CC0066", "CC00CC", "CC99FF", "E5CCFF", "FF007F", "FF00FF", "FF3399", "FF33FF", "FF66B2", "FF66FF", "FF99CC", "FF99FF", "FFCCE5", + "FFCCFF"}; + + String[] OgFairyHexes = {"FF99FF", "FFCCFF", "E5CCFF", "CC99FF", "CC00CC", "FF00FF", "FF33FF", "FF66FF", + "B266FF", "9933FF", "7F00FF", "660066", "6600CC", "4C0099", "330066", "990099", "660033", "99004C", "CC0066", + "660033", "99004C", "FFCCE5", "660033", "FFCCE5", "FF99CC", "FFCCE5", "FF99CC", "FF66B2"}; + + String[] Glitched = {"FFDC51", "F7DA33", "606060", "E7413C", "45413C", "4A14B7", "1793C4", "000000", "E75C3C", "65605A", + "5D2FB9", "17A8C4", "E76E3C", "88837E", "8969C8", "1CD4E4"}; // Glitched through other means such as Shark Scale upgrade color + + String[] Spook = {"000000", "070008", "0E000F", "150017", "1B001F", "220027", "29002E", "300036", "37003E", "3E0046", + "45004D", "4C0055", "52005D", "590065", "60006C", "670074", "6E007C", "750084", "7C008B", "830093", + "89009B", "9000A3", "9700AA", "993399", "9E00B2"}; + + // List of exceptions + + String[] Ranchers = {"CC5500", "000000", "0"}; + String[] Reaper = {"1B1B1B", "FF0000"}; + + String[] AdaptiveChest = {"3ABE78", "82E3D8", "BFBCB2", "D579FF", "FF4242", "FFC234"}; + String[] Adaptive = {"169F57", "2AB5A5", "6E00A0", "BB0000", "BFBCB2", "FFF7E6"}; +} diff --git a/src/main/resources/assets/skyblocker/lang/en_us.json b/src/main/resources/assets/skyblocker/lang/en_us.json index 8665ce45..990fc351 100644 --- a/src/main/resources/assets/skyblocker/lang/en_us.json +++ b/src/main/resources/assets/skyblocker/lang/en_us.json @@ -65,6 +65,7 @@ "text.autoconfig.skyblocker.option.general.tabHud.nameSorting": "Player Name Sorting Method", "text.autoconfig.skyblocker.option.general.tabHud.nameSorting.@Tooltip": "Alphabetical sorting sorts names alphabetically while Default has no particular order.", "text.autoconfig.skyblocker.option.general.itemTooltip": "Item Tooltip", + "text.autoconfig.skyblocker.option.general.itemTooltip.enableExoticCheck": "Enable Exotic Check", "text.autoconfig.skyblocker.option.general.itemTooltip.enableNPCPrice": "Enable NPC Price", "text.autoconfig.skyblocker.option.general.itemTooltip.enableMotesPrice": "Enable Motes Price", "text.autoconfig.skyblocker.option.general.itemTooltip.enableMotesPrice.@Tooltip": "Displays the Motes sell price of an item while in The Rift.", @@ -279,6 +280,13 @@ "skyblocker.dungeons.secrets.customWaypointRemoved": "§rRemoved custom waypoint at X: %d, Y: %d, Z: %d for room %s secret #%d of category %s with name '%s'.", "skyblocker.dungeons.secrets.customWaypointNotFound": "§cNo custom waypoint found at X: %d, Y: %d, Z: %d for room %s.", + "skyblocker.exotic.crystal": "CRYSTAL", + "skyblocker.exotic.fairy": "FAIRY", + "skyblocker.exotic.og_fairy": "OG_FAIRY", + "skyblocker.exotic.spook": "SPOOK", + "skyblocker.exotic.glitched": "GLITCHED", + "skyblocker.exotic.exotic": "EXOTIC", + "skyblocker.fishing.reelNow": "Reel in now!", "skyblocker.rift.healNow": "Heal now!", "skyblocker.rift.iceNow": "Ice now!", -- cgit From ceb5dbbea4079eadca90a96e714cc5539700a5d4 Mon Sep 17 00:00:00 2001 From: Kevinthegreat <92656833+kevinthegreat1@users.noreply.github.com> Date: Fri, 15 Sep 2023 23:46:12 -0400 Subject: Refactor CheckExotic --- .../skyblocker/skyblock/item/PriceInfoTooltip.java | 61 +++++++++-------- src/main/java/de/hysky/skyblocker/utils/Utils.java | 2 +- .../skyblock/item/exotic/CheckExotic.java | 79 +++++++++------------- .../me/xmrvizzy/skyblocker/utils/Constants.java | 53 +++++++-------- 4 files changed, 90 insertions(+), 105 deletions(-) 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 667382ee..3ecbe8be 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/item/PriceInfoTooltip.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/item/PriceInfoTooltip.java @@ -1,7 +1,7 @@ package de.hysky.skyblocker.skyblock.item; -import com.google.gson.Gson; import com.google.gson.JsonObject; +import de.hysky.skyblocker.SkyblockerMod; import de.hysky.skyblocker.config.SkyblockerConfig; import de.hysky.skyblocker.config.SkyblockerConfigManager; import de.hysky.skyblocker.skyblock.item.exotic.CheckExotic; @@ -37,7 +37,7 @@ public class PriceInfoTooltip { private static JsonObject lowestPricesJson; private static JsonObject isMuseumJson; private static JsonObject motesPricesJson; - public static JsonObject ColorApiData; + public static JsonObject colorJson; private static volatile boolean nullMsgSend = false; private final static Gson gson = new Gson(); private static final Map apiAddresses; @@ -45,7 +45,7 @@ public class PriceInfoTooltip { private static long museumHash = 0; private static long motesHash = 0; - public static void onInjectTooltip(ItemStack stack, TooltipContext context, List lines) { + public static void getTooltip(ItemStack stack, TooltipContext context, List lines) { if (!Utils.isOnSkyblock() || client.player == null) return; String name = getInternalNameFromNBT(stack, false); @@ -58,40 +58,33 @@ public class PriceInfoTooltip { neuName = internalID; } - if (lines.size() == 0) { + if (lines.isEmpty()) { return; } if (SkyblockerConfig.get().general.itemTooltip.enableExoticCheck) { + if (colorJson == null) { + nullWarning(); + } else if (stack.getNbt() != null) { + final NbtElement color = stack.getNbt().getCompound("display").get("color"); - if (ColorApiData == null) { // Only download once, don't need to waste resources on downloading every few seconds - ColorApiData = downloadPrices("color"); - } - - final NbtElement Color = stack.getNbt().getCompound("display").get("color"); - - if (Color != null) { - String colorHex = String.format("%06X", Integer.parseInt(Color.asString())); - String expectedHex = CheckExotic.getExpectedHex(internalID); + if (color != null) { + String colorHex = String.format("%06X", Integer.parseInt(color.asString())); + String expectedHex = CheckExotic.getExpectedHex(internalID); - boolean correctLine = false; - for (int i = 0; i < lines.size(); i++) { - String existingTooltip = String.valueOf(lines.get(i)); - if (existingTooltip.startsWith("Color: ")) { - correctLine = true; + boolean correctLine = false; + for (Text text : lines) { + String existingTooltip = text.getString() + " "; + if (existingTooltip.startsWith("Color: ")) { + correctLine = true; - if (!colorHex.equalsIgnoreCase(expectedHex) && !CheckExotic.checkExceptions(internalID, colorHex) && !CheckExotic.intendedDyed(stack.getNbt())) { - final String type = CheckExotic.checkDyeType(colorHex); - lines.add(1, Text.literal(existingTooltip + Formatting.DARK_GRAY + " (" + CheckExotic.FormattingColor(type) + CheckExotic.getTranslatatedText(type).getString() + Formatting.DARK_GRAY + ")")); + addExoticTooltip(lines, internalID, stack.getNbt(), colorHex, expectedHex, existingTooltip); + break; } - break; } - } - if (!correctLine) { - if (!colorHex.equalsIgnoreCase(expectedHex) && !CheckExotic.checkExceptions(internalID, colorHex) && !CheckExotic.intendedDyed(stack.getNbt())) { - final String type = CheckExotic.checkDyeType(colorHex); - lines.add(1, Text.literal(Formatting.DARK_GRAY + "(" + CheckExotic.FormattingColor(type) + CheckExotic.getTranslatatedText(type).getString() + Formatting.DARK_GRAY + ")")); + if (!correctLine) { + addExoticTooltip(lines, internalID, stack.getNbt(), colorHex, expectedHex, ""); } } } @@ -237,6 +230,13 @@ public class PriceInfoTooltip { } } + private static void addExoticTooltip(List lines, String internalID, NbtCompound nbt, String colorHex, String expectedHex, String existingTooltip) { + if (!colorHex.equalsIgnoreCase(expectedHex) && !CheckExotic.isException(internalID, colorHex) && !CheckExotic.intendedDyed(nbt)) { + final String type = CheckExotic.checkDyeType(colorHex); + lines.add(1, Text.literal(existingTooltip + Formatting.DARK_GRAY + "(").append(CheckExotic.getTranslatedText(type).formatted(CheckExotic.getFormattingColor(type))).append(Formatting.DARK_GRAY + ")")); + } + } + private static void nullWarning() { if (!nullMsgSend && client.player != null) { client.player.sendMessage(Constants.PREFIX.get().append(Text.translatable("skyblocker.itemTooltip.nullMessage")), false); @@ -304,7 +304,7 @@ public class PriceInfoTooltip { } case "PET" -> { if (ea.contains("petInfo")) { - JsonObject petInfo = gson.fromJson(ea.getString("petInfo"), JsonObject.class); + JsonObject petInfo = SkyblockerMod.GSON.fromJson(ea.getString("petInfo"), JsonObject.class); return "LVL_1_" + petInfo.get("tier").getAsString() + "_" + petInfo.get("type").getAsString(); } } @@ -416,6 +416,9 @@ public class PriceInfoTooltip { if (SkyblockerConfigManager.get().general.itemTooltip.enableMotesPrice && motesPricesJson == null) futureList.add(CompletableFuture.runAsync(() -> motesPricesJson = downloadPrices("motes"))); + if (SkyblockerConfig.get().general.itemTooltip.enableExoticCheck && colorJson == null) + futureList.add(CompletableFuture.runAsync(() -> colorJson = downloadPrices("color"))); + minute++; CompletableFuture.allOf(futureList.toArray(new CompletableFuture[0])) .whenComplete((unused, throwable) -> nullMsgSend = false); @@ -439,7 +442,7 @@ public class PriceInfoTooltip { String apiResponse = Http.sendGetRequest(url); - return new Gson().fromJson(apiResponse, JsonObject.class); + return SkyblockerMod.GSON.fromJson(apiResponse, JsonObject.class); } catch (Exception e) { LOGGER.warn("[Skyblocker] Failed to download " + type + " prices!", e); return null; diff --git a/src/main/java/de/hysky/skyblocker/utils/Utils.java b/src/main/java/de/hysky/skyblocker/utils/Utils.java index ff406b61..0f87e8c4 100644 --- a/src/main/java/de/hysky/skyblocker/utils/Utils.java +++ b/src/main/java/de/hysky/skyblocker/utils/Utils.java @@ -180,7 +180,7 @@ public class Utils { if (!isOnSkyblock) { if (!isInjected) { isInjected = true; - ItemTooltipCallback.EVENT.register(PriceInfoTooltip::onInjectTooltip); + ItemTooltipCallback.EVENT.register(PriceInfoTooltip::getTooltip); } isOnSkyblock = true; SkyblockEvents.JOIN.invoker().onSkyblockJoin(); diff --git a/src/main/java/me/xmrvizzy/skyblocker/skyblock/item/exotic/CheckExotic.java b/src/main/java/me/xmrvizzy/skyblocker/skyblock/item/exotic/CheckExotic.java index fb22362e..c1b90f06 100644 --- a/src/main/java/me/xmrvizzy/skyblocker/skyblock/item/exotic/CheckExotic.java +++ b/src/main/java/me/xmrvizzy/skyblocker/skyblock/item/exotic/CheckExotic.java @@ -3,13 +3,13 @@ package me.xmrvizzy.skyblocker.skyblock.item.exotic; import me.xmrvizzy.skyblocker.skyblock.item.PriceInfoTooltip; import me.xmrvizzy.skyblocker.utils.Constants; import net.minecraft.nbt.NbtCompound; +import net.minecraft.text.MutableText; import net.minecraft.text.Text; import net.minecraft.util.Formatting; public class CheckExotic { - static String[] SeymourIDS = {"VELVET_TOP_HAT", "CASHMERE_JACKET", "SATIN_TROUSERS", "OXFORD_SHOES"}; public static String getExpectedHex(String id) { - String color = PriceInfoTooltip.ColorApiData.get(id).getAsString(); + String color = PriceInfoTooltip.colorJson.get(id).getAsString(); if (color != null) { String[] RGBValues = color.split(","); String hex = String.format("%02x%02x%02x", Integer.parseInt(RGBValues[0]), Integer.parseInt(RGBValues[1]), Integer.parseInt(RGBValues[2])); @@ -20,86 +20,69 @@ public class CheckExotic { } } - public static Boolean checkExceptions(String id, String hex) { - if (id.startsWith("LEATHER") || id.equals("GHOST_BOOTS") || ListContainsString(SeymourIDS, id)) { + public static boolean isException(String id, String hex) { + if (id.startsWith("LEATHER") || id.equals("GHOST_BOOTS") || Constants.SEYMOUR_IDS.contains(id)) { return true; } if (id.startsWith("RANCHER")) { - return ListContainsString(Constants.Ranchers, hex); + return Constants.RANCHERS.contains(hex); } if (id.contains("ADAPTIVE_CHESTPLATE")) { - return ListContainsString(Constants.AdaptiveChest, hex); + return Constants.ADAPTIVE_CHEST.contains(hex); } else if (id.contains("ADAPTIVE")) { - return ListContainsString(Constants.Adaptive, hex); + return Constants.ADAPTIVE.contains(hex); } if (id.startsWith("REAPER")) { - return ListContainsString(Constants.Reaper, hex); + return Constants.REAPER.contains(hex); } if (id.startsWith("FAIRY")) { - return ListContainsString(Constants.FairyHexes, hex); + return Constants.FAIRY_HEXES.contains(hex); } if (id.startsWith("CRYSTAL")) { - return ListContainsString(Constants.CrystalHexes, hex); + return Constants.CRYSTAL_HEXES.contains(hex); } if (id.contains("SPOOK")) { - return ListContainsString(Constants.Spook, hex); + return Constants.SPOOK.contains(hex); } return false; } - public static String checkDyeType(String ActualHex) { - if (ListContainsString(Constants.CrystalHexes, ActualHex)) { + public static String checkDyeType(String hex) { + if (Constants.CRYSTAL_HEXES.contains(hex)) { return "CRYSTAL"; } - if (ListContainsString(Constants.FairyHexes, ActualHex)) { + if (Constants.FAIRY_HEXES.contains(hex)) { return "FAIRY"; } - if (ListContainsString(Constants.OgFairyHexes, ActualHex)) { + if (Constants.OG_FAIRY_HEXES.contains(hex)) { return "OG_FAIRY"; } - if (ListContainsString(Constants.Spook, ActualHex)) { + if (Constants.SPOOK.contains(hex)) { return "SPOOK"; } - if (ListContainsString(Constants.Glitched, ActualHex)) { + if (Constants.GLITCHED.contains(hex)) { return "GLITCHED"; } return "EXOTIC"; } - private static Boolean ListContainsString(String[] list, String s) { - for (int i = 0; i < list.length; i++) { - if (list[i].equalsIgnoreCase(s)) { - return true; - } - } - return false; - } - - public static Boolean intendedDyed(NbtCompound ItemData) { - return ItemData.getCompound("ExtraAttributes").getKeys().contains("dye_item"); + public static boolean intendedDyed(NbtCompound ItemData) { + return ItemData.getCompound("ExtraAttributes").contains("dye_item"); } - public static Formatting FormattingColor(String s) { - switch (s) { - case "CRYSTAL": return Formatting.AQUA; - case "FAIRY": return Formatting.LIGHT_PURPLE; - case "OG_FAIRY": return Formatting.DARK_PURPLE; - case "SPOOK": return Formatting.RED; - case "GLITCHED": return Formatting.BLUE; - case "EXOTIC": return Formatting.GOLD; - } - return Formatting.DARK_GRAY; + public static Formatting getFormattingColor(String s) { + return switch (s) { + case "CRYSTAL" -> Formatting.AQUA; + case "FAIRY" -> Formatting.LIGHT_PURPLE; + case "OG_FAIRY" -> Formatting.DARK_PURPLE; + case "SPOOK" -> Formatting.RED; + case "GLITCHED" -> Formatting.BLUE; + case "EXOTIC" -> Formatting.GOLD; + default -> Formatting.DARK_GRAY; + }; } - public static Text getTranslatatedText(String s) { - switch (s) { - case "CRYSTAL": return Text.translatable("skyblocker.exotic.crystal"); - case "FAIRY": return Text.translatable("skyblocker.exotic.fairy"); - case "OG_FAIRY": return Text.translatable("skyblocker.exotic.og_fairy"); - case "SPOOK": return Text.translatable("skyblocker.exotic.spook"); - case "GLITCHED": return Text.translatable("skyblocker.exotic.glitched"); - case "EXOTIC": return Text.translatable("skyblocker.exotic.exotic"); - } - return null; + public static MutableText getTranslatedText(String s) { + return Text.translatable("skyblocker.exotic." + s.toLowerCase()); } } diff --git a/src/main/java/me/xmrvizzy/skyblocker/utils/Constants.java b/src/main/java/me/xmrvizzy/skyblocker/utils/Constants.java index 23d4a43f..a10e6025 100644 --- a/src/main/java/me/xmrvizzy/skyblocker/utils/Constants.java +++ b/src/main/java/me/xmrvizzy/skyblocker/utils/Constants.java @@ -1,34 +1,33 @@ package me.xmrvizzy.skyblocker.utils; +import java.util.List; + /** * 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"; - - // Exotic Hexes - String[] CrystalHexes = {"1F0030", "46085E", "54146E", "5D1C78", "63237D", "6A2C82", "7E4196", "8E51A6", "9C64B3", "A875BD", - "B88BC9", "C6A3D4", "D9C1E3", "E5D1ED", "EFE1F5", "FCF3FF"}; - String[] FairyHexes = {"330066", "4C0099", "660033", "660066", "6600CC", "7F00FF", "99004C", "990099", "9933FF", "B266FF", - "CC0066", "CC00CC", "CC99FF", "E5CCFF", "FF007F", "FF00FF", "FF3399", "FF33FF", "FF66B2", "FF66FF", "FF99CC", "FF99FF", "FFCCE5", - "FFCCFF"}; - - String[] OgFairyHexes = {"FF99FF", "FFCCFF", "E5CCFF", "CC99FF", "CC00CC", "FF00FF", "FF33FF", "FF66FF", - "B266FF", "9933FF", "7F00FF", "660066", "6600CC", "4C0099", "330066", "990099", "660033", "99004C", "CC0066", - "660033", "99004C", "FFCCE5", "660033", "FFCCE5", "FF99CC", "FFCCE5", "FF99CC", "FF66B2"}; - - String[] Glitched = {"FFDC51", "F7DA33", "606060", "E7413C", "45413C", "4A14B7", "1793C4", "000000", "E75C3C", "65605A", - "5D2FB9", "17A8C4", "E76E3C", "88837E", "8969C8", "1CD4E4"}; // Glitched through other means such as Shark Scale upgrade color - - String[] Spook = {"000000", "070008", "0E000F", "150017", "1B001F", "220027", "29002E", "300036", "37003E", "3E0046", - "45004D", "4C0055", "52005D", "590065", "60006C", "670074", "6E007C", "750084", "7C008B", "830093", - "89009B", "9000A3", "9700AA", "993399", "9E00B2"}; - - // List of exceptions - - String[] Ranchers = {"CC5500", "000000", "0"}; - String[] Reaper = {"1B1B1B", "FF0000"}; - - String[] AdaptiveChest = {"3ABE78", "82E3D8", "BFBCB2", "D579FF", "FF4242", "FFC234"}; - String[] Adaptive = {"169F57", "2AB5A5", "6E00A0", "BB0000", "BFBCB2", "FFF7E6"}; + 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"; + + List SEYMOUR_IDS = List.of("VELVET_TOP_HAT", "CASHMERE_JACKET", "SATIN_TROUSERS", "OXFORD_SHOES"); + + // Exotic Hexes + List CRYSTAL_HEXES = List.of("1F0030", "46085E", "54146E", "5D1C78", "63237D", "6A2C82", "7E4196", "8E51A6", "9C64B3", "A875BD", + "B88BC9", "C6A3D4", "D9C1E3", "E5D1ED", "EFE1F5", "FCF3FF"); + List FAIRY_HEXES = List.of("330066", "4C0099", "660033", "660066", "6600CC", "7F00FF", "99004C", "990099", "9933FF", "B266FF", + "CC0066", "CC00CC", "CC99FF", "E5CCFF", "FF007F", "FF00FF", "FF3399", "FF33FF", "FF66B2", "FF66FF", "FF99CC", "FF99FF", "FFCCE5", + "FFCCFF"); + List OG_FAIRY_HEXES = List.of("FF99FF", "FFCCFF", "E5CCFF", "CC99FF", "CC00CC", "FF00FF", "FF33FF", "FF66FF", + "B266FF", "9933FF", "7F00FF", "660066", "6600CC", "4C0099", "330066", "990099", "660033", "99004C", "CC0066", + "660033", "99004C", "FFCCE5", "660033", "FFCCE5", "FF99CC", "FFCCE5", "FF99CC", "FF66B2"); + List GLITCHED = List.of("FFDC51", "F7DA33", "606060", "E7413C", "45413C", "4A14B7", "1793C4", "000000", "E75C3C", "65605A", + "5D2FB9", "17A8C4", "E76E3C", "88837E", "8969C8", "1CD4E4"); // Glitched through other means such as Shark Scale upgrade color¬ + List SPOOK = List.of("000000", "070008", "0E000F", "150017", "1B001F", "220027", "29002E", "300036", "37003E", "3E0046", + "45004D", "4C0055", "52005D", "590065", "60006C", "670074", "6E007C", "750084", "7C008B", "830093", + "89009B", "9000A3", "9700AA", "993399", "9E00B2"); + + // List of exceptions + List RANCHERS = List.of("CC5500", "000000", "0"); + List REAPER = List.of("1B1B1B", "FF0000"); + List ADAPTIVE_CHEST = List.of("3ABE78", "82E3D8", "BFBCB2", "D579FF", "FF4242", "FFC234"); + List ADAPTIVE = List.of("169F57", "2AB5A5", "6E00A0", "BB0000", "BFBCB2", "FFF7E6"); } -- cgit From 22cc85e70c50602eda53f1b5447c2fad0c11a5b1 Mon Sep 17 00:00:00 2001 From: Kevinthegreat <92656833+kevinthegreat1@users.noreply.github.com> Date: Sat, 16 Sep 2023 00:14:29 -0400 Subject: Rename CheckExotic --- .../skyblocker/skyblock/item/PriceInfoTooltip.java | 8 +- .../skyblock/item/exotic/CheckExotic.java | 88 ---------------------- .../skyblock/item/exotic/ExoticCheck.java | 88 ++++++++++++++++++++++ 3 files changed, 92 insertions(+), 92 deletions(-) delete mode 100644 src/main/java/me/xmrvizzy/skyblocker/skyblock/item/exotic/CheckExotic.java create mode 100644 src/main/java/me/xmrvizzy/skyblocker/skyblock/item/exotic/ExoticCheck.java 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 3ecbe8be..e8d619cd 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/item/PriceInfoTooltip.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/item/PriceInfoTooltip.java @@ -70,7 +70,7 @@ public class PriceInfoTooltip { if (color != null) { String colorHex = String.format("%06X", Integer.parseInt(color.asString())); - String expectedHex = CheckExotic.getExpectedHex(internalID); + String expectedHex = ExoticCheck.getExpectedHex(internalID); boolean correctLine = false; for (Text text : lines) { @@ -231,9 +231,9 @@ public class PriceInfoTooltip { } private static void addExoticTooltip(List lines, String internalID, NbtCompound nbt, String colorHex, String expectedHex, String existingTooltip) { - if (!colorHex.equalsIgnoreCase(expectedHex) && !CheckExotic.isException(internalID, colorHex) && !CheckExotic.intendedDyed(nbt)) { - final String type = CheckExotic.checkDyeType(colorHex); - lines.add(1, Text.literal(existingTooltip + Formatting.DARK_GRAY + "(").append(CheckExotic.getTranslatedText(type).formatted(CheckExotic.getFormattingColor(type))).append(Formatting.DARK_GRAY + ")")); + if (!colorHex.equalsIgnoreCase(expectedHex) && !ExoticCheck.isException(internalID, colorHex) && !ExoticCheck.intendedDyed(nbt)) { + final String type = ExoticCheck.checkDyeType(colorHex); + lines.add(1, Text.literal(existingTooltip + Formatting.DARK_GRAY + "(").append(ExoticCheck.getTranslatedText(type).formatted(ExoticCheck.getFormattingColor(type))).append(Formatting.DARK_GRAY + ")")); } } diff --git a/src/main/java/me/xmrvizzy/skyblocker/skyblock/item/exotic/CheckExotic.java b/src/main/java/me/xmrvizzy/skyblocker/skyblock/item/exotic/CheckExotic.java deleted file mode 100644 index c1b90f06..00000000 --- a/src/main/java/me/xmrvizzy/skyblocker/skyblock/item/exotic/CheckExotic.java +++ /dev/null @@ -1,88 +0,0 @@ -package me.xmrvizzy.skyblocker.skyblock.item.exotic; - -import me.xmrvizzy.skyblocker.skyblock.item.PriceInfoTooltip; -import me.xmrvizzy.skyblocker.utils.Constants; -import net.minecraft.nbt.NbtCompound; -import net.minecraft.text.MutableText; -import net.minecraft.text.Text; -import net.minecraft.util.Formatting; - -public class CheckExotic { - public static String getExpectedHex(String id) { - String color = PriceInfoTooltip.colorJson.get(id).getAsString(); - if (color != null) { - String[] RGBValues = color.split(","); - String hex = String.format("%02x%02x%02x", Integer.parseInt(RGBValues[0]), Integer.parseInt(RGBValues[1]), Integer.parseInt(RGBValues[2])); - return hex.toUpperCase(); - } else { - System.out.println("Color is null"); - return null; - } - } - - public static boolean isException(String id, String hex) { - if (id.startsWith("LEATHER") || id.equals("GHOST_BOOTS") || Constants.SEYMOUR_IDS.contains(id)) { - return true; - } - if (id.startsWith("RANCHER")) { - return Constants.RANCHERS.contains(hex); - } - if (id.contains("ADAPTIVE_CHESTPLATE")) { - return Constants.ADAPTIVE_CHEST.contains(hex); - } else if (id.contains("ADAPTIVE")) { - return Constants.ADAPTIVE.contains(hex); - } - if (id.startsWith("REAPER")) { - return Constants.REAPER.contains(hex); - } - if (id.startsWith("FAIRY")) { - return Constants.FAIRY_HEXES.contains(hex); - } - if (id.startsWith("CRYSTAL")) { - return Constants.CRYSTAL_HEXES.contains(hex); - } - if (id.contains("SPOOK")) { - return Constants.SPOOK.contains(hex); - } - return false; - } - - public static String checkDyeType(String hex) { - if (Constants.CRYSTAL_HEXES.contains(hex)) { - return "CRYSTAL"; - } - if (Constants.FAIRY_HEXES.contains(hex)) { - return "FAIRY"; - } - if (Constants.OG_FAIRY_HEXES.contains(hex)) { - return "OG_FAIRY"; - } - if (Constants.SPOOK.contains(hex)) { - return "SPOOK"; - } - if (Constants.GLITCHED.contains(hex)) { - return "GLITCHED"; - } - return "EXOTIC"; - } - - public static boolean intendedDyed(NbtCompound ItemData) { - return ItemData.getCompound("ExtraAttributes").contains("dye_item"); - } - - public static Formatting getFormattingColor(String s) { - return switch (s) { - case "CRYSTAL" -> Formatting.AQUA; - case "FAIRY" -> Formatting.LIGHT_PURPLE; - case "OG_FAIRY" -> Formatting.DARK_PURPLE; - case "SPOOK" -> Formatting.RED; - case "GLITCHED" -> Formatting.BLUE; - case "EXOTIC" -> Formatting.GOLD; - default -> Formatting.DARK_GRAY; - }; - } - - public static MutableText getTranslatedText(String s) { - return Text.translatable("skyblocker.exotic." + s.toLowerCase()); - } -} diff --git a/src/main/java/me/xmrvizzy/skyblocker/skyblock/item/exotic/ExoticCheck.java b/src/main/java/me/xmrvizzy/skyblocker/skyblock/item/exotic/ExoticCheck.java new file mode 100644 index 00000000..6a8e51a5 --- /dev/null +++ b/src/main/java/me/xmrvizzy/skyblocker/skyblock/item/exotic/ExoticCheck.java @@ -0,0 +1,88 @@ +package me.xmrvizzy.skyblocker.skyblock.item.exotic; + +import me.xmrvizzy.skyblocker.skyblock.item.PriceInfoTooltip; +import me.xmrvizzy.skyblocker.utils.Constants; +import net.minecraft.nbt.NbtCompound; +import net.minecraft.text.MutableText; +import net.minecraft.text.Text; +import net.minecraft.util.Formatting; + +public class ExoticCheck { + public static String getExpectedHex(String id) { + String color = PriceInfoTooltip.colorJson.get(id).getAsString(); + if (color != null) { + String[] RGBValues = color.split(","); + String hex = String.format("%02x%02x%02x", Integer.parseInt(RGBValues[0]), Integer.parseInt(RGBValues[1]), Integer.parseInt(RGBValues[2])); + return hex.toUpperCase(); + } else { + System.out.println("Color is null"); + return null; + } + } + + public static boolean isException(String id, String hex) { + if (id.startsWith("LEATHER") || id.equals("GHOST_BOOTS") || Constants.SEYMOUR_IDS.contains(id)) { + return true; + } + if (id.startsWith("RANCHER")) { + return Constants.RANCHERS.contains(hex); + } + if (id.contains("ADAPTIVE_CHESTPLATE")) { + return Constants.ADAPTIVE_CHEST.contains(hex); + } else if (id.contains("ADAPTIVE")) { + return Constants.ADAPTIVE.contains(hex); + } + if (id.startsWith("REAPER")) { + return Constants.REAPER.contains(hex); + } + if (id.startsWith("FAIRY")) { + return Constants.FAIRY_HEXES.contains(hex); + } + if (id.startsWith("CRYSTAL")) { + return Constants.CRYSTAL_HEXES.contains(hex); + } + if (id.contains("SPOOK")) { + return Constants.SPOOK.contains(hex); + } + return false; + } + + public static String checkDyeType(String hex) { + if (Constants.CRYSTAL_HEXES.contains(hex)) { + return "CRYSTAL"; + } + if (Constants.FAIRY_HEXES.contains(hex)) { + return "FAIRY"; + } + if (Constants.OG_FAIRY_HEXES.contains(hex)) { + return "OG_FAIRY"; + } + if (Constants.SPOOK.contains(hex)) { + return "SPOOK"; + } + if (Constants.GLITCHED.contains(hex)) { + return "GLITCHED"; + } + return "EXOTIC"; + } + + public static boolean intendedDyed(NbtCompound ItemData) { + return ItemData.getCompound("ExtraAttributes").contains("dye_item"); + } + + public static Formatting getFormattingColor(String s) { + return switch (s) { + case "CRYSTAL" -> Formatting.AQUA; + case "FAIRY" -> Formatting.LIGHT_PURPLE; + case "OG_FAIRY" -> Formatting.DARK_PURPLE; + case "SPOOK" -> Formatting.RED; + case "GLITCHED" -> Formatting.BLUE; + case "EXOTIC" -> Formatting.GOLD; + default -> Formatting.DARK_GRAY; + }; + } + + public static MutableText getTranslatedText(String s) { + return Text.translatable("skyblocker.exotic." + s.toLowerCase()); + } +} -- cgit From 3a68bf3d435e1288a050f3db18c9fc61b7e23172 Mon Sep 17 00:00:00 2001 From: Kevinthegreat <92656833+kevinthegreat1@users.noreply.github.com> Date: Sat, 28 Oct 2023 13:14:37 -0400 Subject: Update files --- .../hysky/skyblocker/config/SkyblockerConfig.java | 5 +- .../config/categories/GeneralCategory.java | 7 + .../skyblocker/skyblock/item/ExoticCheck.java | 87 +++ .../skyblocker/skyblock/item/PriceInfoTooltip.java | 8 +- .../java/de/hysky/skyblocker/utils/Constants.java | 25 + .../skyblocker/config/SkyblockerConfig.java | 650 --------------------- .../skyblock/item/exotic/ExoticCheck.java | 88 --- .../me/xmrvizzy/skyblocker/utils/Constants.java | 33 -- .../resources/assets/skyblocker/lang/en_us.json | 2 +- 9 files changed, 127 insertions(+), 778 deletions(-) create mode 100644 src/main/java/de/hysky/skyblocker/skyblock/item/ExoticCheck.java delete mode 100644 src/main/java/me/xmrvizzy/skyblocker/config/SkyblockerConfig.java delete mode 100644 src/main/java/me/xmrvizzy/skyblocker/skyblock/item/exotic/ExoticCheck.java delete mode 100644 src/main/java/me/xmrvizzy/skyblocker/utils/Constants.java diff --git a/src/main/java/de/hysky/skyblocker/config/SkyblockerConfig.java b/src/main/java/de/hysky/skyblocker/config/SkyblockerConfig.java index 8905644f..4959ca3b 100644 --- a/src/main/java/de/hysky/skyblocker/config/SkyblockerConfig.java +++ b/src/main/java/de/hysky/skyblocker/config/SkyblockerConfig.java @@ -178,7 +178,7 @@ public class SkyblockerConfig { public FairySouls fairySouls = new FairySouls(); @SerialEntry - public MythologicalRitual mythologicalRitual = new MythologicalRitual(); + public MythologicalRitual mythologicalRitual = new MythologicalRitual(); @SerialEntry public ItemCooldown itemCooldown = new ItemCooldown(); @@ -485,6 +485,9 @@ public class SkyblockerConfig { @SerialEntry public boolean enableMuseumDate = true; + + @SerialEntry + public boolean enableExoticCheck = true; } public static class ItemInfoDisplay { 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 10b21891..8ce00172 100644 --- a/src/main/java/de/hysky/skyblocker/config/categories/GeneralCategory.java +++ b/src/main/java/de/hysky/skyblocker/config/categories/GeneralCategory.java @@ -356,6 +356,13 @@ public class GeneralCategory { newValue -> config.general.itemTooltip.enableMuseumDate = newValue) .controller(ConfigUtils::createBooleanController) .build()) + .option(Option.createBuilder() + .name(Text.translatable("text.autoconfig.skyblocker.option.general.itemTooltip.enableExoticCheck")) + .binding(defaults.general.itemTooltip.enableExoticCheck, + () -> config.general.itemTooltip.enableExoticCheck, + newValue -> config.general.itemTooltip.enableExoticCheck = newValue) + .controller(ConfigUtils::createBooleanController) + .build()) .build()) //Item Info Display diff --git a/src/main/java/de/hysky/skyblocker/skyblock/item/ExoticCheck.java b/src/main/java/de/hysky/skyblocker/skyblock/item/ExoticCheck.java new file mode 100644 index 00000000..130ef049 --- /dev/null +++ b/src/main/java/de/hysky/skyblocker/skyblock/item/ExoticCheck.java @@ -0,0 +1,87 @@ +package de.hysky.skyblocker.skyblock.item; + +import de.hysky.skyblocker.utils.Constants; +import net.minecraft.nbt.NbtCompound; +import net.minecraft.text.MutableText; +import net.minecraft.text.Text; +import net.minecraft.util.Formatting; + +public class ExoticCheck { + public static String getExpectedHex(String id) { + String color = PriceInfoTooltip.colorJson.get(id).getAsString(); + if (color != null) { + String[] RGBValues = color.split(","); + String hex = String.format("%02x%02x%02x", Integer.parseInt(RGBValues[0]), Integer.parseInt(RGBValues[1]), Integer.parseInt(RGBValues[2])); + return hex.toUpperCase(); + } else { + System.out.println("Color is null"); + return null; + } + } + + public static boolean isException(String id, String hex) { + if (id.startsWith("LEATHER") || id.equals("GHOST_BOOTS") || Constants.SEYMOUR_IDS.contains(id)) { + return true; + } + if (id.startsWith("RANCHER")) { + return Constants.RANCHERS.contains(hex); + } + if (id.contains("ADAPTIVE_CHESTPLATE")) { + return Constants.ADAPTIVE_CHEST.contains(hex); + } else if (id.contains("ADAPTIVE")) { + return Constants.ADAPTIVE.contains(hex); + } + if (id.startsWith("REAPER")) { + return Constants.REAPER.contains(hex); + } + if (id.startsWith("FAIRY")) { + return Constants.FAIRY_HEXES.contains(hex); + } + if (id.startsWith("CRYSTAL")) { + return Constants.CRYSTAL_HEXES.contains(hex); + } + if (id.contains("SPOOK")) { + return Constants.SPOOK.contains(hex); + } + return false; + } + + public static String checkDyeType(String hex) { + if (Constants.CRYSTAL_HEXES.contains(hex)) { + return "CRYSTAL"; + } + if (Constants.FAIRY_HEXES.contains(hex)) { + return "FAIRY"; + } + if (Constants.OG_FAIRY_HEXES.contains(hex)) { + return "OG_FAIRY"; + } + if (Constants.SPOOK.contains(hex)) { + return "SPOOK"; + } + if (Constants.GLITCHED.contains(hex)) { + return "GLITCHED"; + } + return "EXOTIC"; + } + + public static boolean intendedDyed(NbtCompound ItemData) { + return ItemData.getCompound("ExtraAttributes").contains("dye_item"); + } + + public static Formatting getFormattingColor(String s) { + return switch (s) { + case "CRYSTAL" -> Formatting.AQUA; + case "FAIRY" -> Formatting.LIGHT_PURPLE; + case "OG_FAIRY" -> Formatting.DARK_PURPLE; + case "SPOOK" -> Formatting.RED; + case "GLITCHED" -> Formatting.BLUE; + case "EXOTIC" -> Formatting.GOLD; + default -> Formatting.DARK_GRAY; + }; + } + + public static MutableText getTranslatedText(String s) { + return Text.translatable("skyblocker.exotic." + s.toLowerCase()); + } +} 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 e8d619cd..9e38f276 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/item/PriceInfoTooltip.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/item/PriceInfoTooltip.java @@ -4,7 +4,6 @@ import com.google.gson.JsonObject; import de.hysky.skyblocker.SkyblockerMod; import de.hysky.skyblocker.config.SkyblockerConfig; import de.hysky.skyblocker.config.SkyblockerConfigManager; -import de.hysky.skyblocker.skyblock.item.exotic.CheckExotic; import de.hysky.skyblocker.utils.Constants; import de.hysky.skyblocker.utils.Http; import de.hysky.skyblocker.utils.ItemUtils; @@ -39,7 +38,6 @@ public class PriceInfoTooltip { private static JsonObject motesPricesJson; public static JsonObject colorJson; private static volatile boolean nullMsgSend = false; - private final static Gson gson = new Gson(); private static final Map apiAddresses; private static long npcHash = 0; private static long museumHash = 0; @@ -62,7 +60,7 @@ public class PriceInfoTooltip { return; } - if (SkyblockerConfig.get().general.itemTooltip.enableExoticCheck) { + if (SkyblockerConfigManager.get().general.itemTooltip.enableExoticCheck) { if (colorJson == null) { nullWarning(); } else if (stack.getNbt() != null) { @@ -416,11 +414,11 @@ public class PriceInfoTooltip { if (SkyblockerConfigManager.get().general.itemTooltip.enableMotesPrice && motesPricesJson == null) futureList.add(CompletableFuture.runAsync(() -> motesPricesJson = downloadPrices("motes"))); - if (SkyblockerConfig.get().general.itemTooltip.enableExoticCheck && colorJson == null) + if (SkyblockerConfigManager.get().general.itemTooltip.enableExoticCheck && colorJson == null) futureList.add(CompletableFuture.runAsync(() -> colorJson = downloadPrices("color"))); minute++; - CompletableFuture.allOf(futureList.toArray(new CompletableFuture[0])) + CompletableFuture.allOf(futureList.toArray(CompletableFuture[]::new)) .whenComplete((unused, throwable) -> nullMsgSend = false); }, 1200, true); } diff --git a/src/main/java/de/hysky/skyblocker/utils/Constants.java b/src/main/java/de/hysky/skyblocker/utils/Constants.java index f144b519..94eacf49 100644 --- a/src/main/java/de/hysky/skyblocker/utils/Constants.java +++ b/src/main/java/de/hysky/skyblocker/utils/Constants.java @@ -1,5 +1,6 @@ package de.hysky.skyblocker.utils; +import java.util.List; import java.util.function.IntFunction; import java.util.function.Supplier; import java.util.function.UnaryOperator; @@ -28,4 +29,28 @@ public interface Constants { .append(Text.literal("e").styled(WITH_COLOR.apply(0x12d5eb))) .append(Text.literal("r").styled(WITH_COLOR.apply(0x14d0ff))) .append(Text.literal("] ").formatted(Formatting.GRAY)); + + + List SEYMOUR_IDS = List.of("VELVET_TOP_HAT", "CASHMERE_JACKET", "SATIN_TROUSERS", "OXFORD_SHOES"); + + // Exotic Hexes + List CRYSTAL_HEXES = List.of("1F0030", "46085E", "54146E", "5D1C78", "63237D", "6A2C82", "7E4196", "8E51A6", "9C64B3", "A875BD", + "B88BC9", "C6A3D4", "D9C1E3", "E5D1ED", "EFE1F5", "FCF3FF"); + List FAIRY_HEXES = List.of("330066", "4C0099", "660033", "660066", "6600CC", "7F00FF", "99004C", "990099", "9933FF", "B266FF", + "CC0066", "CC00CC", "CC99FF", "E5CCFF", "FF007F", "FF00FF", "FF3399", "FF33FF", "FF66B2", "FF66FF", "FF99CC", "FF99FF", "FFCCE5", + "FFCCFF"); + List OG_FAIRY_HEXES = List.of("FF99FF", "FFCCFF", "E5CCFF", "CC99FF", "CC00CC", "FF00FF", "FF33FF", "FF66FF", + "B266FF", "9933FF", "7F00FF", "660066", "6600CC", "4C0099", "330066", "990099", "660033", "99004C", "CC0066", + "660033", "99004C", "FFCCE5", "660033", "FFCCE5", "FF99CC", "FFCCE5", "FF99CC", "FF66B2"); + List GLITCHED = List.of("FFDC51", "F7DA33", "606060", "E7413C", "45413C", "4A14B7", "1793C4", "000000", "E75C3C", "65605A", + "5D2FB9", "17A8C4", "E76E3C", "88837E", "8969C8", "1CD4E4"); // Glitched through other means such as Shark Scale upgrade color + List SPOOK = List.of("000000", "070008", "0E000F", "150017", "1B001F", "220027", "29002E", "300036", "37003E", "3E0046", + "45004D", "4C0055", "52005D", "590065", "60006C", "670074", "6E007C", "750084", "7C008B", "830093", + "89009B", "9000A3", "9700AA", "993399", "9E00B2"); + + // List of exceptions + List RANCHERS = List.of("CC5500", "000000", "0"); + List REAPER = List.of("1B1B1B", "FF0000"); + List ADAPTIVE_CHEST = List.of("3ABE78", "82E3D8", "BFBCB2", "D579FF", "FF4242", "FFC234"); + List ADAPTIVE = List.of("169F57", "2AB5A5", "6E00A0", "BB0000", "BFBCB2", "FFF7E6"); } diff --git a/src/main/java/me/xmrvizzy/skyblocker/config/SkyblockerConfig.java b/src/main/java/me/xmrvizzy/skyblocker/config/SkyblockerConfig.java deleted file mode 100644 index 7fc042e5..00000000 --- a/src/main/java/me/xmrvizzy/skyblocker/config/SkyblockerConfig.java +++ /dev/null @@ -1,650 +0,0 @@ -package me.xmrvizzy.skyblocker.config; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.mojang.brigadier.builder.LiteralArgumentBuilder; -import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap; -import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; -import me.shedaniel.autoconfig.AutoConfig; -import me.shedaniel.autoconfig.ConfigData; -import me.shedaniel.autoconfig.annotation.Config; -import me.shedaniel.autoconfig.annotation.ConfigEntry; -import me.shedaniel.autoconfig.serializer.ConfigSerializer; -import me.shedaniel.autoconfig.serializer.GsonConfigSerializer; -import me.xmrvizzy.skyblocker.SkyblockerMod; -import me.xmrvizzy.skyblocker.skyblock.item.CustomArmorTrims; -import me.xmrvizzy.skyblocker.utils.chat.ChatFilterResult; -import me.xmrvizzy.skyblocker.utils.scheduler.Scheduler; -import net.fabricmc.fabric.api.client.command.v2.ClientCommandRegistrationCallback; -import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource; -import net.minecraft.client.resource.language.I18n; -import net.minecraft.text.Style; -import net.minecraft.text.Text; -import net.minecraft.util.Identifier; - -import java.util.ArrayList; -import java.util.List; - -import static net.fabricmc.fabric.api.client.command.v2.ClientCommandManager.literal; - -@Config(name = "skyblocker") -public class SkyblockerConfig implements ConfigData { - - @ConfigEntry.Category("general") - @ConfigEntry.Gui.TransitiveObject - public General general = new General(); - - @ConfigEntry.Category("locations") - @ConfigEntry.Gui.TransitiveObject - public Locations locations = new Locations(); - - @ConfigEntry.Category("slayer") - @ConfigEntry.Gui.TransitiveObject - public Slayer slayer = new Slayer(); - - @ConfigEntry.Category("quickNav") - @ConfigEntry.Gui.TransitiveObject - public QuickNav quickNav = new QuickNav(); - - @ConfigEntry.Category("messages") - @ConfigEntry.Gui.TransitiveObject - public Messages messages = new Messages(); - - @ConfigEntry.Category("richPresence") - @ConfigEntry.Gui.TransitiveObject - public RichPresence richPresence = new RichPresence(); - - public static class QuickNav { - public boolean enableQuickNav = true; - - @ConfigEntry.Category("button1") - @ConfigEntry.Gui.CollapsibleObject() - public QuickNavItem button1 = new QuickNavItem(true, new ItemData("diamond_sword"), "Your Skills", "/skills"); - - @ConfigEntry.Category("button2") - @ConfigEntry.Gui.CollapsibleObject() - public QuickNavItem button2 = new QuickNavItem(true, new ItemData("painting"), "Collections", "/collection"); - - @ConfigEntry.Category("button3") - @ConfigEntry.Gui.CollapsibleObject() - public QuickNavItem button3 = new QuickNavItem(true, new ItemData("bone"), "\\Pets \\(\\d+/\\d+\\)", "/pets"); - - @ConfigEntry.Category("button4") - @ConfigEntry.Gui.CollapsibleObject() - public QuickNavItem button4 = new QuickNavItem(true, new ItemData("leather_chestplate", 1, "tag:{display:{color:8991416}}"), "Wardrobe \\([12]/2\\)", "/wardrobe"); - - @ConfigEntry.Category("button5") - @ConfigEntry.Gui.CollapsibleObject() - public QuickNavItem button5 = new QuickNavItem(true, new ItemData("player_head", 1, "tag:{SkullOwner:{Id:[I;-2081424676,-57521078,-2073572414,158072763],Properties:{textures:[{Value:\"ewogICJ0aW1lc3RhbXAiIDogMTU5MTMxMDU4NTYwOSwKICAicHJvZmlsZUlkIiA6ICI0MWQzYWJjMmQ3NDk0MDBjOTA5MGQ1NDM0ZDAzODMxYiIsCiAgInByb2ZpbGVOYW1lIiA6ICJNZWdha2xvb24iLAogICJzaWduYXR1cmVSZXF1aXJlZCIgOiB0cnVlLAogICJ0ZXh0dXJlcyIgOiB7CiAgICAiU0tJTiIgOiB7CiAgICAgICJ1cmwiIDogImh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvODBhMDc3ZTI0OGQxNDI3NzJlYTgwMDg2NGY4YzU3OGI5ZDM2ODg1YjI5ZGFmODM2YjY0YTcwNjg4MmI2ZWMxMCIKICAgIH0KICB9Cn0=\"}]}}}"), "Sack of Sacks", "/sacks"); - - @ConfigEntry.Category("button6") - @ConfigEntry.Gui.CollapsibleObject() - public QuickNavItem button6 = new QuickNavItem(true, new ItemData("ender_chest"), "(?:Rift )?Storage(?: \\(1/2\\))?", "/storage"); - - @ConfigEntry.Category("button7") - @ConfigEntry.Gui.CollapsibleObject() - public QuickNavItem button7 = new QuickNavItem(true, new ItemData("player_head", 1, "tag:{SkullOwner:{Id:[I;-300151517,-631415889,-1193921967,-1821784279],Properties:{textures:[{Value:\"e3RleHR1cmVzOntTS0lOOnt1cmw6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZDdjYzY2ODc0MjNkMDU3MGQ1NTZhYzUzZTA2NzZjYjU2M2JiZGQ5NzE3Y2Q4MjY5YmRlYmVkNmY2ZDRlN2JmOCJ9fX0=\"}]}}}"), "none", "/hub"); - - @ConfigEntry.Category("button8") - @ConfigEntry.Gui.CollapsibleObject() - public QuickNavItem button8 = new QuickNavItem(true, new ItemData("player_head", 1, "tag:{SkullOwner:{Id:[I;1605800870,415127827,-1236127084,15358548],Properties:{textures:[{Value:\"e3RleHR1cmVzOntTS0lOOnt1cmw6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNzg5MWQ1YjI3M2ZmMGJjNTBjOTYwYjJjZDg2ZWVmMWM0MGExYjk0MDMyYWU3MWU3NTQ3NWE1NjhhODI1NzQyMSJ9fX0=\"}]}}}"), "none", "/warp dungeon_hub"); - - @ConfigEntry.Category("button9") - @ConfigEntry.Gui.CollapsibleObject() - public QuickNavItem button9 = new QuickNavItem(true, new ItemData("player_head", 1, "tag:{SkullOwner:{Id:[I;-562285948,532499670,-1705302742,775653035],Properties:{textures:[{Value:\"eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYjVkZjU1NTkyNjQzMGQ1ZDc1YWRlZDIxZGQ5NjE5Yjc2YzViN2NhMmM3ZjU0MDE0NDA1MjNkNTNhOGJjZmFhYiJ9fX0=\"}]}}}"), "Visit prtl", "/visit prtl"); - - @ConfigEntry.Category("button10") - @ConfigEntry.Gui.CollapsibleObject() - public QuickNavItem button10 = new QuickNavItem(true, new ItemData("enchanting_table"), "Enchant Item", "/etable"); - - @ConfigEntry.Category("button11") - @ConfigEntry.Gui.CollapsibleObject() - public QuickNavItem button11 = new QuickNavItem(true, new ItemData("anvil"), "Anvil", "/anvil"); - - @ConfigEntry.Category("button12") - @ConfigEntry.Gui.CollapsibleObject() - public QuickNavItem button12 = new QuickNavItem(true, new ItemData("crafting_table"), "Craft Item", "/craft"); - } - - public static class QuickNavItem { - public QuickNavItem(Boolean render, ItemData itemData, String uiTitle, String clickEvent) { - this.render = render; - this.item = itemData; - this.clickEvent = clickEvent; - this.uiTitle = uiTitle; - } - - public Boolean render; - - @ConfigEntry.Category("item") - @ConfigEntry.Gui.CollapsibleObject() - public ItemData item; - - public String uiTitle; - public String clickEvent; - } - - public static class ItemData { - public ItemData(String itemName, int count, String nbt) { - this.itemName = itemName; - this.count = count; - this.nbt = nbt; - } - - public ItemData(String itemName) { - this.itemName = itemName; - this.count = 1; - this.nbt = ""; - } - - public String itemName; - public int count; - public String nbt; - } - - public static class General { - public boolean acceptReparty = true; - public boolean backpackPreviewWithoutShift = false; - public boolean hideEmptyTooltips = true; - public boolean hideStatusEffectOverlay = false; - - @ConfigEntry.Category("tabHud") - @ConfigEntry.Gui.CollapsibleObject() - public TabHudConf tabHud = new TabHudConf(); - - @ConfigEntry.Gui.Excluded - public String apiKey; - - @ConfigEntry.Category("bars") - @ConfigEntry.Gui.CollapsibleObject() - public Bars bars = new Bars(); - - @ConfigEntry.Category("experiments") - @ConfigEntry.Gui.CollapsibleObject() - public Experiments experiments = new Experiments(); - - @ConfigEntry.Category("fishing") - @ConfigEntry.Gui.CollapsibleObject() - public Fishing fishing = new Fishing(); - - @ConfigEntry.Category("fairySouls") - @ConfigEntry.Gui.CollapsibleObject() - public FairySouls fairySouls = new FairySouls(); - - @ConfigEntry.Category("shortcuts") - @ConfigEntry.Gui.CollapsibleObject() - public Shortcuts shortcuts = new Shortcuts(); - - @ConfigEntry.Category("quiverWarning") - @ConfigEntry.Gui.CollapsibleObject() - public QuiverWarning quiverWarning = new QuiverWarning(); - - @ConfigEntry.Category("itemList") - @ConfigEntry.Gui.CollapsibleObject() - public ItemList itemList = new ItemList(); - - @ConfigEntry.Category("itemTooltip") - @ConfigEntry.Gui.CollapsibleObject() - public ItemTooltip itemTooltip = new ItemTooltip(); - - @ConfigEntry.Category("itemInfoDisplay") - @ConfigEntry.Gui.CollapsibleObject - public ItemInfoDisplay itemInfoDisplay = new ItemInfoDisplay(); - - @ConfigEntry.Category("specialEffects") - @ConfigEntry.Gui.CollapsibleObject - public SpecialEffects specialEffects = new SpecialEffects(); - - @ConfigEntry.Category("hitbox") - @ConfigEntry.Gui.CollapsibleObject() - public Hitbox hitbox = new Hitbox(); - - @ConfigEntry.Gui.Tooltip() - @ConfigEntry.Category("titleContainer") - @ConfigEntry.Gui.CollapsibleObject() - public TitleContainer titleContainer = new TitleContainer(); - - @ConfigEntry.Category("Teleport Overlay") - @ConfigEntry.Gui.CollapsibleObject() - public TeleportOverlay teleportOverlay = new TeleportOverlay(); - - @ConfigEntry.Gui.Excluded - public List lockedSlots = new ArrayList<>(); - - @ConfigEntry.Gui.Excluded - public Object2ObjectOpenHashMap customItemNames = new Object2ObjectOpenHashMap<>(); - - @ConfigEntry.Gui.Excluded - public Object2IntOpenHashMap customDyeColors = new Object2IntOpenHashMap<>(); - - @ConfigEntry.Gui.Excluded - public Object2ObjectOpenHashMap customArmorTrims = new Object2ObjectOpenHashMap<>(); - } - - public static class TabHudConf { - public boolean tabHudEnabled = true; - - @ConfigEntry.BoundedDiscrete(min = 10, max = 200) - @ConfigEntry.Gui.Tooltip() - public int tabHudScale = 100; - @ConfigEntry.Gui.Tooltip - public boolean plainPlayerNames = false; - @ConfigEntry.Gui.EnumHandler(option = ConfigEntry.Gui.EnumHandler.EnumDisplayOption.BUTTON) - @ConfigEntry.Gui.Tooltip - public NameSorting nameSorting = NameSorting.DEFAULT; - } - - public enum NameSorting { - DEFAULT, - ALPHABETICAL; - - @Override - public String toString() { - return switch (this) { - case DEFAULT -> "Default"; - case ALPHABETICAL -> "Alphabetical"; - }; - } - } - - public static class Bars { - public boolean enableBars = true; - - @ConfigEntry.Category("barpositions") - @ConfigEntry.Gui.CollapsibleObject() - public BarPositions barpositions = new BarPositions(); - } - - public static class BarPositions { - @ConfigEntry.Gui.EnumHandler(option = ConfigEntry.Gui.EnumHandler.EnumDisplayOption.BUTTON) - public BarPosition healthBarPosition = BarPosition.LAYER1; - @ConfigEntry.Gui.EnumHandler(option = ConfigEntry.Gui.EnumHandler.EnumDisplayOption.BUTTON) - public BarPosition manaBarPosition = BarPosition.LAYER1; - @ConfigEntry.Gui.EnumHandler(option = ConfigEntry.Gui.EnumHandler.EnumDisplayOption.BUTTON) - public BarPosition defenceBarPosition = BarPosition.LAYER1; - @ConfigEntry.Gui.EnumHandler(option = ConfigEntry.Gui.EnumHandler.EnumDisplayOption.BUTTON) - public BarPosition experienceBarPosition = BarPosition.LAYER1; - - } - - public enum BarPosition { - LAYER1, - LAYER2, - RIGHT, - NONE; - - @Override - public String toString() { - return I18n.translate("text.autoconfig.skyblocker.option.general.bars.barpositions." + name()); - } - - public int toInt() { - return switch (this) { - case LAYER1 -> 0; - case LAYER2 -> 1; - case RIGHT -> 2; - case NONE -> -1; - }; - } - } - - public static class Experiments { - public boolean enableChronomatronSolver = true; - public boolean enableSuperpairsSolver = true; - public boolean enableUltrasequencerSolver = true; - } - - public static class Fishing { - public boolean enableFishingHelper = true; - } - - public static class FairySouls { - public boolean enableFairySoulsHelper = false; - } - - public static class Shortcuts { - @ConfigEntry.Gui.Tooltip() - public boolean enableShortcuts = true; - @ConfigEntry.Gui.Tooltip() - public boolean enableCommandShortcuts = true; - @ConfigEntry.Gui.Tooltip() - public boolean enableCommandArgShortcuts = true; - } - - public static class QuiverWarning { - public boolean enableQuiverWarning = true; - public boolean enableQuiverWarningInDungeons = true; - public boolean enableQuiverWarningAfterDungeon = true; - } - - public static class Hitbox { - public boolean oldFarmlandHitbox = true; - public boolean oldLeverHitbox = false; - } - - public static class TitleContainer { - @ConfigEntry.BoundedDiscrete(min = 30, max = 140) - public float titleContainerScale = 100; - public int x = 540; - public int y = 10; - @ConfigEntry.Gui.EnumHandler(option = ConfigEntry.Gui.EnumHandler.EnumDisplayOption.BUTTON) - public Direction direction = Direction.HORIZONTAL; - @ConfigEntry.Gui.EnumHandler(option = ConfigEntry.Gui.EnumHandler.EnumDisplayOption.DROPDOWN) - public Alignment alignment = Alignment.MIDDLE; - } - - public static class TeleportOverlay { - public boolean enableTeleportOverlays = true; - public boolean enableWeirdTransmission = true; - public boolean enableInstantTransmission = true; - public boolean enableEtherTransmission = true; - public boolean enableSinrecallTransmission = true; - public boolean enableWitherImpact = true; - } - - public enum Direction { - HORIZONTAL, - VERTICAL; - - @Override - public String toString() { - return switch (this) { - case HORIZONTAL -> "Horizontal"; - case VERTICAL -> "Vertical"; - }; - } - } - - public enum Alignment { - LEFT, - RIGHT, - MIDDLE; - - @Override - public String toString() { - return switch (this) { - case LEFT -> "Left"; - case RIGHT -> "Right"; - case MIDDLE -> "Middle"; - }; - } - } - - public static class RichPresence { - public boolean enableRichPresence = false; - @ConfigEntry.Gui.EnumHandler(option = ConfigEntry.Gui.EnumHandler.EnumDisplayOption.BUTTON) - @ConfigEntry.Gui.Tooltip() - public Info info = Info.LOCATION; - public boolean cycleMode = false; - public String customMessage = "Playing Skyblock"; - } - - public static class ItemList { - public boolean enableItemList = true; - } - - public enum Average { - ONE_DAY, - THREE_DAY, - BOTH; - - @Override - public String toString() { - return I18n.translate("text.autoconfig.skyblocker.option.general.itemTooltip.avg." + name()); - } - } - - public static class ItemTooltip { - public boolean enableExoticCheck = true; - public boolean enableNPCPrice = true; - @ConfigEntry.Gui.Tooltip - public boolean enableMotesPrice = true; - public boolean enableAvgBIN = true; - @ConfigEntry.Gui.EnumHandler(option = ConfigEntry.Gui.EnumHandler.EnumDisplayOption.BUTTON) - @ConfigEntry.Gui.Tooltip() - public Average avg = Average.THREE_DAY; - public boolean enableLowestBIN = true; - public boolean enableBazaarPrice = true; - public boolean enableMuseumDate = true; - } - - public static class ItemInfoDisplay { - @ConfigEntry.Gui.Tooltip - public boolean attributeShardInfo = true; - } - - public static class SpecialEffects { - @ConfigEntry.Gui.Tooltip - public boolean rareDungeonDropEffects = true; - } - - public static class Locations { - @ConfigEntry.Category("barn") - @ConfigEntry.Gui.CollapsibleObject() - public Barn barn = new Barn(); - - @ConfigEntry.Category("dungeons") - @ConfigEntry.Gui.CollapsibleObject() - public Dungeons dungeons = new Dungeons(); - - @ConfigEntry.Category("dwarvenmines") - @ConfigEntry.Gui.CollapsibleObject() - public DwarvenMines dwarvenMines = new DwarvenMines(); - - @ConfigEntry.Category("rift") - @ConfigEntry.Gui.CollapsibleObject() - public Rift rift = new Rift(); - } - - public static class Dungeons { - @ConfigEntry.Gui.CollapsibleObject - public SecretWaypoints secretWaypoints = new SecretWaypoints(); - @ConfigEntry.Gui.CollapsibleObject - public DungeonChestProfit dungeonChestProfit = new DungeonChestProfit(); - @ConfigEntry.Gui.Tooltip() - public boolean croesusHelper = true; - public boolean enableMap = true; - public float mapScaling = 1f; - public int mapX = 2; - public int mapY = 2; - @ConfigEntry.Gui.Tooltip - public boolean starredMobGlow = true; - public boolean solveThreeWeirdos = true; - @ConfigEntry.Gui.Tooltip - public boolean blazesolver = true; - public boolean solveTrivia = true; - @ConfigEntry.Gui.Tooltip - public boolean solveTicTacToe = true; - @ConfigEntry.Gui.CollapsibleObject - public LividColor lividColor = new LividColor(); - @ConfigEntry.Gui.CollapsibleObject() - public Terminals terminals = new Terminals(); - } - - public static class SecretWaypoints { - - public boolean enableSecretWaypoints = true; - @ConfigEntry.Gui.Tooltip() - public boolean noInitSecretWaypoints = false; - public boolean enableEntranceWaypoints = true; - public boolean enableSuperboomWaypoints = true; - public boolean enableChestWaypoints = true; - public boolean enableItemWaypoints = true; - public boolean enableBatWaypoints = true; - public boolean enableWitherWaypoints = true; - public boolean enableLeverWaypoints = true; - public boolean enableFairySoulWaypoints = true; - public boolean enableStonkWaypoints = true; - @ConfigEntry.Gui.Tooltip() - public boolean enableDefaultWaypoints = true; - } - - public static class DungeonChestProfit { - @ConfigEntry.Gui.Tooltip - public boolean enableProfitCalculator = true; - @ConfigEntry.Gui.Tooltip - public boolean includeKismet = false; - @ConfigEntry.Gui.Tooltip - public boolean includeEssence = true; - } - - public static class LividColor { - @ConfigEntry.Gui.Tooltip() - public boolean enableLividColor = true; - @ConfigEntry.Gui.Tooltip() - public String lividColorText = "The livid color is [color]"; - } - - public static class Terminals { - public boolean solveColor = true; - public boolean solveOrder = true; - public boolean solveStartsWith = true; - } - - public static class DwarvenMines { - public boolean enableDrillFuel = true; - public boolean solveFetchur = true; - public boolean solvePuzzler = true; - @ConfigEntry.Gui.CollapsibleObject() - public DwarvenHud dwarvenHud = new DwarvenHud(); - } - - public static class DwarvenHud { - public boolean enabled = true; - @ConfigEntry.Gui.EnumHandler(option = ConfigEntry.Gui.EnumHandler.EnumDisplayOption.BUTTON) - @ConfigEntry.Gui.Tooltip(count = 3) - public DwarvenHudStyle style = DwarvenHudStyle.SIMPLE; - public boolean enableBackground = true; - public int x = 10; - public int y = 10; - } - - public enum DwarvenHudStyle { - SIMPLE, - FANCY, - CLASSIC; - - @Override - public String toString() { - return switch (this) { - case SIMPLE -> "Simple"; - case FANCY -> "Fancy"; - case CLASSIC -> "Classic"; - }; - } - } - - public static class Barn { - public boolean solveHungryHiker = true; - public boolean solveTreasureHunter = true; - } - - public static class Rift { - public boolean mirrorverseWaypoints = true; - @ConfigEntry.BoundedDiscrete(min = 0, max = 5) - @ConfigEntry.Gui.Tooltip - public int mcGrubberStacks = 0; - } - - public static class Slayer { - @ConfigEntry.Category("vampire") - @ConfigEntry.Gui.CollapsibleObject() - public VampireSlayer vampireSlayer = new VampireSlayer(); - } - - public static class VampireSlayer { - public boolean enableEffigyWaypoints = true; - public boolean compactEffigyWaypoints; - @ConfigEntry.BoundedDiscrete(min = 1, max = 10) - @ConfigEntry.Gui.Tooltip() - public int effigyUpdateFrequency = 5; - public boolean enableHolyIceIndicator = true; - public int holyIceIndicatorTickDelay = 10; - @ConfigEntry.BoundedDiscrete(min = 1, max = 10) - @ConfigEntry.Gui.Tooltip() - public int holyIceUpdateFrequency = 5; - public boolean enableHealingMelonIndicator = true; - public float healingMelonHealthThreshold = 4F; - public boolean enableSteakStakeIndicator = true; - @ConfigEntry.BoundedDiscrete(min = 1, max = 10) - @ConfigEntry.Gui.Tooltip() - public int steakStakeUpdateFrequency = 5; - public boolean enableManiaIndicator = true; - @ConfigEntry.BoundedDiscrete(min = 1, max = 10) - @ConfigEntry.Gui.Tooltip() - public int maniaUpdateFrequency = 5; - } - - public static class Messages { - @ConfigEntry.Gui.EnumHandler(option = ConfigEntry.Gui.EnumHandler.EnumDisplayOption.BUTTON) - public ChatFilterResult hideAbility = ChatFilterResult.PASS; - @ConfigEntry.Gui.EnumHandler(option = ConfigEntry.Gui.EnumHandler.EnumDisplayOption.BUTTON) - public ChatFilterResult hideHeal = ChatFilterResult.PASS; - @ConfigEntry.Gui.EnumHandler(option = ConfigEntry.Gui.EnumHandler.EnumDisplayOption.BUTTON) - public ChatFilterResult hideAOTE = ChatFilterResult.PASS; - @ConfigEntry.Gui.EnumHandler(option = ConfigEntry.Gui.EnumHandler.EnumDisplayOption.BUTTON) - public ChatFilterResult hideImplosion = ChatFilterResult.PASS; - @ConfigEntry.Gui.EnumHandler(option = ConfigEntry.Gui.EnumHandler.EnumDisplayOption.BUTTON) - public ChatFilterResult hideMoltenWave = ChatFilterResult.PASS; - @ConfigEntry.Gui.EnumHandler(option = ConfigEntry.Gui.EnumHandler.EnumDisplayOption.BUTTON) - public ChatFilterResult hideAds = ChatFilterResult.PASS; - @ConfigEntry.Gui.EnumHandler(option = ConfigEntry.Gui.EnumHandler.EnumDisplayOption.BUTTON) - public ChatFilterResult hideTeleportPad = ChatFilterResult.PASS; - @ConfigEntry.Gui.EnumHandler(option = ConfigEntry.Gui.EnumHandler.EnumDisplayOption.BUTTON) - public ChatFilterResult hideCombo = ChatFilterResult.PASS; - @ConfigEntry.Gui.EnumHandler(option = ConfigEntry.Gui.EnumHandler.EnumDisplayOption.BUTTON) - public ChatFilterResult hideAutopet = ChatFilterResult.PASS; - @ConfigEntry.Gui.EnumHandler(option = ConfigEntry.Gui.EnumHandler.EnumDisplayOption.BUTTON) - @ConfigEntry.Gui.Tooltip - public ChatFilterResult hideShowOff = ChatFilterResult.PASS; - @ConfigEntry.Gui.Tooltip() - public boolean hideMana = false; - } - - public enum Info { - PURSE, - BITS, - LOCATION; - - @Override - public String toString() { - return I18n.translate("text.autoconfig.skyblocker.option.richPresence.info." + name()); - } - } - - /** - * Registers the config to AutoConfig and registers commands to open the config screen. - */ - public static void init() { - Gson gson = new GsonBuilder() - .setPrettyPrinting() - .registerTypeHierarchyAdapter(Text.class, new Text.Serializer()) - .registerTypeHierarchyAdapter(Style.class, new Style.Serializer()) - .registerTypeHierarchyAdapter(Identifier.class, new Identifier.Serializer()) - .create(); - - ConfigSerializer.Factory serializer = (cfg, cfgClass) -> new GsonConfigSerializer<>(cfg, cfgClass, gson); - - AutoConfig.register(SkyblockerConfig.class, serializer); - ClientCommandRegistrationCallback.EVENT.register(((dispatcher, registryAccess) -> dispatcher.register(literal(SkyblockerMod.NAMESPACE).then(optionsLiteral("config")).then(optionsLiteral("options"))))); - } - - /** - * Registers an options command with the given name. Used for registering both options and config as valid commands. - * - * @param name the name of the command node - * @return the command builder - */ - private static LiteralArgumentBuilder optionsLiteral(String name) { - // Don't immediately open the next screen as it will be closed by ChatScreen right after this command is executed - return literal(name).executes(Scheduler.queueOpenScreenCommand(AutoConfig.getConfigScreen(SkyblockerConfig.class, null))); - } - - public static SkyblockerConfig get() { - return AutoConfig.getConfigHolder(SkyblockerConfig.class).getConfig(); - } - - public static void save() { - AutoConfig.getConfigHolder(SkyblockerConfig.class).save(); - } -} diff --git a/src/main/java/me/xmrvizzy/skyblocker/skyblock/item/exotic/ExoticCheck.java b/src/main/java/me/xmrvizzy/skyblocker/skyblock/item/exotic/ExoticCheck.java deleted file mode 100644 index 6a8e51a5..00000000 --- a/src/main/java/me/xmrvizzy/skyblocker/skyblock/item/exotic/ExoticCheck.java +++ /dev/null @@ -1,88 +0,0 @@ -package me.xmrvizzy.skyblocker.skyblock.item.exotic; - -import me.xmrvizzy.skyblocker.skyblock.item.PriceInfoTooltip; -import me.xmrvizzy.skyblocker.utils.Constants; -import net.minecraft.nbt.NbtCompound; -import net.minecraft.text.MutableText; -import net.minecraft.text.Text; -import net.minecraft.util.Formatting; - -public class ExoticCheck { - public static String getExpectedHex(String id) { - String color = PriceInfoTooltip.colorJson.get(id).getAsString(); - if (color != null) { - String[] RGBValues = color.split(","); - String hex = String.format("%02x%02x%02x", Integer.parseInt(RGBValues[0]), Integer.parseInt(RGBValues[1]), Integer.parseInt(RGBValues[2])); - return hex.toUpperCase(); - } else { - System.out.println("Color is null"); - return null; - } - } - - public static boolean isException(String id, String hex) { - if (id.startsWith("LEATHER") || id.equals("GHOST_BOOTS") || Constants.SEYMOUR_IDS.contains(id)) { - return true; - } - if (id.startsWith("RANCHER")) { - return Constants.RANCHERS.contains(hex); - } - if (id.contains("ADAPTIVE_CHESTPLATE")) { - return Constants.ADAPTIVE_CHEST.contains(hex); - } else if (id.contains("ADAPTIVE")) { - return Constants.ADAPTIVE.contains(hex); - } - if (id.startsWith("REAPER")) { - return Constants.REAPER.contains(hex); - } - if (id.startsWith("FAIRY")) { - return Constants.FAIRY_HEXES.contains(hex); - } - if (id.startsWith("CRYSTAL")) { - return Constants.CRYSTAL_HEXES.contains(hex); - } - if (id.contains("SPOOK")) { - return Constants.SPOOK.contains(hex); - } - return false; - } - - public static String checkDyeType(String hex) { - if (Constants.CRYSTAL_HEXES.contains(hex)) { - return "CRYSTAL"; - } - if (Constants.FAIRY_HEXES.contains(hex)) { - return "FAIRY"; - } - if (Constants.OG_FAIRY_HEXES.contains(hex)) { - return "OG_FAIRY"; - } - if (Constants.SPOOK.contains(hex)) { - return "SPOOK"; - } - if (Constants.GLITCHED.contains(hex)) { - return "GLITCHED"; - } - return "EXOTIC"; - } - - public static boolean intendedDyed(NbtCompound ItemData) { - return ItemData.getCompound("ExtraAttributes").contains("dye_item"); - } - - public static Formatting getFormattingColor(String s) { - return switch (s) { - case "CRYSTAL" -> Formatting.AQUA; - case "FAIRY" -> Formatting.LIGHT_PURPLE; - case "OG_FAIRY" -> Formatting.DARK_PURPLE; - case "SPOOK" -> Formatting.RED; - case "GLITCHED" -> Formatting.BLUE; - case "EXOTIC" -> Formatting.GOLD; - default -> Formatting.DARK_GRAY; - }; - } - - public static MutableText getTranslatedText(String s) { - return Text.translatable("skyblocker.exotic." + s.toLowerCase()); - } -} diff --git a/src/main/java/me/xmrvizzy/skyblocker/utils/Constants.java b/src/main/java/me/xmrvizzy/skyblocker/utils/Constants.java deleted file mode 100644 index a10e6025..00000000 --- a/src/main/java/me/xmrvizzy/skyblocker/utils/Constants.java +++ /dev/null @@ -1,33 +0,0 @@ -package me.xmrvizzy.skyblocker.utils; - -import java.util.List; - -/** - * 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"; - - List SEYMOUR_IDS = List.of("VELVET_TOP_HAT", "CASHMERE_JACKET", "SATIN_TROUSERS", "OXFORD_SHOES"); - - // Exotic Hexes - List CRYSTAL_HEXES = List.of("1F0030", "46085E", "54146E", "5D1C78", "63237D", "6A2C82", "7E4196", "8E51A6", "9C64B3", "A875BD", - "B88BC9", "C6A3D4", "D9C1E3", "E5D1ED", "EFE1F5", "FCF3FF"); - List FAIRY_HEXES = List.of("330066", "4C0099", "660033", "660066", "6600CC", "7F00FF", "99004C", "990099", "9933FF", "B266FF", - "CC0066", "CC00CC", "CC99FF", "E5CCFF", "FF007F", "FF00FF", "FF3399", "FF33FF", "FF66B2", "FF66FF", "FF99CC", "FF99FF", "FFCCE5", - "FFCCFF"); - List OG_FAIRY_HEXES = List.of("FF99FF", "FFCCFF", "E5CCFF", "CC99FF", "CC00CC", "FF00FF", "FF33FF", "FF66FF", - "B266FF", "9933FF", "7F00FF", "660066", "6600CC", "4C0099", "330066", "990099", "660033", "99004C", "CC0066", - "660033", "99004C", "FFCCE5", "660033", "FFCCE5", "FF99CC", "FFCCE5", "FF99CC", "FF66B2"); - List GLITCHED = List.of("FFDC51", "F7DA33", "606060", "E7413C", "45413C", "4A14B7", "1793C4", "000000", "E75C3C", "65605A", - "5D2FB9", "17A8C4", "E76E3C", "88837E", "8969C8", "1CD4E4"); // Glitched through other means such as Shark Scale upgrade color¬ - List SPOOK = List.of("000000", "070008", "0E000F", "150017", "1B001F", "220027", "29002E", "300036", "37003E", "3E0046", - "45004D", "4C0055", "52005D", "590065", "60006C", "670074", "6E007C", "750084", "7C008B", "830093", - "89009B", "9000A3", "9700AA", "993399", "9E00B2"); - - // List of exceptions - List RANCHERS = List.of("CC5500", "000000", "0"); - List REAPER = List.of("1B1B1B", "FF0000"); - List ADAPTIVE_CHEST = List.of("3ABE78", "82E3D8", "BFBCB2", "D579FF", "FF4242", "FFC234"); - List ADAPTIVE = List.of("169F57", "2AB5A5", "6E00A0", "BB0000", "BFBCB2", "FFF7E6"); -} diff --git a/src/main/resources/assets/skyblocker/lang/en_us.json b/src/main/resources/assets/skyblocker/lang/en_us.json index 990fc351..2373468b 100644 --- a/src/main/resources/assets/skyblocker/lang/en_us.json +++ b/src/main/resources/assets/skyblocker/lang/en_us.json @@ -65,7 +65,6 @@ "text.autoconfig.skyblocker.option.general.tabHud.nameSorting": "Player Name Sorting Method", "text.autoconfig.skyblocker.option.general.tabHud.nameSorting.@Tooltip": "Alphabetical sorting sorts names alphabetically while Default has no particular order.", "text.autoconfig.skyblocker.option.general.itemTooltip": "Item Tooltip", - "text.autoconfig.skyblocker.option.general.itemTooltip.enableExoticCheck": "Enable Exotic Check", "text.autoconfig.skyblocker.option.general.itemTooltip.enableNPCPrice": "Enable NPC Price", "text.autoconfig.skyblocker.option.general.itemTooltip.enableMotesPrice": "Enable Motes Price", "text.autoconfig.skyblocker.option.general.itemTooltip.enableMotesPrice.@Tooltip": "Displays the Motes sell price of an item while in The Rift.", @@ -78,6 +77,7 @@ "text.autoconfig.skyblocker.option.general.itemTooltip.enableLowestBIN": "Enable Lowest BIN Price", "text.autoconfig.skyblocker.option.general.itemTooltip.enableBazaarPrice": "Enable Bazaar buy/sell Price", "text.autoconfig.skyblocker.option.general.itemTooltip.enableMuseumDate": "Enable Museum & Date", + "text.autoconfig.skyblocker.option.general.itemTooltip.enableExoticCheck": "Enable Exotic Check", "text.autoconfig.skyblocker.option.general.itemInfoDisplay": "Item Info Display", "text.autoconfig.skyblocker.option.general.itemInfoDisplay.attributeShardInfo": "Attribute Shard Info", "text.autoconfig.skyblocker.option.general.itemInfoDisplay.attributeShardInfo.@Tooltip": "Displays the attribute's level as the stack count and the initials of the attribute's name.", -- cgit From 14074ff48e377d26502047ca07b6e2b14bd2ca2d Mon Sep 17 00:00:00 2001 From: Kevinthegreat <92656833+kevinthegreat1@users.noreply.github.com> Date: Sun, 29 Oct 2023 01:12:49 -0400 Subject: Update ItemTooltip --- .../java/de/hysky/skyblocker/SkyblockerMod.java | 4 +- .../hysky/skyblocker/mixin/HandledScreenMixin.java | 2 + .../hysky/skyblocker/skyblock/TeleportOverlay.java | 4 +- .../skyblock/dungeon/DungeonChestProfit.java | 8 +- .../skyblocker/skyblock/item/BackpackPreview.java | 203 --------- .../skyblock/item/CompactorDeletorPreview.java | 90 ---- .../item/CompactorPreviewTooltipComponent.java | 56 --- .../skyblocker/skyblock/item/ExoticCheck.java | 87 ---- .../skyblocker/skyblock/item/PriceInfoTooltip.java | 469 -------------------- .../skyblock/item/tooltip/BackpackPreview.java | 204 +++++++++ .../item/tooltip/CompactorDeletorPreview.java | 90 ++++ .../tooltip/CompactorPreviewTooltipComponent.java | 56 +++ .../skyblock/item/tooltip/ExoticTooltip.java | 98 +++++ .../skyblock/item/tooltip/ItemTooltip.java | 485 +++++++++++++++++++++ src/main/java/de/hysky/skyblocker/utils/Utils.java | 4 +- 15 files changed, 946 insertions(+), 914 deletions(-) delete mode 100644 src/main/java/de/hysky/skyblocker/skyblock/item/BackpackPreview.java delete mode 100644 src/main/java/de/hysky/skyblocker/skyblock/item/CompactorDeletorPreview.java delete mode 100644 src/main/java/de/hysky/skyblocker/skyblock/item/CompactorPreviewTooltipComponent.java delete mode 100644 src/main/java/de/hysky/skyblocker/skyblock/item/ExoticCheck.java delete mode 100644 src/main/java/de/hysky/skyblocker/skyblock/item/PriceInfoTooltip.java create mode 100644 src/main/java/de/hysky/skyblocker/skyblock/item/tooltip/BackpackPreview.java create mode 100644 src/main/java/de/hysky/skyblocker/skyblock/item/tooltip/CompactorDeletorPreview.java create mode 100644 src/main/java/de/hysky/skyblocker/skyblock/item/tooltip/CompactorPreviewTooltipComponent.java create mode 100644 src/main/java/de/hysky/skyblocker/skyblock/item/tooltip/ExoticTooltip.java create mode 100644 src/main/java/de/hysky/skyblocker/skyblock/item/tooltip/ItemTooltip.java diff --git a/src/main/java/de/hysky/skyblocker/SkyblockerMod.java b/src/main/java/de/hysky/skyblocker/SkyblockerMod.java index 5e23e2e2..5178a777 100644 --- a/src/main/java/de/hysky/skyblocker/SkyblockerMod.java +++ b/src/main/java/de/hysky/skyblocker/SkyblockerMod.java @@ -9,6 +9,8 @@ import de.hysky.skyblocker.skyblock.dungeon.*; import de.hysky.skyblocker.skyblock.dungeon.secrets.DungeonSecrets; import de.hysky.skyblocker.skyblock.dwarven.DwarvenHud; import de.hysky.skyblocker.skyblock.item.*; +import de.hysky.skyblocker.skyblock.item.tooltip.BackpackPreview; +import de.hysky.skyblocker.skyblock.item.tooltip.ItemTooltip; import de.hysky.skyblocker.skyblock.itemlist.ItemRepository; import de.hysky.skyblocker.skyblock.quicknav.QuickNav; import de.hysky.skyblocker.skyblock.rift.TheRift; @@ -73,7 +75,7 @@ public class SkyblockerMod implements ClientModInitializer { NEURepoManager.init(); ItemRepository.init(); HotbarSlotLock.init(); - PriceInfoTooltip.init(); + ItemTooltip.init(); WikiLookup.init(); FairySouls.init(); Relics.init(); diff --git a/src/main/java/de/hysky/skyblocker/mixin/HandledScreenMixin.java b/src/main/java/de/hysky/skyblocker/mixin/HandledScreenMixin.java index 597faa3d..d7e5e824 100644 --- a/src/main/java/de/hysky/skyblocker/mixin/HandledScreenMixin.java +++ b/src/main/java/de/hysky/skyblocker/mixin/HandledScreenMixin.java @@ -7,6 +7,8 @@ import de.hysky.skyblocker.skyblock.experiment.ExperimentSolver; import de.hysky.skyblocker.skyblock.experiment.SuperpairsSolver; import de.hysky.skyblocker.skyblock.experiment.UltrasequencerSolver; import de.hysky.skyblocker.skyblock.item.*; +import de.hysky.skyblocker.skyblock.item.tooltip.BackpackPreview; +import de.hysky.skyblocker.skyblock.item.tooltip.CompactorDeletorPreview; import de.hysky.skyblocker.utils.ItemUtils; import de.hysky.skyblocker.utils.Utils; import de.hysky.skyblocker.utils.render.gui.ContainerSolver; diff --git a/src/main/java/de/hysky/skyblocker/skyblock/TeleportOverlay.java b/src/main/java/de/hysky/skyblocker/skyblock/TeleportOverlay.java index 36e25d5c..c290e5b8 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/TeleportOverlay.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/TeleportOverlay.java @@ -1,7 +1,7 @@ package de.hysky.skyblocker.skyblock; import de.hysky.skyblocker.config.SkyblockerConfigManager; -import de.hysky.skyblocker.skyblock.item.PriceInfoTooltip; +import de.hysky.skyblocker.skyblock.item.tooltip.ItemTooltip; import de.hysky.skyblocker.utils.ItemUtils; import de.hysky.skyblocker.utils.Utils; import de.hysky.skyblocker.utils.render.RenderHelper; @@ -26,7 +26,7 @@ public class TeleportOverlay { private static void render(WorldRenderContext wrc) { if (Utils.isOnSkyblock() && SkyblockerConfigManager.get().general.teleportOverlay.enableTeleportOverlays && client.player != null && client.world != null) { ItemStack heldItem = client.player.getMainHandStack(); - String itemId = PriceInfoTooltip.getInternalNameFromNBT(heldItem, true); + String itemId = ItemTooltip.getInternalNameFromNBT(heldItem, true); NbtCompound extraAttributes = ItemUtils.getExtraAttributes(heldItem); if (itemId != null) { diff --git a/src/main/java/de/hysky/skyblocker/skyblock/dungeon/DungeonChestProfit.java b/src/main/java/de/hysky/skyblocker/skyblock/dungeon/DungeonChestProfit.java index 4e6a5240..84d19f73 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/dungeon/DungeonChestProfit.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/dungeon/DungeonChestProfit.java @@ -4,7 +4,7 @@ import com.google.gson.JsonObject; import de.hysky.skyblocker.config.SkyblockerConfig; import de.hysky.skyblocker.config.SkyblockerConfigManager; import de.hysky.skyblocker.mixin.accessor.ScreenAccessor; -import de.hysky.skyblocker.skyblock.item.PriceInfoTooltip; +import de.hysky.skyblocker.skyblock.item.tooltip.ItemTooltip; import de.hysky.skyblocker.utils.Utils; import it.unimi.dsi.fastutil.ints.IntBooleanPair; import net.fabricmc.fabric.api.client.screen.v1.ScreenEvents; @@ -54,7 +54,7 @@ public class DungeonChestProfit { if (!stack.isEmpty()) { String name = stack.getName().getString(); - String id = PriceInfoTooltip.getInternalNameFromNBT(stack, false); + String id = ItemTooltip.getInternalNameFromNBT(stack, false); //Regular item price if (id != null) { @@ -128,8 +128,8 @@ public class DungeonChestProfit { * was based on complete data. */ private static IntBooleanPair getItemPrice(String id) { - JsonObject bazaarPrices = PriceInfoTooltip.getBazaarPrices(); - JsonObject lbinPrices = PriceInfoTooltip.getLBINPrices(); + JsonObject bazaarPrices = ItemTooltip.getBazaarPrices(); + JsonObject lbinPrices = ItemTooltip.getLBINPrices(); if (bazaarPrices == null || lbinPrices == null) return IntBooleanPair.of(0, false); diff --git a/src/main/java/de/hysky/skyblocker/skyblock/item/BackpackPreview.java b/src/main/java/de/hysky/skyblocker/skyblock/item/BackpackPreview.java deleted file mode 100644 index 8782440c..00000000 --- a/src/main/java/de/hysky/skyblocker/skyblock/item/BackpackPreview.java +++ /dev/null @@ -1,203 +0,0 @@ -package de.hysky.skyblocker.skyblock.item; - -import com.mojang.blaze3d.systems.RenderSystem; -import de.hysky.skyblocker.SkyblockerMod; -import de.hysky.skyblocker.config.SkyblockerConfigManager; -import de.hysky.skyblocker.utils.Utils; -import net.fabricmc.fabric.api.client.screen.v1.ScreenEvents; -import net.minecraft.client.MinecraftClient; -import net.minecraft.client.font.TextRenderer; -import net.minecraft.client.gui.DrawContext; -import net.minecraft.client.gui.screen.Screen; -import net.minecraft.client.gui.screen.ingame.HandledScreen; -import net.minecraft.client.util.math.MatrixStack; -import net.minecraft.inventory.Inventory; -import net.minecraft.inventory.SimpleInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NbtCompound; -import net.minecraft.nbt.NbtInt; -import net.minecraft.nbt.NbtIo; -import net.minecraft.nbt.NbtList; -import net.minecraft.util.Identifier; -import org.jetbrains.annotations.NotNull; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.File; -import java.nio.file.Path; -import java.util.Objects; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -public class BackpackPreview { - private static final Logger LOGGER = LoggerFactory.getLogger(BackpackPreview.class); - private static final Identifier TEXTURE = new Identifier("textures/gui/container/generic_54.png"); - private static final Pattern ECHEST_PATTERN = Pattern.compile("Ender Chest.*\\((\\d+)/\\d+\\)"); - private static final Pattern BACKPACK_PATTERN = Pattern.compile("Backpack.*\\(Slot #(\\d+)\\)"); - private static final int STORAGE_SIZE = 27; - - private static final Storage[] storages = new Storage[STORAGE_SIZE]; - - /** - * The profile id of the currently loaded backpack preview. - */ - private static String loaded; - private static Path saveDir; - - public static void init() { - ScreenEvents.AFTER_INIT.register((client, screen, scaledWidth, scaledHeight) -> { - if (screen instanceof HandledScreen handledScreen) { - ScreenEvents.remove(screen).register(screen1 -> updateStorage(handledScreen)); - } - }); - } - - public static void tick() { - Utils.update(); // force update isOnSkyblock to prevent crash on disconnect - if (Utils.isOnSkyblock()) { - // save all dirty storages - saveStorages(); - // update save dir based on sb profile id - String id = MinecraftClient.getInstance().getSession().getUuidOrNull().toString().replaceAll("-", "") + "/" + Utils.getProfileId(); - if (!id.equals(loaded)) { - saveDir = SkyblockerMod.CONFIG_DIR.resolve("backpack-preview/" + id); - //noinspection ResultOfMethodCallIgnored - saveDir.toFile().mkdirs(); - // load storage again because profile id changed - loaded = id; - loadStorages(); - } - } - } - - private static void loadStorages() { - for (int index = 0; index < STORAGE_SIZE; ++index) { - storages[index] = null; - File storageFile = saveDir.resolve(index + ".nbt").toFile(); - if (storageFile.isFile()) { - try { - storages[index] = Storage.fromNbt(Objects.requireNonNull(NbtIo.read(storageFile))); - } catch (Exception e) { - LOGGER.error("Failed to load backpack preview file: " + storageFile.getName(), e); - } - } - } - } - - private static void saveStorages() { - for (int index = 0; index < STORAGE_SIZE; ++index) { - if (storages[index] != null && storages[index].dirty) { - saveStorage(index); - } - } - } - - private static void saveStorage(int index) { - try { - NbtIo.write(storages[index].toNbt(), saveDir.resolve(index + ".nbt").toFile()); - storages[index].markClean(); - } catch (Exception e) { - LOGGER.error("Failed to save backpack preview file: " + index + ".nbt", e); - } - } - - private static void updateStorage(HandledScreen handledScreen) { - String title = handledScreen.getTitle().getString(); - int index = getStorageIndexFromTitle(title); - if (index != -1) { - storages[index] = new Storage(handledScreen.getScreenHandler().slots.get(0).inventory, title, true); - } - } - - public static boolean renderPreview(DrawContext context, Screen screen, int index, int mouseX, int mouseY) { - if (index >= 9 && index < 18) index -= 9; - else if (index >= 27 && index < 45) index -= 18; - else return false; - - if (storages[index] == null) return false; - int rows = (storages[index].size() - 9) / 9; - - int x = mouseX + 184 >= screen.width ? mouseX - 188 : mouseX + 8; - int y = Math.max(0, mouseY - 16); - - MatrixStack matrices = context.getMatrices(); - matrices.push(); - matrices.translate(0f, 0f, 400f); - - RenderSystem.enableDepthTest(); - context.drawTexture(TEXTURE, x, y, 0, 0, 176, rows * 18 + 17); - context.drawTexture(TEXTURE, x, y + rows * 18 + 17, 0, 215, 176, 7); - - TextRenderer textRenderer = MinecraftClient.getInstance().textRenderer; - context.drawText(textRenderer, storages[index].name, x + 8, y + 6, 0x404040, false); - - matrices.translate(0f, 0f, 200f); - for (int i = 9; i < storages[index].size(); ++i) { - ItemStack currentStack = storages[index].getStack(i); - int itemX = x + (i - 9) % 9 * 18 + 8; - int itemY = y + (i - 9) / 9 * 18 + 18; - - if (SkyblockerConfigManager.get().general.itemInfoDisplay.itemRarityBackgrounds) { - ItemRarityBackgrounds.tryDraw(currentStack, context, itemX, itemY); - } - - context.drawItem(currentStack, itemX, itemY); - context.drawItemInSlot(textRenderer, currentStack, itemX, itemY); - } - - matrices.pop(); - - return true; - } - - private static int getStorageIndexFromTitle(String title) { - Matcher echest = ECHEST_PATTERN.matcher(title); - if (echest.find()) return Integer.parseInt(echest.group(1)) - 1; - Matcher backpack = BACKPACK_PATTERN.matcher(title); - if (backpack.find()) return Integer.parseInt(backpack.group(1)) + 8; - return -1; - } - - static class Storage { - private final Inventory inventory; - private final String name; - private boolean dirty; - - private Storage(Inventory inventory, String name, boolean dirty) { - this.inventory = inventory; - this.name = name; - this.dirty = dirty; - } - - private int size() { - return inventory.size(); - } - - private ItemStack getStack(int index) { - return inventory.getStack(index); - } - - private void markClean() { - dirty = false; - } - - @NotNull - private static Storage fromNbt(NbtCompound root) { - SimpleInventory inventory = new SimpleInventory(root.getList("list", NbtCompound.COMPOUND_TYPE).stream().map(NbtCompound.class::cast).map(ItemStack::fromNbt).toArray(ItemStack[]::new)); - return new Storage(inventory, root.getString("name"), false); - } - - @NotNull - private NbtCompound toNbt() { - NbtCompound root = new NbtCompound(); - NbtList list = new NbtList(); - for (int i = 0; i < size(); ++i) { - list.add(getStack(i).writeNbt(new NbtCompound())); - } - root.put("list", list); - root.put("size", NbtInt.of(size())); - root.putString("name", name); - return root; - } - } -} diff --git a/src/main/java/de/hysky/skyblocker/skyblock/item/CompactorDeletorPreview.java b/src/main/java/de/hysky/skyblocker/skyblock/item/CompactorDeletorPreview.java deleted file mode 100644 index 1e3dd7d2..00000000 --- a/src/main/java/de/hysky/skyblocker/skyblock/item/CompactorDeletorPreview.java +++ /dev/null @@ -1,90 +0,0 @@ -package de.hysky.skyblocker.skyblock.item; - -import de.hysky.skyblocker.mixin.accessor.DrawContextInvoker; -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; -import net.minecraft.client.MinecraftClient; -import net.minecraft.client.gui.DrawContext; -import net.minecraft.client.gui.screen.Screen; -import net.minecraft.client.gui.tooltip.HoveredTooltipPositioner; -import net.minecraft.client.gui.tooltip.TooltipComponent; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NbtCompound; -import net.minecraft.text.Text; -import net.minecraft.util.Formatting; - -import java.util.List; -import java.util.Map; -import java.util.regex.Pattern; -import java.util.stream.Collectors; - -public class CompactorDeletorPreview { - /** - * The width and height in slots of the compactor/deletor - */ - private static final Map DIMENSIONS = Map.of( - "4000", IntIntPair.of(1, 1), - "5000", IntIntPair.of(1, 3), - "6000", IntIntPair.of(1, 7), - "7000", IntIntPair.of(2, 6) - ); - private static final IntIntPair DEFAULT_DIMENSION = IntIntPair.of(1, 6); - public static final Pattern NAME = Pattern.compile("PERSONAL_(?COMPACTOR|DELETOR)_(?\\d+)"); - private static final MinecraftClient client = MinecraftClient.getInstance(); - - public static boolean drawPreview(DrawContext context, ItemStack stack, String type, String size, int x, int y) { - List tooltips = Screen.getTooltipFromItem(client, stack); - int targetIndex = getTargetIndex(tooltips); - if (targetIndex == -1) return false; - - // Get items in compactor or deletor - 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_ or personal_deletor_ - List> 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 components = tooltips.stream().map(Text::asOrderedText).map(TooltipComponent::of).collect(Collectors.toList()); - IntIntPair dimensions = DIMENSIONS.getOrDefault(size, DEFAULT_DIMENSION); - - // If there are no items in compactor or deletor - if (slots.isEmpty()) { - int slotsCount = dimensions.leftInt() * dimensions.rightInt(); - components.add(targetIndex, TooltipComponent.of(Text.literal(slotsCount + (slotsCount == 1 ? " slot" : " slots")).formatted(Formatting.GRAY).asOrderedText())); - - ((DrawContextInvoker) context).invokeDrawTooltip(client.textRenderer, components, x, y, HoveredTooltipPositioner.INSTANCE); - return true; - } - - // Add the preview tooltip component - components.add(targetIndex, new CompactorPreviewTooltipComponent(slots, dimensions)); - - // Render accompanying text - components.add(targetIndex, TooltipComponent.of(Text.literal("Contents:").asOrderedText())); - if (extraAttributes.contains("PERSONAL_DELETOR_ACTIVE")) { - components.add(targetIndex, TooltipComponent.of(Text.literal("Active: ") - .append(extraAttributes.getBoolean("PERSONAL_DELETOR_ACTIVE") ? Text.literal("YES").formatted(Formatting.BOLD).formatted(Formatting.GREEN) : Text.literal("NO").formatted(Formatting.BOLD).formatted(Formatting.RED)).asOrderedText())); - } - ((DrawContextInvoker) context).invokeDrawTooltip(client.textRenderer, components, x, y, HoveredTooltipPositioner.INSTANCE); - return true; - } - - /** - * Finds the target index to insert the preview component, which is the second empty line - */ - private static int getTargetIndex(List tooltips) { - int targetIndex = -1; - int lineCount = 0; - for (int i = 0; i < tooltips.size(); i++) { - if (tooltips.get(i).getString().isEmpty()) { - lineCount += 1; - } - if (lineCount == 2) { - targetIndex = i; - break; - } - } - return targetIndex; - } -} diff --git a/src/main/java/de/hysky/skyblocker/skyblock/item/CompactorPreviewTooltipComponent.java b/src/main/java/de/hysky/skyblocker/skyblock/item/CompactorPreviewTooltipComponent.java deleted file mode 100644 index 513d7d72..00000000 --- a/src/main/java/de/hysky/skyblocker/skyblock/item/CompactorPreviewTooltipComponent.java +++ /dev/null @@ -1,56 +0,0 @@ -package de.hysky.skyblocker.skyblock.item; - -import de.hysky.skyblocker.SkyblockerMod; -import it.unimi.dsi.fastutil.ints.IntIntPair; -import it.unimi.dsi.fastutil.ints.IntObjectPair; -import net.minecraft.client.font.TextRenderer; -import net.minecraft.client.gui.DrawContext; -import net.minecraft.client.gui.tooltip.TooltipComponent; -import net.minecraft.item.ItemStack; -import net.minecraft.util.Identifier; - -public class CompactorPreviewTooltipComponent implements TooltipComponent { - private static final Identifier INVENTORY_TEXTURE = new Identifier(SkyblockerMod.NAMESPACE, "textures/gui/inventory_background.png"); - private final Iterable> items; - private final IntIntPair dimensions; - - public CompactorPreviewTooltipComponent(Iterable> items, IntIntPair dimensions) { - this.items = items; - this.dimensions = dimensions; - } - - @Override - public int getHeight() { - return dimensions.leftInt() * 18 + 14; - } - - @Override - public int getWidth(TextRenderer textRenderer) { - return dimensions.rightInt() * 18 + 14; - } - - @Override - public void drawItems(TextRenderer textRenderer, int x, int y, DrawContext context) { - context.drawTexture(INVENTORY_TEXTURE, x, y, 0, 0, 7 + dimensions.rightInt() * 18, 7); - context.drawTexture(INVENTORY_TEXTURE, x + 7 + dimensions.rightInt() * 18, y, 169, 0, 7, 7); - - for (int i = 0; i < dimensions.leftInt(); i++) { - context.drawTexture(INVENTORY_TEXTURE, x, y + 7 + i * 18, 0, 7, 7, 18); - for (int j = 0; j < dimensions.rightInt(); j++) { - context.drawTexture(INVENTORY_TEXTURE, x + 7 + j * 18, y + 7 + i * 18, 7, 7, 18, 18); - } - context.drawTexture(INVENTORY_TEXTURE, x + 7 + dimensions.rightInt() * 18, y + 7 + i * 18, 169, 7, 7, 18); - } - context.drawTexture(INVENTORY_TEXTURE, x, y + 7 + dimensions.leftInt() * 18, 0, 25, 7 + dimensions.rightInt() * 18, 7); - context.drawTexture(INVENTORY_TEXTURE, x + 7 + dimensions.rightInt() * 18, y + 7 + dimensions.leftInt() * 18, 169, 25, 7, 7); - - for (IntObjectPair entry : items) { - if (entry.right() != null) { - int itemX = x + entry.leftInt() % dimensions.rightInt() * 18 + 8; - int itemY = y + entry.leftInt() / dimensions.rightInt() * 18 + 8; - context.drawItem(entry.right(), itemX, itemY); - context.drawItemInSlot(textRenderer, entry.right(), itemX, itemY); - } - } - } -} diff --git a/src/main/java/de/hysky/skyblocker/skyblock/item/ExoticCheck.java b/src/main/java/de/hysky/skyblocker/skyblock/item/ExoticCheck.java deleted file mode 100644 index 130ef049..00000000 --- a/src/main/java/de/hysky/skyblocker/skyblock/item/ExoticCheck.java +++ /dev/null @@ -1,87 +0,0 @@ -package de.hysky.skyblocker.skyblock.item; - -import de.hysky.skyblocker.utils.Constants; -import net.minecraft.nbt.NbtCompound; -import net.minecraft.text.MutableText; -import net.minecraft.text.Text; -import net.minecraft.util.Formatting; - -public class ExoticCheck { - public static String getExpectedHex(String id) { - String color = PriceInfoTooltip.colorJson.get(id).getAsString(); - if (color != null) { - String[] RGBValues = color.split(","); - String hex = String.format("%02x%02x%02x", Integer.parseInt(RGBValues[0]), Integer.parseInt(RGBValues[1]), Integer.parseInt(RGBValues[2])); - return hex.toUpperCase(); - } else { - System.out.println("Color is null"); - return null; - } - } - - public static boolean isException(String id, String hex) { - if (id.startsWith("LEATHER") || id.equals("GHOST_BOOTS") || Constants.SEYMOUR_IDS.contains(id)) { - return true; - } - if (id.startsWith("RANCHER")) { - return Constants.RANCHERS.contains(hex); - } - if (id.contains("ADAPTIVE_CHESTPLATE")) { - return Constants.ADAPTIVE_CHEST.contains(hex); - } else if (id.contains("ADAPTIVE")) { - return Constants.ADAPTIVE.contains(hex); - } - if (id.startsWith("REAPER")) { - return Constants.REAPER.contains(hex); - } - if (id.startsWith("FAIRY")) { - return Constants.FAIRY_HEXES.contains(hex); - } - if (id.startsWith("CRYSTAL")) { - return Constants.CRYSTAL_HEXES.contains(hex); - } - if (id.contains("SPOOK")) { - return Constants.SPOOK.contains(hex); - } - return false; - } - - public static String checkDyeType(String hex) { - if (Constants.CRYSTAL_HEXES.contains(hex)) { - return "CRYSTAL"; - } - if (Constants.FAIRY_HEXES.contains(hex)) { - return "FAIRY"; - } - if (Constants.OG_FAIRY_HEXES.contains(hex)) { - return "OG_FAIRY"; - } - if (Constants.SPOOK.contains(hex)) { - return "SPOOK"; - } - if (Constants.GLITCHED.contains(hex)) { - return "GLITCHED"; - } - return "EXOTIC"; - } - - public static boolean intendedDyed(NbtCompound ItemData) { - return ItemData.getCompound("ExtraAttributes").contains("dye_item"); - } - - public static Formatting getFormattingColor(String s) { - return switch (s) { - case "CRYSTAL" -> Formatting.AQUA; - case "FAIRY" -> Formatting.LIGHT_PURPLE; - case "OG_FAIRY" -> Formatting.DARK_PURPLE; - case "SPOOK" -> Formatting.RED; - case "GLITCHED" -> Formatting.BLUE; - case "EXOTIC" -> Formatting.GOLD; - default -> Formatting.DARK_GRAY; - }; - } - - public static MutableText getTranslatedText(String s) { - return Text.translatable("skyblocker.exotic." + s.toLowerCase()); - } -} diff --git a/src/main/java/de/hysky/skyblocker/skyblock/item/PriceInfoTooltip.java b/src/main/java/de/hysky/skyblocker/skyblock/item/PriceInfoTooltip.java deleted file mode 100644 index 9e38f276..00000000 --- a/src/main/java/de/hysky/skyblocker/skyblock/item/PriceInfoTooltip.java +++ /dev/null @@ -1,469 +0,0 @@ -package de.hysky.skyblocker.skyblock.item; - -import com.google.gson.JsonObject; -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.Http; -import de.hysky.skyblocker.utils.ItemUtils; -import de.hysky.skyblocker.utils.Utils; -import de.hysky.skyblocker.utils.scheduler.Scheduler; -import net.minecraft.client.MinecraftClient; -import net.minecraft.client.item.TooltipContext; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NbtCompound; -import net.minecraft.nbt.NbtElement; -import net.minecraft.text.MutableText; -import net.minecraft.text.Text; -import net.minecraft.util.Formatting; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.net.http.HttpHeaders; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.*; -import java.util.concurrent.CompletableFuture; - -public class PriceInfoTooltip { - private static final Logger LOGGER = LoggerFactory.getLogger(PriceInfoTooltip.class.getName()); - private static final MinecraftClient client = MinecraftClient.getInstance(); - private static JsonObject npcPricesJson; - private static JsonObject bazaarPricesJson; - private static JsonObject oneDayAvgPricesJson; - private static JsonObject threeDayAvgPricesJson; - private static JsonObject lowestPricesJson; - private static JsonObject isMuseumJson; - private static JsonObject motesPricesJson; - public static JsonObject colorJson; - private static volatile boolean nullMsgSend = false; - private static final Map apiAddresses; - private static long npcHash = 0; - private static long museumHash = 0; - private static long motesHash = 0; - - public static void getTooltip(ItemStack stack, TooltipContext context, List lines) { - if (!Utils.isOnSkyblock() || client.player == null) return; - - String name = getInternalNameFromNBT(stack, false); - String internalID = getInternalNameFromNBT(stack, true); - String neuName = name; - if (name == null || internalID == null) return; - - if (name.startsWith("ISSHINY_")) { - name = "SHINY_" + internalID; - neuName = internalID; - } - - if (lines.isEmpty()) { - return; - } - - if (SkyblockerConfigManager.get().general.itemTooltip.enableExoticCheck) { - if (colorJson == null) { - nullWarning(); - } else if (stack.getNbt() != null) { - final NbtElement color = stack.getNbt().getCompound("display").get("color"); - - if (color != null) { - String colorHex = String.format("%06X", Integer.parseInt(color.asString())); - String expectedHex = ExoticCheck.getExpectedHex(internalID); - - boolean correctLine = false; - for (Text text : lines) { - String existingTooltip = text.getString() + " "; - if (existingTooltip.startsWith("Color: ")) { - correctLine = true; - - addExoticTooltip(lines, internalID, stack.getNbt(), colorHex, expectedHex, existingTooltip); - break; - } - } - - if (!correctLine) { - addExoticTooltip(lines, internalID, stack.getNbt(), colorHex, expectedHex, ""); - } - } - } - } - - int count = stack.getCount(); - boolean bazaarOpened = lines.stream().anyMatch(each -> each.getString().contains("Buy price:") || each.getString().contains("Sell price:")); - - if (SkyblockerConfigManager.get().general.itemTooltip.enableNPCPrice) { - if (npcPricesJson == null) { - nullWarning(); - } else if (npcPricesJson.has(internalID)) { - lines.add(Text.literal(String.format("%-21s", "NPC Price:")) - .formatted(Formatting.YELLOW) - .append(getCoinsMessage(npcPricesJson.get(internalID).getAsDouble(), count))); - } - } - - if (SkyblockerConfigManager.get().general.itemTooltip.enableMotesPrice && Utils.isInTheRift()) { - if (motesPricesJson == null) { - nullWarning(); - } else if (motesPricesJson.has(internalID)) { - lines.add(Text.literal(String.format("%-20s", "Motes Price:")) - .formatted(Formatting.LIGHT_PURPLE) - .append(getMotesMessage(motesPricesJson.get(internalID).getAsInt(), count))); - } - } - - boolean bazaarExist = false; - - if (SkyblockerConfigManager.get().general.itemTooltip.enableBazaarPrice && !bazaarOpened) { - if (bazaarPricesJson == null) { - nullWarning(); - } else if (bazaarPricesJson.has(name)) { - JsonObject getItem = bazaarPricesJson.getAsJsonObject(name); - lines.add(Text.literal(String.format("%-18s", "Bazaar buy Price:")) - .formatted(Formatting.GOLD) - .append(getItem.get("buyPrice").isJsonNull() - ? Text.literal("No data").formatted(Formatting.RED) - : getCoinsMessage(getItem.get("buyPrice").getAsDouble(), count))); - lines.add(Text.literal(String.format("%-19s", "Bazaar sell Price:")) - .formatted(Formatting.GOLD) - .append(getItem.get("sellPrice").isJsonNull() - ? Text.literal("No data").formatted(Formatting.RED) - : getCoinsMessage(getItem.get("sellPrice").getAsDouble(), count))); - bazaarExist = true; - } - } - - // bazaarOpened & bazaarExist check for lbin, because Skytils keeps some bazaar item data in lbin api - boolean lbinExist = false; - if (SkyblockerConfigManager.get().general.itemTooltip.enableLowestBIN && !bazaarOpened && !bazaarExist) { - if (lowestPricesJson == null) { - nullWarning(); - } else if (lowestPricesJson.has(name)) { - lines.add(Text.literal(String.format("%-19s", "Lowest BIN Price:")) - .formatted(Formatting.GOLD) - .append(getCoinsMessage(lowestPricesJson.get(name).getAsDouble(), count))); - lbinExist = true; - } - } - - if (SkyblockerConfigManager.get().general.itemTooltip.enableAvgBIN) { - if (threeDayAvgPricesJson == null || oneDayAvgPricesJson == null) { - nullWarning(); - } else { - /* - We are skipping check average prices for potions, runes - and enchanted books because there is no data for their in API. - */ - switch (internalID) { - case "PET" -> { - neuName = neuName.replaceAll("LVL_\\d*_", ""); - String[] parts = neuName.split("_"); - String type = parts[0]; - neuName = neuName.replaceAll(type + "_", ""); - neuName = neuName + "-" + type; - neuName = neuName.replace("UNCOMMON", "1") - .replace("COMMON", "0") - .replace("RARE", "2") - .replace("EPIC", "3") - .replace("LEGENDARY", "4") - .replace("MYTHIC", "5") - .replace("-", ";"); - } - case "RUNE" -> neuName = neuName.replaceAll("_(?!.*_)", ";"); - case "POTION" -> neuName = ""; - case "ATTRIBUTE_SHARD" -> - neuName = internalID + "+" + neuName.replace("SHARD-", "").replaceAll("_(?!.*_)", ";"); - default -> neuName = neuName.replace(":", "-"); - } - - if (!neuName.isEmpty() && lbinExist) { - SkyblockerConfig.Average type = SkyblockerConfigManager.get().general.itemTooltip.avg; - - // "No data" line because of API not keeping old data, it causes NullPointerException - if (type == SkyblockerConfig.Average.ONE_DAY || type == SkyblockerConfig.Average.BOTH) { - lines.add( - Text.literal(String.format("%-19s", "1 Day Avg. Price:")) - .formatted(Formatting.GOLD) - .append(oneDayAvgPricesJson.get(neuName) == null - ? Text.literal("No data").formatted(Formatting.RED) - : getCoinsMessage(oneDayAvgPricesJson.get(neuName).getAsDouble(), count) - ) - ); - } - if (type == SkyblockerConfig.Average.THREE_DAY || type == SkyblockerConfig.Average.BOTH) { - lines.add( - Text.literal(String.format("%-19s", "3 Day Avg. Price:")) - .formatted(Formatting.GOLD) - .append(threeDayAvgPricesJson.get(neuName) == null - ? Text.literal("No data").formatted(Formatting.RED) - : getCoinsMessage(threeDayAvgPricesJson.get(neuName).getAsDouble(), count) - ) - ); - } - } - } - } - - if (SkyblockerConfigManager.get().general.itemTooltip.enableMuseumDate && !bazaarOpened) { - if (isMuseumJson == null) { - nullWarning(); - } else { - String timestamp = getTimestamp(stack); - - if (isMuseumJson.has(internalID)) { - String itemCategory = isMuseumJson.get(internalID).getAsString(); - String format = switch (itemCategory) { - case "Weapons" -> "%-18s"; - case "Armor" -> "%-19s"; - default -> "%-20s"; - }; - lines.add(Text.literal(String.format(format, "Museum: (" + itemCategory + ")")) - .formatted(Formatting.LIGHT_PURPLE) - .append(Text.literal(timestamp).formatted(Formatting.RED))); - } else if (!timestamp.isEmpty()) { - lines.add(Text.literal(String.format("%-21s", "Obtained: ")) - .formatted(Formatting.LIGHT_PURPLE) - .append(Text.literal(timestamp).formatted(Formatting.RED))); - } - } - } - } - - private static void addExoticTooltip(List lines, String internalID, NbtCompound nbt, String colorHex, String expectedHex, String existingTooltip) { - if (!colorHex.equalsIgnoreCase(expectedHex) && !ExoticCheck.isException(internalID, colorHex) && !ExoticCheck.intendedDyed(nbt)) { - final String type = ExoticCheck.checkDyeType(colorHex); - lines.add(1, Text.literal(existingTooltip + Formatting.DARK_GRAY + "(").append(ExoticCheck.getTranslatedText(type).formatted(ExoticCheck.getFormattingColor(type))).append(Formatting.DARK_GRAY + ")")); - } - } - - private static void nullWarning() { - if (!nullMsgSend && client.player != null) { - client.player.sendMessage(Constants.PREFIX.get().append(Text.translatable("skyblocker.itemTooltip.nullMessage")), false); - nullMsgSend = true; - } - } - - /** - * this method converts the "timestamp" variable into the same date format as Hypixel represents it in the museum. - * Currently, there are two types of timestamps the legacy which is built like this - * "dd/MM/yy hh:mm" ("25/04/20 16:38") and the current which is built like this - * "MM/dd/yy hh:mm aa" ("12/24/20 11:08 PM"). Since Hypixel transforms the two formats into one format without - * taking into account of their formats, we do the same. The final result looks like this - * "MMMM dd, yyyy" (December 24, 2020). - * Since the legacy format has a 25 as "month" SimpleDateFormat converts the 25 into 2 years and 1 month and makes - * "25/04/20 16:38" -> "January 04, 2022" instead of "April 25, 2020". - * This causes the museum rank to be much worse than it should be. - * - * @param stack the item under the pointer - * @return if the item have a "Timestamp" it will be shown formated on the tooltip - */ - public static String getTimestamp(ItemStack stack) { - NbtCompound ea = ItemUtils.getExtraAttributes(stack); - - if (ea != null && ea.contains("timestamp", 8)) { - SimpleDateFormat nbtFormat = new SimpleDateFormat("MM/dd/yy"); - - try { - Date date = nbtFormat.parse(ea.getString("timestamp")); - SimpleDateFormat skyblockerFormat = new SimpleDateFormat("MMMM dd, yyyy", Locale.ENGLISH); - return skyblockerFormat.format(date); - } catch (ParseException e) { - LOGGER.warn("[Skyblocker-tooltip] getTimestamp", e); - } - } - - return ""; - } - - public static String getInternalNameFromNBT(ItemStack stack, boolean internalIDOnly) { - NbtCompound ea = ItemUtils.getExtraAttributes(stack); - - if (ea == null || !ea.contains(ItemUtils.ID, 8)) { - return null; - } - String internalName = ea.getString(ItemUtils.ID); - - if (internalIDOnly) { - return internalName; - } - - // Transformation to API format. - if (ea.contains("is_shiny")) { - return "ISSHINY_" + internalName; - } - - switch (internalName) { - case "ENCHANTED_BOOK" -> { - if (ea.contains("enchantments")) { - NbtCompound enchants = ea.getCompound("enchantments"); - Optional firstEnchant = enchants.getKeys().stream().findFirst(); - String enchant = firstEnchant.orElse(""); - return "ENCHANTMENT_" + enchant.toUpperCase(Locale.ENGLISH) + "_" + enchants.getInt(enchant); - } - } - case "PET" -> { - if (ea.contains("petInfo")) { - JsonObject petInfo = SkyblockerMod.GSON.fromJson(ea.getString("petInfo"), JsonObject.class); - return "LVL_1_" + petInfo.get("tier").getAsString() + "_" + petInfo.get("type").getAsString(); - } - } - case "POTION" -> { - String enhanced = ea.contains("enhanced") ? "_ENHANCED" : ""; - String extended = ea.contains("extended") ? "_EXTENDED" : ""; - String splash = ea.contains("splash") ? "_SPLASH" : ""; - if (ea.contains("potion") && ea.contains("potion_level")) { - return (ea.getString("potion") + "_" + internalName + "_" + ea.getInt("potion_level") - + enhanced + extended + splash).toUpperCase(Locale.ENGLISH); - } - } - case "RUNE" -> { - if (ea.contains("runes")) { - NbtCompound runes = ea.getCompound("runes"); - Optional firstRunes = runes.getKeys().stream().findFirst(); - String rune = firstRunes.orElse(""); - return rune.toUpperCase(Locale.ENGLISH) + "_RUNE_" + runes.getInt(rune); - } - } - case "ATTRIBUTE_SHARD" -> { - if (ea.contains("attributes")) { - NbtCompound shards = ea.getCompound("attributes"); - Optional firstShards = shards.getKeys().stream().findFirst(); - String shard = firstShards.orElse(""); - return internalName + "-" + shard.toUpperCase(Locale.ENGLISH) + "_" + shards.getInt(shard); - } - } - } - return internalName; - } - - - private static Text getCoinsMessage(double price, int count) { - // Format the price string once - String priceString = String.format(Locale.ENGLISH, "%1$,.1f", price); - - // If count is 1, return a simple message - if (count == 1) { - return Text.literal(priceString + " Coins").formatted(Formatting.DARK_AQUA); - } - - // If count is greater than 1, include the "each" information - String priceStringTotal = String.format(Locale.ENGLISH, "%1$,.1f", price * count); - MutableText message = Text.literal(priceStringTotal + " Coins ").formatted(Formatting.DARK_AQUA); - message.append(Text.literal("(" + priceString + " each)").formatted(Formatting.GRAY)); - - return message; - } - - private static Text getMotesMessage(int price, int count) { - float motesMultiplier = SkyblockerConfigManager.get().locations.rift.mcGrubberStacks * 0.05f + 1; - - // Calculate the total price - int totalPrice = price * count; - String totalPriceString = String.format(Locale.ENGLISH, "%1$,.1f", totalPrice * motesMultiplier); - - // If count is 1, return a simple message - if (count == 1) { - return Text.literal(totalPriceString.replace(".0", "") + " Motes").formatted(Formatting.DARK_AQUA); - } - - // If count is greater than 1, include the "each" information - String eachPriceString = String.format(Locale.ENGLISH, "%1$,.1f", price * motesMultiplier); - MutableText message = Text.literal(totalPriceString.replace(".0", "") + " Motes ").formatted(Formatting.DARK_AQUA); - message.append(Text.literal("(" + eachPriceString.replace(".0", "") + " each)").formatted(Formatting.GRAY)); - - return message; - } - - // If these options is true beforehand, the client will get first data of these options while loading. - // After then, it will only fetch the data if it is on Skyblock. - public static int minute = -1; - - public static void init() { - Scheduler.INSTANCE.scheduleCyclic(() -> { - if (!Utils.isOnSkyblock() && 0 < minute++) { - nullMsgSend = false; - return; - } - - List> futureList = new ArrayList<>(); - if (SkyblockerConfigManager.get().general.itemTooltip.enableAvgBIN) { - SkyblockerConfig.Average type = SkyblockerConfigManager.get().general.itemTooltip.avg; - - if (type == SkyblockerConfig.Average.BOTH || oneDayAvgPricesJson == null || threeDayAvgPricesJson == null || minute % 5 == 0) { - futureList.add(CompletableFuture.runAsync(() -> { - oneDayAvgPricesJson = downloadPrices("1 day avg"); - threeDayAvgPricesJson = downloadPrices("3 day avg"); - })); - } else if (type == SkyblockerConfig.Average.ONE_DAY) { - futureList.add(CompletableFuture.runAsync(() -> oneDayAvgPricesJson = downloadPrices("1 day avg"))); - } else if (type == SkyblockerConfig.Average.THREE_DAY) { - futureList.add(CompletableFuture.runAsync(() -> threeDayAvgPricesJson = downloadPrices("3 day avg"))); - } - } - if (SkyblockerConfigManager.get().general.itemTooltip.enableLowestBIN || SkyblockerConfigManager.get().locations.dungeons.dungeonChestProfit.enableProfitCalculator) - futureList.add(CompletableFuture.runAsync(() -> lowestPricesJson = downloadPrices("lowest bins"))); - - if (SkyblockerConfigManager.get().general.itemTooltip.enableBazaarPrice || SkyblockerConfigManager.get().locations.dungeons.dungeonChestProfit.enableProfitCalculator) - futureList.add(CompletableFuture.runAsync(() -> bazaarPricesJson = downloadPrices("bazaar"))); - - if (SkyblockerConfigManager.get().general.itemTooltip.enableNPCPrice && npcPricesJson == null) - futureList.add(CompletableFuture.runAsync(() -> npcPricesJson = downloadPrices("npc"))); - - if (SkyblockerConfigManager.get().general.itemTooltip.enableMuseumDate && isMuseumJson == null) - futureList.add(CompletableFuture.runAsync(() -> isMuseumJson = downloadPrices("museum"))); - - if (SkyblockerConfigManager.get().general.itemTooltip.enableMotesPrice && motesPricesJson == null) - futureList.add(CompletableFuture.runAsync(() -> motesPricesJson = downloadPrices("motes"))); - - if (SkyblockerConfigManager.get().general.itemTooltip.enableExoticCheck && colorJson == null) - futureList.add(CompletableFuture.runAsync(() -> colorJson = downloadPrices("color"))); - - minute++; - CompletableFuture.allOf(futureList.toArray(CompletableFuture[]::new)) - .whenComplete((unused, throwable) -> nullMsgSend = false); - }, 1200, true); - } - - private static JsonObject downloadPrices(String type) { - try { - String url = apiAddresses.get(type); - - if (type.equals("npc") || type.equals("museum") || type.equals("motes")) { - HttpHeaders headers = Http.sendHeadRequest(url); - long combinedHash = Http.getEtag(headers).hashCode() + Http.getLastModified(headers).hashCode(); - - switch (type) { - case "npc": if (npcHash == combinedHash) return npcPricesJson; else npcHash = combinedHash; - case "museum": if (museumHash == combinedHash) return isMuseumJson; else museumHash = combinedHash; - case "motes": if (motesHash == combinedHash) return motesPricesJson; else motesHash = combinedHash; - } - } - - String apiResponse = Http.sendGetRequest(url); - - return SkyblockerMod.GSON.fromJson(apiResponse, JsonObject.class); - } catch (Exception e) { - LOGGER.warn("[Skyblocker] Failed to download " + type + " prices!", e); - return null; - } - } - - public static JsonObject getBazaarPrices() { - return bazaarPricesJson; - } - - public static JsonObject getLBINPrices() { - return lowestPricesJson; - } - - static { - apiAddresses = new HashMap<>(); - apiAddresses.put("1 day avg", "https://moulberry.codes/auction_averages_lbin/1day.json"); - apiAddresses.put("3 day avg", "https://moulberry.codes/auction_averages_lbin/3day.json"); - apiAddresses.put("bazaar", "https://hysky.de/api/bazaar"); - apiAddresses.put("lowest bins", "https://hysky.de/api/auctions/lowestbins"); - apiAddresses.put("npc", "https://hysky.de/api/npcprice"); - apiAddresses.put("museum", "https://hysky.de/api/museum"); - apiAddresses.put("motes", "https://hysky.de/api/motesprice"); - apiAddresses.put("color", "https://hysky.de/api/color"); - } -} \ No newline at end of file diff --git a/src/main/java/de/hysky/skyblocker/skyblock/item/tooltip/BackpackPreview.java b/src/main/java/de/hysky/skyblocker/skyblock/item/tooltip/BackpackPreview.java new file mode 100644 index 00000000..5627b56d --- /dev/null +++ b/src/main/java/de/hysky/skyblocker/skyblock/item/tooltip/BackpackPreview.java @@ -0,0 +1,204 @@ +package de.hysky.skyblocker.skyblock.item.tooltip; + +import com.mojang.blaze3d.systems.RenderSystem; +import de.hysky.skyblocker.SkyblockerMod; +import de.hysky.skyblocker.config.SkyblockerConfigManager; +import de.hysky.skyblocker.skyblock.item.ItemRarityBackgrounds; +import de.hysky.skyblocker.utils.Utils; +import net.fabricmc.fabric.api.client.screen.v1.ScreenEvents; +import net.minecraft.client.MinecraftClient; +import net.minecraft.client.font.TextRenderer; +import net.minecraft.client.gui.DrawContext; +import net.minecraft.client.gui.screen.Screen; +import net.minecraft.client.gui.screen.ingame.HandledScreen; +import net.minecraft.client.util.math.MatrixStack; +import net.minecraft.inventory.Inventory; +import net.minecraft.inventory.SimpleInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NbtCompound; +import net.minecraft.nbt.NbtInt; +import net.minecraft.nbt.NbtIo; +import net.minecraft.nbt.NbtList; +import net.minecraft.util.Identifier; +import org.jetbrains.annotations.NotNull; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.File; +import java.nio.file.Path; +import java.util.Objects; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +public class BackpackPreview { + private static final Logger LOGGER = LoggerFactory.getLogger(BackpackPreview.class); + private static final Identifier TEXTURE = new Identifier("textures/gui/container/generic_54.png"); + private static final Pattern ECHEST_PATTERN = Pattern.compile("Ender Chest.*\\((\\d+)/\\d+\\)"); + private static final Pattern BACKPACK_PATTERN = Pattern.compile("Backpack.*\\(Slot #(\\d+)\\)"); + private static final int STORAGE_SIZE = 27; + + private static final Storage[] storages = new Storage[STORAGE_SIZE]; + + /** + * The profile id of the currently loaded backpack preview. + */ + private static String loaded; + private static Path saveDir; + + public static void init() { + ScreenEvents.AFTER_INIT.register((client, screen, scaledWidth, scaledHeight) -> { + if (screen instanceof HandledScreen handledScreen) { + ScreenEvents.remove(screen).register(screen1 -> updateStorage(handledScreen)); + } + }); + } + + public static void tick() { + Utils.update(); // force update isOnSkyblock to prevent crash on disconnect + if (Utils.isOnSkyblock()) { + // save all dirty storages + saveStorages(); + // update save dir based on sb profile id + String id = MinecraftClient.getInstance().getSession().getUuidOrNull().toString().replaceAll("-", "") + "/" + Utils.getProfileId(); + if (!id.equals(loaded)) { + saveDir = SkyblockerMod.CONFIG_DIR.resolve("backpack-preview/" + id); + //noinspection ResultOfMethodCallIgnored + saveDir.toFile().mkdirs(); + // load storage again because profile id changed + loaded = id; + loadStorages(); + } + } + } + + private static void loadStorages() { + for (int index = 0; index < STORAGE_SIZE; ++index) { + storages[index] = null; + File storageFile = saveDir.resolve(index + ".nbt").toFile(); + if (storageFile.isFile()) { + try { + storages[index] = Storage.fromNbt(Objects.requireNonNull(NbtIo.read(storageFile))); + } catch (Exception e) { + LOGGER.error("Failed to load backpack preview file: " + storageFile.getName(), e); + } + } + } + } + + private static void saveStorages() { + for (int index = 0; index < STORAGE_SIZE; ++index) { + if (storages[index] != null && storages[index].dirty) { + saveStorage(index); + } + } + } + + private static void saveStorage(int index) { + try { + NbtIo.write(storages[index].toNbt(), saveDir.resolve(index + ".nbt").toFile()); + storages[index].markClean(); + } catch (Exception e) { + LOGGER.error("Failed to save backpack preview file: " + index + ".nbt", e); + } + } + + private static void updateStorage(HandledScreen handledScreen) { + String title = handledScreen.getTitle().getString(); + int index = getStorageIndexFromTitle(title); + if (index != -1) { + storages[index] = new Storage(handledScreen.getScreenHandler().slots.get(0).inventory, title, true); + } + } + + public static boolean renderPreview(DrawContext context, Screen screen, int index, int mouseX, int mouseY) { + if (index >= 9 && index < 18) index -= 9; + else if (index >= 27 && index < 45) index -= 18; + else return false; + + if (storages[index] == null) return false; + int rows = (storages[index].size() - 9) / 9; + + int x = mouseX + 184 >= screen.width ? mouseX - 188 : mouseX + 8; + int y = Math.max(0, mouseY - 16); + + MatrixStack matrices = context.getMatrices(); + matrices.push(); + matrices.translate(0f, 0f, 400f); + + RenderSystem.enableDepthTest(); + context.drawTexture(TEXTURE, x, y, 0, 0, 176, rows * 18 + 17); + context.drawTexture(TEXTURE, x, y + rows * 18 + 17, 0, 215, 176, 7); + + TextRenderer textRenderer = MinecraftClient.getInstance().textRenderer; + context.drawText(textRenderer, storages[index].name, x + 8, y + 6, 0x404040, false); + + matrices.translate(0f, 0f, 200f); + for (int i = 9; i < storages[index].size(); ++i) { + ItemStack currentStack = storages[index].getStack(i); + int itemX = x + (i - 9) % 9 * 18 + 8; + int itemY = y + (i - 9) / 9 * 18 + 18; + + if (SkyblockerConfigManager.get().general.itemInfoDisplay.itemRarityBackgrounds) { + ItemRarityBackgrounds.tryDraw(currentStack, context, itemX, itemY); + } + + context.drawItem(currentStack, itemX, itemY); + context.drawItemInSlot(textRenderer, currentStack, itemX, itemY); + } + + matrices.pop(); + + return true; + } + + private static int getStorageIndexFromTitle(String title) { + Matcher echest = ECHEST_PATTERN.matcher(title); + if (echest.find()) return Integer.parseInt(echest.group(1)) - 1; + Matcher backpack = BACKPACK_PATTERN.matcher(title); + if (backpack.find()) return Integer.parseInt(backpack.group(1)) + 8; + return -1; + } + + static class Storage { + private final Inventory inventory; + private final String name; + private boolean dirty; + + private Storage(Inventory inventory, String name, boolean dirty) { + this.inventory = inventory; + this.name = name; + this.dirty = dirty; + } + + private int size() { + return inventory.size(); + } + + private ItemStack getStack(int index) { + return inventory.getStack(index); + } + + private void markClean() { + dirty = false; + } + + @NotNull + private static Storage fromNbt(NbtCompound root) { + SimpleInventory inventory = new SimpleInventory(root.getList("list", NbtCompound.COMPOUND_TYPE).stream().map(NbtCompound.class::cast).map(ItemStack::fromNbt).toArray(ItemStack[]::new)); + return new Storage(inventory, root.getString("name"), false); + } + + @NotNull + private NbtCompound toNbt() { + NbtCompound root = new NbtCompound(); + NbtList list = new NbtList(); + for (int i = 0; i < size(); ++i) { + list.add(getStack(i).writeNbt(new NbtCompound())); + } + root.put("list", list); + root.put("size", NbtInt.of(size())); + root.putString("name", name); + return root; + } + } +} diff --git a/src/main/java/de/hysky/skyblocker/skyblock/item/tooltip/CompactorDeletorPreview.java b/src/main/java/de/hysky/skyblocker/skyblock/item/tooltip/CompactorDeletorPreview.java new file mode 100644 index 00000000..9cf0356b --- /dev/null +++ b/src/main/java/de/hysky/skyblocker/skyblock/item/tooltip/CompactorDeletorPreview.java @@ -0,0 +1,90 @@ +package de.hysky.skyblocker.skyblock.item.tooltip; + +import de.hysky.skyblocker.mixin.accessor.DrawContextInvoker; +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; +import net.minecraft.client.MinecraftClient; +import net.minecraft.client.gui.DrawContext; +import net.minecraft.client.gui.screen.Screen; +import net.minecraft.client.gui.tooltip.HoveredTooltipPositioner; +import net.minecraft.client.gui.tooltip.TooltipComponent; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NbtCompound; +import net.minecraft.text.Text; +import net.minecraft.util.Formatting; + +import java.util.List; +import java.util.Map; +import java.util.regex.Pattern; +import java.util.stream.Collectors; + +public class CompactorDeletorPreview { + /** + * The width and height in slots of the compactor/deletor + */ + private static final Map DIMENSIONS = Map.of( + "4000", IntIntPair.of(1, 1), + "5000", IntIntPair.of(1, 3), + "6000", IntIntPair.of(1, 7), + "7000", IntIntPair.of(2, 6) + ); + private static final IntIntPair DEFAULT_DIMENSION = IntIntPair.of(1, 6); + public static final Pattern NAME = Pattern.compile("PERSONAL_(?COMPACTOR|DELETOR)_(?\\d+)"); + private static final MinecraftClient client = MinecraftClient.getInstance(); + + public static boolean drawPreview(DrawContext context, ItemStack stack, String type, String size, int x, int y) { + List tooltips = Screen.getTooltipFromItem(client, stack); + int targetIndex = getTargetIndex(tooltips); + if (targetIndex == -1) return false; + + // Get items in compactor or deletor + 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_ or personal_deletor_ + List> 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 components = tooltips.stream().map(Text::asOrderedText).map(TooltipComponent::of).collect(Collectors.toList()); + IntIntPair dimensions = DIMENSIONS.getOrDefault(size, DEFAULT_DIMENSION); + + // If there are no items in compactor or deletor + if (slots.isEmpty()) { + int slotsCount = dimensions.leftInt() * dimensions.rightInt(); + components.add(targetIndex, TooltipComponent.of(Text.literal(slotsCount + (slotsCount == 1 ? " slot" : " slots")).formatted(Formatting.GRAY).asOrderedText())); + + ((DrawContextInvoker) context).invokeDrawTooltip(client.textRenderer, components, x, y, HoveredTooltipPositioner.INSTANCE); + return true; + } + + // Add the preview tooltip component + components.add(targetIndex, new CompactorPreviewTooltipComponent(slots, dimensions)); + + // Render accompanying text + components.add(targetIndex, TooltipComponent.of(Text.literal("Contents:").asOrderedText())); + if (extraAttributes.contains("PERSONAL_DELETOR_ACTIVE")) { + components.add(targetIndex, TooltipComponent.of(Text.literal("Active: ") + .append(extraAttributes.getBoolean("PERSONAL_DELETOR_ACTIVE") ? Text.literal("YES").formatted(Formatting.BOLD).formatted(Formatting.GREEN) : Text.literal("NO").formatted(Formatting.BOLD).formatted(Formatting.RED)).asOrderedText())); + } + ((DrawContextInvoker) context).invokeDrawTooltip(client.textRenderer, components, x, y, HoveredTooltipPositioner.INSTANCE); + return true; + } + + /** + * Finds the target index to insert the preview component, which is the second empty line + */ + private static int getTargetIndex(List tooltips) { + int targetIndex = -1; + int lineCount = 0; + for (int i = 0; i < tooltips.size(); i++) { + if (tooltips.get(i).getString().isEmpty()) { + lineCount += 1; + } + if (lineCount == 2) { + targetIndex = i; + break; + } + } + return targetIndex; + } +} diff --git a/src/main/java/de/hysky/skyblocker/skyblock/item/tooltip/CompactorPreviewTooltipComponent.java b/src/main/java/de/hysky/skyblocker/skyblock/item/tooltip/CompactorPreviewTooltipComponent.java new file mode 100644 index 00000000..22498c02 --- /dev/null +++ b/src/main/java/de/hysky/skyblocker/skyblock/item/tooltip/CompactorPreviewTooltipComponent.java @@ -0,0 +1,56 @@ +package de.hysky.skyblocker.skyblock.item.tooltip; + +import de.hysky.skyblocker.SkyblockerMod; +import it.unimi.dsi.fastutil.ints.IntIntPair; +import it.unimi.dsi.fastutil.ints.IntObjectPair; +import net.minecraft.client.font.TextRenderer; +import net.minecraft.client.gui.DrawContext; +import net.minecraft.client.gui.tooltip.TooltipComponent; +import net.minecraft.item.ItemStack; +import net.minecraft.util.Identifier; + +public class CompactorPreviewTooltipComponent implements TooltipComponent { + private static final Identifier INVENTORY_TEXTURE = new Identifier(SkyblockerMod.NAMESPACE, "textures/gui/inventory_background.png"); + private final Iterable> items; + private final IntIntPair dimensions; + + public CompactorPreviewTooltipComponent(Iterable> items, IntIntPair dimensions) { + this.items = items; + this.dimensions = dimensions; + } + + @Override + public int getHeight() { + return dimensions.leftInt() * 18 + 14; + } + + @Override + public int getWidth(TextRenderer textRenderer) { + return dimensions.rightInt() * 18 + 14; + } + + @Override + public void drawItems(TextRenderer textRenderer, int x, int y, DrawContext context) { + context.drawTexture(INVENTORY_TEXTURE, x, y, 0, 0, 7 + dimensions.rightInt() * 18, 7); + context.drawTexture(INVENTORY_TEXTURE, x + 7 + dimensions.rightInt() * 18, y, 169, 0, 7, 7); + + for (int i = 0; i < dimensions.leftInt(); i++) { + context.drawTexture(INVENTORY_TEXTURE, x, y + 7 + i * 18, 0, 7, 7, 18); + for (int j = 0; j < dimensions.rightInt(); j++) { + context.drawTexture(INVENTORY_TEXTURE, x + 7 + j * 18, y + 7 + i * 18, 7, 7, 18, 18); + } + context.drawTexture(INVENTORY_TEXTURE, x + 7 + dimensions.rightInt() * 18, y + 7 + i * 18, 169, 7, 7, 18); + } + context.drawTexture(INVENTORY_TEXTURE, x, y + 7 + dimensions.leftInt() * 18, 0, 25, 7 + dimensions.rightInt() * 18, 7); + context.drawTexture(INVENTORY_TEXTURE, x + 7 + dimensions.rightInt() * 18, y + 7 + dimensions.leftInt() * 18, 169, 25, 7, 7); + + for (IntObjectPair entry : items) { + if (entry.right() != null) { + int itemX = x + entry.leftInt() % dimensions.rightInt() * 18 + 8; + int itemY = y + entry.leftInt() / dimensions.rightInt() * 18 + 8; + context.drawItem(entry.right(), itemX, itemY); + context.drawItemInSlot(textRenderer, entry.right(), itemX, itemY); + } + } + } +} diff --git a/src/main/java/de/hysky/skyblocker/skyblock/item/tooltip/ExoticTooltip.java b/src/main/java/de/hysky/skyblocker/skyblock/item/tooltip/ExoticTooltip.java new file mode 100644 index 00000000..8f701758 --- /dev/null +++ b/src/main/java/de/hysky/skyblocker/skyblock/item/tooltip/ExoticTooltip.java @@ -0,0 +1,98 @@ +package de.hysky.skyblocker.skyblock.item.tooltip; + +import de.hysky.skyblocker.utils.Constants; +import net.minecraft.nbt.NbtCompound; +import net.minecraft.text.MutableText; +import net.minecraft.text.Text; +import net.minecraft.util.Formatting; +import net.minecraft.util.StringIdentifiable; + +public class ExoticTooltip { + public static String getExpectedHex(String id) { + if (!ItemTooltip.colorJson.has(id)) { + return null; + } + String color = ItemTooltip.colorJson.get(id).getAsString(); + if (color != null) { + String[] RGBValues = color.split(","); + return String.format("%02X%02X%02X", Integer.parseInt(RGBValues[0]), Integer.parseInt(RGBValues[1]), Integer.parseInt(RGBValues[2])); + } else { + ItemTooltip.LOGGER.warn("[Skyblocker Exotics] No expected color data found for id {}", id); + return null; + } + } + + public static boolean isException(String id, String hex) { + if (id.startsWith("LEATHER") || id.equals("GHOST_BOOTS") || Constants.SEYMOUR_IDS.contains(id)) { + return true; + } + if (id.startsWith("RANCHER")) { + return Constants.RANCHERS.contains(hex); + } + if (id.contains("ADAPTIVE_CHESTPLATE")) { + return Constants.ADAPTIVE_CHEST.contains(hex); + } else if (id.contains("ADAPTIVE")) { + return Constants.ADAPTIVE.contains(hex); + } + if (id.startsWith("REAPER")) { + return Constants.REAPER.contains(hex); + } + if (id.startsWith("FAIRY")) { + return Constants.FAIRY_HEXES.contains(hex); + } + if (id.startsWith("CRYSTAL")) { + return Constants.CRYSTAL_HEXES.contains(hex); + } + if (id.contains("SPOOK")) { + return Constants.SPOOK.contains(hex); + } + return false; + } + + public static DyeType checkDyeType(String hex) { + if (Constants.CRYSTAL_HEXES.contains(hex)) { + return DyeType.CRYSTAL; + } + if (Constants.FAIRY_HEXES.contains(hex)) { + return DyeType.FAIRY; + } + if (Constants.OG_FAIRY_HEXES.contains(hex)) { + return DyeType.OG_FAIRY; + } + if (Constants.SPOOK.contains(hex)) { + return DyeType.SPOOK; + } + if (Constants.GLITCHED.contains(hex)) { + return DyeType.GLITCHED; + } + return DyeType.EXOTIC; + } + + public static boolean intendedDyed(NbtCompound ItemData) { + return ItemData.getCompound("ExtraAttributes").contains("dye_item"); + } + + public enum DyeType implements StringIdentifiable { + CRYSTAL("crystal", Formatting.AQUA), + FAIRY("fairy", Formatting.LIGHT_PURPLE), + OG_FAIRY("og_fairy", Formatting.DARK_PURPLE), + SPOOK("spook", Formatting.RED), + GLITCHED("glitched", Formatting.BLUE), + EXOTIC("exotic", Formatting.GOLD); + private final String name; + private final Formatting formatting; + DyeType(String name, Formatting formatting) { + this.name = name; + this.formatting = formatting; + } + + @Override + public String asString() { + return name; + } + + public MutableText getTranslatedText() { + return Text.translatable("skyblocker.exotic." + name).formatted(formatting); + } + } +} diff --git a/src/main/java/de/hysky/skyblocker/skyblock/item/tooltip/ItemTooltip.java b/src/main/java/de/hysky/skyblocker/skyblock/item/tooltip/ItemTooltip.java new file mode 100644 index 00000000..3c5e0b33 --- /dev/null +++ b/src/main/java/de/hysky/skyblocker/skyblock/item/tooltip/ItemTooltip.java @@ -0,0 +1,485 @@ +package de.hysky.skyblocker.skyblock.item.tooltip; + +import com.google.gson.JsonObject; +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.Http; +import de.hysky.skyblocker.utils.ItemUtils; +import de.hysky.skyblocker.utils.Utils; +import de.hysky.skyblocker.utils.scheduler.Scheduler; +import net.minecraft.client.MinecraftClient; +import net.minecraft.client.item.TooltipContext; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NbtCompound; +import net.minecraft.nbt.NbtElement; +import net.minecraft.text.MutableText; +import net.minecraft.text.Text; +import net.minecraft.util.Formatting; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.net.http.HttpHeaders; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.*; +import java.util.concurrent.CompletableFuture; +import java.util.function.Predicate; + +public class ItemTooltip { + protected static final Logger LOGGER = LoggerFactory.getLogger(ItemTooltip.class.getName()); + private static final MinecraftClient client = MinecraftClient.getInstance(); + private static final SkyblockerConfig.ItemTooltip config = SkyblockerConfigManager.get().general.itemTooltip; + private static final Map API_ADDRESSES = Map.of( + InfoType.NPC, "https://hysky.de/api/npcprice", + InfoType.BAZAAR, "https://hysky.de/api/bazaar", + InfoType.LOWEST_BINS, "https://hysky.de/api/auctions/lowestbins", + InfoType.ONE_DAY_AVERAGE, "https://moulberry.codes/auction_averages_lbin/1day.json", + InfoType.THREE_DAY_AVERAGE, "https://moulberry.codes/auction_averages_lbin/3day.json", + InfoType.MOTES, "https://hysky.de/api/motesprice", + InfoType.MUSEUM, "https://hysky.de/api/museum", + InfoType.COLOR, "https://hysky.de/api/color" + ); + private static volatile boolean sentNullWarning = false; + + public static void getTooltip(ItemStack stack, TooltipContext context, List lines) { + if (!Utils.isOnSkyblock() || client.player == null) return; + + String name = getInternalNameFromNBT(stack, false); + String internalID = getInternalNameFromNBT(stack, true); + String neuName = name; + if (name == null || internalID == null) return; + + if (name.startsWith("ISSHINY_")) { + name = "SHINY_" + internalID; + neuName = internalID; + } + + if (lines.isEmpty()) { + return; + } + + int count = stack.getCount(); + boolean bazaarOpened = lines.stream().anyMatch(each -> each.getString().contains("Buy price:") || each.getString().contains("Sell price:")); + + if (InfoType.NPC.isEnabled(config)) { + if (InfoType.NPC.hasOrNullWarning(internalID)) { + lines.add(Text.literal(String.format("%-21s", "NPC Price:")) + .formatted(Formatting.YELLOW) + .append(getCoinsMessage(InfoType.NPC.data.get(internalID).getAsDouble(), count))); + } + } + + boolean bazaarExist = false; + + if (InfoType.BAZAAR.isEnabled(config) && !bazaarOpened) { + if (InfoType.BAZAAR.hasOrNullWarning(name)) { + JsonObject getItem = InfoType.BAZAAR.data.getAsJsonObject(name); + lines.add(Text.literal(String.format("%-18s", "Bazaar buy Price:")) + .formatted(Formatting.GOLD) + .append(getItem.get("buyPrice").isJsonNull() + ? Text.literal("No data").formatted(Formatting.RED) + : getCoinsMessage(getItem.get("buyPrice").getAsDouble(), count))); + lines.add(Text.literal(String.format("%-19s", "Bazaar sell Price:")) + .formatted(Formatting.GOLD) + .append(getItem.get("sellPrice").isJsonNull() + ? Text.literal("No data").formatted(Formatting.RED) + : getCoinsMessage(getItem.get("sellPrice").getAsDouble(), count))); + bazaarExist = true; + } + } + + // bazaarOpened & bazaarExist check for lbin, because Skytils keeps some bazaar item data in lbin api + boolean lbinExist = false; + if (InfoType.LOWEST_BINS.isEnabled(config) && !bazaarOpened && !bazaarExist) { + if (InfoType.LOWEST_BINS.hasOrNullWarning(name)) { + lines.add(Text.literal(String.format("%-19s", "Lowest BIN Price:")) + .formatted(Formatting.GOLD) + .append(getCoinsMessage(InfoType.LOWEST_BINS.data.get(name).getAsDouble(), count))); + lbinExist = true; + } + } + + if (SkyblockerConfigManager.get().general.itemTooltip.enableAvgBIN) { + if (InfoType.ONE_DAY_AVERAGE.data == null || InfoType.THREE_DAY_AVERAGE.data == null) { + nullWarning(); + } else { + /* + We are skipping check average prices for potions, runes + and enchanted books because there is no data for their in API. + */ + switch (internalID) { + case "PET" -> { + neuName = neuName.replaceAll("LVL_\\d*_", ""); + String[] parts = neuName.split("_"); + String type = parts[0]; + neuName = neuName.replaceAll(type + "_", ""); + neuName = neuName + "-" + type; + neuName = neuName.replace("UNCOMMON", "1") + .replace("COMMON", "0") + .replace("RARE", "2") + .replace("EPIC", "3") + .replace("LEGENDARY", "4") + .replace("MYTHIC", "5") + .replace("-", ";"); + } + case "RUNE" -> neuName = neuName.replaceAll("_(?!.*_)", ";"); + case "POTION" -> neuName = ""; + case "ATTRIBUTE_SHARD" -> + neuName = internalID + "+" + neuName.replace("SHARD-", "").replaceAll("_(?!.*_)", ";"); + default -> neuName = neuName.replace(":", "-"); + } + + if (!neuName.isEmpty() && lbinExist) { + SkyblockerConfig.Average type = config.avg; + + // "No data" line because of API not keeping old data, it causes NullPointerException + if (type == SkyblockerConfig.Average.ONE_DAY || type == SkyblockerConfig.Average.BOTH) { + lines.add( + Text.literal(String.format("%-19s", "1 Day Avg. Price:")) + .formatted(Formatting.GOLD) + .append(InfoType.ONE_DAY_AVERAGE.data.get(neuName) == null + ? Text.literal("No data").formatted(Formatting.RED) + : getCoinsMessage(InfoType.ONE_DAY_AVERAGE.data.get(neuName).getAsDouble(), count) + ) + ); + } + if (type == SkyblockerConfig.Average.THREE_DAY || type == SkyblockerConfig.Average.BOTH) { + lines.add( + Text.literal(String.format("%-19s", "3 Day Avg. Price:")) + .formatted(Formatting.GOLD) + .append(InfoType.THREE_DAY_AVERAGE.data.get(neuName) == null + ? Text.literal("No data").formatted(Formatting.RED) + : getCoinsMessage(InfoType.THREE_DAY_AVERAGE.data.get(neuName).getAsDouble(), count) + ) + ); + } + } + } + } + + if (InfoType.MOTES.isEnabled(config) && Utils.isInTheRift()) { + if (InfoType.MOTES.hasOrNullWarning(internalID)) { + lines.add(Text.literal(String.format("%-20s", "Motes Price:")) + .formatted(Formatting.LIGHT_PURPLE) + .append(getMotesMessage(InfoType.MOTES.data.get(internalID).getAsInt(), count))); + } + } + + if (InfoType.MUSEUM.isEnabled(config) && !bazaarOpened) { + String timestamp = getTimestamp(stack); + + if (InfoType.MUSEUM.hasOrNullWarning(internalID)) { + String itemCategory = InfoType.MUSEUM.data.get(internalID).getAsString(); + String format = switch (itemCategory) { + case "Weapons" -> "%-18s"; + case "Armor" -> "%-19s"; + default -> "%-20s"; + }; + lines.add(Text.literal(String.format(format, "Museum: (" + itemCategory + ")")) + .formatted(Formatting.LIGHT_PURPLE) + .append(Text.literal(timestamp).formatted(Formatting.RED))); + } else if (!timestamp.isEmpty()) { + lines.add(Text.literal(String.format("%-21s", "Obtained: ")) + .formatted(Formatting.LIGHT_PURPLE) + .append(Text.literal(timestamp).formatted(Formatting.RED))); + } + } + + if (InfoType.COLOR.isEnabled(config)) { + if (InfoType.COLOR.data == null) { + nullWarning(); + } else if (stack.getNbt() != null) { + final NbtElement color = stack.getNbt().getCompound("display").get("color"); + + if (color != null) { + String colorHex = String.format("%06X", Integer.parseInt(color.asString())); + String expectedHex = ExoticTooltip.getExpectedHex(internalID); + + boolean correctLine = false; + for (Text text : lines) { + String existingTooltip = text.getString() + " "; + if (existingTooltip.startsWith("Color: ")) { + correctLine = true; + + addExoticTooltip(lines, internalID, stack.getNbt(), colorHex, expectedHex, existingTooltip); + break; + } + } + + if (!correctLine) { + addExoticTooltip(lines, internalID, stack.getNbt(), colorHex, expectedHex, ""); + } + } + } + } + } + + private static void addExoticTooltip(List lines, String internalID, NbtCompound nbt, String colorHex, String expectedHex, String existingTooltip) { + if (expectedHex != null && !colorHex.equalsIgnoreCase(expectedHex) && !ExoticTooltip.isException(internalID, colorHex) && !ExoticTooltip.intendedDyed(nbt)) { + final ExoticTooltip.DyeType type = ExoticTooltip.checkDyeType(colorHex); + lines.add(1, Text.literal(existingTooltip + Formatting.DARK_GRAY + "(").append(type.getTranslatedText()).append(Formatting.DARK_GRAY + ")")); + } + } + + private static void nullWarning() { + if (!sentNullWarning && client.player != null) { + client.player.sendMessage(Constants.PREFIX.get().append(Text.translatable("skyblocker.itemTooltip.nullMessage")), false); + sentNullWarning = true; + } + } + + /** + * this method converts the "timestamp" variable into the same date format as Hypixel represents it in the museum. + * Currently, there are two types of timestamps the legacy which is built like this + * "dd/MM/yy hh:mm" ("25/04/20 16:38") and the current which is built like this + * "MM/dd/yy hh:mm aa" ("12/24/20 11:08 PM"). Since Hypixel transforms the two formats into one format without + * taking into account of their formats, we do the same. The final result looks like this + * "MMMM dd, yyyy" (December 24, 2020). + * Since the legacy format has a 25 as "month" SimpleDateFormat converts the 25 into 2 years and 1 month and makes + * "25/04/20 16:38" -> "January 04, 2022" instead of "April 25, 2020". + * This causes the museum rank to be much worse than it should be. + * + * @param stack the item under the pointer + * @return if the item have a "Timestamp" it will be shown formated on the tooltip + */ + public static String getTimestamp(ItemStack stack) { + NbtCompound ea = ItemUtils.getExtraAttributes(stack); + + if (ea != null && ea.contains("timestamp", 8)) { + SimpleDateFormat nbtFormat = new SimpleDateFormat("MM/dd/yy"); + + try { + Date date = nbtFormat.parse(ea.getString("timestamp")); + SimpleDateFormat skyblockerFormat = new SimpleDateFormat("MMMM dd, yyyy", Locale.ENGLISH); + return skyblockerFormat.format(date); + } catch (ParseException e) { + LOGGER.warn("[Skyblocker-tooltip] getTimestamp", e); + } + } + + return ""; + } + + public static String getInternalNameFromNBT(ItemStack stack, boolean internalIDOnly) { + NbtCompound ea = ItemUtils.getExtraAttributes(stack); + + if (ea == null || !ea.contains(ItemUtils.ID, 8)) { + return null; + } + String internalName = ea.getString(ItemUtils.ID); + + if (internalIDOnly) { + return internalName; + } + + // Transformation to API format. + if (ea.contains("is_shiny")) { + return "ISSHINY_" + internalName; + } + + switch (internalName) { + case "ENCHANTED_BOOK" -> { + if (ea.contains("enchantments")) { + NbtCompound enchants = ea.getCompound("enchantments"); + Optional firstEnchant = enchants.getKeys().stream().findFirst(); + String enchant = firstEnchant.orElse(""); + return "ENCHANTMENT_" + enchant.toUpperCase(Locale.ENGLISH) + "_" + enchants.getInt(enchant); + } + } + case "PET" -> { + if (ea.contains("petInfo")) { + JsonObject petInfo = SkyblockerMod.GSON.fromJson(ea.getString("petInfo"), JsonObject.class); + return "LVL_1_" + petInfo.get("tier").getAsString() + "_" + petInfo.get("type").getAsString(); + } + } + case "POTION" -> { + String enhanced = ea.contains("enhanced") ? "_ENHANCED" : ""; + String extended = ea.contains("extended") ? "_EXTENDED" : ""; + String splash = ea.contains("splash") ? "_SPLASH" : ""; + if (ea.contains("potion") && ea.contains("potion_level")) { + return (ea.getString("potion") + "_" + internalName + "_" + ea.getInt("potion_level") + + enhanced + extended + splash).toUpperCase(Locale.ENGLISH); + } + } + case "RUNE" -> { + if (ea.contains("runes")) { + NbtCompound runes = ea.getCompound("runes"); + Optional firstRunes = runes.getKeys().stream().findFirst(); + String rune = firstRunes.orElse(""); + return rune.toUpperCase(Locale.ENGLISH) + "_RUNE_" + runes.getInt(rune); + } + } + case "ATTRIBUTE_SHARD" -> { + if (ea.contains("attributes")) { + NbtCompound shards = ea.getCompound("attributes"); + Optional firstShards = shards.getKeys().stream().findFirst(); + String shard = firstShards.orElse(""); + return internalName + "-" + shard.toUpperCase(Locale.ENGLISH) + "_" + shards.getInt(shard); + } + } + } + return internalName; + } + + + private static Text getCoinsMessage(double price, int count) { + // Format the price string once + String priceString = String.format(Locale.ENGLISH, "%1$,.1f", price); + + // If count is 1, return a simple message + if (count == 1) { + return Text.literal(priceString + " Coins").formatted(Formatting.DARK_AQUA); + } + + // If count is greater than 1, include the "each" information + String priceStringTotal = String.format(Locale.ENGLISH, "%1$,.1f", price * count); + MutableText message = Text.literal(priceStringTotal + " Coins ").formatted(Formatting.DARK_AQUA); + message.append(Text.literal("(" + priceString + " each)").formatted(Formatting.GRAY)); + + return message; + } + + private static Text getMotesMessage(int price, int count) { + float motesMultiplier = SkyblockerConfigManager.get().locations.rift.mcGrubberStacks * 0.05f + 1; + + // Calculate the total price + int totalPrice = price * count; + String totalPriceString = String.format(Locale.ENGLISH, "%1$,.1f", totalPrice * motesMultiplier); + + // If count is 1, return a simple message + if (count == 1) { + return Text.literal(totalPriceString.replace(".0", "") + " Motes").formatted(Formatting.DARK_AQUA); + } + + // If count is greater than 1, include the "each" information + String eachPriceString = String.format(Locale.ENGLISH, "%1$,.1f", price * motesMultiplier); + MutableText message = Text.literal(totalPriceString.replace(".0", "") + " Motes ").formatted(Formatting.DARK_AQUA); + message.append(Text.literal("(" + eachPriceString.replace(".0", "") + " each)").formatted(Formatting.GRAY)); + + return message; + } + + // If these options is true beforehand, the client will get first data of these options while loading. + // After then, it will only fetch the data if it is on Skyblock. + public static int minute = -1; + + public static void init() { + Scheduler.INSTANCE.scheduleCyclic(() -> { + if (!Utils.isOnSkyblock() && 0 < minute++) { + sentNullWarning = false; + return; + } + + List> futureList = new ArrayList<>(); + + if (InfoType.NPC.isEnabled(config) && InfoType.NPC.data == null) + futureList.add(CompletableFuture.runAsync(() -> downloadPrices(InfoType.NPC))); + + if (InfoType.BAZAAR.isEnabled(config) || SkyblockerConfigManager.get().locations.dungeons.dungeonChestProfit.enableProfitCalculator) + futureList.add(CompletableFuture.runAsync(() -> downloadPrices(InfoType.BAZAAR))); + + if (InfoType.LOWEST_BINS.isEnabled(config) || SkyblockerConfigManager.get().locations.dungeons.dungeonChestProfit.enableProfitCalculator) + futureList.add(CompletableFuture.runAsync(() -> downloadPrices(InfoType.LOWEST_BINS))); + + if (config.enableAvgBIN) { + SkyblockerConfig.Average type = config.avg; + + if (type == SkyblockerConfig.Average.BOTH || InfoType.ONE_DAY_AVERAGE.data == null || InfoType.THREE_DAY_AVERAGE.data == null || minute % 5 == 0) { + futureList.add(CompletableFuture.runAsync(() -> { + downloadPrices(InfoType.ONE_DAY_AVERAGE); + downloadPrices(InfoType.THREE_DAY_AVERAGE); + })); + } else if (type == SkyblockerConfig.Average.ONE_DAY) { + futureList.add(CompletableFuture.runAsync(() -> downloadPrices(InfoType.ONE_DAY_AVERAGE))); + } else if (type == SkyblockerConfig.Average.THREE_DAY) { + futureList.add(CompletableFuture.runAsync(() -> downloadPrices(InfoType.THREE_DAY_AVERAGE))); + } + } + + if (InfoType.MOTES.isEnabled(config) && InfoType.MOTES.data == null) + futureList.add(CompletableFuture.runAsync(() -> downloadPrices(InfoType.MOTES))); + + if (InfoType.MUSEUM.isEnabled(config) && InfoType.MUSEUM.data == null) + futureList.add(CompletableFuture.runAsync(() -> downloadPrices(InfoType.MUSEUM))); + + if (InfoType.COLOR.isEnabled(config) && InfoType.COLOR.data == null) + futureList.add(CompletableFuture.runAsync(() -> downloadPrices(InfoType.COLOR))); + + minute++; + CompletableFuture.allOf(futureList.toArray(CompletableFuture[]::new)) + .whenComplete((unused, throwable) -> sentNullWarning = false); + }, 1200, true); + } + + private static void downloadPrices(InfoType type) { + try { + String url = API_ADDRESSES.get(type); + + if (type.cacheable) { + HttpHeaders headers = Http.sendHeadRequest(url); + long combinedHash = Http.getEtag(headers).hashCode() + Http.getLastModified(headers).hashCode(); + + switch (type) { + case NPC, MOTES, MUSEUM, COLOR: + if (type.hash == combinedHash) return; + else type.hash = combinedHash; + } + } + + type.setData(SkyblockerMod.GSON.fromJson(Http.sendGetRequest(url), JsonObject.class)); + } catch (Exception e) { + LOGGER.warn("[Skyblocker] Failed to download " + type + " prices!", e); + } + } + + public static JsonObject getBazaarPrices() { + return InfoType.BAZAAR.data; + } + + public static JsonObject getLBINPrices() { + return InfoType.LOWEST_BINS.data; + } + + public enum InfoType { + NPC(itemTooltip -> itemTooltip.enableNPCPrice, true), + BAZAAR(itemTooltip -> itemTooltip.enableBazaarPrice, false), + LOWEST_BINS(itemTooltip -> itemTooltip.enableLowestBIN, false), + ONE_DAY_AVERAGE(itemTooltip -> itemTooltip.enableAvgBIN, false), + THREE_DAY_AVERAGE(itemTooltip -> itemTooltip.enableAvgBIN, false), + MOTES(itemTooltip -> itemTooltip.enableMotesPrice, true), + MUSEUM(itemTooltip -> itemTooltip.enableMuseumDate, true), + COLOR(itemTooltip -> itemTooltip.enableExoticCheck, true); + + private final Predicate enabledPredicate; + private JsonObject data; + private final boolean cacheable; + private long hash; + + InfoType(Predicate enabledPredicate, boolean cacheable) { + this(enabledPredicate, null, false); + } + + InfoType(Predicate enabledPredicate, JsonObject data, boolean cacheable) { + this.enabledPredicate = enabledPredicate; + this.data = data; + this.cacheable = cacheable; + } + + public boolean isEnabled(SkyblockerConfig.ItemTooltip config) { + return enabledPredicate.test(config); + } + + public boolean hasOrNullWarning(String memberName) { + if (data == null) { + nullWarning(); + return false; + } else return data.has(memberName); + } + + public void setData(JsonObject data) { + this.data = data; + } + } +} \ No newline at end of file diff --git a/src/main/java/de/hysky/skyblocker/utils/Utils.java b/src/main/java/de/hysky/skyblocker/utils/Utils.java index 0f87e8c4..b1a347f9 100644 --- a/src/main/java/de/hysky/skyblocker/utils/Utils.java +++ b/src/main/java/de/hysky/skyblocker/utils/Utils.java @@ -4,7 +4,7 @@ import com.google.gson.JsonObject; import com.google.gson.JsonParser; import de.hysky.skyblocker.events.SkyblockEvents; import de.hysky.skyblocker.skyblock.item.MuseumItemCache; -import de.hysky.skyblocker.skyblock.item.PriceInfoTooltip; +import de.hysky.skyblocker.skyblock.item.tooltip.ItemTooltip; import de.hysky.skyblocker.skyblock.rift.TheRift; import de.hysky.skyblocker.utils.scheduler.MessageScheduler; import it.unimi.dsi.fastutil.objects.ObjectArrayList; @@ -180,7 +180,7 @@ public class Utils { if (!isOnSkyblock) { if (!isInjected) { isInjected = true; - ItemTooltipCallback.EVENT.register(PriceInfoTooltip::getTooltip); + ItemTooltipCallback.EVENT.register(ItemTooltip::getTooltip); } isOnSkyblock = true; SkyblockEvents.JOIN.invoker().onSkyblockJoin(); -- cgit From b251cb353b85fa48e59ed35b3c7f866f6f403a93 Mon Sep 17 00:00:00 2001 From: Kevinthegreat <92656833+kevinthegreat1@users.noreply.github.com> Date: Sun, 29 Oct 2023 02:09:15 -0400 Subject: Add TooltipInfoType --- .../skyblock/dungeon/DungeonChestProfit.java | 5 +- .../skyblock/item/tooltip/ExoticTooltip.java | 5 +- .../skyblock/item/tooltip/ItemTooltip.java | 238 ++++++--------------- .../skyblock/item/tooltip/TooltipInfoType.java | 154 +++++++++++++ 4 files changed, 224 insertions(+), 178 deletions(-) create mode 100644 src/main/java/de/hysky/skyblocker/skyblock/item/tooltip/TooltipInfoType.java diff --git a/src/main/java/de/hysky/skyblocker/skyblock/dungeon/DungeonChestProfit.java b/src/main/java/de/hysky/skyblocker/skyblock/dungeon/DungeonChestProfit.java index 84d19f73..1e889af3 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/dungeon/DungeonChestProfit.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/dungeon/DungeonChestProfit.java @@ -5,6 +5,7 @@ import de.hysky.skyblocker.config.SkyblockerConfig; import de.hysky.skyblocker.config.SkyblockerConfigManager; import de.hysky.skyblocker.mixin.accessor.ScreenAccessor; import de.hysky.skyblocker.skyblock.item.tooltip.ItemTooltip; +import de.hysky.skyblocker.skyblock.item.tooltip.TooltipInfoType; import de.hysky.skyblocker.utils.Utils; import it.unimi.dsi.fastutil.ints.IntBooleanPair; import net.fabricmc.fabric.api.client.screen.v1.ScreenEvents; @@ -128,8 +129,8 @@ public class DungeonChestProfit { * was based on complete data. */ private static IntBooleanPair getItemPrice(String id) { - JsonObject bazaarPrices = ItemTooltip.getBazaarPrices(); - JsonObject lbinPrices = ItemTooltip.getLBINPrices(); + JsonObject bazaarPrices = TooltipInfoType.BAZAAR.getData(); + JsonObject lbinPrices = TooltipInfoType.LOWEST_BINS.getData(); if (bazaarPrices == null || lbinPrices == null) return IntBooleanPair.of(0, false); diff --git a/src/main/java/de/hysky/skyblocker/skyblock/item/tooltip/ExoticTooltip.java b/src/main/java/de/hysky/skyblocker/skyblock/item/tooltip/ExoticTooltip.java index 8f701758..55a91392 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/item/tooltip/ExoticTooltip.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/item/tooltip/ExoticTooltip.java @@ -9,10 +9,7 @@ import net.minecraft.util.StringIdentifiable; public class ExoticTooltip { public static String getExpectedHex(String id) { - if (!ItemTooltip.colorJson.has(id)) { - return null; - } - String color = ItemTooltip.colorJson.get(id).getAsString(); + String color = TooltipInfoType.COLOR.getData().get(id).getAsString(); if (color != null) { String[] RGBValues = color.split(","); return String.format("%02X%02X%02X", Integer.parseInt(RGBValues[0]), Integer.parseInt(RGBValues[1]), Integer.parseInt(RGBValues[2])); diff --git a/src/main/java/de/hysky/skyblocker/skyblock/item/tooltip/ItemTooltip.java b/src/main/java/de/hysky/skyblocker/skyblock/item/tooltip/ItemTooltip.java index 3c5e0b33..e050aff5 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/item/tooltip/ItemTooltip.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/item/tooltip/ItemTooltip.java @@ -5,7 +5,6 @@ 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.Http; import de.hysky.skyblocker.utils.ItemUtils; import de.hysky.skyblocker.utils.Utils; import de.hysky.skyblocker.utils.scheduler.Scheduler; @@ -20,27 +19,15 @@ import net.minecraft.util.Formatting; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.net.http.HttpHeaders; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.*; import java.util.concurrent.CompletableFuture; -import java.util.function.Predicate; public class ItemTooltip { protected static final Logger LOGGER = LoggerFactory.getLogger(ItemTooltip.class.getName()); private static final MinecraftClient client = MinecraftClient.getInstance(); - private static final SkyblockerConfig.ItemTooltip config = SkyblockerConfigManager.get().general.itemTooltip; - private static final Map API_ADDRESSES = Map.of( - InfoType.NPC, "https://hysky.de/api/npcprice", - InfoType.BAZAAR, "https://hysky.de/api/bazaar", - InfoType.LOWEST_BINS, "https://hysky.de/api/auctions/lowestbins", - InfoType.ONE_DAY_AVERAGE, "https://moulberry.codes/auction_averages_lbin/1day.json", - InfoType.THREE_DAY_AVERAGE, "https://moulberry.codes/auction_averages_lbin/3day.json", - InfoType.MOTES, "https://hysky.de/api/motesprice", - InfoType.MUSEUM, "https://hysky.de/api/museum", - InfoType.COLOR, "https://hysky.de/api/color" - ); + protected static final SkyblockerConfig.ItemTooltip config = SkyblockerConfigManager.get().general.itemTooltip; private static volatile boolean sentNullWarning = false; public static void getTooltip(ItemStack stack, TooltipContext context, List lines) { @@ -63,46 +50,40 @@ public class ItemTooltip { int count = stack.getCount(); boolean bazaarOpened = lines.stream().anyMatch(each -> each.getString().contains("Buy price:") || each.getString().contains("Sell price:")); - if (InfoType.NPC.isEnabled(config)) { - if (InfoType.NPC.hasOrNullWarning(internalID)) { - lines.add(Text.literal(String.format("%-21s", "NPC Price:")) - .formatted(Formatting.YELLOW) - .append(getCoinsMessage(InfoType.NPC.data.get(internalID).getAsDouble(), count))); - } + if (TooltipInfoType.NPC.isTooltipEnabledAndHasOrNullWarning(internalID)) { + lines.add(Text.literal(String.format("%-21s", "NPC Price:")) + .formatted(Formatting.YELLOW) + .append(getCoinsMessage(TooltipInfoType.NPC.getData().get(internalID).getAsDouble(), count))); } boolean bazaarExist = false; - if (InfoType.BAZAAR.isEnabled(config) && !bazaarOpened) { - if (InfoType.BAZAAR.hasOrNullWarning(name)) { - JsonObject getItem = InfoType.BAZAAR.data.getAsJsonObject(name); - lines.add(Text.literal(String.format("%-18s", "Bazaar buy Price:")) - .formatted(Formatting.GOLD) - .append(getItem.get("buyPrice").isJsonNull() - ? Text.literal("No data").formatted(Formatting.RED) - : getCoinsMessage(getItem.get("buyPrice").getAsDouble(), count))); - lines.add(Text.literal(String.format("%-19s", "Bazaar sell Price:")) - .formatted(Formatting.GOLD) - .append(getItem.get("sellPrice").isJsonNull() - ? Text.literal("No data").formatted(Formatting.RED) - : getCoinsMessage(getItem.get("sellPrice").getAsDouble(), count))); - bazaarExist = true; - } + if (TooltipInfoType.BAZAAR.isTooltipEnabledAndHasOrNullWarning(name) && !bazaarOpened) { + JsonObject getItem = TooltipInfoType.BAZAAR.getData().getAsJsonObject(name); + lines.add(Text.literal(String.format("%-18s", "Bazaar buy Price:")) + .formatted(Formatting.GOLD) + .append(getItem.get("buyPrice").isJsonNull() + ? Text.literal("No data").formatted(Formatting.RED) + : getCoinsMessage(getItem.get("buyPrice").getAsDouble(), count))); + lines.add(Text.literal(String.format("%-19s", "Bazaar sell Price:")) + .formatted(Formatting.GOLD) + .append(getItem.get("sellPrice").isJsonNull() + ? Text.literal("No data").formatted(Formatting.RED) + : getCoinsMessage(getItem.get("sellPrice").getAsDouble(), count))); + bazaarExist = true; } // bazaarOpened & bazaarExist check for lbin, because Skytils keeps some bazaar item data in lbin api boolean lbinExist = false; - if (InfoType.LOWEST_BINS.isEnabled(config) && !bazaarOpened && !bazaarExist) { - if (InfoType.LOWEST_BINS.hasOrNullWarning(name)) { - lines.add(Text.literal(String.format("%-19s", "Lowest BIN Price:")) - .formatted(Formatting.GOLD) - .append(getCoinsMessage(InfoType.LOWEST_BINS.data.get(name).getAsDouble(), count))); - lbinExist = true; - } + if (TooltipInfoType.LOWEST_BINS.isTooltipEnabledAndHasOrNullWarning(name) && !bazaarOpened && !bazaarExist) { + lines.add(Text.literal(String.format("%-19s", "Lowest BIN Price:")) + .formatted(Formatting.GOLD) + .append(getCoinsMessage(TooltipInfoType.LOWEST_BINS.getData().get(name).getAsDouble(), count))); + lbinExist = true; } if (SkyblockerConfigManager.get().general.itemTooltip.enableAvgBIN) { - if (InfoType.ONE_DAY_AVERAGE.data == null || InfoType.THREE_DAY_AVERAGE.data == null) { + if (TooltipInfoType.ONE_DAY_AVERAGE.getData() == null || TooltipInfoType.THREE_DAY_AVERAGE.getData() == null) { nullWarning(); } else { /* @@ -139,9 +120,9 @@ public class ItemTooltip { lines.add( Text.literal(String.format("%-19s", "1 Day Avg. Price:")) .formatted(Formatting.GOLD) - .append(InfoType.ONE_DAY_AVERAGE.data.get(neuName) == null + .append(TooltipInfoType.ONE_DAY_AVERAGE.getData().get(neuName) == null ? Text.literal("No data").formatted(Formatting.RED) - : getCoinsMessage(InfoType.ONE_DAY_AVERAGE.data.get(neuName).getAsDouble(), count) + : getCoinsMessage(TooltipInfoType.ONE_DAY_AVERAGE.getData().get(neuName).getAsDouble(), count) ) ); } @@ -149,9 +130,9 @@ public class ItemTooltip { lines.add( Text.literal(String.format("%-19s", "3 Day Avg. Price:")) .formatted(Formatting.GOLD) - .append(InfoType.THREE_DAY_AVERAGE.data.get(neuName) == null + .append(TooltipInfoType.THREE_DAY_AVERAGE.getData().get(neuName) == null ? Text.literal("No data").formatted(Formatting.RED) - : getCoinsMessage(InfoType.THREE_DAY_AVERAGE.data.get(neuName).getAsDouble(), count) + : getCoinsMessage(TooltipInfoType.THREE_DAY_AVERAGE.getData().get(neuName).getAsDouble(), count) ) ); } @@ -159,19 +140,17 @@ public class ItemTooltip { } } - if (InfoType.MOTES.isEnabled(config) && Utils.isInTheRift()) { - if (InfoType.MOTES.hasOrNullWarning(internalID)) { - lines.add(Text.literal(String.format("%-20s", "Motes Price:")) - .formatted(Formatting.LIGHT_PURPLE) - .append(getMotesMessage(InfoType.MOTES.data.get(internalID).getAsInt(), count))); - } + if (TooltipInfoType.MOTES.isTooltipEnabledAndHasOrNullWarning(internalID)) { + lines.add(Text.literal(String.format("%-20s", "Motes Price:")) + .formatted(Formatting.LIGHT_PURPLE) + .append(getMotesMessage(TooltipInfoType.MOTES.getData().get(internalID).getAsInt(), count))); } - if (InfoType.MUSEUM.isEnabled(config) && !bazaarOpened) { + if (TooltipInfoType.MUSEUM.isTooltipEnabled() && !bazaarOpened) { String timestamp = getTimestamp(stack); - if (InfoType.MUSEUM.hasOrNullWarning(internalID)) { - String itemCategory = InfoType.MUSEUM.data.get(internalID).getAsString(); + if (TooltipInfoType.MUSEUM.hasOrNullWarning(internalID)) { + String itemCategory = TooltipInfoType.MUSEUM.getData().get(internalID).getAsString(); String format = switch (itemCategory) { case "Weapons" -> "%-18s"; case "Armor" -> "%-19s"; @@ -187,31 +166,27 @@ public class ItemTooltip { } } - if (InfoType.COLOR.isEnabled(config)) { - if (InfoType.COLOR.data == null) { - nullWarning(); - } else if (stack.getNbt() != null) { - final NbtElement color = stack.getNbt().getCompound("display").get("color"); - - if (color != null) { - String colorHex = String.format("%06X", Integer.parseInt(color.asString())); - String expectedHex = ExoticTooltip.getExpectedHex(internalID); - - boolean correctLine = false; - for (Text text : lines) { - String existingTooltip = text.getString() + " "; - if (existingTooltip.startsWith("Color: ")) { - correctLine = true; - - addExoticTooltip(lines, internalID, stack.getNbt(), colorHex, expectedHex, existingTooltip); - break; - } - } + if (TooltipInfoType.COLOR.isTooltipEnabledAndHasOrNullWarning(internalID) && stack.getNbt() != null) { + final NbtElement color = stack.getNbt().getCompound("display").get("color"); + + if (color != null) { + String colorHex = String.format("%06X", Integer.parseInt(color.asString())); + String expectedHex = ExoticTooltip.getExpectedHex(internalID); - if (!correctLine) { - addExoticTooltip(lines, internalID, stack.getNbt(), colorHex, expectedHex, ""); + boolean correctLine = false; + for (Text text : lines) { + String existingTooltip = text.getString() + " "; + if (existingTooltip.startsWith("Color: ")) { + correctLine = true; + + addExoticTooltip(lines, internalID, stack.getNbt(), colorHex, expectedHex, existingTooltip); + break; } } + + if (!correctLine) { + addExoticTooltip(lines, internalID, stack.getNbt(), colorHex, expectedHex, ""); + } } } } @@ -223,7 +198,7 @@ public class ItemTooltip { } } - private static void nullWarning() { + public static void nullWarning() { if (!sentNullWarning && client.player != null) { client.player.sendMessage(Constants.PREFIX.get().append(Text.translatable("skyblocker.itemTooltip.nullMessage")), false); sentNullWarning = true; @@ -262,6 +237,7 @@ public class ItemTooltip { return ""; } + // TODO What in the world is this? public static String getInternalNameFromNBT(ItemStack stack, boolean internalIDOnly) { NbtCompound ea = ItemUtils.getExtraAttributes(stack); @@ -374,112 +350,30 @@ public class ItemTooltip { List> futureList = new ArrayList<>(); - if (InfoType.NPC.isEnabled(config) && InfoType.NPC.data == null) - futureList.add(CompletableFuture.runAsync(() -> downloadPrices(InfoType.NPC))); - - if (InfoType.BAZAAR.isEnabled(config) || SkyblockerConfigManager.get().locations.dungeons.dungeonChestProfit.enableProfitCalculator) - futureList.add(CompletableFuture.runAsync(() -> downloadPrices(InfoType.BAZAAR))); - - if (InfoType.LOWEST_BINS.isEnabled(config) || SkyblockerConfigManager.get().locations.dungeons.dungeonChestProfit.enableProfitCalculator) - futureList.add(CompletableFuture.runAsync(() -> downloadPrices(InfoType.LOWEST_BINS))); + TooltipInfoType.NPC.downloadIfEnabled(futureList); + TooltipInfoType.BAZAAR.downloadIfEnabled(futureList); + TooltipInfoType.LOWEST_BINS.downloadIfEnabled(futureList); if (config.enableAvgBIN) { SkyblockerConfig.Average type = config.avg; - if (type == SkyblockerConfig.Average.BOTH || InfoType.ONE_DAY_AVERAGE.data == null || InfoType.THREE_DAY_AVERAGE.data == null || minute % 5 == 0) { - futureList.add(CompletableFuture.runAsync(() -> { - downloadPrices(InfoType.ONE_DAY_AVERAGE); - downloadPrices(InfoType.THREE_DAY_AVERAGE); - })); + if (type == SkyblockerConfig.Average.BOTH || TooltipInfoType.ONE_DAY_AVERAGE.getData() == null || TooltipInfoType.THREE_DAY_AVERAGE.getData() == null || minute % 5 == 0) { + TooltipInfoType.ONE_DAY_AVERAGE.download(futureList); + TooltipInfoType.THREE_DAY_AVERAGE.download(futureList); } else if (type == SkyblockerConfig.Average.ONE_DAY) { - futureList.add(CompletableFuture.runAsync(() -> downloadPrices(InfoType.ONE_DAY_AVERAGE))); + TooltipInfoType.ONE_DAY_AVERAGE.download(futureList); } else if (type == SkyblockerConfig.Average.THREE_DAY) { - futureList.add(CompletableFuture.runAsync(() -> downloadPrices(InfoType.THREE_DAY_AVERAGE))); + TooltipInfoType.THREE_DAY_AVERAGE.download(futureList); } } - if (InfoType.MOTES.isEnabled(config) && InfoType.MOTES.data == null) - futureList.add(CompletableFuture.runAsync(() -> downloadPrices(InfoType.MOTES))); - - if (InfoType.MUSEUM.isEnabled(config) && InfoType.MUSEUM.data == null) - futureList.add(CompletableFuture.runAsync(() -> downloadPrices(InfoType.MUSEUM))); - - if (InfoType.COLOR.isEnabled(config) && InfoType.COLOR.data == null) - futureList.add(CompletableFuture.runAsync(() -> downloadPrices(InfoType.COLOR))); + TooltipInfoType.MOTES.downloadIfEnabled(futureList); + TooltipInfoType.MUSEUM.downloadIfEnabled(futureList); + TooltipInfoType.COLOR.downloadIfEnabled(futureList); minute++; CompletableFuture.allOf(futureList.toArray(CompletableFuture[]::new)) .whenComplete((unused, throwable) -> sentNullWarning = false); }, 1200, true); } - - private static void downloadPrices(InfoType type) { - try { - String url = API_ADDRESSES.get(type); - - if (type.cacheable) { - HttpHeaders headers = Http.sendHeadRequest(url); - long combinedHash = Http.getEtag(headers).hashCode() + Http.getLastModified(headers).hashCode(); - - switch (type) { - case NPC, MOTES, MUSEUM, COLOR: - if (type.hash == combinedHash) return; - else type.hash = combinedHash; - } - } - - type.setData(SkyblockerMod.GSON.fromJson(Http.sendGetRequest(url), JsonObject.class)); - } catch (Exception e) { - LOGGER.warn("[Skyblocker] Failed to download " + type + " prices!", e); - } - } - - public static JsonObject getBazaarPrices() { - return InfoType.BAZAAR.data; - } - - public static JsonObject getLBINPrices() { - return InfoType.LOWEST_BINS.data; - } - - public enum InfoType { - NPC(itemTooltip -> itemTooltip.enableNPCPrice, true), - BAZAAR(itemTooltip -> itemTooltip.enableBazaarPrice, false), - LOWEST_BINS(itemTooltip -> itemTooltip.enableLowestBIN, false), - ONE_DAY_AVERAGE(itemTooltip -> itemTooltip.enableAvgBIN, false), - THREE_DAY_AVERAGE(itemTooltip -> itemTooltip.enableAvgBIN, false), - MOTES(itemTooltip -> itemTooltip.enableMotesPrice, true), - MUSEUM(itemTooltip -> itemTooltip.enableMuseumDate, true), - COLOR(itemTooltip -> itemTooltip.enableExoticCheck, true); - - private final Predicate enabledPredicate; - private JsonObject data; - private final boolean cacheable; - private long hash; - - InfoType(Predicate enabledPredicate, boolean cacheable) { - this(enabledPredicate, null, false); - } - - InfoType(Predicate enabledPredicate, JsonObject data, boolean cacheable) { - this.enabledPredicate = enabledPredicate; - this.data = data; - this.cacheable = cacheable; - } - - public boolean isEnabled(SkyblockerConfig.ItemTooltip config) { - return enabledPredicate.test(config); - } - - public boolean hasOrNullWarning(String memberName) { - if (data == null) { - nullWarning(); - return false; - } else return data.has(memberName); - } - - public void setData(JsonObject data) { - this.data = data; - } - } } \ No newline at end of file diff --git a/src/main/java/de/hysky/skyblocker/skyblock/item/tooltip/TooltipInfoType.java b/src/main/java/de/hysky/skyblocker/skyblock/item/tooltip/TooltipInfoType.java new file mode 100644 index 00000000..ddc8bd1c --- /dev/null +++ b/src/main/java/de/hysky/skyblocker/skyblock/item/tooltip/TooltipInfoType.java @@ -0,0 +1,154 @@ +package de.hysky.skyblocker.skyblock.item.tooltip; + +import com.google.gson.JsonObject; +import de.hysky.skyblocker.SkyblockerMod; +import de.hysky.skyblocker.config.SkyblockerConfig; +import de.hysky.skyblocker.config.SkyblockerConfigManager; +import de.hysky.skyblocker.utils.Http; +import de.hysky.skyblocker.utils.Utils; +import org.jetbrains.annotations.Nullable; + +import java.net.http.HttpHeaders; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import java.util.function.Predicate; + +public enum TooltipInfoType implements Runnable { + NPC("https://hysky.de/api/npcprice", itemTooltip -> itemTooltip.enableNPCPrice, true), + BAZAAR("https://hysky.de/api/bazaar", itemTooltip -> itemTooltip.enableBazaarPrice || SkyblockerConfigManager.get().locations.dungeons.dungeonChestProfit.enableProfitCalculator, itemTooltip -> itemTooltip.enableBazaarPrice, false), + LOWEST_BINS("https://hysky.de/api/auctions/lowestbins", itemTooltip -> itemTooltip.enableLowestBIN || SkyblockerConfigManager.get().locations.dungeons.dungeonChestProfit.enableProfitCalculator, itemTooltip -> itemTooltip.enableLowestBIN, false), + ONE_DAY_AVERAGE("https://moulberry.codes/auction_averages_lbin/1day.json", itemTooltip -> itemTooltip.enableAvgBIN, false), + THREE_DAY_AVERAGE("https://moulberry.codes/auction_averages_lbin/3day.json", itemTooltip -> itemTooltip.enableAvgBIN, false), + MOTES("https://hysky.de/api/motesprice", itemTooltip -> itemTooltip.enableMotesPrice, itemTooltip -> itemTooltip.enableMotesPrice && Utils.isInTheRift(), true), + MUSEUM("https://hysky.de/api/museum", itemTooltip -> itemTooltip.enableMuseumDate, true), + COLOR("https://hysky.de/api/color", itemTooltip -> itemTooltip.enableExoticCheck, true); + + private final String address; + private final Predicate dataEnabled; + private final Predicate tooltipEnabled; + private JsonObject data; + private final boolean cacheable; + private long hash; + + /** + * @param address the address to download the data from + * @param enabled the predicate to check if the data should be downloaded and the tooltip should be shown + * @param cacheable whether the data should be cached + */ + TooltipInfoType(String address, Predicate enabled, boolean cacheable) { + this(address, enabled, enabled, null, cacheable); + } + + /** + * @param address the address to download the data from + * @param dataEnabled the predicate to check if data should be downloaded + * @param tooltipEnabled the predicate to check if the tooltip should be shown + * @param cacheable whether the data should be cached + */ + TooltipInfoType(String address, Predicate dataEnabled, Predicate tooltipEnabled, boolean cacheable) { + this(address, dataEnabled, tooltipEnabled, null, cacheable); + } + + /** + * @param address the address to download the data from + * @param dataEnabled the predicate to check if data should be downloaded + * @param tooltipEnabled the predicate to check if the tooltip should be shown + * @param data the data + * @param cacheable whether the data should be cached + */ + TooltipInfoType(String address, Predicate dataEnabled, Predicate tooltipEnabled, @Nullable JsonObject data, boolean cacheable) { + this.address = address; + this.dataEnabled = dataEnabled; + this.tooltipEnabled = tooltipEnabled; + this.data = data; + this.cacheable = cacheable; + } + + /** + * @return whether the data should be downloaded + */ + private boolean isDataEnabled() { + return dataEnabled.test(ItemTooltip.config); + } + + /** + * @return whether the tooltip should be shown + */ + public boolean isTooltipEnabled() { + return tooltipEnabled.test(ItemTooltip.config); + } + + public JsonObject getData() { + return data; + } + + public void setData(JsonObject data) { + this.data = data; + } + + /** + * Checks if the data has the given member name and sends a warning message if data is null. + * + * @param memberName the member name to check + * @return whether the data has the given member name or not + */ + public boolean hasOrNullWarning(String memberName) { + if (data == null) { + ItemTooltip.nullWarning(); + return false; + } else return data.has(memberName); + } + + /** + * Checks if the tooltip is enabled and the data has the given member name and sends a warning message if data is null. + * + * @param memberName the member name to check + * @return whether the tooltip is enabled and the data has the given member name or not + */ + public boolean isTooltipEnabledAndHasOrNullWarning(String memberName) { + return isTooltipEnabled() && hasOrNullWarning(memberName); + } + + /** + * Downloads the data if it is enabled. + * + * @param futureList the list to add the future to + */ + public void downloadIfEnabled(List> futureList) { + if (isDataEnabled()) { + download(futureList); + } + } + + /** + * Downloads the data. + * + * @param futureList the list to add the future to + */ + public void download(List> futureList) { + futureList.add(CompletableFuture.runAsync(this)); + } + + /** + * Downloads the data. + */ + @Override + public void run() { + try { + if (this.cacheable) { + HttpHeaders headers = Http.sendHeadRequest(address); + long combinedHash = Http.getEtag(headers).hashCode() + Http.getLastModified(headers).hashCode(); + + switch (this) { + case NPC, MOTES, MUSEUM, COLOR: + if (this.hash == combinedHash) return; + else this.hash = combinedHash; + } + } + + setData(SkyblockerMod.GSON.fromJson(Http.sendGetRequest(address), JsonObject.class)); + } catch (Exception e) { + ItemTooltip.LOGGER.warn("[Skyblocker] Failed to download " + this + " prices!", e); + } + } +} -- cgit From 54b67d826aa84c40c506b46649483d5f08737134 Mon Sep 17 00:00:00 2001 From: Kevinthegreat <92656833+kevinthegreat1@users.noreply.github.com> Date: Sun, 29 Oct 2023 02:16:44 -0400 Subject: Update exotic tooltip --- src/main/java/de/hysky/skyblocker/config/SkyblockerConfig.java | 2 +- .../de/hysky/skyblocker/config/categories/GeneralCategory.java | 8 ++++---- src/main/java/de/hysky/skyblocker/mixin/HandledScreenMixin.java | 4 +++- .../hysky/skyblocker/skyblock/item/tooltip/TooltipInfoType.java | 2 +- src/main/resources/assets/skyblocker/lang/en_us.json | 2 +- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/main/java/de/hysky/skyblocker/config/SkyblockerConfig.java b/src/main/java/de/hysky/skyblocker/config/SkyblockerConfig.java index 4959ca3b..15017995 100644 --- a/src/main/java/de/hysky/skyblocker/config/SkyblockerConfig.java +++ b/src/main/java/de/hysky/skyblocker/config/SkyblockerConfig.java @@ -487,7 +487,7 @@ public class SkyblockerConfig { public boolean enableMuseumDate = true; @SerialEntry - public boolean enableExoticCheck = true; + public boolean enableExoticTooltip = true; } public static class ItemInfoDisplay { 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 8ce00172..b6865edc 100644 --- a/src/main/java/de/hysky/skyblocker/config/categories/GeneralCategory.java +++ b/src/main/java/de/hysky/skyblocker/config/categories/GeneralCategory.java @@ -357,10 +357,10 @@ public class GeneralCategory { .controller(ConfigUtils::createBooleanController) .build()) .option(Option.createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.general.itemTooltip.enableExoticCheck")) - .binding(defaults.general.itemTooltip.enableExoticCheck, - () -> config.general.itemTooltip.enableExoticCheck, - newValue -> config.general.itemTooltip.enableExoticCheck = newValue) + .name(Text.translatable("text.autoconfig.skyblocker.option.general.itemTooltip.enableExoticTooltip")) + .binding(defaults.general.itemTooltip.enableExoticTooltip, + () -> config.general.itemTooltip.enableExoticTooltip, + newValue -> config.general.itemTooltip.enableExoticTooltip = newValue) .controller(ConfigUtils::createBooleanController) .build()) .build()) diff --git a/src/main/java/de/hysky/skyblocker/mixin/HandledScreenMixin.java b/src/main/java/de/hysky/skyblocker/mixin/HandledScreenMixin.java index d7e5e824..b25db7cf 100644 --- a/src/main/java/de/hysky/skyblocker/mixin/HandledScreenMixin.java +++ b/src/main/java/de/hysky/skyblocker/mixin/HandledScreenMixin.java @@ -6,7 +6,9 @@ import de.hysky.skyblocker.skyblock.experiment.ChronomatronSolver; import de.hysky.skyblocker.skyblock.experiment.ExperimentSolver; import de.hysky.skyblocker.skyblock.experiment.SuperpairsSolver; import de.hysky.skyblocker.skyblock.experiment.UltrasequencerSolver; -import de.hysky.skyblocker.skyblock.item.*; +import de.hysky.skyblocker.skyblock.item.ItemProtection; +import de.hysky.skyblocker.skyblock.item.ItemRarityBackgrounds; +import de.hysky.skyblocker.skyblock.item.WikiLookup; import de.hysky.skyblocker.skyblock.item.tooltip.BackpackPreview; import de.hysky.skyblocker.skyblock.item.tooltip.CompactorDeletorPreview; import de.hysky.skyblocker.utils.ItemUtils; diff --git a/src/main/java/de/hysky/skyblocker/skyblock/item/tooltip/TooltipInfoType.java b/src/main/java/de/hysky/skyblocker/skyblock/item/tooltip/TooltipInfoType.java index ddc8bd1c..b786f4c1 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/item/tooltip/TooltipInfoType.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/item/tooltip/TooltipInfoType.java @@ -21,7 +21,7 @@ public enum TooltipInfoType implements Runnable { THREE_DAY_AVERAGE("https://moulberry.codes/auction_averages_lbin/3day.json", itemTooltip -> itemTooltip.enableAvgBIN, false), MOTES("https://hysky.de/api/motesprice", itemTooltip -> itemTooltip.enableMotesPrice, itemTooltip -> itemTooltip.enableMotesPrice && Utils.isInTheRift(), true), MUSEUM("https://hysky.de/api/museum", itemTooltip -> itemTooltip.enableMuseumDate, true), - COLOR("https://hysky.de/api/color", itemTooltip -> itemTooltip.enableExoticCheck, true); + COLOR("https://hysky.de/api/color", itemTooltip -> itemTooltip.enableExoticTooltip, true); private final String address; private final Predicate dataEnabled; diff --git a/src/main/resources/assets/skyblocker/lang/en_us.json b/src/main/resources/assets/skyblocker/lang/en_us.json index 2373468b..b1aa7e44 100644 --- a/src/main/resources/assets/skyblocker/lang/en_us.json +++ b/src/main/resources/assets/skyblocker/lang/en_us.json @@ -77,7 +77,7 @@ "text.autoconfig.skyblocker.option.general.itemTooltip.enableLowestBIN": "Enable Lowest BIN Price", "text.autoconfig.skyblocker.option.general.itemTooltip.enableBazaarPrice": "Enable Bazaar buy/sell Price", "text.autoconfig.skyblocker.option.general.itemTooltip.enableMuseumDate": "Enable Museum & Date", - "text.autoconfig.skyblocker.option.general.itemTooltip.enableExoticCheck": "Enable Exotic Check", + "text.autoconfig.skyblocker.option.general.itemTooltip.enableExoticTooltip": "Enable Exotic Tooltip", "text.autoconfig.skyblocker.option.general.itemInfoDisplay": "Item Info Display", "text.autoconfig.skyblocker.option.general.itemInfoDisplay.attributeShardInfo": "Attribute Shard Info", "text.autoconfig.skyblocker.option.general.itemInfoDisplay.attributeShardInfo.@Tooltip": "Displays the attribute's level as the stack count and the initials of the attribute's name.", -- cgit From 81c6d870e9806729eb20be5e2d6c5fbe05ab8a02 Mon Sep 17 00:00:00 2001 From: Kevinthegreat <92656833+kevinthegreat1@users.noreply.github.com> Date: Sun, 29 Oct 2023 02:44:22 -0400 Subject: Update text --- src/main/java/de/hysky/skyblocker/config/categories/GeneralCategory.java | 1 + .../java/de/hysky/skyblocker/skyblock/item/tooltip/ExoticTooltip.java | 1 + src/main/resources/assets/skyblocker/lang/en_us.json | 1 + 3 files changed, 3 insertions(+) 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 b6865edc..3cbb1b94 100644 --- a/src/main/java/de/hysky/skyblocker/config/categories/GeneralCategory.java +++ b/src/main/java/de/hysky/skyblocker/config/categories/GeneralCategory.java @@ -358,6 +358,7 @@ public class GeneralCategory { .build()) .option(Option.createBuilder() .name(Text.translatable("text.autoconfig.skyblocker.option.general.itemTooltip.enableExoticTooltip")) + .description(OptionDescription.of(Text.translatable("text.autoconfig.skyblocker.option.general.itemTooltip.enableExoticTooltip.@Tooltip"))) .binding(defaults.general.itemTooltip.enableExoticTooltip, () -> config.general.itemTooltip.enableExoticTooltip, newValue -> config.general.itemTooltip.enableExoticTooltip = newValue) diff --git a/src/main/java/de/hysky/skyblocker/skyblock/item/tooltip/ExoticTooltip.java b/src/main/java/de/hysky/skyblocker/skyblock/item/tooltip/ExoticTooltip.java index 55a91392..66d94890 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/item/tooltip/ExoticTooltip.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/item/tooltip/ExoticTooltip.java @@ -78,6 +78,7 @@ public class ExoticTooltip { EXOTIC("exotic", Formatting.GOLD); private final String name; private final Formatting formatting; + DyeType(String name, Formatting formatting) { this.name = name; this.formatting = formatting; diff --git a/src/main/resources/assets/skyblocker/lang/en_us.json b/src/main/resources/assets/skyblocker/lang/en_us.json index b1aa7e44..c0f3c7ba 100644 --- a/src/main/resources/assets/skyblocker/lang/en_us.json +++ b/src/main/resources/assets/skyblocker/lang/en_us.json @@ -78,6 +78,7 @@ "text.autoconfig.skyblocker.option.general.itemTooltip.enableBazaarPrice": "Enable Bazaar buy/sell Price", "text.autoconfig.skyblocker.option.general.itemTooltip.enableMuseumDate": "Enable Museum & Date", "text.autoconfig.skyblocker.option.general.itemTooltip.enableExoticTooltip": "Enable Exotic Tooltip", + "text.autoconfig.skyblocker.option.general.itemTooltip.enableExoticTooltip.@Tooltip": "Displays the type of exotic below the item's name if an armor piece is exotic.", "text.autoconfig.skyblocker.option.general.itemInfoDisplay": "Item Info Display", "text.autoconfig.skyblocker.option.general.itemInfoDisplay.attributeShardInfo": "Attribute Shard Info", "text.autoconfig.skyblocker.option.general.itemInfoDisplay.attributeShardInfo.@Tooltip": "Displays the attribute's level as the stack count and the initials of the attribute's name.", -- cgit From b944188297014cf0bbd5ebcb4c124b2ca77a5cee Mon Sep 17 00:00:00 2001 From: Kevinthegreat <92656833+kevinthegreat1@users.noreply.github.com> Date: Sun, 29 Oct 2023 02:56:50 -0400 Subject: Refactor TooltipInfoType#run --- .../skyblock/item/tooltip/TooltipInfoType.java | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/src/main/java/de/hysky/skyblocker/skyblock/item/tooltip/TooltipInfoType.java b/src/main/java/de/hysky/skyblocker/skyblock/item/tooltip/TooltipInfoType.java index b786f4c1..086fcb00 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/item/tooltip/TooltipInfoType.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/item/tooltip/TooltipInfoType.java @@ -82,10 +82,6 @@ public enum TooltipInfoType implements Runnable { return data; } - public void setData(JsonObject data) { - this.data = data; - } - /** * Checks if the data has the given member name and sends a warning message if data is null. * @@ -135,18 +131,13 @@ public enum TooltipInfoType implements Runnable { @Override public void run() { try { - if (this.cacheable) { + if (cacheable) { HttpHeaders headers = Http.sendHeadRequest(address); - long combinedHash = Http.getEtag(headers).hashCode() + Http.getLastModified(headers).hashCode(); - - switch (this) { - case NPC, MOTES, MUSEUM, COLOR: - if (this.hash == combinedHash) return; - else this.hash = combinedHash; - } + long hash = Http.getEtag(headers).hashCode() + Http.getLastModified(headers).hashCode(); + if (this.hash == hash) return; + else this.hash = hash; } - - setData(SkyblockerMod.GSON.fromJson(Http.sendGetRequest(address), JsonObject.class)); + data = SkyblockerMod.GSON.fromJson(Http.sendGetRequest(address), JsonObject.class); } catch (Exception e) { ItemTooltip.LOGGER.warn("[Skyblocker] Failed to download " + this + " prices!", e); } -- cgit From 5bb91104d3275283d7479f0b35c1b18be470d632 Mon Sep 17 00:00:00 2001 From: Aaron <51387595+AzureAaron@users.noreply.github.com> Date: Tue, 31 Oct 2023 01:08:28 -0400 Subject: Player Secrets Tracker (#394) * Player Secrets Tracker * Refactor SecretsTracker --------- Co-authored-by: Kevinthegreat <92656833+kevinthegreat1@users.noreply.github.com> --- .../java/de/hysky/skyblocker/SkyblockerMod.java | 4 + .../hysky/skyblocker/config/SkyblockerConfig.java | 3 + .../config/categories/DungeonsCategory.java | 8 + .../skyblock/dungeon/secrets/SecretsTracker.java | 174 +++++++++++++++++++++ .../skyblocker/skyblock/item/MuseumItemCache.java | 4 +- .../tabhud/widget/DungeonPlayerWidget.java | 2 +- .../java/de/hysky/skyblocker/utils/ApiUtils.java | 53 +++++++ src/main/java/de/hysky/skyblocker/utils/Http.java | 22 ++- src/main/java/de/hysky/skyblocker/utils/Utils.java | 7 +- .../resources/assets/skyblocker/lang/en_us.json | 8 +- 10 files changed, 270 insertions(+), 15 deletions(-) create mode 100644 src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/SecretsTracker.java create mode 100644 src/main/java/de/hysky/skyblocker/utils/ApiUtils.java diff --git a/src/main/java/de/hysky/skyblocker/SkyblockerMod.java b/src/main/java/de/hysky/skyblocker/SkyblockerMod.java index 5178a777..b398e9b6 100644 --- a/src/main/java/de/hysky/skyblocker/SkyblockerMod.java +++ b/src/main/java/de/hysky/skyblocker/SkyblockerMod.java @@ -7,6 +7,7 @@ import de.hysky.skyblocker.skyblock.*; import de.hysky.skyblocker.skyblock.diana.MythologicalRitual; import de.hysky.skyblocker.skyblock.dungeon.*; import de.hysky.skyblocker.skyblock.dungeon.secrets.DungeonSecrets; +import de.hysky.skyblocker.skyblock.dungeon.secrets.SecretsTracker; import de.hysky.skyblocker.skyblock.dwarven.DwarvenHud; import de.hysky.skyblocker.skyblock.item.*; import de.hysky.skyblocker.skyblock.item.tooltip.BackpackPreview; @@ -20,6 +21,7 @@ import de.hysky.skyblocker.skyblock.spidersden.Relics; import de.hysky.skyblocker.skyblock.tabhud.TabHud; import de.hysky.skyblocker.skyblock.tabhud.screenbuilder.ScreenMaster; import de.hysky.skyblocker.skyblock.tabhud.util.PlayerListMgr; +import de.hysky.skyblocker.utils.ApiUtils; import de.hysky.skyblocker.utils.NEURepoManager; import de.hysky.skyblocker.utils.Utils; import de.hysky.skyblocker.utils.chat.ChatMessageListener; @@ -109,6 +111,8 @@ public class SkyblockerMod implements ClientModInitializer { CreeperBeams.init(); ItemRarityBackgrounds.init(); MuseumItemCache.init(); + SecretsTracker.init(); + ApiUtils.init(); containerSolverManager.init(); statusBarTracker.init(); Scheduler.INSTANCE.scheduleCyclic(Utils::update, 20); diff --git a/src/main/java/de/hysky/skyblocker/config/SkyblockerConfig.java b/src/main/java/de/hysky/skyblocker/config/SkyblockerConfig.java index 15017995..68520cab 100644 --- a/src/main/java/de/hysky/skyblocker/config/SkyblockerConfig.java +++ b/src/main/java/de/hysky/skyblocker/config/SkyblockerConfig.java @@ -552,6 +552,9 @@ public class SkyblockerConfig { @SerialEntry public int mapY = 2; + + @SerialEntry + public boolean playerSecretsTracker = false; @SerialEntry public boolean starredMobGlow = true; 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 fdb13892..02913a28 100644 --- a/src/main/java/de/hysky/skyblocker/config/categories/DungeonsCategory.java +++ b/src/main/java/de/hysky/skyblocker/config/categories/DungeonsCategory.java @@ -241,6 +241,14 @@ public class DungeonsCategory { newValue -> config.locations.dungeons.mapScaling = newValue) .controller(FloatFieldControllerBuilder::create) .build()) + .option(Option.createBuilder() + .name(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.secretsTracker")) + .description(OptionDescription.of(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.secretsTracker.@Tooltip"))) + .binding(defaults.locations.dungeons.playerSecretsTracker, + () -> config.locations.dungeons.playerSecretsTracker, + newValue -> config.locations.dungeons.playerSecretsTracker = newValue) + .controller(ConfigUtils::createBooleanController) + .build()) .option(Option.createBuilder() .name(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.starredMobGlow")) .description(OptionDescription.of(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.starredMobGlow.@Tooltip"))) diff --git a/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/SecretsTracker.java b/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/SecretsTracker.java new file mode 100644 index 00000000..0690952e --- /dev/null +++ b/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/SecretsTracker.java @@ -0,0 +1,174 @@ +package de.hysky.skyblocker.skyblock.dungeon.secrets; + +import com.google.gson.JsonObject; +import com.google.gson.JsonParser; +import de.hysky.skyblocker.config.SkyblockerConfigManager; +import de.hysky.skyblocker.skyblock.tabhud.util.PlayerListMgr; +import de.hysky.skyblocker.skyblock.tabhud.widget.DungeonPlayerWidget; +import de.hysky.skyblocker.utils.ApiUtils; +import de.hysky.skyblocker.utils.Constants; +import de.hysky.skyblocker.utils.Http; +import de.hysky.skyblocker.utils.Http.ApiResponse; +import de.hysky.skyblocker.utils.Utils; +import it.unimi.dsi.fastutil.ints.IntIntPair; +import it.unimi.dsi.fastutil.objects.Object2IntMap.Entry; +import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap; +import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; +import net.fabricmc.fabric.api.client.message.v1.ClientReceiveMessageEvents; +import net.minecraft.client.MinecraftClient; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.text.HoverEvent; +import net.minecraft.text.Text; +import net.minecraft.util.Formatting; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.Map; +import java.util.concurrent.CompletableFuture; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * Tracks the amount of secrets players get every run + */ +public class SecretsTracker { + private static final Logger LOGGER = LoggerFactory.getLogger(SecretsTracker.class); + private static final Pattern TEAM_SCORE_PATTERN = Pattern.compile(" +Team Score: [0-9]+ \\([A-z+]+\\)"); + + private static volatile TrackedRun currentRun = null; + private static volatile TrackedRun lastRun = null; + private static volatile long lastRunEnded = 0L; + + public static void init() { + ClientReceiveMessageEvents.GAME.register(SecretsTracker::onMessage); + } + + //If -1 is somehow encountered, it would be very rare, so I just disregard its possibility for now + //people would probably recognize if it was inaccurate so yeah + private static void calculate(RunPhase phase) { + switch (phase) { + case START -> CompletableFuture.runAsync(() -> { + TrackedRun newlyStartedRun = new TrackedRun(); + + //Initialize players in new run + for (int i = 0; i < 5; i++) { + String playerName = getPlayerNameAt(i + 1); + + //The player name will be blank if there isn't a player at that index + if (!playerName.isEmpty()) { + + //If the player was a part of the last run (and didn't have -1 secret count) and that run ended less than 5 mins ago then copy the secrets over + if (lastRun != null && System.currentTimeMillis() <= lastRunEnded + 300_000 && lastRun.secretCounts().getOrDefault(playerName, -1) != -1) { + newlyStartedRun.secretCounts().put(playerName, lastRun.secretCounts().getInt(playerName)); + } else { + newlyStartedRun.secretCounts().put(playerName, getPlayerSecrets(playerName).leftInt()); + } + } + } + + currentRun = newlyStartedRun; + }); + + case END -> CompletableFuture.runAsync(() -> { + //In case the game crashes from something + if (currentRun != null) { + Object2ObjectOpenHashMap secretsFound = new Object2ObjectOpenHashMap<>(); + + //Update secret counts + for (Entry entry : currentRun.secretCounts().object2IntEntrySet()) { + String playerName = entry.getKey(); + int startingSecrets = entry.getIntValue(); + IntIntPair secretsNow = getPlayerSecrets(playerName); + int secretsPlayerFound = secretsNow.leftInt() - startingSecrets; + + secretsFound.put(playerName, IntIntPair.of(secretsPlayerFound, secretsNow.rightInt())); + entry.setValue(secretsNow.leftInt()); + } + + //Print the results all in one go, so its clean and less of a chance of it being broken up + for (Map.Entry entry : secretsFound.entrySet()) { + sendResultMessage(entry.getKey(), entry.getValue().leftInt(), entry.getValue().rightInt(), true); + } + + //Swap the current and last run as well as mark the run end time + lastRunEnded = System.currentTimeMillis(); + lastRun = currentRun; + currentRun = null; + } else { + sendResultMessage(null, -1, -1, false); + } + }); + } + } + + private static void sendResultMessage(String player, int secrets, int cacheAge, boolean success) { + PlayerEntity playerEntity = MinecraftClient.getInstance().player; + if (playerEntity != null) { + if (success) { + playerEntity.sendMessage(Constants.PREFIX.get().append(Text.translatable("skyblocker.dungeons.secretsTracker.feedback", Text.literal(player).styled(Constants.WITH_COLOR.apply(0xf57542)), "§7" + secrets, getCacheText(cacheAge)))); + } else { + playerEntity.sendMessage(Constants.PREFIX.get().append(Text.translatable("skyblocker.dungeons.secretsTracker.failFeedback"))); + } + } + } + + private static Text getCacheText(int cacheAge) { + return Text.literal("\u2139").styled(style -> style.withColor(cacheAge == -1 ? 0x218bff : 0xeac864).withHoverEvent( + new HoverEvent(HoverEvent.Action.SHOW_TEXT, cacheAge == -1 ? Text.translatable("skyblocker.api.cache.MISS") : Text.translatable("skyblocker.api.cache.HIT", cacheAge)))); + } + + private static void onMessage(Text text, boolean overlay) { + if (Utils.isInDungeons() && SkyblockerConfigManager.get().locations.dungeons.playerSecretsTracker) { + String message = Formatting.strip(text.getString()); + + try { + if (message.equals("[NPC] Mort: Here, I found this map when I first entered the dungeon.")) calculate(RunPhase.START); + if (TEAM_SCORE_PATTERN.matcher(message).matches()) calculate(RunPhase.END); + } catch (Exception e) { + LOGGER.error("[Skyblocker] Encountered an unknown error while trying to track player secrets!", e); + } + } + } + + private static String getPlayerNameAt(int index) { + Matcher matcher = PlayerListMgr.regexAt(1 + (index - 1) * 4, DungeonPlayerWidget.PLAYER_PATTERN); + + return matcher != null ? matcher.group("name") : ""; + } + + private static IntIntPair getPlayerSecrets(String name) { + String uuid = ApiUtils.name2Uuid(name); + + if (!uuid.isEmpty()) { + try (ApiResponse response = Http.sendHypixelRequest("player", "?uuid=" + uuid)) { + return IntIntPair.of(getSecretCountFromAchievements(JsonParser.parseString(response.content()).getAsJsonObject()), response.age()); + } catch (Exception e) { + LOGGER.error("[Skyblocker] Encountered an error while trying to fetch {} secret count!", name + "'s", e); + } + } + + return IntIntPair.of(-1, -1); + } + + /** + * Gets a player's secret count from their hypixel achievements + */ + private static int getSecretCountFromAchievements(JsonObject playerJson) { + JsonObject player = playerJson.get("player").getAsJsonObject(); + JsonObject achievements = (player.has("achievements")) ? player.get("achievements").getAsJsonObject() : null; + return (achievements != null && achievements.has("skyblock_treasure_hunter")) ? achievements.get("skyblock_treasure_hunter").getAsInt() : 0; + } + + /** + * This will either reflect the value at the start or the end depending on when this is called + */ + private record TrackedRun(Object2IntOpenHashMap secretCounts) { + private TrackedRun() { + this(new Object2IntOpenHashMap<>()); + } + } + + private enum RunPhase { + START, END + } +} diff --git a/src/main/java/de/hysky/skyblocker/skyblock/item/MuseumItemCache.java b/src/main/java/de/hysky/skyblocker/skyblock/item/MuseumItemCache.java index cb11d702..ac9b1bf0 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/item/MuseumItemCache.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/item/MuseumItemCache.java @@ -73,9 +73,7 @@ public class MuseumItemCache { private static void updateData4ProfileMember(String uuid, String profileId) { CompletableFuture.runAsync(() -> { - try { - ApiResponse response = Http.sendHypixelRequest("skyblock/museum", "?profile=" + profileId); - + try (ApiResponse response = Http.sendHypixelRequest("skyblock/museum", "?profile=" + profileId)) { //The request was successful if (response.ok()) { JsonObject profileData = JsonParser.parseString(response.content()).getAsJsonObject(); diff --git a/src/main/java/de/hysky/skyblocker/skyblock/tabhud/widget/DungeonPlayerWidget.java b/src/main/java/de/hysky/skyblocker/skyblock/tabhud/widget/DungeonPlayerWidget.java index be1a3c6e..d71eb190 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/tabhud/widget/DungeonPlayerWidget.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/tabhud/widget/DungeonPlayerWidget.java @@ -27,7 +27,7 @@ public class DungeonPlayerWidget extends Widget { // group 3: level (or nothing, if pre dungeon start) // this regex filters out the ironman icon as well as rank prefixes and emblems // \[\d*\] (?:\[[A-Za-z]+\] )?(?[A-Za-z0-9_]*) (?:.* )?\((?\S*) ?(?[LXVI]*)\) - private static final Pattern PLAYER_PATTERN = Pattern + public static final Pattern PLAYER_PATTERN = Pattern .compile("\\[\\d*\\] (?:\\[[A-Za-z]+\\] )?(?[A-Za-z0-9_]*) (?:.* )?\\((?\\S*) ?(?[LXVI]*)\\)"); private static final HashMap ICOS = new HashMap<>(); diff --git a/src/main/java/de/hysky/skyblocker/utils/ApiUtils.java b/src/main/java/de/hysky/skyblocker/utils/ApiUtils.java new file mode 100644 index 00000000..c0648eba --- /dev/null +++ b/src/main/java/de/hysky/skyblocker/utils/ApiUtils.java @@ -0,0 +1,53 @@ +package de.hysky.skyblocker.utils; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.google.gson.JsonParser; +import com.mojang.util.UndashedUuid; + +import de.hysky.skyblocker.utils.Http.ApiResponse; +import de.hysky.skyblocker.utils.scheduler.Scheduler; +import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; +import net.minecraft.client.MinecraftClient; +import net.minecraft.client.session.Session; + +/* + * Contains only basic helpers for using Http APIs + */ +public class ApiUtils { + private static final Logger LOGGER = LoggerFactory.getLogger(ApiUtils.class); + /** + * Do not iterate over this map, it will be accessed and modified by multiple threads. + */ + private static final Object2ObjectOpenHashMap NAME_2_UUID_CACHE = new Object2ObjectOpenHashMap<>(); + + public static void init() { + //Clear cache every 20 minutes + Scheduler.INSTANCE.scheduleCyclic(NAME_2_UUID_CACHE::clear, 24_000, true); + } + + /** + * Multithreading is to be handled by the method caller + */ + public static String name2Uuid(String name) { + Session session = MinecraftClient.getInstance().getSession(); + + if (session.getUsername().equals(name)) return UndashedUuid.toString(session.getUuidOrNull()); + if (NAME_2_UUID_CACHE.containsKey(name)) return NAME_2_UUID_CACHE.get(name); + + try (ApiResponse response = Http.sendName2UuidRequest(name)) { + if (response.ok()) { + String uuid = JsonParser.parseString(response.content()).getAsJsonObject().get("id").getAsString(); + + NAME_2_UUID_CACHE.put(name, uuid); + + return uuid; + } + } catch (Exception e) { + LOGGER.error("[Skyblocker] Name to uuid lookup failed! Name: {}", name, e); + } + + return ""; + } +} diff --git a/src/main/java/de/hysky/skyblocker/utils/Http.java b/src/main/java/de/hysky/skyblocker/utils/Http.java index eabb02e4..573c3458 100644 --- a/src/main/java/de/hysky/skyblocker/utils/Http.java +++ b/src/main/java/de/hysky/skyblocker/utils/Http.java @@ -49,9 +49,11 @@ public class Http { HttpResponse response = HTTP_CLIENT.send(request, BodyHandlers.ofInputStream()); InputStream decodedInputStream = getDecodedInputStream(response); + String body = new String(decodedInputStream.readAllBytes()); + HttpHeaders headers = response.headers(); - return new ApiResponse(body, response.statusCode(), getCacheStatus(response.headers())); + return new ApiResponse(body, response.statusCode(), getCacheStatus(headers), getAge(headers)); } public static HttpHeaders sendHeadRequest(String url) throws IOException, InterruptedException { @@ -66,8 +68,8 @@ public class Http { return response.headers(); } - public static String sendName2UuidRequest(String name) throws IOException, InterruptedException { - return sendGetRequest(NAME_2_UUID + name); + public static ApiResponse sendName2UuidRequest(String name) throws IOException, InterruptedException { + return sendCacheableGetRequest(NAME_2_UUID + name); } /** @@ -115,12 +117,16 @@ public class Http { * * @see Cloudflare Cache Docs */ - public static String getCacheStatus(HttpHeaders headers) { + private static String getCacheStatus(HttpHeaders headers) { return headers.firstValue("CF-Cache-Status").orElse("UNKNOWN"); } + private static int getAge(HttpHeaders headers) { + return Integer.parseInt(headers.firstValue("Age").orElse("-1")); + } + //TODO If ever needed, we could just replace cache status with the response headers and go from there - public record ApiResponse(String content, int statusCode, String cacheStatus) { + public record ApiResponse(String content, int statusCode, String cacheStatus, int age) implements AutoCloseable { public boolean ok() { return statusCode == 200; @@ -129,5 +135,11 @@ public class Http { public boolean cached() { return cacheStatus.equals("HIT"); } + + @Override + public void close() { + //Allows for nice syntax when dealing with api requests in try catch blocks + //Maybe one day we'll have some resources to free + } } } diff --git a/src/main/java/de/hysky/skyblocker/utils/Utils.java b/src/main/java/de/hysky/skyblocker/utils/Utils.java index b1a347f9..71e08865 100644 --- a/src/main/java/de/hysky/skyblocker/utils/Utils.java +++ b/src/main/java/de/hysky/skyblocker/utils/Utils.java @@ -33,10 +33,10 @@ import java.util.List; public class Utils { private static final Logger LOGGER = LoggerFactory.getLogger(Utils.class); private static final String ALTERNATE_HYPIXEL_ADDRESS = System.getProperty("skyblocker.alternateHypixelAddress", ""); + private static final String DUNGEONS_LOCATION = "dungeon"; private static final String PROFILE_PREFIX = "Profile: "; private static boolean isOnHypixel = false; private static boolean isOnSkyblock = false; - private static boolean isInDungeons = false; private static boolean isInjected = false; /** * The profile name parsed from the player list. @@ -79,7 +79,7 @@ public class Utils { } public static boolean isInDungeons() { - return isInDungeons; + return getLocationRaw().equals(DUNGEONS_LOCATION) || FabricLoader.getInstance().isDevelopmentEnvironment(); } public static boolean isInTheRift() { @@ -164,7 +164,6 @@ public class Utils { sidebar = Collections.emptyList(); } else { isOnSkyblock = false; - isInDungeons = false; return; } } @@ -188,7 +187,6 @@ public class Utils { } else { onLeaveSkyblock(); } - isInDungeons = fabricLoader.isDevelopmentEnvironment() || isOnSkyblock && string.contains("The Catacombs"); } else if (isOnHypixel) { isOnHypixel = false; onLeaveSkyblock(); @@ -205,7 +203,6 @@ public class Utils { private static void onLeaveSkyblock() { if (isOnSkyblock) { isOnSkyblock = false; - isInDungeons = false; SkyblockEvents.LEAVE.invoker().onSkyblockLeave(); } } diff --git a/src/main/resources/assets/skyblocker/lang/en_us.json b/src/main/resources/assets/skyblocker/lang/en_us.json index c0f3c7ba..31e7bb9c 100644 --- a/src/main/resources/assets/skyblocker/lang/en_us.json +++ b/src/main/resources/assets/skyblocker/lang/en_us.json @@ -280,6 +280,12 @@ "skyblocker.dungeons.secrets.customWaypointAdded": "§rAdded a custom waypoint at X: %d, Y: %d, Z: %d for room %s secret #%d of category %s with name '%s'.", "skyblocker.dungeons.secrets.customWaypointRemoved": "§rRemoved custom waypoint at X: %d, Y: %d, Z: %d for room %s secret #%d of category %s with name '%s'.", "skyblocker.dungeons.secrets.customWaypointNotFound": "§cNo custom waypoint found at X: %d, Y: %d, Z: %d for room %s.", + + "skyblocker.dungeons.secretsTracker.feedback": "%s§f found %s§f secrets. %s", + "skyblocker.dungeons.secretsTracker.failFeedback": "§cUnable to calculate the amount of secrets everybody did this run!", + + "skyblocker.api.cache.HIT": "This data was cached!\nIt's %d seconds old.", + "skyblocker.api.cache.MISS": "This data wasn't cached!", "skyblocker.exotic.crystal": "CRYSTAL", "skyblocker.exotic.fairy": "FAIRY", @@ -343,4 +349,4 @@ "skyblocker.itemProtection.unableToProtect": "§cUnable to protect this item :( (Are you in skyblock?, are you holding an item?)", "emi.category.skyblocker.skyblock": "Skyblock" -} +} \ No newline at end of file -- cgit