diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2024-06-22 09:33:15 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2024-06-22 09:33:15 +0200 |
commit | 8f3314c9397a62085941ece6d9fe2114f5338889 (patch) | |
tree | 298798c38d4875893787446b3af351660b4d3436 /src/main/java/at/hannibal2/skyhanni | |
parent | c52a71ee63c633d17d7a935c0aa92ddda904c750 (diff) | |
download | skyhanni-8f3314c9397a62085941ece6d9fe2114f5338889.tar.gz skyhanni-8f3314c9397a62085941ece6d9fe2114f5338889.tar.bz2 skyhanni-8f3314c9397a62085941ece6d9fe2114f5338889.zip |
enum is singular
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni')
12 files changed, 48 insertions, 48 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/gui/customscoreboard/EventsConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/gui/customscoreboard/EventsConfig.java index 904e8028f..f2fd7a85a 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/gui/customscoreboard/EventsConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/gui/customscoreboard/EventsConfig.java @@ -1,6 +1,6 @@ package at.hannibal2.skyhanni.config.features.gui.customscoreboard; -import at.hannibal2.skyhanni.features.gui.customscoreboard.ScoreboardEvents; +import at.hannibal2.skyhanni.features.gui.customscoreboard.ScoreboardEvent; import com.google.gson.annotations.Expose; import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean; import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorDraggableList; @@ -17,7 +17,7 @@ public class EventsConfig { desc = "Drag your list to select the priority of each event." ) @ConfigEditorDraggableList() - public List<ScoreboardEvents> eventEntries = new ArrayList<>(ScoreboardEvents.defaultOption); + public List<ScoreboardEvent> eventEntries = new ArrayList<>(ScoreboardEvent.defaultOption); @Expose @ConfigOption(name = "Show all active events", desc = "Show all active events in the scoreboard instead of the one with the highest priority.") diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/lobby/waypoints/easter/EasterEggWaypoints.kt b/src/main/java/at/hannibal2/skyhanni/features/event/lobby/waypoints/easter/EasterEggWaypoints.kt index 1b3bf9cb4..2df035702 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/lobby/waypoints/easter/EasterEggWaypoints.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/lobby/waypoints/easter/EasterEggWaypoints.kt @@ -70,7 +70,7 @@ object EasterEggWaypoints { } if (config.allEntranceWaypoints) { - for (eggEntrance in EggEntrances.entries) { + for (eggEntrance in EggEntrance.entries) { if (!eggEntrance.easterEgg.any { it.shouldShow() }) continue event.drawWaypointFilled(eggEntrance.waypoint, LorenzColor.YELLOW.toColor()) event.drawDynamicText(eggEntrance.waypoint, "§e" + eggEntrance.eggEntranceName, 1.5) diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/lobby/waypoints/easter/EggEntrances.kt b/src/main/java/at/hannibal2/skyhanni/features/event/lobby/waypoints/easter/EggEntrance.kt index 31663b403..1ac684570 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/lobby/waypoints/easter/EggEntrances.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/lobby/waypoints/easter/EggEntrance.kt @@ -2,7 +2,7 @@ package at.hannibal2.skyhanni.features.event.lobby.waypoints.easter import at.hannibal2.skyhanni.utils.LorenzVec -enum class EggEntrances( +enum class EggEntrance( val eggEntranceName: String, val waypoint: LorenzVec, vararg val easterEgg: EasterEgg, diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/lobby/waypoints/halloween/BasketEntrances.kt b/src/main/java/at/hannibal2/skyhanni/features/event/lobby/waypoints/halloween/BasketEntrance.kt index 3907986d9..b54b17eb8 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/lobby/waypoints/halloween/BasketEntrances.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/lobby/waypoints/halloween/BasketEntrance.kt @@ -2,7 +2,7 @@ package at.hannibal2.skyhanni.features.event.lobby.waypoints.halloween import at.hannibal2.skyhanni.utils.LorenzVec -enum class BasketEntrances( +enum class BasketEntrance( val basketEntranceName: String, val waypoint: LorenzVec, vararg val basket: Basket, diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/lobby/waypoints/halloween/BasketWaypoints.kt b/src/main/java/at/hannibal2/skyhanni/features/event/lobby/waypoints/halloween/BasketWaypoints.kt index c2f30a967..a76805577 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/lobby/waypoints/halloween/BasketWaypoints.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/lobby/waypoints/halloween/BasketWaypoints.kt @@ -71,7 +71,7 @@ object BasketWaypoints { } if (config.allEntranceWaypoints) { - for (basketEntrance in BasketEntrances.entries) { + for (basketEntrance in BasketEntrance.entries) { if (!basketEntrance.basket.any { it.shouldShow() }) continue event.drawWaypointFilled(basketEntrance.waypoint, LorenzColor.YELLOW.toColor()) event.drawDynamicText(basketEntrance.waypoint, "§e" + basketEntrance.basketEntranceName, 1.5) diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FarmingReforges.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FarmingReforge.kt index 6ac7171fb..75eccf4cc 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FarmingReforges.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FarmingReforge.kt @@ -1,7 +1,7 @@ package at.hannibal2.skyhanni.features.garden.fortuneguide // TODO replace with ReforgeAPI -enum class FarmingReforges( +enum class FarmingReforge( val reforgeName: String, val reforgeItem: String, val common: Int, @@ -22,7 +22,7 @@ enum class FarmingReforges( GREEN_THUMB("Green Thumb", "", 1, 2, 3, 4, 5, 6) } -operator fun FarmingReforges.get(index: Int, current: Double = 0.0): Double? { +operator fun FarmingReforge.get(index: Int, current: Double = 0.0): Double? { return when (index) { 0 -> common - current 1 -> uncommon - current diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FarmingSets.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FarmingSet.kt index e0b74ce8a..4e1c3d521 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FarmingSets.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FarmingSet.kt @@ -1,6 +1,6 @@ package at.hannibal2.skyhanni.features.garden.fortuneguide -enum class FarmingSets( +enum class FarmingSet( val helmetIncrease: Double, val chestplateIncrease: Double, val leggingsIncrease: Double, diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FortuneUpgrades.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FortuneUpgrades.kt index 43289dc62..cd76262c0 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FortuneUpgrades.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FortuneUpgrades.kt @@ -107,11 +107,11 @@ object FortuneUpgrades { when (item.getReforgeName()) { "rooted" -> {} "blooming" -> { - reforgeItem(item, FarmingReforges.ROOTED, genericUpgrades) + reforgeItem(item, FarmingReforge.ROOTED, genericUpgrades) } else -> { - reforgeItem(item, FarmingReforges.BLOOMING, genericUpgrades) + reforgeItem(item, FarmingReforge.BLOOMING, genericUpgrades) } } } @@ -126,11 +126,11 @@ object FortuneUpgrades { when (item.getReforgeName()) { "mossy" -> {} "bustling" -> { - reforgeItem(item, FarmingReforges.MOSSY, genericUpgrades) + reforgeItem(item, FarmingReforge.MOSSY, genericUpgrades) } else -> { - reforgeItem(item, FarmingReforges.BUSTLING, genericUpgrades, 100) + reforgeItem(item, FarmingReforge.BUSTLING, genericUpgrades, 100) } } } @@ -242,7 +242,7 @@ object FortuneUpgrades { "blessed" -> {} "bountiful" -> {} else -> { - reforgeItem(tool, FarmingReforges.BLESSED, cropSpecificUpgrades) + reforgeItem(tool, FarmingReforge.BLESSED, cropSpecificUpgrades) } } cropSpecificUpgrades.populateAndSort(0) @@ -251,7 +251,7 @@ object FortuneUpgrades { private fun recombobulateItem(item: ItemStack, list: MutableList<FortuneUpgrade>) { if (item.isRecombobulated()) return val reforge = item.getReforgeName()?.let { - FarmingReforges.entries.find { enumValue -> + FarmingReforge.entries.find { enumValue -> enumValue.name == it.uppercase() } } ?: return @@ -265,7 +265,7 @@ object FortuneUpgrades { private fun reforgeItem( item: ItemStack, - reforge: FarmingReforges, + reforge: FarmingReforge, list: MutableList<FortuneUpgrade>, copperPrice: Int? = null, ) { diff --git a/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/CustomScoreboard.kt b/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/CustomScoreboard.kt index 721ec62ce..a4d5bd628 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/CustomScoreboard.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/CustomScoreboard.kt @@ -242,7 +242,7 @@ object CustomScoreboard { event.transform(37, "$displayPrefix.events.eventEntries") { element -> val array = element.asJsonArray - array.add(JsonPrimitive(ScoreboardEvents.QUEUE.name)) + array.add(JsonPrimitive(ScoreboardEvent.QUEUE.name)) array } event.transform(40, "$displayPrefix.events.eventEntries") { element -> @@ -257,7 +257,7 @@ object CustomScoreboard { } if (jsonArray.any { it.asString in listOf("HOT_DOG_CONTEST", "EFFIGIES") }) { - newArray.add(JsonPrimitive(ScoreboardEvents.RIFT.name)) + newArray.add(JsonPrimitive(ScoreboardEvent.RIFT.name)) } newArray @@ -283,13 +283,13 @@ object CustomScoreboard { } event.transform(50, "$displayPrefix.events.eventEntries") { element -> val array = element.asJsonArray - array.add(JsonPrimitive(ScoreboardEvents.ANNIVERSARY.name)) - array.add(JsonPrimitive(ScoreboardEvents.CARNIVAL.name)) + array.add(JsonPrimitive(ScoreboardEvent.ANNIVERSARY.name)) + array.add(JsonPrimitive(ScoreboardEvent.CARNIVAL.name)) array } event.transform(51, "$displayPrefix.events.eventEntries") { element -> val array = element.asJsonArray - array.add(JsonPrimitive(ScoreboardEvents.NEW_YEAR.name)) + array.add(JsonPrimitive(ScoreboardEvent.NEW_YEAR.name)) array } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/ScoreboardElements.kt b/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/ScoreboardElements.kt index 116cecd19..ab3584251 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/ScoreboardElements.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/ScoreboardElements.kt @@ -730,13 +730,13 @@ private fun getPowderDisplayPair() = buildList { private fun getPowderShowWhen() = inAdvancedMiningIsland() -private fun getEventsDisplayPair(): List<ScoreboardElementType> = ScoreboardEvents.getEvent() +private fun getEventsDisplayPair(): List<ScoreboardElementType> = ScoreboardEvent.getEvent() .filterNotNull() .flatMap { it.getLines().map { i -> i to HorizontalAlignment.LEFT } } .takeIf { it.isNotEmpty() } ?: listOf("<hidden>" to HorizontalAlignment.LEFT) -private fun getEventsShowWhen() = ScoreboardEvents.getEvent().isNotEmpty() +private fun getEventsShowWhen() = ScoreboardEvent.getEvent().isNotEmpty() private fun getMayorDisplayPair() = buildList { val currentMayorName = MayorAPI.currentMayor?.mayorName?.let { MayorAPI.mayorNameWithColorCode(it) } ?: "<hidden>" diff --git a/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/ScoreboardEvents.kt b/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/ScoreboardEvent.kt index ebeed5eee..7279079ef 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/ScoreboardEvents.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/ScoreboardEvent.kt @@ -5,7 +5,7 @@ import at.hannibal2.skyhanni.data.IslandType import at.hannibal2.skyhanni.data.ScoreboardData import at.hannibal2.skyhanni.features.dungeon.DungeonAPI import at.hannibal2.skyhanni.features.gui.customscoreboard.CustomScoreboard.eventsConfig -import at.hannibal2.skyhanni.features.gui.customscoreboard.ScoreboardEvents.VOTING +import at.hannibal2.skyhanni.features.gui.customscoreboard.ScoreboardEvent.VOTING import at.hannibal2.skyhanni.features.gui.customscoreboard.ScoreboardPattern import at.hannibal2.skyhanni.features.misc.ServerRestartTitle import at.hannibal2.skyhanni.features.rift.area.stillgorechateau.RiftBloodEffigies @@ -32,7 +32,7 @@ private fun getSbLines(): List<String> { return ScoreboardData.sidebarLinesFormatted } -enum class ScoreboardEvents( +enum class ScoreboardEvent( private val displayLine: () -> List<String>, private val showWhen: () -> Boolean, private val configLine: String, @@ -194,7 +194,7 @@ enum class ScoreboardEvents( fun getLines(): List<String> = displayLine() companion object { - fun getEvent() = buildList<ScoreboardEvents?> { + fun getEvent() = buildList<ScoreboardEvent?> { if (eventsConfig.showAllActiveEvents) { for (event in eventsConfig.eventEntries) { if (event.showWhen()) { diff --git a/src/main/java/at/hannibal2/skyhanni/features/mining/crystalhollows/CrystalHollowsWalls.kt b/src/main/java/at/hannibal2/skyhanni/features/mining/crystalhollows/CrystalHollowsWalls.kt index 950e93976..e32de6c3d 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/mining/crystalhollows/CrystalHollowsWalls.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/mining/crystalhollows/CrystalHollowsWalls.kt @@ -21,7 +21,7 @@ object CrystalHollowsWalls { private val config get() = SkyHanniMod.feature.mining.crystalHollowsAreaWalls - private enum class Areas(val color: Color) { + private enum class Area(val color: Color) { MITHRIL(LorenzColor.GREEN.addOpacity(60)), PRECURSOR(LorenzColor.BLUE.addOpacity(60)), JUNGLE(LorenzColor.LIGHT_PURPLE.addOpacity(60)), @@ -93,19 +93,19 @@ object CrystalHollowsWalls { } private fun drawGoblin(event: LorenzRenderWorldEvent) = RenderUtils.QuadDrawer.draw3D(event.partialTicks) { - drawArea(true, false, Areas.JUNGLE.color, Areas.PRECURSOR.color) + drawArea(true, false, Area.JUNGLE.color, Area.PRECURSOR.color) } private fun drawJungle(event: LorenzRenderWorldEvent) = RenderUtils.QuadDrawer.draw3D(event.partialTicks) { - drawArea(true, true, Areas.GOBLIN.color, Areas.MITHRIL.color) + drawArea(true, true, Area.GOBLIN.color, Area.MITHRIL.color) } private fun drawPrecursor(event: LorenzRenderWorldEvent) = RenderUtils.QuadDrawer.draw3D(event.partialTicks) { - drawArea(false, false, Areas.MITHRIL.color, Areas.GOBLIN.color) + drawArea(false, false, Area.MITHRIL.color, Area.GOBLIN.color) } private fun drawMithril(event: LorenzRenderWorldEvent) = RenderUtils.QuadDrawer.draw3D(event.partialTicks) { - drawArea(false, true, Areas.PRECURSOR.color, Areas.JUNGLE.color) + drawArea(false, true, Area.PRECURSOR.color, Area.JUNGLE.color) } private fun drawHeat(event: LorenzRenderWorldEvent) = RenderUtils.QuadDrawer.draw3D(event.partialTicks) { @@ -114,13 +114,13 @@ object CrystalHollowsWalls { LorenzVec(nucleusBB.minX, heatHeight, nucleusBB.minZ), LorenzVec(nucleusBB.maxX, heatHeight, nucleusBB.minZ), LorenzVec(nucleusBB.minX, heatHeight, nucleusBB.maxZ), - Areas.NUCLEUS.color + Area.NUCLEUS.color ) - drawHeatAreaForHeat(false, false, Areas.PRECURSOR.color, heatHeight) - drawHeatAreaForHeat(false, true, Areas.MITHRIL.color, heatHeight) - drawHeatAreaForHeat(true, false, Areas.GOBLIN.color, heatHeight) - drawHeatAreaForHeat(true, true, Areas.JUNGLE.color, heatHeight) + drawHeatAreaForHeat(false, false, Area.PRECURSOR.color, heatHeight) + drawHeatAreaForHeat(false, true, Area.MITHRIL.color, heatHeight) + drawHeatAreaForHeat(true, false, Area.GOBLIN.color, heatHeight) + drawHeatAreaForHeat(true, true, Area.JUNGLE.color, heatHeight) } private fun drawNucleus(event: LorenzRenderWorldEvent) { @@ -134,55 +134,55 @@ object CrystalHollowsWalls { southEastCorner, southWestCorner, northEastCorner, - Areas.HEAT.color + Area.HEAT.color ) draw( southEastCorner, southEastTopCorner, LorenzVec(nucleusBBInflate.minX, nucleusBBInflate.minY, MIDDLE_Z), - Areas.JUNGLE.color + Area.JUNGLE.color ) draw( southEastCorner, southEastTopCorner, LorenzVec(MIDDLE_X, nucleusBBInflate.minY, nucleusBBInflate.minZ), - Areas.JUNGLE.color + Area.JUNGLE.color ) draw( northWestCorner, northWestTopCorner, LorenzVec(nucleusBBInflate.maxX, nucleusBBInflate.minY, MIDDLE_Z), - Areas.PRECURSOR.color + Area.PRECURSOR.color ) draw( northWestCorner, northWestTopCorner, LorenzVec(MIDDLE_X, nucleusBBInflate.minY, nucleusBBInflate.maxZ), - Areas.PRECURSOR.color + Area.PRECURSOR.color ) draw( southWestCorner, southWestTopCorner, LorenzVec(nucleusBBInflate.minX, nucleusBBInflate.minY, MIDDLE_Z), - Areas.GOBLIN.color, + Area.GOBLIN.color, ) draw( southWestCorner, southWestTopCorner, LorenzVec(MIDDLE_X, nucleusBBInflate.minY, nucleusBBInflate.maxZ), - Areas.GOBLIN.color + Area.GOBLIN.color ) draw( northEastCorner, northEastTopCorner, LorenzVec(nucleusBBInflate.maxX, nucleusBBInflate.minY, MIDDLE_Z), - Areas.MITHRIL.color + Area.MITHRIL.color ) draw( northEastCorner, northEastTopCorner, LorenzVec(MIDDLE_X, nucleusBBInflate.minY, nucleusBBInflate.minZ), - Areas.MITHRIL.color + Area.MITHRIL.color ) } } @@ -209,7 +209,7 @@ object CrystalHollowsWalls { val nucleusXSideBase = LorenzVec(nucleusX, heatHeight, middleZ) drawHeatArea( - Areas.HEAT.color, + Area.HEAT.color, heatHeight, nucleusX, middleX, @@ -234,13 +234,13 @@ object CrystalHollowsWalls { nucleusXSideBase, nucleusBase, LorenzVec(nucleusX, MAX_HEIGHT, middleZ), - Areas.NUCLEUS.color, + Area.NUCLEUS.color, ) draw( nucleusZSideBase, nucleusBase, LorenzVec(middleX, MAX_HEIGHT, nucleusZ), - Areas.NUCLEUS.color, + Area.NUCLEUS.color, ) } |