bump pixlyzer, soul campfire particle emission, fix particle ageing

This commit is contained in:
Bixilon 2021-05-29 14:36:19 +02:00 committed by Lukas
parent 88278387ae
commit f094400c99
3 changed files with 7 additions and 5 deletions

View File

@ -37,6 +37,8 @@ import glm_.vec3.Vec3i
import kotlin.random.Random
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 cosySmokeParticle = registries.particleTypeRegistry[CampfireSmokeParticle.CosyFactory]!!
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)
}
if (random.chance(20)) {
if (lavaParticles && random.chance(20)) {
val position = Vec3(blockPosition) + Vec3(0.5f)
for (i in 0 until random.nextInt(1) + 1) {
particleRenderer.add(LavaParticle(connection, particleRenderer, position, lavaParticle.simple()))

View File

@ -160,13 +160,13 @@ abstract class Particle(
}
open fun realTick() {
if (!movement) {
return
}
age()
if (dead) {
return
}
if (!movement) {
return
}
velocity.y -= 0.04f * gravityStrength

File diff suppressed because one or more lines are too long