feat: Add Pet overlay
* feat: pet overlay * fix: missing shadow * fix: getting pet when not in pets menu * sort translations * Merge branch 'master' into feat/pet-overlay * Merge branch 'master' into feat/pet-overlay * Add requested changes for Pet Overlay
This commit is contained in:
@@ -135,4 +135,8 @@ object FirmFormatters {
|
||||
fun formatPosition(position: BlockPos): Text {
|
||||
return Text.literal("x: ${position.x}, y: ${position.y}, z: ${position.z}")
|
||||
}
|
||||
|
||||
fun formatPercent(value: Double, decimals: Int = 1): String {
|
||||
return "%.${decimals}f%%".format(value * 100)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ import net.minecraft.network.RegistryByteBuf
|
||||
import net.minecraft.network.codec.PacketCodec
|
||||
import net.minecraft.network.codec.PacketCodecs
|
||||
import net.minecraft.util.Identifier
|
||||
import moe.nea.firmament.repo.ExpLadders
|
||||
import moe.nea.firmament.repo.ItemCache.asItemStack
|
||||
import moe.nea.firmament.repo.set
|
||||
import moe.nea.firmament.util.collections.WeakCache
|
||||
@@ -104,8 +105,10 @@ data class HypixelPetInfo(
|
||||
val candyUsed: Int = 0,
|
||||
val uuid: UUID? = null,
|
||||
val active: Boolean = false,
|
||||
val heldItem: String? = null,
|
||||
) {
|
||||
val skyblockId get() = SkyblockId("${type.uppercase()};${tier.ordinal}") // TODO: is this ordinal set up correctly?
|
||||
val level get() = ExpLadders.getExpLadder(type, tier).getPetLevel(exp)
|
||||
}
|
||||
|
||||
private val jsonparser = Json { ignoreUnknownKeys = true }
|
||||
|
||||
@@ -164,4 +164,14 @@ fun Text.transformEachRecursively(function: (Text) -> Text): Text {
|
||||
|
||||
fun tr(key: String, default: String): MutableText = error("Compiler plugin did not run.")
|
||||
fun trResolved(key: String, vararg args: Any): MutableText = Text.stringifiedTranslatable(key, *args)
|
||||
fun titleCase(str: String): String {
|
||||
return str
|
||||
.lowercase()
|
||||
.replace("_", " ")
|
||||
.split(" ")
|
||||
.joinToString(" ") { word ->
|
||||
word.replaceFirstChar { if (it.isLowerCase()) it.titlecase() else it.toString() }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user