Compare commits
2 Commits
dca1482526
...
2c95dfa660
Author | SHA1 | Date | |
---|---|---|---|
2c95dfa660 | |||
fa1aefe425 |
@ -39,7 +39,7 @@ data class ProjectionEffectType<T : ProjectionEffect>(val constructor: () -> T)
|
|||||||
|
|
||||||
val registryKey: ResourceKey<Registry<ProjectionEffectType<*>>> =
|
val registryKey: ResourceKey<Registry<ProjectionEffectType<*>>> =
|
||||||
ResourceKey.createRegistryKey(Quaedam.resource("projection_effect"))
|
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> =
|
val nopEffect: ProjectionEffectType<NopEffect> =
|
||||||
Registry.register(registry, Quaedam.resource("nop"), ProjectionEffectType { NopEffect })
|
Registry.register(registry, Quaedam.resource("nop"), ProjectionEffectType { NopEffect })
|
||||||
|
@ -71,7 +71,7 @@ class MusicPlayer(
|
|||||||
// play note
|
// play note
|
||||||
val projections = Projector.findNearbyProjections(level, pos, MusicProjection.effect.get())
|
val projections = Projector.findNearbyProjections(level, pos, MusicProjection.effect.get())
|
||||||
.takeIf { it.isNotEmpty() } ?: listOf(MusicProjectionEffect())
|
.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 particle = projections.any { it.particle }
|
||||||
val instrument = level.getBlockState(pos).getValue(BlockStateProperties.NOTEBLOCK_INSTRUMENT)
|
val instrument = level.getBlockState(pos).getValue(BlockStateProperties.NOTEBLOCK_INSTRUMENT)
|
||||||
val pitch = if (instrument.isTunable) {
|
val pitch = if (instrument.isTunable) {
|
||||||
|
Loading…
Reference in New Issue
Block a user