forked from mirrors/cobblemon
Merge branch 'multiplayer_mount_sync' into 'main'
Multiplayer mount sync Closes #2023 See merge request cable-mc/cobblemon!2315
This commit is contained in:
@@ -358,6 +358,7 @@
|
||||
- Fixed fished up Pokémon not being added as "seen" to the Pokedex
|
||||
- Fixed surprised Gimmighoul encounters not being added as "seen" to the Pokedex
|
||||
- Fixed a crash involving berry trees that have been world edited.
|
||||
- Fixed visual desync in multiplayer for players mounting Pokémon outside other players' loaded chunks
|
||||
|
||||
### Developer
|
||||
- Added `PokeSnackSpawnerFactory` which allows influence registration on PokeSnack encounters
|
||||
|
||||
+9
@@ -64,6 +64,7 @@ class SpawnPokemonPacket(
|
||||
var rideStamina: Float,
|
||||
var isAlpha: Boolean,
|
||||
var silent: Boolean,
|
||||
var riders: List<Int>,
|
||||
vanillaSpawnPacket: ClientboundAddEntityPacket,
|
||||
) : SpawnExtraDataEntityPacket<SpawnPokemonPacket, PokemonEntity>(vanillaSpawnPacket) {
|
||||
|
||||
@@ -98,6 +99,7 @@ class SpawnPokemonPacket(
|
||||
entity.entityData.get(PokemonEntity.RIDE_STAMINA),
|
||||
entity.entityData.get(PokemonEntity.IS_ALPHA),
|
||||
entity.isSilent,
|
||||
entity.occupiedSeats.map { entry -> entry.value.id }.toList(),
|
||||
vanillaSpawnPacket
|
||||
)
|
||||
|
||||
@@ -134,6 +136,7 @@ class SpawnPokemonPacket(
|
||||
buffer.writeFloat(rideStamina)
|
||||
buffer.writeBoolean(isAlpha)
|
||||
buffer.writeBoolean(silent)
|
||||
buffer.writeCollection(this.riders) { pb, value -> pb.writeInt(value) }
|
||||
}
|
||||
|
||||
override fun applyData(entity: PokemonEntity, level: ClientLevel) {
|
||||
@@ -184,6 +187,10 @@ class SpawnPokemonPacket(
|
||||
|
||||
entity.tickSpawned = this.tickSpawned
|
||||
entity.delegate.updateAge(this.tickSpawned)
|
||||
|
||||
if (this.riders.isNotEmpty()) {
|
||||
this.riders.forEach { level.getEntity(it)?.startRiding(entity) }
|
||||
}
|
||||
}
|
||||
|
||||
override fun checkType(entity: Entity): Boolean = entity is PokemonEntity
|
||||
@@ -222,6 +229,7 @@ class SpawnPokemonPacket(
|
||||
val rideStamina = buffer.readFloat()
|
||||
val isAlpha = buffer.readBoolean()
|
||||
val silent = buffer.readBoolean()
|
||||
val riders = buffer.readList { it.readInt() }.toList()
|
||||
val vanillaPacket = decodeVanillaPacket(buffer)
|
||||
|
||||
return SpawnPokemonPacket(
|
||||
@@ -253,6 +261,7 @@ class SpawnPokemonPacket(
|
||||
rideStamina,
|
||||
isAlpha,
|
||||
silent,
|
||||
riders,
|
||||
vanillaPacket
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user