Compare commits

..

2 Commits

Author SHA1 Message Date
2c95dfa660
fix: fix unable to bootstrap registry warning 2023-08-01 17:53:34 +08:00
fa1aefe425
feat: remove 3.0 base factor for music 2023-08-01 17:51:53 +08:00
2 changed files with 2 additions and 2 deletions

View File

@ -39,7 +39,7 @@ data class ProjectionEffectType<T : ProjectionEffect>(val constructor: () -> T)
val registryKey: ResourceKey<Registry<ProjectionEffectType<*>>> =
ResourceKey.createRegistryKey(Quaedam.resource("projection_effect"))
val registry: Registry<ProjectionEffectType<*>> = BuiltInRegistries.registerSimple(registryKey) { null }
val registry: Registry<ProjectionEffectType<*>> = BuiltInRegistries.registerSimple(registryKey) { nopEffect }
val nopEffect: ProjectionEffectType<NopEffect> =
Registry.register(registry, Quaedam.resource("nop"), ProjectionEffectType { NopEffect })

View File

@ -71,7 +71,7 @@ class MusicPlayer(
// play note
val projections = Projector.findNearbyProjections(level, pos, MusicProjection.effect.get())
.takeIf { it.isNotEmpty() } ?: listOf(MusicProjectionEffect())
val volume = 3.0f * projections.maxOf { it.volumeFactor } * note.volume
val volume = projections.maxOf { it.volumeFactor } * note.volume
val particle = projections.any { it.particle }
val instrument = level.getBlockState(pos).getValue(BlockStateProperties.NOTEBLOCK_INSTRUMENT)
val pitch = if (instrument.isTunable) {