Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/1.20.1' into 1.19.4
Browse files Browse the repository at this point in the history
  • Loading branch information
senseiwells committed Feb 20, 2024
2 parents d60b4f2 + 49d93b7 commit ad757a2
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/main/kotlin/me/senseiwells/replay/recorder/ReplayRecorder.kt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import net.minecraft.network.protocol.game.*
import net.minecraft.network.protocol.login.ClientboundGameProfilePacket
import net.minecraft.server.MinecraftServer
import net.minecraft.server.level.ServerLevel
import net.minecraft.world.entity.EntityType
import org.apache.commons.lang3.builder.StandardToStringStyle
import org.apache.commons.lang3.builder.ToStringBuilder
import org.jetbrains.annotations.ApiStatus.Internal
Expand Down Expand Up @@ -274,13 +273,11 @@ abstract class ReplayRecorder(

private fun prePacket(packet: MinecraftPacket<*>): Boolean {
when (packet) {
is ClientboundAddEntityPacket -> {
if (packet.type == EntityType.PLAYER) {
val uuids = this.meta.players.toMutableSet()
uuids.add(packet.uuid.toString())
this.meta.players = uuids.toTypedArray()
this.saveMeta()
}
is ClientboundAddPlayerPacket -> {
val uuids = this.meta.players.toMutableSet()
uuids.add(packet.playerId.toString())
this.meta.players = uuids.toTypedArray()
this.saveMeta()
}
is ClientboundBundlePacket -> {
for (sub in packet.subPackets()) {
Expand Down

0 comments on commit ad757a2

Please sign in to comment.