Skip to content

Commit

Permalink
Merge branch 'refs/heads/main' into fix/announcement-color
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/main/kotlin/me/partlysanestudios/partlysaneskies/utils/StringUtils.kt
  • Loading branch information
j10a1n15 committed Jul 24, 2024
2 parents bfae114 + 63bbbe7 commit 3990a5d
Show file tree
Hide file tree
Showing 18 changed files with 572 additions and 281 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -197,4 +197,4 @@ public void onChat(ClientChatReceivedEvent event) {
FALLEN STAR
§r§5§l✯ §r§eA §r§5Fallen Star §r§ehas crashed at §r§bRoyal Mines§r§e! Nearby ore and Powder drops are amplified!§r
*/
*/

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ import me.partlysanestudios.partlysaneskies.features.gui.hud.CooldownHud
import me.partlysanestudios.partlysaneskies.features.gui.hud.LocationBannerDisplay
import me.partlysanestudios.partlysaneskies.features.gui.hud.rngdropbanner.DropBannerDisplay
import me.partlysanestudios.partlysaneskies.features.gui.hud.rngdropbanner.DropWebhook
import me.partlysanestudios.partlysaneskies.features.gui.hud.rngdropbanner.RareDropGUIManager
import me.partlysanestudios.partlysaneskies.features.gui.mainmenu.PSSMainMenu
import me.partlysanestudios.partlysaneskies.features.information.WikiArticleOpener
import me.partlysanestudios.partlysaneskies.features.mining.MiningEvents
Expand Down Expand Up @@ -223,6 +224,11 @@ class PartlySaneSkies {
} catch (e: IOException) {
e.printStackTrace()
}
try {
RareDropGUIManager.loadData()
} catch (e: IOException) {
e.printStackTrace()
}
}.start()


Expand Down Expand Up @@ -306,6 +312,7 @@ class PartlySaneSkies {
PlayerRating.registerReprintCommand()
ModChecker.registerModCheckCommand()
ItemRefill.registerCommand()
RareDropGUIManager.registerCommand()
WebhookMenu.registerWebhookCommand()

registerCoreConfig()
Expand All @@ -327,8 +334,6 @@ class PartlySaneSkies {

DebugKey.init()

// Initializes skill upgrade recommendation
SkillUpgradeRecommendation.populateSkillMap()
try {
SkyblockDataManager.updateAll()
} catch (e: IOException) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ object Keybinds {
if (OneConfigScreen.favouritePetKeybind.isActive()) {
PetAlert.favouritePet()
}
if (!Keyboard.isCreated()) return
if (Keyboard.isKeyDown(Keyboard.KEY_LEFT)) {
if (PartlySaneSkies.minecraft.currentScreen is AuctionHouseGui || PartlySaneSkies.minecraft.currentScreen is GuiChest && isAhGui(
(PartlySaneSkies.minecraft.currentScreen as GuiChest).containerInventory
Expand Down Expand Up @@ -107,4 +108,4 @@ object Keybinds {
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class Config : ConfigOption() {
companion object {
val ConfigOption.asConfig get() = this as Config
}

// Recursively find paths for options
fun find(path: String): ConfigOption? {
val indexOfSplit = path.indexOf("/")
Expand All @@ -34,6 +35,7 @@ class Config : ConfigOption() {
}

private val options = LinkedHashMap<String, ConfigOption>()

// Recursively create new options to get to the path
fun registerOption(path: String, configOption: ConfigOption): Config {
val indexOfSplit = path.indexOf("/")
Expand All @@ -55,9 +57,7 @@ class Config : ConfigOption() {
return this
}

fun getAllOptions(): LinkedHashMap<String, ConfigOption> {
return options.clone() as LinkedHashMap<String, ConfigOption>
}
fun getAllOptions(): LinkedHashMap<String, ConfigOption> = options.clone() as LinkedHashMap<String, ConfigOption>

override fun loadFromJson(element: JsonElement) {
val obj = element.asJsonObject
Expand All @@ -66,7 +66,7 @@ class Config : ConfigOption() {
// If the parameter exists
if (obj.has(option.key)) {
try {
option.value.loadFromJson(obj.get(option.key))
option.value.loadFromJson(obj[option.key])

} catch (e: Exception) {
log(Level.ERROR, "Error loading option ${option.key}")
Expand All @@ -88,9 +88,11 @@ class Config : ConfigOption() {
var savePath: String? = null
fun save() {
if (parent == null) {
ConfigManager.saveConfig(savePath ?: throw IllegalArgumentException("Unable to Save. No save path provided. Config is not registered."), this)
ConfigManager.saveConfig(
savePath ?: throw IllegalArgumentException("Unable to Save. No save path provided. Config is not registered."), this,
)
} else {
(parent as? Config)?.save() ?: throw IllegalArgumentException("Unable to save. Parent of config is not a config.")
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import com.google.gson.JsonParser
import me.partlysanestudios.partlysaneskies.PartlySaneSkies.Companion.config
import me.partlysanestudios.partlysaneskies.PartlySaneSkies.Companion.time
import me.partlysanestudios.partlysaneskies.data.api.GetRequest
import me.partlysanestudios.partlysaneskies.data.api.Request
import me.partlysanestudios.partlysaneskies.data.api.RequestsManager
import me.partlysanestudios.partlysaneskies.utils.MathUtils
import me.partlysanestudios.partlysaneskies.utils.StringUtils.titleCase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import java.time.Instant
import java.time.LocalDateTime
import java.time.ZoneId
import java.time.format.DateTimeFormatter
import java.util.*
import java.util.LinkedList

object CrystalHollowsGemstoneMapper {

Expand Down Expand Up @@ -102,17 +102,15 @@ object CrystalHollowsGemstoneMapper {
val coordObj = coordElement.asJsonObject
val point = Point3d(coordObj.get("x").asDouble, coordObj.get("y").asDouble, coordObj.get("z").asDouble)
try {
val type = "COLOR_${
world.getBlockState(point.toBlockPosInt())
.getValue(PropertyEnum.create("color", EnumDyeColor::class.java))
}"
val color = world.getBlockState(point.toBlockPosInt())
.getValue(PropertyEnum.create("color", EnumDyeColor::class.java))
val type = "COLOR_$color"

if (!map.contains(type)) {
map[type] = ArrayList<JsonObject>()
}

map[type]?.add(coordObj)
} catch (e: Exception) {
e.printStackTrace()
continue
}
}
Expand Down Expand Up @@ -306,4 +304,4 @@ object CrystalHollowsGemstoneMapper {
}

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,4 @@ object RequiredSecretsFound {
}
}
}
}
}
Loading

0 comments on commit 3990a5d

Please sign in to comment.