mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-09 15:29:20 -04:00
fix some portal particle bugs
This commit is contained in:
parent
1a95f7d696
commit
325d8ccfe6
@ -34,24 +34,26 @@ open class NetherPortalBlock(resourceLocation: ResourceLocation, registries: Reg
|
||||
super.randomTick(connection, blockState, blockPosition, random)
|
||||
|
||||
portalParticleType?.let {
|
||||
val position = Vec3d(blockPosition) + { random.nextDouble() }
|
||||
val velocity = Vec3d.of { (random.nextDouble() - 0.5) * 0.5 }
|
||||
for (i in 0 until 4) {
|
||||
val position = Vec3d(blockPosition) + { random.nextDouble() }
|
||||
val velocity = Vec3d.of { (random.nextDouble() - 0.5) * 0.5 }
|
||||
|
||||
val factor = (random.nextInt(2) * 2 + 1).toDouble()
|
||||
val factor = (random.nextInt(2) * 2 + 1).toDouble()
|
||||
|
||||
if (connection.world[blockPosition + Directions.WEST]?.block != this && connection.world[blockPosition + Directions.EAST]?.block != this) {
|
||||
position.x = blockPosition.x * 0.5 + 0.25 * factor
|
||||
velocity.x = random.nextDouble() * 2.0 * factor
|
||||
} else {
|
||||
position.z = blockPosition.x * 0.5 + 0.25 * factor
|
||||
velocity.z = random.nextDouble() * 2.0 * factor
|
||||
if (connection.world[blockPosition + Directions.WEST]?.block != this && connection.world[blockPosition + Directions.EAST]?.block != this) {
|
||||
position.x = blockPosition.x + 0.5 + 0.25 * factor
|
||||
velocity.x = random.nextDouble() * 2.0 * factor
|
||||
} else {
|
||||
position.z = blockPosition.z + 0.5 + 0.25 * factor
|
||||
velocity.z = random.nextDouble() * 2.0 * factor
|
||||
}
|
||||
connection.world += PortalParticle(
|
||||
connection,
|
||||
position,
|
||||
velocity,
|
||||
it.default(),
|
||||
)
|
||||
}
|
||||
connection.world += PortalParticle(
|
||||
connection,
|
||||
position,
|
||||
velocity,
|
||||
it.default(),
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user