mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-13 01:16:46 -04:00
bump pixlyzer, soul campfire particle emission, fix particle ageing
This commit is contained in:
parent
88278387ae
commit
f094400c99
@ -37,6 +37,8 @@ import glm_.vec3.Vec3i
|
|||||||
import kotlin.random.Random
|
import kotlin.random.Random
|
||||||
|
|
||||||
open class CampfireBlock(resourceLocation: ResourceLocation, registries: Registries, data: JsonObject) : Block(resourceLocation, registries, data) {
|
open class CampfireBlock(resourceLocation: ResourceLocation, registries: Registries, data: JsonObject) : Block(resourceLocation, registries, data) {
|
||||||
|
val lavaParticles = data["lava_particles"]?.asBoolean ?: true
|
||||||
|
|
||||||
private val campfireCrackleSoundEvent = registries.soundEventRegistry[CAMPFIRE_CRACKLE_SOUND_RESOURCE_LOCATION]!!
|
private val campfireCrackleSoundEvent = registries.soundEventRegistry[CAMPFIRE_CRACKLE_SOUND_RESOURCE_LOCATION]!!
|
||||||
private val cosySmokeParticle = registries.particleTypeRegistry[CampfireSmokeParticle.CosyFactory]!!
|
private val cosySmokeParticle = registries.particleTypeRegistry[CampfireSmokeParticle.CosyFactory]!!
|
||||||
private val signalSmokeParticle = registries.particleTypeRegistry[CampfireSmokeParticle.SignalFactory]!!
|
private val signalSmokeParticle = registries.particleTypeRegistry[CampfireSmokeParticle.SignalFactory]!!
|
||||||
@ -86,7 +88,7 @@ open class CampfireBlock(resourceLocation: ResourceLocation, registries: Registr
|
|||||||
connection.rendering?.audioPlayer?.playSoundEvent(campfireCrackleSoundEvent, blockPosition + Vec3(0.5f), 0.5f + random.nextFloat(), 0.6f + random.nextFloat() * 0.7f)
|
connection.rendering?.audioPlayer?.playSoundEvent(campfireCrackleSoundEvent, blockPosition + Vec3(0.5f), 0.5f + random.nextFloat(), 0.6f + random.nextFloat() * 0.7f)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (random.chance(20)) {
|
if (lavaParticles && random.chance(20)) {
|
||||||
val position = Vec3(blockPosition) + Vec3(0.5f)
|
val position = Vec3(blockPosition) + Vec3(0.5f)
|
||||||
for (i in 0 until random.nextInt(1) + 1) {
|
for (i in 0 until random.nextInt(1) + 1) {
|
||||||
particleRenderer.add(LavaParticle(connection, particleRenderer, position, lavaParticle.simple()))
|
particleRenderer.add(LavaParticle(connection, particleRenderer, position, lavaParticle.simple()))
|
||||||
|
@ -160,13 +160,13 @@ abstract class Particle(
|
|||||||
}
|
}
|
||||||
|
|
||||||
open fun realTick() {
|
open fun realTick() {
|
||||||
if (!movement) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
age()
|
age()
|
||||||
if (dead) {
|
if (dead) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if (!movement) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
velocity.y -= 0.04f * gravityStrength
|
velocity.y -= 0.04f * gravityStrength
|
||||||
|
|
||||||
|
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user