diff --git a/.github/docs/images/Minecraft Installations.png b/.github/docs/images/Minecraft Installations.png deleted file mode 100644 index 203bfe08a..000000000 Binary files a/.github/docs/images/Minecraft Installations.png and /dev/null differ diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c7d832990..4c49c42f1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,33 +1,15 @@ -name: Build +name: build + +on: [ push, pull_request ] -on: - push: - branches: - - unofficial-update - - main - paths: - - '**.java' - pull_request: - branches: - - main - paths: - - '**.java' - workflow_dispatch: - inputs: - upload_artifact: - description: 'Upload artifact to this run? [yes | no]' - required: false - default: 'no' jobs: build: - name: Build if: ${{ !contains(github.head_ref, 'translations/') }} runs-on: ubuntu-latest env: ORG_GRADLE_PROJECT_buildNumber: ${{ github.run_number }} ORG_GRADLE_PROJECT_runAttempt: ${{ github.run_attempt }} ORG_GRADLE_PROJECT_runningOnCi: ${{ true }} - UPLOAD_ARTIFACT_ENABLED: ${{ true }} timeout-minutes: 15 steps: @@ -42,17 +24,15 @@ jobs: - name: Build with Gradle run: ./gradlew build --no-daemon - name: Read Project Version - id: read_project_version - if: ${{ env.UPLOAD_ARTIFACT_ENABLED || contains(github.event.inputs.upload_artifact, 'yes') }} - uses: christian-draeger/read-properties@1.0.1 + id: read_properties + uses: christian-draeger/read-properties@1.1.1 with: path: gradle.properties - property: version + properties: version - name: Upload Artifact - if: ${{ env.UPLOAD_ARTIFACT_ENABLED || contains(github.event.inputs.upload_artifact, 'yes') }} env: - project_version: ${{ steps.read_project_version.outputs.value }} + project_version: ${{ steps.read_properties.outputs.value }} uses: actions/upload-artifact@v3 with: - name: SkyblockAddons v${{ env.project_version }} + name: build_artifacts path: build/libs/* diff --git a/.gitignore b/.gitignore index fb4ca741a..b70eec8d7 100644 --- a/.gitignore +++ b/.gitignore @@ -29,3 +29,4 @@ run Thumbs.db bytecode .vscode +logs diff --git a/LICENSE b/LICENSE index e44ce9f5f..7b3d79508 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2023 Biscuit Development +Copyright (c) 2023 Fix3dll Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -20,7 +20,8 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - +This project is fork of SkyblockAddons mod, which was written by Biscuit team and they announced to be end of life, which is +available under the MIT license. The full license available at https://github.com/BiscuitDevelopment/SkyblockAddons/blob/main/LICENSE This product bundles the files /gradle/wrapper/gradle-wrapper.jar, /gradle/wrapper/gradle-wrapper.properties, /gradlew, and /gradlew.bat, which are available under the Apache 2.0 license. The full license is available at @@ -40,4 +41,4 @@ in MinecraftForge 11.15.1.2318-1.8.9, which is available under the Minecraft For available at dependencyLicenses/minecraftForge/MINECRAFT_FORGE_LICENSE.txt. This product bundles SLF4J API Module 1.7.25, which is available under the MIT license. The full license is available at -dependencyLicenses/slf4j-api/MIT.txt. \ No newline at end of file +dependencyLicenses/slf4j-api/MIT.txt. diff --git a/README.md b/README.md index ca3f1e757..0416d0653 100644 --- a/README.md +++ b/README.md @@ -2,35 +2,12 @@

SkyblockAddons

- - release - - - downloads - - + license - - discord - - - twitter - - - localization -

-A Minecraft Forge mod with many features to make your Hypixel Skyblock experience better. - -``` -Sorry, development is slow and will be for the foreseeable future since I quit SB and I'm also busy with -other things. Thank you for your understanding. - -- TirelessTraveler -``` - +Skyblock Addons has reached end of life. This fork contains unofficial updates from me. You can reach latest unofficial build [here](https://nightly.link/Fix3dll/SkyblockAddons/workflows/build/unofficial-update/SkyblockAddons%20v1.7.2.zip). Special Credits ----- @@ -40,27 +17,8 @@ TirelessTraveler (aka ILikePlayingGames) for helping maintain the project. DidiSkywalker & CraftedFury (Nahydrin) for adding/PRing many incredible features! -Thanks to YourKit +Thanks to Our Translators ------ -![YourKit](https://www.yourkit.com/images/yklogo.png) - -Big thank you to YourKit for supporting this project with their profiler to help us improve performance! - - -YourKit supports open source projects with innovative and intelligent tools -for monitoring and profiling Java and .NET applications. -YourKit is the creator of [YourKit Java Profiler](https://www.yourkit.com/java/profiler/), -[YourKit .NET Profiler](https://www.yourkit.com/.net/profiler/), -and [YourKit YouMonitor](https://www.yourkit.com/youmonitor/). - -Thanks to Crowdin & Our Translators ------- -![Crowdin](https://crowdin.com/images/crowdin-logo.svg) - -Big thanks to Crowdin for supporting this project with their -localization management platform to help us serve the mod in many languages! -[Check out their website here](https://crowdin.com/)! - Also thanks for our countless translators who help us translate this mod! Thanks to Open Source Software diff --git a/build.gradle b/build.gradle index 99f367e33..1ca2e2c3f 100644 --- a/build.gradle +++ b/build.gradle @@ -4,9 +4,9 @@ import java.text.ParseException plugins { id 'java' - id 'gg.essential.loom' version '0.10.0.5' + id 'gg.essential.loom' version '0.10.0.+' id 'dev.architectury.architectury-pack200' version '0.1.3' - id 'io.freefair.lombok' version "6.6.1" + id 'io.freefair.lombok' version "8.0.1" id 'com.github.johnrengelman.shadow' version '7.1.2' id 'net.kyori.blossom' version '1.3.1' } @@ -97,10 +97,10 @@ dependencies { minecraft("com.mojang:minecraft:${project.minecraftVersion}") mappings("de.oceanlabs.mcp:mcp_stable:${project.mappings}") forge("net.minecraftforge:forge:${project.forgeVersion}") - runtimeOnly('me.djtheredstoner:DevAuth-forge-legacy:1.1.0') + runtimeOnly('me.djtheredstoner:DevAuth-forge-legacy:1.1.2') // Discord RPC for Java https://github.com/jagrosh/DiscordIPC - bundle('com.github.ILikePlayingGames:DiscordIPC:-SNAPSHOT') { + bundle('com.github.ILikePlayingGames:DiscordIPC:f91ed4b') { exclude module: 'log4j' because 'Different version conflicts with Minecraft\'s Log4J' exclude module: 'gson' @@ -110,7 +110,7 @@ dependencies { exclude module: 'gson' because 'Different version conflicts with Minecraft\'s GSON' } - testImplementation('org.junit.jupiter:junit-jupiter:5.9.1') + testImplementation('org.junit.jupiter:junit-jupiter:5.9.3') } tasks.withType(JavaCompile).configureEach { diff --git a/gradle.properties b/gradle.properties index 88576f089..722f8c4bc 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,7 +3,7 @@ org.gradle.jvmargs=-Xmx2G # SkyblockAddons Properties -version=1.7.2 +version=1.8.0-beta.1 # Set by CI buildNumber=0 acceptedMinecraftVersions=[1.8.9] diff --git a/src/main/java/codes/biscuit/skyblockaddons/SkyblockAddons.java b/src/main/java/codes/biscuit/skyblockaddons/SkyblockAddons.java index 3352d7736..3b448767b 100644 --- a/src/main/java/codes/biscuit/skyblockaddons/SkyblockAddons.java +++ b/src/main/java/codes/biscuit/skyblockaddons/SkyblockAddons.java @@ -22,10 +22,7 @@ import codes.biscuit.skyblockaddons.misc.scheduler.NewScheduler; import codes.biscuit.skyblockaddons.misc.scheduler.Scheduler; import codes.biscuit.skyblockaddons.newgui.GuiManager; -import codes.biscuit.skyblockaddons.utils.EnumUtils; -import codes.biscuit.skyblockaddons.utils.InventoryUtils; -import codes.biscuit.skyblockaddons.utils.SkyblockAddonsMessageFactory; -import codes.biscuit.skyblockaddons.utils.Utils; +import codes.biscuit.skyblockaddons.utils.*; import codes.biscuit.skyblockaddons.utils.data.DataUtils; import codes.biscuit.skyblockaddons.utils.gson.GsonInitializableTypeAdapter; import codes.biscuit.skyblockaddons.utils.gson.PatternAdapter; @@ -191,6 +188,10 @@ public void init(FMLInitializationEvent e) { usingLabymod = utils.isModLoaded("labymod"); usingOofModv1 = utils.isModLoaded("refractionoof", "1.0"); usingPatcher = utils.isModLoaded("patcher"); + + if (!this.configValues.isEnabled(Feature.NUMBER_SEPARATORS)) { + TextUtils.NUMBER_FORMAT.setGroupingUsed(false); + } } @Mod.EventHandler diff --git a/src/main/java/codes/biscuit/skyblockaddons/asm/hooks/GuiContainerHook.java b/src/main/java/codes/biscuit/skyblockaddons/asm/hooks/GuiContainerHook.java index ff92ae179..ea849566d 100644 --- a/src/main/java/codes/biscuit/skyblockaddons/asm/hooks/GuiContainerHook.java +++ b/src/main/java/codes/biscuit/skyblockaddons/asm/hooks/GuiContainerHook.java @@ -5,7 +5,6 @@ import codes.biscuit.skyblockaddons.core.Feature; import codes.biscuit.skyblockaddons.core.InventoryType; import codes.biscuit.skyblockaddons.features.backpacks.ContainerPreviewManager; -import codes.biscuit.skyblockaddons.features.craftingpatterns.CraftingPattern; import codes.biscuit.skyblockaddons.utils.ColorCode; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; @@ -64,29 +63,6 @@ public static void drawSlot(GuiContainer guiContainer, Slot slot) { Container container = mc.thePlayer.openContainer; if (slot != null) { - // Draw crafting pattern overlays inside the crafting grid. - if (false /*main.getConfigValues().isEnabled(Feature.CRAFTING_PATTERNS)*/ && main.getUtils().isOnSkyblock() - && slot.inventory.getDisplayName().getUnformattedText().equals(CraftingPattern.CRAFTING_TABLE_DISPLAYNAME) - && main.getPersistentValuesManager().getPersistentValues().getSelectedCraftingPattern() != CraftingPattern.FREE) { - - int craftingGridIndex = CraftingPattern.slotToCraftingGridIndex(slot.getSlotIndex()); - if (craftingGridIndex >= 0) { - int slotLeft = slot.xDisplayPosition; - int slotTop = slot.yDisplayPosition; - int slotRight = slotLeft + 16; - int slotBottom = slotTop + 16; - if (main.getPersistentValuesManager().getPersistentValues().getSelectedCraftingPattern().isSlotInPattern(craftingGridIndex)) { - if (!slot.getHasStack()) { - guiContainer.drawGradientRect(slotLeft, slotTop, slotRight, slotBottom, OVERLAY_GREEN, OVERLAY_GREEN); - } - } else { - if (slot.getHasStack()) { - guiContainer.drawGradientRect(slotLeft, slotTop, slotRight, slotBottom, OVERLAY_RED, OVERLAY_RED); - } - } - } - } - if (main.getConfigValues().isEnabled(Feature.LOCK_SLOTS) && main.getUtils().isOnSkyblock()) { int slotNum = slot.slotNumber + main.getInventoryUtils().getSlotDifference(container); diff --git a/src/main/java/codes/biscuit/skyblockaddons/asm/hooks/PlayerControllerMPHook.java b/src/main/java/codes/biscuit/skyblockaddons/asm/hooks/PlayerControllerMPHook.java index 035171925..57135d9f9 100644 --- a/src/main/java/codes/biscuit/skyblockaddons/asm/hooks/PlayerControllerMPHook.java +++ b/src/main/java/codes/biscuit/skyblockaddons/asm/hooks/PlayerControllerMPHook.java @@ -3,12 +3,9 @@ import codes.biscuit.skyblockaddons.SkyblockAddons; import codes.biscuit.skyblockaddons.asm.utils.ReturnValue; import codes.biscuit.skyblockaddons.core.Feature; -import codes.biscuit.skyblockaddons.core.InventoryType; import codes.biscuit.skyblockaddons.events.SkyblockBlockBreakEvent; import codes.biscuit.skyblockaddons.features.backpacks.BackpackColor; import codes.biscuit.skyblockaddons.features.backpacks.BackpackInventoryManager; -import codes.biscuit.skyblockaddons.features.craftingpatterns.CraftingPattern; -import codes.biscuit.skyblockaddons.features.craftingpatterns.CraftingPatternResult; import codes.biscuit.skyblockaddons.utils.ItemUtils; import codes.biscuit.skyblockaddons.utils.Utils; import com.google.common.collect.Sets; @@ -161,45 +158,6 @@ public static void onWindowClick(int slotNum, int mouseButtonClicked, int mode, main.getUtils().playLoudSound("note.bass", 0.5); returnValue.cancel(); } - - // Crafting patterns - if (false && slotIn != null && main.getInventoryUtils().getInventoryType() == InventoryType.CRAFTING_TABLE - /*&& main.getConfigValues().isEnabled(Feature.CRAFTING_PATTERNS)*/) { - - final CraftingPattern selectedPattern = main.getPersistentValuesManager().getPersistentValues().getSelectedCraftingPattern(); - final ItemStack clickedItem = slotIn.getStack(); - if (selectedPattern != CraftingPattern.FREE && clickedItem != null) { - final ItemStack[] craftingGrid = new ItemStack[9]; - for (int i = 0; i < CraftingPattern.CRAFTING_GRID_SLOTS.size(); i++) { - int slotIndex = CraftingPattern.CRAFTING_GRID_SLOTS.get(i); - craftingGrid[i] = slots.getSlot(slotIndex).getStack(); - } - - final CraftingPatternResult result = selectedPattern.checkAgainstGrid(craftingGrid); - - if (slotIn.inventory.equals(Minecraft.getMinecraft().thePlayer.inventory)) { - if (result.isFilled() && !result.fitsItem(clickedItem) && mode == SHIFTCLICK_CLICK_TYPE) { - // cancel shift-clicking items from the inventory if the pattern is already filled - if (System.currentTimeMillis() > lastCraftingSoundPlayed + CRAFTING_PATTERN_SOUND_COOLDOWN) { - main.getUtils().playSound("note.bass", 0.5); - lastCraftingSoundPlayed = System.currentTimeMillis(); - } - returnValue.cancel(); - } - } else { - if (slotIn.getSlotIndex() == CraftingPattern.CRAFTING_RESULT_INDEX - && !result.isSatisfied() - && main.getPersistentValuesManager().getPersistentValues().isBlockCraftingIncompletePatterns()) { - // cancel clicking the result if the pattern isn't satisfied - if (System.currentTimeMillis() > lastCraftingSoundPlayed + CRAFTING_PATTERN_SOUND_COOLDOWN) { - main.getUtils().playSound("note.bass", 0.5); - lastCraftingSoundPlayed = System.currentTimeMillis(); - } - returnValue.cancel(); - } - } - } - } } } else { diff --git a/src/main/java/codes/biscuit/skyblockaddons/config/ConfigValues.java b/src/main/java/codes/biscuit/skyblockaddons/config/ConfigValues.java index 0f527385b..b62a815fb 100644 --- a/src/main/java/codes/biscuit/skyblockaddons/config/ConfigValues.java +++ b/src/main/java/codes/biscuit/skyblockaddons/config/ConfigValues.java @@ -66,7 +66,7 @@ public class ConfigValues { private Map anchorPoints = new EnumMap<>(Feature.class); private final MutableObject language = new MutableObject<>(Language.ENGLISH); private final MutableObject backpackStyle = new MutableObject<>(EnumUtils.BackpackStyle.GUI); - private final MutableObject powerOrbDisplayStyle = new MutableObject<>(EnumUtils.PowerOrbDisplayStyle.COMPACT); + private final MutableObject deployableDisplayStyle = new MutableObject<>(EnumUtils.DeployableDisplayStyle.COMPACT); private final MutableObject textStyle = new MutableObject<>(EnumUtils.TextStyle.STYLE_ONE); private final Map> profileLockedSlots = new HashMap<>(); @Getter @@ -146,7 +146,7 @@ public void loadValues() { Language configLanguage = Language.getFromPath(languageKey); if (configLanguage != null) { setLanguage(configLanguage); // TODO Will this crash? -// language.setValue(configLanguage); + //language.setValue(configLanguage); } } } catch (Exception ex) { @@ -155,7 +155,7 @@ public void loadValues() { } deserializeEnumValueFromOrdinal(backpackStyle, "backpackStyle"); - deserializeEnumValueFromOrdinal(powerOrbDisplayStyle, "powerOrbStyle"); + deserializeEnumValueFromOrdinal(deployableDisplayStyle, "deployableStyle"); deserializeEnumEnumMapFromIDS(anchorPoints, "anchorPoints", Feature.class, EnumUtils.AnchorPoint.class); deserializeEnumNumberMapFromID(guiScales, "guiScales", Feature.class, float.class); @@ -390,7 +390,7 @@ public void saveConfig() { saveConfig.addProperty("textStyle", textStyle.getValue().ordinal()); saveConfig.addProperty("language", language.getValue().getPath()); saveConfig.addProperty("backpackStyle", backpackStyle.getValue().ordinal()); - saveConfig.addProperty("powerOrbStyle", powerOrbDisplayStyle.getValue().ordinal()); + saveConfig.addProperty("deployableStyle", deployableDisplayStyle.getValue().ordinal()); JsonArray chromaFeaturesArray = new JsonArray(); for (Feature feature : chromaFeatures) { @@ -515,7 +515,6 @@ private , F extends Enum> void deserializeEnumEnumMapFromID } } - @SuppressWarnings("unchecked") private , N extends Number> void deserializeEnumNumberMapFromID(Map map, String path, Class keyClass, Class numberClass) { deserializeEnumNumberMapFromID(loadedConfig, map, path, keyClass, numberClass); } @@ -957,12 +956,12 @@ public void setBackpackStyle(EnumUtils.BackpackStyle backpackStyle) { this.backpackStyle.setValue(backpackStyle); } - public EnumUtils.PowerOrbDisplayStyle getPowerOrbDisplayStyle() { - return powerOrbDisplayStyle.getValue(); + public EnumUtils.DeployableDisplayStyle getDeployableDisplayStyle() { + return deployableDisplayStyle.getValue(); } - public void setPowerOrbDisplayStyle(EnumUtils.PowerOrbDisplayStyle powerOrbDisplayStyle) { - this.powerOrbDisplayStyle.setValue(powerOrbDisplayStyle); + public void setDeployableDisplayStyle(EnumUtils.DeployableDisplayStyle deployableDisplayStyle) { + this.deployableDisplayStyle.setValue(deployableDisplayStyle); } public EnumUtils.TextStyle getTextStyle() { diff --git a/src/main/java/codes/biscuit/skyblockaddons/core/EssenceType.java b/src/main/java/codes/biscuit/skyblockaddons/core/EssenceType.java index 1a5b54ca5..25a73c6e4 100644 --- a/src/main/java/codes/biscuit/skyblockaddons/core/EssenceType.java +++ b/src/main/java/codes/biscuit/skyblockaddons/core/EssenceType.java @@ -14,7 +14,8 @@ public enum EssenceType { DRAGON, GOLD, DIAMOND, - ICE; + ICE, + CRIMSON; private String niceName; @Getter private ResourceLocation resourceLocation; diff --git a/src/main/java/codes/biscuit/skyblockaddons/core/Feature.java b/src/main/java/codes/biscuit/skyblockaddons/core/Feature.java index adcd6f0ff..7bd3b85c0 100644 --- a/src/main/java/codes/biscuit/skyblockaddons/core/Feature.java +++ b/src/main/java/codes/biscuit/skyblockaddons/core/Feature.java @@ -67,10 +67,9 @@ public enum Feature { HIDE_PET_HEALTH_BAR(63, "settings.hidePetHealthBar", null, false), // Release v1.4 DISABLE_MAGICAL_SOUP_MESSAGES(64, "settings.disableMagicalSoupMessage", null,true), - POWER_ORB_STATUS_DISPLAY(65, "settings.powerOrbDisplay", new GuiFeatureData(EnumUtils.DrawType.POWER_ORB_DISPLAY, null), false, EnumUtils.FeatureSetting.POWER_ORB_DISPLAY_STYLE), + DEPLOYABLE_STATUS_DISPLAY(65, "settings.deployableDisplay", new GuiFeatureData(EnumUtils.DrawType.DEPLOYABLE_DISPLAY, null), false, EnumUtils.FeatureSetting.DEPLOYABLE_DISPLAY_STYLE), ZEALOT_COUNTER(66, "settings.zealotCounter", new GuiFeatureData(EnumUtils.DrawType.TEXT, ColorCode.DARK_AQUA), false, EnumUtils.FeatureSetting.ZEALOT_SPAWN_AREAS_ONLY), TICKER_CHARGES_DISPLAY(67, "settings.tickerChargesDisplay", new GuiFeatureData(EnumUtils.DrawType.TICKER, null), false), - TAB_EFFECT_TIMERS(68, "settings.tabEffectTimers", new GuiFeatureData(EnumUtils.DrawType.TAB_EFFECT_TIMERS, ColorCode.WHITE), true), NO_ARROWS_LEFT_ALERT(69, "settings.noArrowsLeftAlert", new GuiFeatureData(ColorCode.RED), false), CAKE_BAG_PREVIEW(71, "settings.showCakeBagPreview", null, true), REPEAT_FULL_INVENTORY_WARNING(73, null, true), @@ -211,11 +210,18 @@ public enum Feature { SHOW_SKYBLOCK_ITEM_ID(213, "settings.showSkyblockItemId", null, true), RESET_SALVAGED_ESSENCES_AFTER_LEAVING_MENU(214, "settings.resetSalvagedEssencesAfterLeavingMenu", null, false), CHANGE_DUNGEON_MAP_ZOOM_WITH_KEYBOARD(215, "settings.changeDungeonMapZoomWithKeyboard", null, false), + // Release 1.7 PLAYER_SYMBOLS_IN_CHAT(216, "settings.showPlayerSymbolsInChat", null, false, EnumUtils.FeatureSetting.SHOW_PROFILE_TYPE, EnumUtils.FeatureSetting.SHOW_NETHER_FACTION), CRIMSON_ARMOR_ABILITY_STACKS(217, "settings.crimsonArmorAbilityStacks", new GuiFeatureData(EnumUtils.DrawType.TEXT, ColorCode.GOLD), false), HIDE_TRUE_DEFENSE(218, "settings.hideTrueDefense", new GuiFeatureData(ColorCode.RED), false), SHOW_PROFILE_TYPE(219, "settings.showProfileType", false), SHOW_NETHER_FACTION(220,"settings.showNetherFaction", false), + // Release Fix3dll + NUMBER_SEPARATORS(221, "settings.numberSeparators", null, false), + HIDE_WHEN_NOT_IN_CRIMSON(222, null, false), + INFERNO_SLAYER_TRACKER(223, "settings.infernoSlayerTracker", new GuiFeatureData(EnumUtils.DrawType.SLAYER_TRACKERS, ColorCode.WHITE), false, EnumUtils.FeatureSetting.COLOUR_BY_RARITY, EnumUtils.FeatureSetting.TEXT_MODE, EnumUtils.FeatureSetting.HIDE_WHEN_NOT_IN_CRIMSON), + INFERNO_COLOR_BY_RARITY(224, null, false), + INFERNO_TEXT_MODE(225, null, true), WARNING_TIME(-1, "settings.warningDuration", null, false), WARP_ADVANCED_MODE(-1, "settings.advancedMode", null, true), @@ -252,6 +258,10 @@ public enum Feature { REPEAT_SLAYER_BOSS_WARNING, ROTATE_MAP, CENTER_ROTATION_ON_PLAYER, MAP_ZOOM, BASE_STAT_BOOST_COLOR_BY_RARITY, SHOW_PLAYER_HEADS_ON_MAP, SHOW_GLOWING_ITEMS_ON_ISLAND, SKILL_ACTIONS_LEFT_UNTIL_NEXT_LEVEL, REVENANT_COLOR_BY_RARITY, TARANTULA_COLOR_BY_RARITY, SVEN_COLOR_BY_RARITY, REVENANT_TEXT_MODE, TARANTULA_TEXT_MODE, SVEN_TEXT_MODE, + DRAGON_STATS_TRACKER_COLOR_BY_RARITY, HIDE_WHEN_NOT_IN_CASTLE, HIDE_WHEN_NOT_IN_SPIDERS_DEN, HIDE_WHEN_NOT_IN_END, + ENDERMAN_COLOR_BY_RARITY, ENDERMAN_TEXT_MODE, HIDE_WHEN_NOT_IN_CRIMSON, INFERNO_COLOR_BY_RARITY, INFERNO_TEXT_MODE, + HIDE_WHEN_NOT_IN_CRYPTS, SHOW_PERSONAL_COMPACTOR_PREVIEW, SHOW_SKILL_PERCENTAGE_INSTEAD_OF_XP, + SHOW_SKILL_XP_GAINED, SHOW_SALVAGE_ESSENCES_COUNTER, HEALING_CIRCLE_OPACITY, COOLDOWN_PREDICTION, ENCHANTMENTS_HIGHLIGHT, DRAGON_STATS_TRACKER_COLOR_BY_RARITY, HIDE_WHEN_NOT_IN_CASTLE, HIDE_WHEN_NOT_IN_SPIDERS_DEN, HIDE_WHEN_NOT_IN_CRYPTS, SHOW_PERSONAL_COMPACTOR_PREVIEW, SHOW_SKILL_PERCENTAGE_INSTEAD_OF_XP, SHOW_SKILL_XP_GAINED, SHOW_SALVAGE_ESSENCES_COUNTER, HEALING_CIRCLE_OPACITY, COOLDOWN_PREDICTION, ENCHANTMENTS_HIGHLIGHT, @@ -271,10 +281,10 @@ public enum Feature { private static final Set guiFeatures = new LinkedHashSet<>(Arrays.asList(DRILL_FUEL_BAR, SKILL_PROGRESS_BAR, MANA_BAR, HEALTH_BAR, MANA_TEXT, OVERFLOW_MANA, DEFENCE_ICON, DEFENCE_TEXT, EFFECTIVE_HEALTH_TEXT, DEFENCE_PERCENTAGE, HEALTH_TEXT, SKELETON_BAR, HEALTH_UPDATES, ITEM_PICKUP_LOG, DARK_AUCTION_TIMER, SKILL_DISPLAY, SPEED_PERCENTAGE, - SLAYER_INDICATOR, POWER_ORB_STATUS_DISPLAY, ZEALOT_COUNTER, TICKER_CHARGES_DISPLAY, TAB_EFFECT_TIMERS, SHOW_TOTAL_ZEALOT_COUNT, SHOW_SUMMONING_EYE_COUNT, + SLAYER_INDICATOR, DEPLOYABLE_STATUS_DISPLAY, ZEALOT_COUNTER, TICKER_CHARGES_DISPLAY, SHOW_TOTAL_ZEALOT_COUNT, SHOW_SUMMONING_EYE_COUNT, SHOW_AVERAGE_ZEALOTS_PER_EYE, BIRCH_PARK_RAINMAKER_TIMER, ENDSTONE_PROTECTOR_DISPLAY, BAIT_LIST, DUNGEONS_MAP_DISPLAY, SHOW_DUNGEON_MILESTONE, DUNGEONS_COLLECTED_ESSENCES_DISPLAY, REVENANT_SLAYER_TRACKER, TARANTULA_SLAYER_TRACKER, SVEN_SLAYER_TRACKER, DRAGON_STATS_TRACKER, DUNGEON_DEATH_COUNTER, - ROCK_PET_TRACKER, DOLPHIN_PET_TRACKER, DUNGEONS_SECRETS_DISPLAY, CANDY_POINTS_COUNTER, DRILL_FUEL_TEXT, + ROCK_PET_TRACKER, DOLPHIN_PET_TRACKER, DUNGEONS_SECRETS_DISPLAY, CANDY_POINTS_COUNTER, DRILL_FUEL_TEXT, INFERNO_SLAYER_TRACKER, TREVOR_TRACKED_ENTITY_PROXIMITY_INDICATOR, FETCHUR_TODAY, VOIDGLOOM_SLAYER_TRACKER, OTHER_DEFENCE_STATS, SPIRIT_SCEPTRE_DISPLAY, FARM_EVENT_TIMER, CRIMSON_ARMOR_ABILITY_STACKS, HIDE_TRUE_DEFENSE)); @@ -283,7 +293,7 @@ public enum Feature { */ @Getter private static final Set generalTabFeatures = new LinkedHashSet<>(Arrays.asList(TEXT_STYLE, WARNING_TIME, CHROMA_SPEED, CHROMA_MODE, - CHROMA_SIZE, TURN_ALL_FEATURES_CHROMA, CHROMA_SATURATION, CHROMA_BRIGHTNESS, USE_NEW_CHROMA_EFFECT, DEVELOPER_MODE)); + CHROMA_SIZE, TURN_ALL_FEATURES_CHROMA, CHROMA_SATURATION, CHROMA_BRIGHTNESS, USE_NEW_CHROMA_EFFECT, NUMBER_SEPARATORS, DEVELOPER_MODE)); private static final int ID_AT_PREVIOUS_UPDATE = 199; @@ -313,7 +323,7 @@ public enum Feature { } /** - * Called when a features enable state is changed. + * Called right after a feature's enable state is changed. */ public void onToggle() { if (this.id == DEVELOPER_MODE.id) { @@ -386,14 +396,12 @@ public void draw(float scale, Minecraft mc, ButtonLocation buttonLocation) { main.getRenderListener().drawIcon(scale, mc, buttonLocation); } else if (guiFeatureData.getDrawType() == EnumUtils.DrawType.REVENANT_PROGRESS) { main.getRenderListener().drawRevenantIndicator(scale, mc, buttonLocation); - } else if (guiFeatureData.getDrawType() == EnumUtils.DrawType.POWER_ORB_DISPLAY) { - main.getRenderListener().drawPowerOrbStatus(mc, scale, buttonLocation); + } else if (guiFeatureData.getDrawType() == EnumUtils.DrawType.DEPLOYABLE_DISPLAY) { + main.getRenderListener().drawDeployableStatus(mc, scale, buttonLocation); } else if (guiFeatureData.getDrawType() == EnumUtils.DrawType.TICKER) { main.getRenderListener().drawScorpionFoilTicker(mc, scale, buttonLocation); } else if (guiFeatureData.getDrawType() == EnumUtils.DrawType.PROXIMITY_INDICATOR) { FeatureTrackerQuest.drawTrackerLocationIndicator(mc, scale, buttonLocation); - } else if (guiFeatureData.getDrawType() == EnumUtils.DrawType.TAB_EFFECT_TIMERS) { - main.getRenderListener().drawPotionEffectTimers(scale, buttonLocation); } else if (guiFeatureData.getDrawType() == EnumUtils.DrawType.BAIT_LIST_DISPLAY) { main.getRenderListener().drawBaitList(mc, scale, buttonLocation); } else if (guiFeatureData.getDrawType() == EnumUtils.DrawType.DUNGEONS_MAP) { diff --git a/src/main/java/codes/biscuit/skyblockaddons/core/Location.java b/src/main/java/codes/biscuit/skyblockaddons/core/Location.java index 53d3bbf3e..6d85ef10f 100644 --- a/src/main/java/codes/biscuit/skyblockaddons/core/Location.java +++ b/src/main/java/codes/biscuit/skyblockaddons/core/Location.java @@ -13,6 +13,8 @@ public enum Location { // TODO: Jsonify all of these ISLAND("Your Island"), // TODO RPC GUEST_ISLAND("'s Island", "island"), // TODO RPC + GARDEN("The Garden"), + GARDEN_PLOT("Plot"), //TODO RPC // Hub AUCTION_HOUSE("Auction House"), @@ -113,11 +115,16 @@ public enum Location { OVERGROWN_MUSHROOM_CAVE("Overgrown Mushroom Cave"), JAKES_HOUSE("Jake's House"), SHEPHERDS_KEEP("Shepherds Keep"), - TRAPPERS_DEN("Trappers Den"), + TRAPPERS_DEN("Trapper's Den"), + // Spider's Den SPIDERS_DEN("Spider's Den"), - - BLAZING_FORTRESS("Blazing Fortress"), + SPIDER_MOUND("Spider Mound"), + ARACHNES_BURROW("Arachne's Burrow"), + ARACHNES_SANCTUARY("Arachnes's Sanctuary"), + GRANDMAS_HOUSE("Grandma's House"), + ARCHAEOLOGISTS_CAMP("Archaeologist's Camp"), + GRAVEL_MINES("Gravel Mines"), // The End THE_END("The End"), @@ -127,8 +134,18 @@ public enum Location { VOID_SLATE("Void Slate"), // Jerry's workshop + // TODO check is it correct JERRY_POND("Jerry Pond"), // TODO RPC JERRYS_WORKSHOP("Jerry's Workshop"), // TODO RPC + MOUNT_JERRY("Mount Jerry"), + GARYS_SHACK("Gary's Shack"), + GLACIAL_CAVE("Glacial Cave"), + TERRYS_SHACK("Terry's Shack"), + HOT_SPRINGS("Hot Springs"), + REFLECTIVE_POND("Reflective Pond"), + SUNKEN_JERRY_POND("Sunken Jerry Pond"), + SHERRYS_SHOWROOM("Sherry's Showroom"), + EINARYS_EMPORIUM("Einary's Emporium"), // Dungeons THE_CATACOMBS("The Catacombs"), // TODO RPC diff --git a/src/main/java/codes/biscuit/skyblockaddons/core/SkyblockDate.java b/src/main/java/codes/biscuit/skyblockaddons/core/SkyblockDate.java index 36a2b6b46..5ba9b8454 100644 --- a/src/main/java/codes/biscuit/skyblockaddons/core/SkyblockDate.java +++ b/src/main/java/codes/biscuit/skyblockaddons/core/SkyblockDate.java @@ -2,7 +2,6 @@ import codes.biscuit.skyblockaddons.utils.TextUtils; -import java.text.DecimalFormat; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -120,7 +119,7 @@ public String toString() { monthName, DAY + TextUtils.getOrdinalSuffix(DAY), HOUR, - TextUtils.NUMBER_FORMAT.format(MINUTE), + TextUtils.formatNumber(MINUTE), PERIOD); } } diff --git a/src/main/java/codes/biscuit/skyblockaddons/core/dungeons/DungeonManager.java b/src/main/java/codes/biscuit/skyblockaddons/core/dungeons/DungeonManager.java index 91df723fe..74e02e638 100644 --- a/src/main/java/codes/biscuit/skyblockaddons/core/dungeons/DungeonManager.java +++ b/src/main/java/codes/biscuit/skyblockaddons/core/dungeons/DungeonManager.java @@ -9,7 +9,9 @@ import net.minecraft.client.Minecraft; import net.minecraft.client.network.NetHandlerPlayClient; import net.minecraft.client.network.NetworkPlayerInfo; +import org.apache.logging.log4j.Logger; +import java.text.ParseException; import java.util.EnumMap; import java.util.HashMap; import java.util.List; @@ -22,13 +24,13 @@ * This class contains a set of utility methods for Skyblock Dungeons. */ public class DungeonManager { - - private static final Pattern PATTERN_MILESTONE = Pattern.compile("^.+?(Healer|Tank|Mage|Archer|Berserk) Milestone .+?([❶-❿]).+?§r§.(\\d+)§.§7 .+?"); - private static final Pattern PATTERN_COLLECTED_ESSENCES = Pattern.compile("§.+?(\\d+) (Wither|Spider|Undead|Dragon|Gold|Diamond|Ice) Essence"); - private static final Pattern PATTERN_BONUS_ESSENCE = Pattern.compile("^§.+?[^You] .+?found a .+?(Wither|Spider|Undead|Dragon|Gold|Diamond|Ice) Essence.+?"); - private static final Pattern PATTERN_SALVAGE_ESSENCES = Pattern.compile("\\+(?[0-9]+) (?Wither|Spider|Undead|Dragon|Gold|Diamond|Ice) Essence!"); + private static final Logger logger = SkyblockAddons.getLogger(); + private static final Pattern PATTERN_MILESTONE = Pattern.compile("^.+?(Healer|Tank|Mage|Archer|Berserk) Milestone .+?([❶-❿]).+?§r§.([\\d,]+)"); + private static final Pattern PATTERN_COLLECTED_ESSENCES = Pattern.compile("§.+?(\\d+) (Wither|Spider|Undead|Dragon|Gold|Diamond|Ice|Crimson) Essence"); + private static final Pattern PATTERN_BONUS_ESSENCE = Pattern.compile("^§.+?[^You] .+?found a .+?(Wither|Spider|Undead|Dragon|Gold|Diamond|Ice|Crimson) Essence.+?"); + private static final Pattern PATTERN_SALVAGE_ESSENCES = Pattern.compile("\\+(?[0-9]+) (?Wither|Spider|Undead|Dragon|Gold|Diamond|Ice|Crimson) Essence!"); private static final Pattern PATTERN_SECRETS = Pattern.compile("§7([0-9]+)/([0-9]+) Secrets"); - private static final Pattern PATTERN_PLAYER_LINE = Pattern.compile("^§.\\[(?.)] (?[\\w§]+) (?:§.)*?§(?.)(?[\\w]+)(?:§c❤)?"); + private static final Pattern PATTERN_PLAYER_LINE = Pattern.compile("^§.\\[(?.)] (?[\\w§]+) (?:§.)*?§(?.)(?[\\w,]+)(?:§c❤)?"); private static final Pattern PLAYER_LIST_INFO_DEATHS_PATTERN = Pattern.compile("Deaths: \\((?\\d+)\\)"); /** The last dungeon server the player played on */ @@ -223,7 +225,12 @@ public void updateDungeonPlayer(String scoreboardLine) { if (healthText.equals("DEAD")) { health = 0; } else { - health = Integer.parseInt(healthText); + try { + health = TextUtils.NUMBER_FORMAT.parse(healthText).intValue(); + } catch (ParseException ex) { + logger.error("Failed to parse player "+ name + " health: " + healthText, ex); + return; + } } for (DungeonPlayer player: teammates.values()) { diff --git a/src/main/java/codes/biscuit/skyblockaddons/features/EntityOutlines/FeatureTrackerQuest.java b/src/main/java/codes/biscuit/skyblockaddons/features/EntityOutlines/FeatureTrackerQuest.java index 67ff79d56..8802ec2bd 100644 --- a/src/main/java/codes/biscuit/skyblockaddons/features/EntityOutlines/FeatureTrackerQuest.java +++ b/src/main/java/codes/biscuit/skyblockaddons/features/EntityOutlines/FeatureTrackerQuest.java @@ -42,7 +42,7 @@ public class FeatureTrackerQuest { Location.SHEPHERDS_KEEP, Location.OVERGROWN_MUSHROOM_CAVE, Location.JAKES_HOUSE, Location.TREASURE_HUNTER_CAMP); private static final Pattern TRACKED_ANIMAL_NAME_PATTERN = Pattern.compile("\\[Lv[0-9]+] (?[a-zA-Z]+) (?[a-zA-Z]+) .*❤"); - private static final Pattern TREVOR_FIND_ANIMAL_PATTERN = Pattern.compile("\\[NPC] Trevor The Trapper: You can find your [A-Z]+ animal near the [a-zA-Z ]+."); + private static final Pattern TREVOR_FIND_ANIMAL_PATTERN = Pattern.compile("\\[NPC] Trevor: You can find your [A-Z]+ animal near the [a-zA-Z ]+."); private static final Pattern ANIMAL_DIED_PATTERN = Pattern.compile("Your mob died randomly, you are rewarded [0-9]+ pelts?."); private static final Pattern ANIMAL_KILLED_PATTERN = Pattern.compile("Killing the animal rewarded you [0-9]+ pelts?."); @@ -190,7 +190,7 @@ public void onNameTagRender(Pre e) { if (SkyblockAddons.getInstance().getConfigValues().isEnabled(Feature.TREVOR_THE_TRAPPER_FEATURES) && !e.isCanceled() && SkyblockAddons.getInstance().getConfigValues().isEnabled(Feature.TREVOR_SHOW_QUEST_COOLDOWN) && CooldownManager.isOnCooldown("TREVOR_THE_TRAPPER_RETURN")) { - Pattern p = Pattern.compile("Trevor The Trapper"); + Pattern p = Pattern.compile("Trevor"); String s = TextUtils.stripColor(entity.getCustomNameTag()); if (p.matcher(s).matches()) { String str = Utils.MESSAGE_PREFIX_SHORT + Translations.getMessage("messages.worldRenderedCooldownTime", diff --git a/src/main/java/codes/biscuit/skyblockaddons/features/deployables/Deployable.java b/src/main/java/codes/biscuit/skyblockaddons/features/deployables/Deployable.java new file mode 100644 index 000000000..b92e4e0eb --- /dev/null +++ b/src/main/java/codes/biscuit/skyblockaddons/features/deployables/Deployable.java @@ -0,0 +1,134 @@ +package codes.biscuit.skyblockaddons.features.deployables; + +import lombok.Getter; +import net.minecraft.util.ResourceLocation; + +/** + * Represents the Deployables introduced with the Slayer Update and unlocked through the Wolf slayer and Blaze slayer quests. + */ +@Getter +public enum Deployable { + // Orbs + RADIANT("§aRadiant", 0.01, 0.0, 0, 0, 0.0, 18*18, "radiant"), + MANA_FLUX("§9Mana Flux", 0.02, 0.5, 10, 0, 0.0, 18*18, "manaflux"), + OVERFLUX("§5Overflux", 0.025, 1, 25, 5, 5.0, 18*18, "overflux"), + PLASMAFLUX("§d§lPlasmaflux", 0.03, 1.25, 35, 7.5, 7.5, 20*20, "plasmaflux"), + + // Flares + WARNING_FLARE(0.0, 10, 10, 0, 0, "22e2bf6c1ec330247927ba63479e5872ac66b06903c86c82b52dac9f1c971458", 40*40, "warning"), + ALERT_FLARE(0.5, 20, 20, 10, 0, "9d2bf9864720d87fd06b84efa80b795c48ed539b16523c3b1f1990b40c003f6b", 40*40, "alert"), + SOS_FLARE(1.25, 30, 25, 10, 5, "c0062cc98ebda72a6a4b89783adcef2815b483a01d73ea87b3df76072a89d13b", 40*40, "sos"); + + /** + * Start of the display name of the actual floating deployable entity. + */ + private String display = ""; + /** + * Percentage of max health that's regenerated every second + */ + private double healthRegen = 0.0; + /** + * Percentage of mana regeneration increase given by the deployable + */ + private final double manaRegen; + /** + * Amount of strength given by the deployable + */ + private int strength = 0; + /** + * Amount of vitality given by the deployable + */ + private final double vitality; + /** + * Amount of mending given by the deployable + */ + private double mending = 0; + /** + * Amount of vitality given by the deployable + */ + private int trueDefense = 0; + /** + * Amount of ferocity given by the deployable + */ + private int ferocity = 0; + /** + * Amount of strength given by the deployable + */ + private int bonusAttackSpeed; + /** + * The squared range of the deployable effects + */ + private final int rangeSquared; + /** + * Resource location to the icon used when displaying the deployable + */ + private final ResourceLocation resourceLocation; + /** + * Entity textureId for detect Flares + */ + private String textureId = ""; + + // Orbs + Deployable(String display, double healthRegen, double manaRegen, int strength, double vitality, double mending, int rangeSquared, String resourcePath) { + this.display = display; + this.healthRegen = healthRegen; + this.manaRegen = manaRegen; + this.strength = strength; + this.vitality = vitality; + this.mending = mending; + this.rangeSquared = rangeSquared; + this.resourceLocation = new ResourceLocation("skyblockaddons", "deployables/"+resourcePath+".png"); + } + + // Flares + Deployable(double manaRegen, double vitality, int trueDefense, int ferocity, int bonusAttackSpeed, String textureId, int rangeSquared, String resourcePath) { + this.manaRegen = manaRegen; + this.vitality = vitality; + this.trueDefense = trueDefense; + this.ferocity = ferocity; + this.bonusAttackSpeed = bonusAttackSpeed; + this.rangeSquared = rangeSquared; + this.resourceLocation = new ResourceLocation("skyblockaddons", "deployables/"+resourcePath+".png"); + this.textureId = textureId; + } + + /** + * Check if a distance is within this deployables radius. + * + * @param distanceSquared Squared distance from deployable entity to player + * @return Whether that distance is within radius + */ + public boolean isInRadius(double distanceSquared) { + return distanceSquared <= rangeSquared; + } + + /** + * Match an entity display name against Orbs entity names to get the corresponding type. + * + * @param displayName Entity display name + * @return The matching type or null if none was found + */ + public static Deployable getByDisplayname(String displayName) { + for (Deployable orb : values()) { + if(displayName.startsWith(orb.display)) { + return orb; + } + } + return null; + } + + /** + * Match an entity skull id against Flares skull ids to get the corresponding type. + * + * @param textureId Entity skull id + * @return The matching type or null if none was found + */ + public static Deployable getByTextureId(String textureId) { + for (Deployable flare : values()) { + if(textureId.equals(flare.textureId)) { + return flare; + } + } + return null; + } +} diff --git a/src/main/java/codes/biscuit/skyblockaddons/features/deployables/DeployableManager.java b/src/main/java/codes/biscuit/skyblockaddons/features/deployables/DeployableManager.java new file mode 100644 index 000000000..87c2152b0 --- /dev/null +++ b/src/main/java/codes/biscuit/skyblockaddons/features/deployables/DeployableManager.java @@ -0,0 +1,179 @@ +package codes.biscuit.skyblockaddons.features.deployables; + +import codes.biscuit.skyblockaddons.utils.TextUtils; +import codes.biscuit.skyblockaddons.utils.Utils; +import lombok.Getter; +import lombok.RequiredArgsConstructor; +import net.minecraft.client.Minecraft; +import net.minecraft.entity.item.EntityArmorStand; +import net.minecraft.item.ItemStack; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.ReportedException; + +import java.nio.charset.StandardCharsets; +import java.util.*; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * Class for managing active Deployable around the player. + * {@link #put(Deployable, int, UUID) Insert} deployable that get detected and {@link #getActiveDeployable() get} the + * active deployable with the highest priority (enum ordinal). + * + * @author DidiSkywalker + */ +public class DeployableManager { + private static final Pattern TEXTURE_URL_PATTERN = Pattern.compile("\\\"url\\\"\\s?:\\s?\\\".+/(?\\w+)\\\""); + private static final Pattern POWER_ORB_PATTERN = Pattern.compile("[A-Za-z ]* (?[0-9]*)s"); + + /** The DeployableManager instance. */ + @Getter private static final DeployableManager instance = new DeployableManager(); + + /** + * Entry displaying {@link Deployable#RADIANT} at 20 seconds for the edit screen + */ + public static final DeployableEntry DUMMY_POWER_ORB_ENTRY = new DeployableEntry(Deployable.SOS_FLARE, 90, null); + + private Map deployableEntryMap = new HashMap<>(); + + /** + * Put any detected deployable into the list of active deployables. + * + * @param deployable Detected Deployable type + * @param seconds Seconds the deployable has left before running out + */ + private void put(Deployable deployable, int seconds, UUID uuid) { + deployableEntryMap.put(deployable, new DeployableEntry(deployable, seconds, uuid)); + } + + /** + * Get the active deployable with the highest priority. Priority is based on enum value's ordinal + * and the returned deployable is guaranteed to have been active at least 100ms ago. + * + * @return Highest priority deployable or null if none is around + */ + public DeployableEntry getActiveDeployable() { + Optional> max = deployableEntryMap.entrySet().stream() + .filter(deployableEntryEntry -> deployableEntryEntry.getValue().timestamp + 100 > System.currentTimeMillis()) + .max(Map.Entry.comparingByKey()); + + return max.map(Map.Entry::getValue).orElse(null); + } + + /** + * Detects a deployable from an entity, and puts it in this manager. + * + * @param entityArmorStand The entity to detect whether it is a deployable or not. + */ + public void detectDeployables(EntityArmorStand entityArmorStand) { + if (entityArmorStand.hasCustomName()) { + String customNameTag = entityArmorStand.getCustomNameTag(); + Deployable orb = Deployable.getByDisplayname(customNameTag); + + if (orb != null && orb.isInRadius(entityArmorStand.getDistanceSqToEntity(Minecraft.getMinecraft().thePlayer))) { + Matcher matcher = POWER_ORB_PATTERN.matcher(TextUtils.stripColor(customNameTag)); + + if (matcher.matches()) { + int seconds; + try { + // Apparently they don't have a second count for moment after spawning, that's what this try-catch is for + seconds = Integer.parseInt(matcher.group("seconds")); + } catch (NumberFormatException ex) { + // It's okay, just don't add the deployable I guess... + return; + } + + List surroundingArmorStands = Minecraft.getMinecraft().theWorld.getEntitiesWithinAABB( + EntityArmorStand.class, + new AxisAlignedBB( + entityArmorStand.posX - 0.1, + entityArmorStand.posY - 3, + entityArmorStand.posZ - 0.1, + entityArmorStand.posX + 0.1, + entityArmorStand.posY, + entityArmorStand.posZ + 0.1 + ) + ); + if (!surroundingArmorStands.isEmpty()) { + EntityArmorStand orbArmorStand = null; + + for (EntityArmorStand surroundingArmorStand : surroundingArmorStands) { + ItemStack helmet = surroundingArmorStand.getCurrentArmor(3); + if (helmet != null) { + orbArmorStand = surroundingArmorStand; + } + } + + put(orb, seconds, orbArmorStand == null ? null : orbArmorStand.getUniqueID()); + } + } + } + } else { + // Flare detection + // TODO optimize + if (entityArmorStand.isInvisible()) { + // we need skull on head + if (entityArmorStand.getCurrentArmor(3) == null) + return; + + String textureBase64; + try { + textureBase64 = entityArmorStand.getCurrentArmor(3).getSubCompound("SkullOwner", false) + .getCompoundTag("Properties").getTagList("textures", 10).getCompoundTagAt(0) + .getString("Value"); + } catch (NullPointerException|ReportedException ex) { + // entity head texture is empty + return; + } + + String decodedTextureUrl = new String( + Base64.getDecoder().decode( + // Getting before '=' to avoid IllegalArgumentException. No padding needed + textureBase64.contains("=") + ? textureBase64.substring(0, textureBase64.indexOf('=')) + : textureBase64 + ), + StandardCharsets.UTF_8 + ); + + Deployable flare; + Matcher matcher = TEXTURE_URL_PATTERN.matcher(decodedTextureUrl); + if (matcher.find()) { + flare = Deployable.getByTextureId(matcher.group("textureId")); + } else + return; + + // Default exist time of flares + int seconds = 180; + + if (flare != null && flare.isInRadius(entityArmorStand.getDistanceSqToEntity(Minecraft.getMinecraft().thePlayer))) { + // 1 tick = 50ms + seconds -= entityArmorStand.ticksExisted * 50 / 1000; + + put(flare, seconds, entityArmorStand.getUniqueID() == null ? null : entityArmorStand.getUniqueID()); + } + } + } + } + + public EntityArmorStand createVirtualArmorStand(EntityArmorStand armorStandToClone) { + EntityArmorStand virtualArmorStand = new EntityArmorStand(Utils.getDummyWorld()); + + virtualArmorStand.setCurrentItemOrArmor(4, armorStandToClone.getEquipmentInSlot(4)); + + return virtualArmorStand; + } + + @Getter @RequiredArgsConstructor + public static class DeployableEntry { + /** The Deployable type. */ + private final Deployable deployable; + + /** Seconds the deployable has left before running out */ + private final int seconds; + + private final long timestamp = System.currentTimeMillis(); + + private final UUID uuid; + } +} diff --git a/src/main/java/codes/biscuit/skyblockaddons/features/discordrpc/DiscordStatus.java b/src/main/java/codes/biscuit/skyblockaddons/features/discordrpc/DiscordStatus.java index 840391cb8..f95ca0403 100644 --- a/src/main/java/codes/biscuit/skyblockaddons/features/discordrpc/DiscordStatus.java +++ b/src/main/java/codes/biscuit/skyblockaddons/features/discordrpc/DiscordStatus.java @@ -36,9 +36,9 @@ public enum DiscordStatus implements ButtonSelect.SelectItem { String coinString = " Coin"; if (coins == 1) { - return TextUtils.formatDouble(coins) + coinString; + return TextUtils.formatNumber(coins) + coinString; } else { - return TextUtils.formatDouble(coins) + coinString + 's'; + return TextUtils.formatNumber(coins) + coinString + 's'; } }), @@ -48,9 +48,9 @@ public enum DiscordStatus implements ButtonSelect.SelectItem { String bitString = " Bit"; if (bits == 1) { - return TextUtils.formatDouble(bits) + bitString; + return TextUtils.formatNumber(bits) + bitString; } else { - return TextUtils.formatDouble(bits) + bitString + 's'; + return TextUtils.formatNumber(bits) + bitString + 's'; } }), @@ -107,6 +107,8 @@ public enum DiscordStatus implements ButtonSelect.SelectItem { if (slayerQuest == EnumUtils.SlayerQuest.REVENANT_HORROR) return DiscordStatus.valueOf("REVENANT").displayMessageSupplier.get(); if (slayerQuest == EnumUtils.SlayerQuest.SVEN_PACKMASTER) return DiscordStatus.valueOf("SVEN").displayMessageSupplier.get(); if (slayerQuest == EnumUtils.SlayerQuest.TARANTULA_BROODFATHER) return DiscordStatus.valueOf("TARANTULA").displayMessageSupplier.get(); + if (slayerQuest == EnumUtils.SlayerQuest.VOIDGLOOM_SERAPH) return DiscordStatus.valueOf("VOIDGLOOM").displayMessageSupplier.get(); + if (slayerQuest == EnumUtils.SlayerQuest.INFERNO_DEMONLORD) return DiscordStatus.valueOf("INFERNO").displayMessageSupplier.get(); } if ("AUTO_STATUS".equals(main.getConfigValues().getDiscordAutoDefault().name())) { // Avoid self reference. diff --git a/src/main/java/codes/biscuit/skyblockaddons/features/dungeonmap/DungeonMapManager.java b/src/main/java/codes/biscuit/skyblockaddons/features/dungeonmap/DungeonMapManager.java index bf6a574a5..255ab6ab7 100644 --- a/src/main/java/codes/biscuit/skyblockaddons/features/dungeonmap/DungeonMapManager.java +++ b/src/main/java/codes/biscuit/skyblockaddons/features/dungeonmap/DungeonMapManager.java @@ -59,9 +59,9 @@ public class DungeonMapManager { /** The factor the player's coordinates are multiplied by to calculate their map marker coordinates */ private static final float COORDINATE_FACTOR = 1.33F; - /** {@link EntityPlayerSP#lastReportedPosX} */ + /** {@code EntityPlayerSP#lastReportedPosX} */ static final Field lastReportedPosX; - /** {@link EntityPlayerSP#lastReportedPosZ} */ + /** {@code EntityPlayerSP#lastReportedPosZ} */ static final Field lastReportedPosZ; private static MapData mapData; @@ -505,9 +505,9 @@ public static void decreaseZoomByStep() { } /** - * Returns the map zoom factor from {@link codes.biscuit.skyblockaddons.config.ConfigValues#mapZoom}. + * Returns the map zoom factor from {@code codes.biscuit.skyblockaddons.config.ConfigValues#mapZoom}. * - * @return the map zoom factor from {@link codes.biscuit.skyblockaddons.config.ConfigValues#mapZoom} + * @return the map zoom factor from {@code codes.biscuit.skyblockaddons.config.ConfigValues#mapZoom} */ public static float getMapZoom() { return main.getConfigValues().getMapZoom().getValue(); @@ -526,7 +526,7 @@ public static void setDenormalizedMapZoom(float value){ } /** - * Sets the map zoom factor in {@link codes.biscuit.skyblockaddons.config.ConfigValues#mapZoom}. + * Sets the map zoom factor in {@code codes.biscuit.skyblockaddons.config.ConfigValues#mapZoom}. * The new value must be between 0.5f and 5f inclusive. * * @param value the new map zoom factor diff --git a/src/main/java/codes/biscuit/skyblockaddons/features/powerorbs/PowerOrb.java b/src/main/java/codes/biscuit/skyblockaddons/features/powerorbs/PowerOrb.java deleted file mode 100644 index ffa189d99..000000000 --- a/src/main/java/codes/biscuit/skyblockaddons/features/powerorbs/PowerOrb.java +++ /dev/null @@ -1,82 +0,0 @@ -package codes.biscuit.skyblockaddons.features.powerorbs; - -import lombok.Getter; -import net.minecraft.util.ResourceLocation; - -/** - * Represents the Power Orbs introduced with the Slayer Update and unlocked through the Wolf slayer quests. - * - * @author DidiSkywalker - */ -@Getter -public enum PowerOrb { - - RADIANT("§aRadiant", 0.01, 0, 0, 0, 18*18, "radiant"), - MANA_FLUX("§9Mana Flux", 0.02, 0.5, 10, 0, 18*18, "manaflux"), - OVERFLUX("§5Overflux", 0.025, 1, 25, 0.05, 18*18, "overflux"), - PLASMAFLUX("§d§lPlasmaflux", 0.03, 1.25, 35, 0.075, 20*20, "plasmaflux"); - - /** - * Start of the display name of the actual floating orb entity. - */ - private String display; - /** - * Percentage of max health that's regenerated every second - */ - private double healthRegen; - /** - * Percentage of mana regeneration increase given by the orb - */ - private double manaRegen; - /** - * Amount of strength given by the orb - */ - private int strength; - /** - * Percentage value that all healing is increased by within orb radius - */ - private double healIncrease; - /** - * The squared range of the orb effects - */ - private int rangeSquared; - /** - * Resource location to the icon used when displaying the orb - */ - private ResourceLocation resourceLocation; - - PowerOrb(String display, double healthRegen, double manaRegen, int strength, double healIncrease, int rangeSquared, String resourcePath) { - this.display = display; - this.healthRegen = healthRegen; - this.manaRegen = manaRegen; - this.strength = strength; - this.healIncrease = healIncrease; - this.rangeSquared = rangeSquared; - this.resourceLocation = new ResourceLocation("skyblockaddons", "powerorbs/"+resourcePath+".png"); - } - - /** - * Check if a distance is within this orbs radius. - * - * @param distanceSquared Squared distance from orb entity to player - * @return Whether that distance is within radius - */ - public boolean isInRadius(double distanceSquared) { - return distanceSquared <= rangeSquared; - } - - /** - * Match an entity display name against Power Orb entity names to get the corresponding type. - * - * @param displayName Entity display name - * @return The matching type or null if none was found - */ - public static PowerOrb getByDisplayname(String displayName) { - for (PowerOrb powerOrb : values()) { - if(displayName.startsWith(powerOrb.display)) { - return powerOrb; - } - } - return null; - } -} diff --git a/src/main/java/codes/biscuit/skyblockaddons/features/powerorbs/PowerOrbManager.java b/src/main/java/codes/biscuit/skyblockaddons/features/powerorbs/PowerOrbManager.java deleted file mode 100644 index ced1e8858..000000000 --- a/src/main/java/codes/biscuit/skyblockaddons/features/powerorbs/PowerOrbManager.java +++ /dev/null @@ -1,123 +0,0 @@ -package codes.biscuit.skyblockaddons.features.powerorbs; - -import codes.biscuit.skyblockaddons.utils.TextUtils; -import codes.biscuit.skyblockaddons.utils.Utils; -import lombok.Getter; -import lombok.RequiredArgsConstructor; -import net.minecraft.client.Minecraft; -import net.minecraft.entity.Entity; -import net.minecraft.entity.item.EntityArmorStand; -import net.minecraft.item.ItemStack; -import net.minecraft.util.AxisAlignedBB; - -import java.util.*; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -/** - * Class for managing active PowerOrbs around the player. - * {@link #put(PowerOrb, int, UUID) Insert} orbs that get detected and {@link #getActivePowerOrb() get} the - * active orb with the highest priority (enum ordinal). - * - * @author DidiSkywalker - */ -public class PowerOrbManager { - - private static final Pattern POWER_ORB_PATTERN = Pattern.compile("[A-Za-z ]* (?[0-9]*)s"); - - /** The PowerOrbManager instance. */ - @Getter private static final PowerOrbManager instance = new PowerOrbManager(); - - /** - * Entry displaying {@link PowerOrb#RADIANT} at 20 seconds for the edit screen - */ - public static final PowerOrbEntry DUMMY_POWER_ORB_ENTRY = new PowerOrbEntry(PowerOrb.RADIANT, 20, null); - - private Map powerOrbEntryMap = new HashMap<>(); - - /** - * Put any detected orb into the list of active orbs. - * - * @param powerOrb Detected PowerOrb type - * @param seconds Seconds the orb has left before running out - */ - private void put(PowerOrb powerOrb, int seconds, UUID uuid) { - powerOrbEntryMap.put(powerOrb, new PowerOrbEntry(powerOrb, seconds, uuid)); - } - - /** - * Get the active orb with the highest priority. Priority is based on enum value's ordinal - * and the returned orb is guaranteed to have been active at least 100ms ago. - * - * @return Highest priority orb or null if none is around - */ - public PowerOrbEntry getActivePowerOrb() { - Optional> max = powerOrbEntryMap.entrySet().stream() - .filter(powerOrbEntryEntry -> powerOrbEntryEntry.getValue().timestamp + 100 > System.currentTimeMillis()) - .max(Map.Entry.comparingByKey()); - - return max.map(Map.Entry::getValue).orElse(null); - } - - /** - * Detects a power orb from an entity, and puts it in this manager. - * - * @param entity The entity to detect whether it is a power orb or not. - */ - public void detectPowerOrb(Entity entity) { - String customNameTag = entity.getCustomNameTag(); - PowerOrb powerOrb = PowerOrb.getByDisplayname(customNameTag); - - if (powerOrb != null && powerOrb.isInRadius(entity.getDistanceSqToEntity(Minecraft.getMinecraft().thePlayer))) { // TODO Make sure this works... - Matcher matcher = POWER_ORB_PATTERN.matcher(TextUtils.stripColor(customNameTag)); - - if (matcher.matches()) { - int seconds; - try { - // Apparently they don't have a second count for moment after spawning, that's what this try-catch is for - seconds = Integer.parseInt(matcher.group("seconds")); - } catch (NumberFormatException ex) { - // It's okay, just don't add the power orb I guess... - return; - } - - List surroundingArmorStands = Minecraft.getMinecraft().theWorld.getEntitiesWithinAABB(EntityArmorStand.class, - new AxisAlignedBB(entity.posX - 0.1, entity.posY - 3, entity.posZ - 0.1, entity.posX + 0.1, entity.posY, entity.posZ + 0.1)); - if (!surroundingArmorStands.isEmpty()) { - - EntityArmorStand orbArmorStand = null; - - for (EntityArmorStand surroundingArmorStand : surroundingArmorStands) { - ItemStack helmet = surroundingArmorStand.getCurrentArmor(3); - if (helmet != null) { - orbArmorStand = surroundingArmorStand; - } - } - - put(powerOrb, seconds, orbArmorStand == null ? null : orbArmorStand.getUniqueID()); - } - } - } - } - - public EntityArmorStand createVirtualArmorStand(EntityArmorStand armorStandToClone) { - EntityArmorStand virtualArmorStand = new EntityArmorStand(Utils.getDummyWorld()); - - virtualArmorStand.setCurrentItemOrArmor(4, armorStandToClone.getEquipmentInSlot(4)); - - return virtualArmorStand; - } - - @Getter @RequiredArgsConstructor - public static class PowerOrbEntry { - /** The PowerOrb type. */ - private final PowerOrb powerOrb; - - /** Seconds the orb has left before running out */ - private final int seconds; - - private final long timestamp = System.currentTimeMillis(); - - private final UUID uuid; - } -} diff --git a/src/main/java/codes/biscuit/skyblockaddons/features/slayertracker/SlayerBoss.java b/src/main/java/codes/biscuit/skyblockaddons/features/slayertracker/SlayerBoss.java index 315dfae07..6904180f2 100644 --- a/src/main/java/codes/biscuit/skyblockaddons/features/slayertracker/SlayerBoss.java +++ b/src/main/java/codes/biscuit/skyblockaddons/features/slayertracker/SlayerBoss.java @@ -8,6 +8,7 @@ import java.util.Locale; import static codes.biscuit.skyblockaddons.features.slayertracker.SlayerDrop.*; +import static codes.biscuit.skyblockaddons.features.slayertracker.SlayerDrop.SUBZERO_INVERTER; public enum SlayerBoss { @@ -23,8 +24,12 @@ public enum SlayerBoss { VOIDGLOOM("Enderman", NULL_SPHERE, TWILIGHT_ARROW_POISON, ENDERSNAKE_RUNE, SUMMONING_EYE, MANA_STEAL_ONE, TRANSMISSION_TUNER, NULL_ATOM, HAZMAT_ENDERMAN, POCKET_ESPRESSO_MACHINE, SMARTY_PANTS_ONE, END_RUNE, HANDY_BLOOD_CHALICE, SINFUL_DICE, EXCEEDINGLY_RARE_ENDER_ARTIFACT_UPGRADER, VOID_CONQUEROR_ENDERMAN_SKIN, - ETHERWARP_MERGER, JUDGEMENT_CORE, ENCHANT_RUNE, ENDER_SLAYER_SEVEN); - + ETHERWARP_MERGER, JUDGEMENT_CORE, ENCHANT_RUNE, ENDER_SLAYER_SEVEN), + + INFERNO("Blaze", DERELICT_ASHE, LAVATEARS_RUNE, WISP_ICE_FLAVORED_WATER, BUNDLE_OF_MAGMA, MANA_DISINTEGRATOR, + SCORCHED_BOOKS, KELVIN_INVERTER, BLAZE_ROD_DISTILLATE, GLOWSTONE_DISTILLATE, MAGMA_CREAM_DISTILLATE, NETHER_WART_DISTILLATE, + GABAGOOL_DISTILLATE, SCORCHED_POWER_CRYSTAL, ARCHFIEND_DICE, FIRE_ASPECT, FIERY_BURST_RUNE, FLAWED_OPAL_GEMSTONE, + DUPLEX, HIGH_CLASS_ARCHFIEND_DICE, WILSON_ENGINEERING_PLANS, SUBZERO_INVERTER); @Getter private final List drops; diff --git a/src/main/java/codes/biscuit/skyblockaddons/features/slayertracker/SlayerDrop.java b/src/main/java/codes/biscuit/skyblockaddons/features/slayertracker/SlayerDrop.java index 981a720e9..1ac5427f4 100644 --- a/src/main/java/codes/biscuit/skyblockaddons/features/slayertracker/SlayerDrop.java +++ b/src/main/java/codes/biscuit/skyblockaddons/features/slayertracker/SlayerDrop.java @@ -67,7 +67,30 @@ public enum SlayerDrop { ETHERWARP_MERGER("Etherwarp Merger", "ETHERWARP_MERGER", ItemRarity.EPIC, "209e7834-3376-36e1-84eb-da13ef083836", "3e5314f4919691ccbf807743dae47ae45ac2e3ff08f79eecdd452fe602eff7f6"), JUDGEMENT_CORE("Judgement Core", "JUDGEMENT_CORE", ItemRarity.LEGENDARY, "ed896594-8655-3212-933e-c67bca300084", "2f3ddd7f81089c85b26ed597675519f03a1dcd6d1713e0cfc66afb8743cbe0"), ENCHANT_RUNE("Enchant Rune", "RUNE", "ENCHANT", ItemRarity.LEGENDARY, "1a34ecd4-6a5f-35aa-b5d3-617be4684d9a", "59ffacec6ee5a23d9cb24a2fe9dc15b24488f5f71006924560bf12148421ae6d"), - ENDER_SLAYER_SEVEN("Enchanted Book", "ENCHANTED_BOOK", ItemRarity.RARE, "ender_slayer", 7); + ENDER_SLAYER_SEVEN("Enchanted Book", "ENCHANTED_BOOK", ItemRarity.RARE, "ender_slayer", 7), + + // Blaze Drops + DERELICT_ASHE(Items.gunpowder, "Derelict Ashe", "DERELICT_ASHE", ItemRarity.UNCOMMON, true), + LAVATEARS_RUNE("Lavatears Rune I", "RUNE", "LAVATEARS", ItemRarity.LEGENDARY, "9a960dcb-e362-3642-bf8e-510574a20cd7", "4f01ec6331a3bc30a8204ec56398d08ca38788556bca9b81d776f6238d567367"), + WISP_ICE_FLAVORED_WATER(Items.potionitem, "Wisp's Ice-Flavored Water I Splash Potion", "POTION", ItemRarity.COMMON), + BUNDLE_OF_MAGMA("Bundle of Magma Arrows", "ARROW_BUNDLE_MAGMA", ItemRarity.EPIC, "17c69624-a342-3d09-a976-d0c155aaafec", "68392651a1a4cbb5982b13ace0829a75b98c11e13b68868fe349aea24014ffbd"), + MANA_DISINTEGRATOR("Mana Disintegrator", "MANA_DISINTEGRATOR", ItemRarity.RARE, "b9d84e23-a8e5-3992-bace-b6f3b32e34d8", "818f83eb64f438e3f6ae3a5c2dea8ed10303bad85ac34a798659a275aa096506"), + SCORCHED_BOOKS("Scorched Books", "SCORCHED_BOOKS", ItemRarity.MYTHIC, "d15a5bd9-33f1-3336-9679-9d4887b84e9c", "46ee7e906686abd5ec192b079314c45f1fb8171d9e13caa4cf9f63afc2263fd5"), + KELVIN_INVERTER("Kelvin Inverter", "KELVIN_INVERTER", ItemRarity.RARE, "be00aa7f-9080-3862-8d7d-2c6e4cbfd7c8", "b247f2658aebbb2766046624da85ee04cd2b18a8252045d4260bd81d62c7b6d8"), + BLAZE_ROD_DISTILLATE("Blaze Rod Distillate", "BLAZE_ROD_DISTILLATE", ItemRarity.RARE, "8056c161-527f-3c65-87c7-6c6240874d2e", "41e813a3a380e3eb201c24b9661f6edb39bdf42a88989f81a90f771997d6f5cd"), + GLOWSTONE_DISTILLATE("Glowstone Distillate", "GLOWSTONE_DUST_DISTILLATE", ItemRarity.RARE, "2f04f258-da20-330c-a415-f03d3b8ffd91", "18a2be157f2380931d697f1169af4eac09cfddaa4e052b53d76ef1cfd19cdaf"), + MAGMA_CREAM_DISTILLATE("Magma Cream Distillate", "MAGMA_CREAM_DISTILLATE", ItemRarity.RARE, "c95d296c-9b74-3f50-b97e-2108f6f86e6a", "41e813a3a380e3eb201c24b9661f6edb39bdf42a88989f81a90f771997d6f5cd"), + NETHER_WART_DISTILLATE("Nether Wart Distillate", "NETHER_STALK_DISTILLATE", ItemRarity.RARE, "57e7938b-2d98-3ede-86fb-48ba0d3deb4e", "7aff47f07df632bdafbf0b4ab8f3227d1f94c89aefaa28c5a3463b4ca5bfe6c5"), + GABAGOOL_DISTILLATE("Gabagool Distillate", "CRUDE_GABAGOOL_DISTILLATE", ItemRarity.RARE, "e33f8341-3ece-364c-a26b-a1d3b460645f", "595231147189ac4b9f53487ce35ba0205bf377f3986c0e5ceb942e77f1c39cc"), + SCORCHED_POWER_CRYSTAL("Scorched Power Crystal", "SCORCHED_POWER_CRYSTAL", ItemRarity.LEGENDARY, "3c4d9142-a59b-4e72-8f48-5e48b1650163", "2cf0ccf5a5f97097262e773bbf65c4d7d9a39938015bf00de4918620f034f9b0"), + ARCHFIEND_DICE("Archfiend Dice", "ARCHFIEND_DICE", ItemRarity.EPIC, "9c3c19b2-84e6-3eb6-8aec-450e133a569a", "6e22c298e7c6336af17909ac1f1ee6834b58b1a3cc99aba255ca7eaeb476173"), + FIRE_ASPECT("Enchanted Book", "ENCHANTED_BOOK", ItemRarity.COMMON, "fire_aspect", 3), + FIERY_BURST_RUNE("Fiery Burst Rune I", "RUNE", "FIERY_BURST", ItemRarity.LEGENDARY, "983fd05e-d9e2-3dbc-9185-28e3138ccb34", "8d620e4e3d3abfed6ad81a58a56bcd085d9e9efc803cabb21fa6c9e3969e2d2e"), + FLAWED_OPAL_GEMSTONE("❂ Flawed Opal Gemstone", "FLAWED_OPAL_GEM", ItemRarity.UNCOMMON, "f1fa016a-e25d-3e5b-90c5-b9928ecf14c4", "eadc3bcdd7c701b63f8b8b4a96e429316a08388669d9a98c1a98791729b961df"), + DUPLEX("Enchanted Book", "ENCHANTED_BOOK", ItemRarity.COMMON, "ultimate_reiterate", 1), + HIGH_CLASS_ARCHFIEND_DICE("High Class Archfiend Dice", "HIGH_CLASS_ARCHFIEND_DICE", ItemRarity.LEGENDARY, "9c3c19b2-84e6-3eb6-8aec-450e133a569a"/*change*/, "915f7c313bca9c2f958e68ab14ab393867d67503affff8f20cb13fbe917fd31"), + WILSON_ENGINEERING_PLANS(Items.paper, "Wilson's Engineering Plans", "WILSON_ENGINEERING_PLANS", ItemRarity.LEGENDARY, true), + SUBZERO_INVERTER("Subzero Inverter", "SUBZERO_INVERTER", ItemRarity.LEGENDARY, "5ab20327-b51e-36b3-b65a-a772bc225067", "1cf677ca6209961e81beeb3aa274e0ec8d21d36778e5a94b80b1d8425b04ac6e"); @Getter private final String skyblockID; @@ -185,6 +208,27 @@ public enum SlayerDrop { internalItemTranslations.put("judgementCore", "Judgement Core"); internalItemTranslations.put("enchantRune", "Enchant Rune"); internalItemTranslations.put("enderSlayerSeven", "Ender Slayer 7"); + internalItemTranslations.put("derelictAshe", "Derelict Ashe"); + internalItemTranslations.put("lavatearsRune", "Lavatears Rune"); + internalItemTranslations.put("wispIceFlavored", "Wisp's Ice-Flavored Water"); + internalItemTranslations.put("bundleOfMagmaArrows", "Bundle of Magma Arrows"); + internalItemTranslations.put("manaDisintegrator", "Mana Disintegrator"); + internalItemTranslations.put("scorchedBooks", "Scorched Books"); + internalItemTranslations.put("kelvinInverter", "Kelvin Inverter"); + internalItemTranslations.put("blazeRodDisillate", "Blaze Rod Distillate"); + internalItemTranslations.put("glowstoneDistillate", "Glowstone Distillate"); + internalItemTranslations.put("magmaCreamDistillate", "Magma Cream Distillate"); + internalItemTranslations.put("netherWartDistillate", "Nether Wart Distillate"); + internalItemTranslations.put("gabagoolDistillate", "Gabagool Distillate"); + internalItemTranslations.put("scorchedPowerCrystal", "Scorched Power Crystal"); + internalItemTranslations.put("archfiendDice", "Archfiend Dice"); + internalItemTranslations.put("fireAspect", "Fire Aspect 3"); + internalItemTranslations.put("fieryBurstRune", "Fiery Burst Rune"); + internalItemTranslations.put("flawedOpalGemstone", "Flawed Opal Gemstone"); + internalItemTranslations.put("duplex", "Duplex 1"); + internalItemTranslations.put("highClassArchfiendDice", "High Class Archfiend Dice"); + internalItemTranslations.put("wilsonEngineeringPlans", "Wilson's Engineering Plans"); + internalItemTranslations.put("subzeroInverter", "Subzero Inverter"); } public String getDisplayName() { diff --git a/src/main/java/codes/biscuit/skyblockaddons/features/slayertracker/SlayerTracker.java b/src/main/java/codes/biscuit/skyblockaddons/features/slayertracker/SlayerTracker.java index c0c0a016d..39d9f5d03 100644 --- a/src/main/java/codes/biscuit/skyblockaddons/features/slayertracker/SlayerTracker.java +++ b/src/main/java/codes/biscuit/skyblockaddons/features/slayertracker/SlayerTracker.java @@ -43,7 +43,8 @@ public boolean isTrackerEnabled() { return main.getConfigValues().isEnabled(Feature.REVENANT_SLAYER_TRACKER) || main.getConfigValues().isEnabled(Feature.TARANTULA_SLAYER_TRACKER) || main.getConfigValues().isEnabled(Feature.SVEN_SLAYER_TRACKER) || - main.getConfigValues().isEnabled(Feature.VOIDGLOOM_SLAYER_TRACKER); + main.getConfigValues().isEnabled(Feature.VOIDGLOOM_SLAYER_TRACKER) || + main.getConfigValues().isEnabled(Feature.INFERNO_SLAYER_TRACKER); } /** diff --git a/src/main/java/codes/biscuit/skyblockaddons/features/tablist/TabListParser.java b/src/main/java/codes/biscuit/skyblockaddons/features/tablist/TabListParser.java index 4aaec7543..816799093 100644 --- a/src/main/java/codes/biscuit/skyblockaddons/features/tablist/TabListParser.java +++ b/src/main/java/codes/biscuit/skyblockaddons/features/tablist/TabListParser.java @@ -5,7 +5,6 @@ import codes.biscuit.skyblockaddons.core.Location; import codes.biscuit.skyblockaddons.core.SkillType; import codes.biscuit.skyblockaddons.features.spookyevent.SpookyEventManager; -import codes.biscuit.skyblockaddons.features.tabtimers.TabEffectManager; import codes.biscuit.skyblockaddons.utils.TextUtils; import lombok.Getter; import net.minecraft.client.Minecraft; @@ -26,10 +25,11 @@ public class TabListParser { public static String HYPIXEL_ADVERTISEMENT_CONTAINS = "HYPIXEL.NET"; - private static final Pattern GOD_POTION_PATTERN = Pattern.compile("You have a God Potion active! (?\\d{0,2}:?\\d{1,2}:\\d{2})"); + private static final Pattern GOD_POTION_PATTERN = Pattern.compile("You have a God Potion active! (?(?:\\d+(?: Hours| Minutes|m \\d+s))|(?:\\d+s))"); private static final Pattern ACTIVE_EFFECTS_PATTERN = Pattern.compile("Active Effects(?:§.)*(?:\\n(?:§.)*§7.+)*"); + private static final Pattern EFFECT_COUNT_PATTERN = Pattern.compile("You have (?[0-9]+) active effects\\."); private static final Pattern COOKIE_BUFF_PATTERN = Pattern.compile("Cookie Buff(?:§.)*(?:\\n(§.)*§7.+)*"); - private static final Pattern UPGRADES_PATTERN = Pattern.compile("(?§e[A-Za-z ]+)(? §f[0-9dhms ]+)"); + private static final Pattern UPGRADES_PATTERN = Pattern.compile("(?§e[A-Za-z ]+)(? §f\\d+(?: Days| Hours| Minutes|m \\d+s)|(?:\\d+s))"); private static final Pattern RAIN_TIME_PATTERN_S = Pattern.compile("Rain: (?