Skip to content

Commit

Permalink
use regex for Bestiary to fix paging and fishing
Browse files Browse the repository at this point in the history
  • Loading branch information
My-Name-Is-Jeff committed Sep 15, 2023
1 parent c98a70c commit df4b117
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ object MiscFeatures {
"ewogICJ0aW1lc3RhbXAiIDogMTU5ODg0NzA4MjYxMywKICAicHJvZmlsZUlkIiA6ICI0MWQzYWJjMmQ3NDk0MDBjOTA5MGQ1NDM0ZDAzODMxYiIsCiAgInByb2ZpbGVOYW1lIiA6ICJNZWdha2xvb24iLAogICJzaWduYXR1cmVSZXF1aXJlZCIgOiB0cnVlLAogICJ0ZXh0dXJlcyIgOiB7CiAgICAiU0tJTiIgOiB7CiAgICAgICJ1cmwiIDogImh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNzQwZDZlMzYyYmM3ZWVlNGY5MTFkYmQwNDQ2MzA3ZTc0NThkMTA1MGQwOWFlZTUzOGViY2IwMjczY2Y3NTc0MiIKICAgIH0KICB9Cn0=",
)
private val hubSpawnPoint = BlockPos(-2, 70, -69)
private val bestiaryTitleRegex = Regex("\"(?:\\\\(\\\\d+\\\\/\\\\d+\\\\) )?(?:Bestiary ➜ (?!Fishing)|(?:Fishing ➜ ))|Search Results\"")

init {
GolemSpawnTimerElement()
Expand Down Expand Up @@ -465,11 +466,7 @@ object MiscFeatures {
val c = mc.thePlayer.openContainer
if (c is ContainerChest) {
val name = c.lowerChestInventory.name
if (Skytils.config.showBestiaryLevel && name.startsWithAny(
"Bestiary ➜ ",
"Search Results"
) && item.item != Item.getItemFromBlock(Blocks.stained_glass_pane)
) {
if (Skytils.config.showBestiaryLevel && bestiaryTitleRegex in name) {
val arrowSlot = c.inventorySlots.getOrNull(48)?.stack
if (arrowSlot != null && arrowSlot.item == Items.arrow && ItemUtil.getItemLore(item)
.lastOrNull() == "§eClick to view!"
Expand Down

0 comments on commit df4b117

Please sign in to comment.