mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-12 17:07:55 -04:00
send client settings, fix underwater particle amount, add missing pose
This commit is contained in:
parent
7da7e10593
commit
e6fd5d5f54
@ -43,6 +43,6 @@
|
||||
|
||||
|
||||
- ToDo:
|
||||
- Build biome cache only in render distance
|
||||
- Update neighbour chunks if needed
|
||||
- Biomes: Check if chunk is single biome
|
||||
-
|
||||
|
@ -17,11 +17,12 @@ import de.bixilon.minosoft.util.enum.ValuesEnum
|
||||
|
||||
enum class Poses {
|
||||
STANDING,
|
||||
FLYING,
|
||||
ELYTRA_FLYING,
|
||||
SLEEPING,
|
||||
SWIMMING,
|
||||
SPIN_ATTACK,
|
||||
SNEAKING,
|
||||
LONG_JUMPING, // ToDo: This was added at some time, no clue when
|
||||
DYING,
|
||||
;
|
||||
|
||||
|
@ -257,7 +257,7 @@ abstract class Entity(
|
||||
open val pose: Poses?
|
||||
get() {
|
||||
return when {
|
||||
isFlyingWithElytra -> Poses.FLYING
|
||||
isFlyingWithElytra -> Poses.ELYTRA_FLYING
|
||||
isSwimming -> Poses.SWIMMING
|
||||
isSneaking -> Poses.SNEAKING
|
||||
else -> entityMetaData.sets.getPose(EntityMetaDataFields.ENTITY_POSE)
|
||||
|
@ -93,7 +93,7 @@ abstract class PlayerEntity(
|
||||
private val DIMENSIONS: Map<Poses, Vec2> = mapOf(
|
||||
Poses.STANDING to Vec2(0.6f, 1.8f),
|
||||
Poses.SLEEPING to Vec2(0.2f, 0.2f),
|
||||
Poses.FLYING to Vec2(0.6f, 0.6f),
|
||||
Poses.ELYTRA_FLYING to Vec2(0.6f, 0.6f),
|
||||
Poses.SWIMMING to Vec2(0.6f, 0.6f),
|
||||
Poses.SPIN_ATTACK to Vec2(0.6f, 0.6f),
|
||||
Poses.SNEAKING to Vec2(0.6f, 1.5f), // ToDo: This changed at some time
|
||||
|
@ -31,6 +31,7 @@ import de.bixilon.minosoft.gui.rendering.particle.types.render.texture.simple.wa
|
||||
import de.bixilon.minosoft.gui.rendering.util.VecUtil.plus
|
||||
import de.bixilon.minosoft.gui.rendering.util.VecUtil.toVec3d
|
||||
import de.bixilon.minosoft.protocol.network.connection.play.PlayConnection
|
||||
import de.bixilon.minosoft.util.KUtil.chance
|
||||
import de.bixilon.minosoft.util.KUtil.decide
|
||||
import de.bixilon.minosoft.util.KUtil.toResourceLocation
|
||||
import glm_.vec3.Vec3d
|
||||
@ -117,8 +118,10 @@ class WaterFluid(
|
||||
override fun randomTick(connection: PlayConnection, blockState: BlockState, blockPosition: Vec3i, random: Random) {
|
||||
super.randomTick(connection, blockState, blockPosition, random)
|
||||
|
||||
// ToDo
|
||||
connection.world += UnderwaterParticle(connection, blockPosition.toVec3d + { random.nextDouble() })
|
||||
// ToDo: if not sill and not falling
|
||||
if (random.chance(10)) {
|
||||
connection.world += UnderwaterParticle(connection, blockPosition.toVec3d + { random.nextDouble() })
|
||||
}
|
||||
}
|
||||
|
||||
companion object : FluidFactory<WaterFluid>, MultiClassFactory<WaterFluid> {
|
||||
|
@ -43,8 +43,6 @@ import de.bixilon.minosoft.util.logging.LogMessageType
|
||||
import de.bixilon.minosoft.util.nbt.tag.NBTUtil.asCompound
|
||||
import de.bixilon.minosoft.util.nbt.tag.NBTUtil.compoundCast
|
||||
import de.bixilon.minosoft.util.nbt.tag.NBTUtil.listCast
|
||||
import de.bixilon.minosoft.util.task.time.TimeWorker
|
||||
import de.bixilon.minosoft.util.task.time.TimeWorkerTask
|
||||
|
||||
class JoinGameS2CP(buffer: PlayInByteBuffer) : PlayS2CPacket() {
|
||||
val entityId: Int
|
||||
@ -165,14 +163,14 @@ class JoinGameS2CP(buffer: PlayInByteBuffer) : PlayS2CPacket() {
|
||||
if (connection.version.versionId >= ProtocolVersions.V_19W36A && !Minosoft.config.config.game.graphics.fastBiomeNoise) {
|
||||
connection.world.cacheBiomeAccessor = NoiseBiomeAccessor(connection.world)
|
||||
}
|
||||
TimeWorker.addTask(TimeWorkerTask(150, true) { // ToDo: Temp workaround
|
||||
connection.sendPacket(ClientSettingsC2SP(viewDistance = Minosoft.config.config.game.camera.viewDistance))
|
||||
|
||||
val brandName = DefaultRegistries.DEFAULT_PLUGIN_CHANNELS_REGISTRY.forVersion(connection.version)[DefaultPluginChannels.BRAND]!!.resourceLocation
|
||||
val buffer = PlayOutByteBuffer(connection)
|
||||
buffer.writeString("vanilla") // ToDo: Remove prefix
|
||||
connection.sendPacket(PluginMessageC2SP(brandName, buffer.toByteArray()))
|
||||
})
|
||||
connection.sendPacket(ClientSettingsC2SP(viewDistance = Minosoft.config.config.game.camera.viewDistance))
|
||||
|
||||
val brandName = DefaultRegistries.DEFAULT_PLUGIN_CHANNELS_REGISTRY.forVersion(connection.version)[DefaultPluginChannels.BRAND]!!.resourceLocation
|
||||
val buffer = PlayOutByteBuffer(connection)
|
||||
buffer.writeString("vanilla") // ToDo: Remove prefix
|
||||
connection.sendPacket(PluginMessageC2SP(brandName, buffer.toByteArray()))
|
||||
|
||||
connection.state = PlayConnectionStates.SPAWNING
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user