Skip to content

Commit

Permalink
Fix unneeded stuff part something (hannibal002#3)
Browse files Browse the repository at this point in the history
Co-authored-by: SeRaid <77941535+SeRaid743@users.noreply.github.com>
Co-authored-by: CalMWolfs <94038482+CalMWolfs@users.noreply.github.com>
  • Loading branch information
3 people authored May 12, 2024
1 parent 034412c commit 6c41ea6
Show file tree
Hide file tree
Showing 57 changed files with 104 additions and 163 deletions.
2 changes: 1 addition & 1 deletion src/main/java/at/hannibal2/skyhanni/api/CollectionAPI.kt
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ object CollectionAPI {
@SubscribeEvent
fun onItemAdd(event: ItemAddEvent) {
val internalName = event.internalName
val (_, amount) = NEUItems.getMultiplier(internalName)
val (_, amount) = NEUItems.getPrimitiveMultiplier(internalName)
if (amount > 1) return

// TODO add support for replenish (higher collection than actual items in inv)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ class ConfigManager {
}
}

// Some position elements dont need config links as they dont have a config option.
// Some position elements don't need config links as they don't have a config option.
private val ignoredMissingConfigLinks = listOf(
// commands
"features.garden.GardenConfig.cropSpeedMeterPos",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public class RiftAreasConfig {
@Expose
public MirrorVerseConfig mirrorverse = new MirrorVerseConfig();

// These are here in case we add features for these later
// @Expose
// @ConfigOption(name = "Village Plaza", desc = "")
// @Accordion
Expand All @@ -53,6 +54,7 @@ public class RiftAreasConfig {
@Accordion
public StillgoreChateauConfig stillgoreChateau = new StillgoreChateauConfig();

// These are here in case we add features for these later
// @Expose
// @ConfigOption(name = "Mountaintop", desc = "")
// @Accordion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ public class Storage {
@Expose
public Float savedMouseloweredSensitivity = .5f;

@Deprecated
@Expose
public Map<String, List<String>> knownFeatureToggles = new HashMap<>();

@Deprecated
@Expose
public List<VisualWord> modifiedWords = new ArrayList<>();
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/at/hannibal2/skyhanni/data/BitsAPI.kt
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ object BitsAPI {
profileStorage?.boosterCookieExpiryTime = value?.toMillis()
}

private const val defaultcookiebits = 4800
private const val DEFAULT_COOKIE_BITS = 4800

private val bitsDataGroup = RepoPattern.group("data.bits")

Expand Down Expand Up @@ -193,7 +193,7 @@ object BitsAPI {
}

boosterCookieAte.matchMatcher(message) {
bitsAvailable += (defaultcookiebits * (currentFameRank?.bitsMultiplier ?: return)).toInt()
bitsAvailable += (DEFAULT_COOKIE_BITS * (currentFameRank?.bitsMultiplier ?: return)).toInt()
val cookieTime = cookieBuffTime
cookieBuffTime = if (cookieTime == null) SimpleTimeMark.now() + 4.days else cookieTime + 4.days
sendBitsAvailableGainedEvent()
Expand Down
4 changes: 0 additions & 4 deletions src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,6 @@ object HypixelData {
"serverid.tablist",
" Server: §r§8(?<serverid>\\S+)"
)
private val lobbyTypePattern by patternGroup.pattern(
"lobbytype",
"(?<lobbyType>.*lobby)\\d+"
)
private val playerAmountPattern by patternGroup.pattern(
"playeramount",
"^\\s*(?:§.)+Players (?:§.)+\\((?<amount>\\d+)\\)\\s*$"
Expand Down
4 changes: 1 addition & 3 deletions src/main/java/at/hannibal2/skyhanni/data/QuiverAPI.kt
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ object QuiverAPI {
"(?:§.)*You've added (?:§.)*(?<type>.*) x(?<amount>.*) (?:§.)*to your quiver!"
)

// Bows that don't use the players arrows, checked using the SkyBlock Id
// Bows that don't use the players arrows, checked using the SkyBlock ID
private val fakeBowsPattern by group.pattern("fakebows", "^(BOSS_SPIRIT_BOW|CRYPT_BOW)$")
private val quiverInventoryNamePattern by group.pattern("quivername", "^Quiver$")
private val quiverInventoryPattern by group.pattern(
Expand Down Expand Up @@ -249,8 +249,6 @@ object QuiverAPI {
return arrows.firstOrNull { it.internalName == internalName }
}

private fun NEUInternalName.asArrowTypeOrNull() = getArrowByNameOrNull(this)

fun isEnabled() = LorenzUtils.inSkyBlock && storage != null

private fun shouldHideAmount() = wearingSkeletonMasterChestplate
Expand Down
4 changes: 0 additions & 4 deletions src/main/java/at/hannibal2/skyhanni/data/SlayerAPI.kt
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@ object SlayerAPI {

fun hasActiveSlayerQuest() = latestSlayerCategory != ""

fun getLatestProgressChangeTime() = if (latestSlayerProgress == "§eSlay the boss!") {
System.currentTimeMillis()
} else latestProgressChangeTime

fun getItemNameAndPrice(internalName: NEUInternalName, amount: Int): Pair<String, Double> {
val key = internalName to amount
nameCache.getOrNull(key)?.let {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package at.hannibal2.skyhanni.data.jsonobjects.repo.neu;
package at.hannibal2.skyhanni.data.jsonobjects.repo.neu

import at.hannibal2.skyhanni.utils.LorenzRarity
import at.hannibal2.skyhanni.utils.NEUInternalName
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,11 +249,11 @@ object IslandExceptions {
} ?: MobData.MobResult.somethingWentWrong
}

private const val ratSearchStart = 1
private const val ratSearchUpTo = 11
private const val RAT_SEARCH_START = 1
private const val RAT_SEARCH_UP_TO = 11

private fun ratHandler(baseEntity: EntityZombie, nextEntity: EntityLivingBase?): MobData.MobResult? =
generateSequence(ratSearchStart) { it + 1 }.take(ratSearchUpTo - ratSearchStart + 1).map { i ->
generateSequence(RAT_SEARCH_START) { it + 1 }.take(RAT_SEARCH_UP_TO - RAT_SEARCH_START + 1).map { i ->
MobUtils.getArmorStand(
baseEntity, i
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
package at.hannibal2.skyhanni.events

import net.minecraft.entity.projectile.EntityFishHook

class FishingBobberCastEvent(val bobber: EntityFishHook) : LorenzEvent()
class FishingBobberCastEvent : LorenzEvent()
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import at.hannibal2.skyhanni.data.HypixelData
import at.hannibal2.skyhanni.data.jsonobjects.other.HypixelPlayerApiJson
import at.hannibal2.skyhanni.utils.LorenzUtils

class NeuProfileDataLoadedEvent(val playerData: HypixelPlayerApiJson) : LorenzEvent() {
class NeuProfileDataLoadedEvent(private val playerData: HypixelPlayerApiJson) : LorenzEvent() {
fun getCurrentProfileData() =
playerData.profiles.firstOrNull { it.profileName.lowercase() == HypixelData.profileName }

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package at.hannibal2.skyhanni.events

import at.hannibal2.skyhanni.utils.mc.McWorld
import net.minecraft.client.Minecraft
import net.minecraft.entity.Entity
import net.minecraft.entity.item.EntityArmorStand
import net.minecraft.entity.item.EntityItemFrame
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ class MinionCraftHelper {
if (!allIngredients.contains(rawId)) continue
if (!isAllowed(allMinions, rawId)) continue

val (itemId, multiplier) = NEUItems.getMultiplier(rawId)
val (itemId, multiplier) = NEUItems.getPrimitiveMultiplier(rawId)
val old = otherItems.getOrDefault(itemId, 0)
otherItems[itemId] = old + item.stackSize * multiplier
}
Expand Down Expand Up @@ -207,7 +207,7 @@ class MinionCraftHelper {
}
var allDone = true
for ((rawId, need) in map) {
val (itemId, multiplier) = NEUItems.getMultiplier(rawId)
val (itemId, multiplier) = NEUItems.getPrimitiveMultiplier(rawId)
val needAmount = need * multiplier
val have = otherItems.getOrDefault(itemId, 0)
val percentage = have.toDouble() / needAmount
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class BingoCardTips {
for (line in bingoTip.guide) {
toolTip.add(index++, " $line")
}
bingoTip.found?.let {
bingoTip.found.let {
toolTip.add(index++, "§7Found by: §e$it")
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class ChatFilterGui(private val history: List<ChatManager.MessageFilteringResult
GlStateManager.translate(l + 0.0, t + 0.0, 0.0)
RenderUtils.drawFloatingRectDark(0, 0, w, h)
GlStateManager.translate(5.0, 5.0 - scroll, 0.0)
var mouseX = originalMouseX - l
val mouseX = originalMouseX - l
val isMouseButtonDown = mouseX in 0..w && originalMouseY in t..(t + h) && Mouse.isButtonDown(0)
var mouseY = originalMouseY - (t - scroll).toInt()
val sr = ScaledResolution(mc)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,18 @@ class WatchdogHider {
if (!LorenzUtils.onHypixel || !SkyHanniMod.feature.chat.filterType.watchDog) return

when (event.message) {
watchdogStartLine -> {
WATCHDOG_START_LINE -> {
startLineComponent = event.chatComponent
blockedLines = 0
}

watchdogAnnouncementLine -> {
WATCHDOG_ANNOUNCEMENT_LINE -> {
ChatManager.retractMessage(startLineComponent, "watchdog")
startLineComponent = null
inWatchdog = true
}

watchdogEndLine -> {
WATCHDOG_END_LINE -> {
event.blockedReason = "watchdog"
inWatchdog = false
}
Expand All @@ -48,9 +48,9 @@ class WatchdogHider {

companion object {

private const val watchdogStartLine = "§f"
private const val watchdogAnnouncementLine = "§4[WATCHDOG ANNOUNCEMENT]"
private const val watchdogEndLine = "§c"
private const val WATCHDOG_START_LINE = "§f"
private const val WATCHDOG_ANNOUNCEMENT_LINE = "§4[WATCHDOG ANNOUNCEMENT]"
private const val WATCHDOG_END_LINE = "§c"
}

@SubscribeEvent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ class PlayerChatFilter {
@SubscribeEvent
fun onRepoReload(event: RepositoryReloadEvent) {
filters.clear()
var countCategories = 0
var countFilters = 0

val playerChatFilter = event.getConstant<PlayerChatFilterJson>("PlayerChatFilter")
Expand All @@ -37,7 +36,6 @@ class PlayerChatFilter {
filter.load(category)
filters[description] = filter

countCategories++
countFilters += filter.count()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import at.hannibal2.skyhanni.features.misc.MarkedPlayerManager
import at.hannibal2.skyhanni.utils.StringUtils.applyIfPossible
import net.minecraft.event.ClickEvent
import net.minecraft.event.HoverEvent
import net.minecraft.util.ChatComponentText
import net.minecraft.util.IChatComponent
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import at.hannibal2.skyhanni.features.dungeon.DungeonLividFinder
import at.hannibal2.skyhanni.features.garden.GardenAPI
import at.hannibal2.skyhanni.features.garden.pests.PestType
import at.hannibal2.skyhanni.features.rift.RiftAPI
import at.hannibal2.skyhanni.utils.EntityUtils
import at.hannibal2.skyhanni.utils.EntityUtils.hasBossHealth
import at.hannibal2.skyhanni.utils.EntityUtils.hasMaxHealth
import at.hannibal2.skyhanni.utils.EntityUtils.hasNameTagWith
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ object EnderNodeTracker {
item = it.groups[2]?.value
}

when {
item == null -> return
item == "§cEndermite Nest" -> {
when (item) {
null -> return
"§cEndermite Nest" -> {
tracker.modify { storage ->
storage.totalEndermiteNests++
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,10 +262,10 @@ object GhostCounter {
addAsSingletonList(etaFormatting.base.formatText(eta).formatText(killETA))

val rate = 0.12 * (1 + (avgMagicFind.toDouble() / 100))
val sorrowValue = SORROW.getBazaarData()?.buyPrice?.toLong() ?: 0L
val sorrowValue = SORROW.getBazaarData()?.sellOfferPrice?.toLong() ?: 0L
val final: String = (killInterp * sorrowValue * (rate / 100)).toLong().addSeparators()
val plasmaValue = PLASMA.getBazaarData()?.buyPrice?.toLong() ?: 0L
val voltaValue = VOLTA.getBazaarData()?.buyPrice?.toLong() ?: 0L
val plasmaValue = PLASMA.getBazaarData()?.sellOfferPrice?.toLong() ?: 0L
val voltaValue = VOLTA.getBazaarData()?.sellOfferPrice?.toLong() ?: 0L
var moneyMade: Long = 0
val priceMap = listOf(
Triple("Sorrow", Option.SORROWCOUNT.getInt(), sorrowValue),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import java.util.Base64

object GhostFormatting {

private const val exportPrefix = "gc/"
private const val EXPORT_PREFIX = "gc/"

fun importFormat() {
val base64: String = try {
Expand All @@ -20,11 +20,11 @@ object GhostFormatting {
return
}

if (base64.length <= exportPrefix.length) return
if (base64.length <= EXPORT_PREFIX.length) return
val jsonString = try {
val t = String(Base64.getDecoder().decode(base64.trim()))
if (!t.startsWith(exportPrefix)) return
t.substring(exportPrefix.length)
if (!t.startsWith(EXPORT_PREFIX)) return
t.substring(EXPORT_PREFIX.length)
} catch (e: IllegalArgumentException) {
return
}
Expand Down Expand Up @@ -131,7 +131,7 @@ object GhostFormatting {
for (l in list) {
jsonArray.add(JsonPrimitive(l))
}
val base64 = Base64.getEncoder().encodeToString((exportPrefix + jsonArray).toByteArray(StandardCharsets.UTF_8))
val base64 = Base64.getEncoder().encodeToString((EXPORT_PREFIX + jsonArray).toByteArray(StandardCharsets.UTF_8))
Toolkit.getDefaultToolkit().systemClipboard.setContents(StringSelection(base64), null)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ object GriffinBurrowParticleFinder {
private val burrows = mutableMapOf<LorenzVec, Burrow>()
private var lastDugParticleBurrow: LorenzVec? = null

// This exist to detect the unlucky timing when the user opens a burrow before it gets fully deteced
// This exists to detect the unlucky timing when the user opens a burrow before it gets fully detected
private var fakeBurrow: LorenzVec? = null

@SubscribeEvent
Expand Down Expand Up @@ -172,7 +172,7 @@ object GriffinBurrowParticleFinder {

if (location == fakeBurrow) {
fakeBurrow = null
// This exist to detect the unlucky timing when the user opens a burrow before it gets fully deteced
// This exists to detect the unlucky timing when the user opens a burrow before it gets fully detected
tryDig(location, ignoreFound = true)
return
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ object InquisitorWaypointShare {
HypixelCommands.partyChat("pc Inquisitor dead!")
}

fun sendInquisitor() {
private fun sendInquisitor() {
if (!isEnabled()) return
if (lastShareTime + 5000 > System.currentTimeMillis()) return
lastShareTime = System.currentTimeMillis()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ object FrozenTreasureTracker {
addAsSingletonList("")
}

fun formatNumber(amount: Number): String {
private fun formatNumber(amount: Number): String {
if (amount is Int) return amount.addSeparators()
if (amount is Long) return NumberUtil.format(amount)
return "$amount"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ object FishingAPI {
lastCastTime = SimpleTimeMark.now()
bobber = entity
bobberHasTouchedWater = false
FishingBobberCastEvent(entity).postAndCatch()
FishingBobberCastEvent().postAndCatch()
}

private fun resetBobber() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class AnitaMedalProfit {
}

private fun readItem(slot: Int, item: ItemStack, table: MutableList<DisplayTableEntry>) {
val itemName = getItemName(item) ?: return
val itemName = getItemName(item)
if (itemName == " ") return
if (itemName == "§cClose") return
if (itemName == "§eUnique Gold Medals") return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@ object FarmingMilestoneCommand {
return
}

val enteredCrop = CropType.getByName(crop) ?: run {
ChatUtils.userError("Invalid crop type entered")
return
}
val enteredCrop = CropType.getByName(crop)

val currentMilestone = current?.toIntOrNull()
val targetMilestone = target?.toIntOrNull()
Expand Down Expand Up @@ -63,10 +60,7 @@ object FarmingMilestoneCommand {
return
}

val enteredCrop = CropType.getByName(crop) ?: run {
ChatUtils.userError("Invalid crop type entered.")
return
}
val enteredCrop = CropType.getByName(crop)

val targetLevel = target?.formatIntOrUserError()
if (targetLevel == null) {
Expand Down
Loading

0 comments on commit 6c41ea6

Please sign in to comment.