diff options
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni')
3 files changed, 46 insertions, 4 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt index 7829607bd..4fbf8a619 100644 --- a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt +++ b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt @@ -66,10 +66,7 @@ import at.hannibal2.skyhanni.features.slayer.blaze.HellionShieldHelper import at.hannibal2.skyhanni.features.summonings.SummoningMobManager import at.hannibal2.skyhanni.features.summonings.SummoningSoulsName import at.hannibal2.skyhanni.mixins.hooks.RenderLivingEntityHelper -import at.hannibal2.skyhanni.test.PacketTest -import at.hannibal2.skyhanni.test.ShowItemUuid -import at.hannibal2.skyhanni.test.SkyHanniTestCommand -import at.hannibal2.skyhanni.test.TestBingo +import at.hannibal2.skyhanni.test.* import at.hannibal2.skyhanni.test.command.CopyNearbyParticlesCommand import at.hannibal2.skyhanni.utils.MinecraftConsoleFilter.Companion.initLogging import at.hannibal2.skyhanni.utils.NEUVersionCheck.checkIfNeuIsLoaded @@ -308,6 +305,7 @@ class SkyHanniMod { loadModule(ButtonOnPause()) loadModule(PacketTest()) loadModule(TestBingo) + loadModule(TestCopyRngMeterValues) } @Mod.EventHandler diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/DevData.java b/src/main/java/at/hannibal2/skyhanni/config/features/DevData.java index e8061e926..77a0fcf33 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/DevData.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/DevData.java @@ -54,6 +54,12 @@ public class DevData { public boolean showItemUuid = false; @Expose + @ConfigOption(name = "Copy Rng Meter", desc = "Copies internal names and maxed xp needed from rng meter inventories in json format into the clipboard.") + @ConfigEditorBoolean + @ConfigAccordionId(id = 0) + public boolean copyRngMeter = false; + + @Expose public Position debugPos = new Position(10, 10, false, true); @Expose diff --git a/src/main/java/at/hannibal2/skyhanni/test/TestCopyRngMeterValues.kt b/src/main/java/at/hannibal2/skyhanni/test/TestCopyRngMeterValues.kt new file mode 100644 index 000000000..7c858df7f --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/test/TestCopyRngMeterValues.kt @@ -0,0 +1,38 @@ +package at.hannibal2.skyhanni.test + +import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.config.ConfigManager +import at.hannibal2.skyhanni.events.InventoryOpenEvent +import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName +import at.hannibal2.skyhanni.utils.ItemUtils.getLore +import at.hannibal2.skyhanni.utils.LorenzUtils +import at.hannibal2.skyhanni.utils.NumberUtil.formatNumber +import at.hannibal2.skyhanni.utils.OSUtils +import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent + +object TestCopyRngMeterValues { + + @SubscribeEvent + fun onInventoryOpen(event: InventoryOpenEvent) { + if (!SkyHanniMod.feature.dev.copyRngMeter) return + + val map = mutableMapOf<String, Long>() + val slayerPattern = "§7Slayer XP: §d.*§5/§d(?<xp>.*)".toPattern() + val dungeonPattern = "§7Dungeon Score: §d.*§5/§d(?<xp>.*)".toPattern() + for (item in event.inventoryItems.values) { + for (line in item.getLore()) { + slayerPattern.matchMatcher(line) { + map[item.getInternalName()] = group("xp").formatNumber() + } + dungeonPattern.matchMatcher(line) { + map[item.getInternalName()] = group("xp").formatNumber() + } + } + } + if (map.isEmpty()) return + + OSUtils.copyToClipboard(ConfigManager.gson.toJson(map)) + LorenzUtils.debug("${map.size} items saved to clipboard.") + } +}
\ No newline at end of file |