mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-17 03:15:35 -04:00
network: support for 21w38a-1.18-pre5
This commit is contained in:
parent
beaeafbb5b
commit
5496b1d47e
@ -232,6 +232,7 @@ class AudioPlayer(
|
||||
Log.log(LogMessageType.AUDIO_LOADING, LogLevels.INFO) { "Unloaded OpenAL!" }
|
||||
}
|
||||
|
||||
@Deprecated("Refactoring needed")
|
||||
private fun loadSounds() {
|
||||
Log.log(LogMessageType.AUDIO_LOADING, LogLevels.VERBOSE) { "Loading sounds.json" }
|
||||
val data = connection.assetsManager.readJsonAsset(SOUNDS_INDEX_FILE)
|
||||
|
@ -30,6 +30,7 @@ class ClientSettingsC2SP(
|
||||
val skinParts: Set<SkinParts> = setOf(*SkinParts.VALUES),
|
||||
val mainHand: Hands = Hands.MAIN,
|
||||
val disableTextFiltering: Boolean = true,
|
||||
val allowListing: Boolean = true,
|
||||
) : PlayC2SPacket {
|
||||
|
||||
override fun write(buffer: PlayOutByteBuffer) {
|
||||
@ -53,10 +54,13 @@ class ClientSettingsC2SP(
|
||||
if (buffer.versionId >= ProtocolVersions.V_21W07A) {
|
||||
buffer.writeBoolean(disableTextFiltering)
|
||||
}
|
||||
if (buffer.versionId >= ProtocolVersions.V_21W44A) {
|
||||
buffer.writeBoolean(allowListing)
|
||||
}
|
||||
}
|
||||
|
||||
override fun log() {
|
||||
Log.log(LogMessageType.NETWORK_PACKETS_OUT, LogLevels.VERBOSE) { "Client settings (locale=$locale, renderDistance=$viewDistance)" }
|
||||
Log.log(LogMessageType.NETWORK_PACKETS_OUT, LogLevels.VERBOSE) { "Client settings (locale=$locale, viewDistance=$viewDistance)" }
|
||||
}
|
||||
|
||||
enum class SkinParts {
|
||||
|
@ -130,7 +130,7 @@ class ChunkDataS2CP(buffer: PlayInByteBuffer) : PlayS2CPacket() {
|
||||
val xz = buffer.readUnsignedByte()
|
||||
val y = buffer.readShort()
|
||||
val type = buffer.connection.registries.blockEntityTypeRegistry[buffer.readVarInt()]
|
||||
val nbt = buffer.readNBT().asCompound()
|
||||
val nbt = buffer.readNBT()?.asCompound() ?: continue
|
||||
val entity = type.build(buffer.connection)
|
||||
entity.updateNBT(nbt)
|
||||
blockEntities[Vec3i(xz shr 4, y, xz and 0x0F)] = entity
|
||||
|
@ -70,6 +70,8 @@ class JoinGameS2CP(buffer: PlayInByteBuffer) : PlayS2CPacket() {
|
||||
private set
|
||||
var world: ResourceLocation? = null
|
||||
private set
|
||||
var simulationDistance: Int = -1
|
||||
private set
|
||||
|
||||
init {
|
||||
entityId = buffer.readInt()
|
||||
@ -131,6 +133,9 @@ class JoinGameS2CP(buffer: PlayInByteBuffer) : PlayS2CPacket() {
|
||||
if (buffer.versionId >= ProtocolVersions.V_19W13A) {
|
||||
viewDistance = buffer.readVarInt()
|
||||
}
|
||||
if (buffer.versionId >= ProtocolVersions.V_21W40A) {
|
||||
simulationDistance = buffer.readVarInt()
|
||||
}
|
||||
if (buffer.versionId >= ProtocolVersions.V_20W20A) {
|
||||
buffer.readBoolean() // isDebug
|
||||
if (buffer.readBoolean()) {
|
||||
|
@ -0,0 +1,27 @@
|
||||
/*
|
||||
* Minosoft
|
||||
* Copyright (C) 2020 Moritz Zwerger
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
* This software is not affiliated with Mojang AB, the original developer of Minecraft.
|
||||
*/
|
||||
package de.bixilon.minosoft.protocol.packets.s2c.play
|
||||
|
||||
import de.bixilon.minosoft.protocol.packets.s2c.PlayS2CPacket
|
||||
import de.bixilon.minosoft.protocol.protocol.PlayInByteBuffer
|
||||
import de.bixilon.minosoft.util.logging.Log
|
||||
import de.bixilon.minosoft.util.logging.LogLevels
|
||||
import de.bixilon.minosoft.util.logging.LogMessageType
|
||||
|
||||
class SimulationDistanceSetS2CP(buffer: PlayInByteBuffer) : PlayS2CPacket() {
|
||||
val simulationDistance: Int = buffer.readVarInt()
|
||||
|
||||
override fun log() {
|
||||
Log.log(LogMessageType.NETWORK_PACKETS_IN, level = LogLevels.VERBOSE) { "Simulation distance set (viewDistance=$simulationDistance)" }
|
||||
}
|
||||
}
|
@ -275,6 +275,7 @@ class PacketTypes {
|
||||
PLAY_ADVANCEMENT_PROGRESS({ TODO() }),
|
||||
PLAY_VIBRATION_SIGNAL({ VibrationSignalS2CP(it) }),
|
||||
PLAY_PING({ PingS2CP(it) }),
|
||||
PLAY_SIMULATION_DISTANCE({ SimulationDistanceSetS2CP(it) }),
|
||||
;
|
||||
|
||||
init {
|
||||
|
@ -16,6 +16,18 @@ package de.bixilon.minosoft.protocol.protocol;
|
||||
@SuppressWarnings("unused")
|
||||
public class ProtocolVersions {
|
||||
public static final int
|
||||
V_1_18_PRE5 = 807,
|
||||
V_1_18_PRE4 = 806,
|
||||
V_1_18_PRE3 = 805,
|
||||
V_1_18_PRE2 = 804,
|
||||
V_1_18_PRE1 = 803,
|
||||
V_21W44A = 802,
|
||||
V_21W43A = 801,
|
||||
V_21W42A = 800,
|
||||
V_21W41A = 799,
|
||||
V_21W40A = 798,
|
||||
V_21W39A = 797,
|
||||
V_21W38A = 796,
|
||||
V_21W37A = 795,
|
||||
V_1_17_1 = 794,
|
||||
V_1_17_1_RC2 = 793,
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user