Skip to content

Commit

Permalink
chore: Bump geary
Browse files Browse the repository at this point in the history
  • Loading branch information
0ffz committed Nov 2, 2024
1 parent 1c7899c commit cff476b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@ package com.mineinabyss.geary.papermc.features.entities.sounds

import com.mineinabyss.geary.modules.Geary
import com.mineinabyss.geary.papermc.features.entities.sounds.OverrideMobSoundsListener.Companion.makeSound
import com.mineinabyss.geary.systems.query.Query
import com.mineinabyss.geary.systems.query.query
import com.mineinabyss.idofront.time.ticks
import com.mineinabyss.idofront.typealiases.BukkitEntity
import kotlin.random.Random

fun Geary.playAmbientSounds() = system(object : Query(this) {
val bukkit by get<BukkitEntity>()
val sounds by get<Sounds>()
}).every(1.ticks).exec {
if (Random.nextDouble() < sounds.ambientChance)
makeSound(bukkit, sounds.ambient)
}
fun Geary.playAmbientSounds() = system(query<BukkitEntity, Sounds>())
.every(1.ticks)
.exec { (bukkit, sounds) ->
if (Random.nextDouble() < sounds.ambientChance)
makeSound(bukkit, sounds.ambient)
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ fun Geary.createPeriodicSaveSystem() = system(
val persisting by getRelationsWithData<Persists, Any>()
val item by get<ItemStack>()
}
).every(5.seconds).exec {
).every(5.seconds).exec { q ->
// val forceSave = every(iterations = 100)
//
// if (forceSave) {
// entity.encodeComponentsTo(item)
// return
// }

item.editItemMeta {
persisting.forEach {
q.item.editItemMeta {
q.persisting.forEach {
val newHash = it.targetData.hashCode()
if (newHash != it.data.hash) {
it.data.hash = newHash
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[versions]
geary = "0.27.0-dev.8"
geary = "0.27.0-dev.9"

[libraries]
geary-core = { module = "com.mineinabyss:geary-core", version.ref = "geary" }
Expand Down

0 comments on commit cff476b

Please sign in to comment.