mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-18 03:44:54 -04:00
fix some bugs when trying to join versions without pixlyzer data
This commit is contained in:
parent
f30de97e31
commit
d71f687f44
@ -97,11 +97,11 @@ data class Version(
|
||||
}
|
||||
val pixlyzerData = try {
|
||||
Util.readJsonFromStream(assetsManager.readAssetAsStream(Resources.getPixLyzerDataHashByVersion(this)))
|
||||
} catch (e: Throwable) {
|
||||
} catch (exception: Throwable) {
|
||||
// should not happen, but if this version is not flattened, we can fallback to the flatten mappings. Some things might not work...
|
||||
Log.printException(e, LogLevels.VERBOSE)
|
||||
Log.printException(exception, LogLevels.VERBOSE)
|
||||
if (isFlattened()) {
|
||||
throw e
|
||||
throw exception
|
||||
}
|
||||
if (versionId == ProtocolDefinition.PRE_FLATTENING_VERSION_ID) {
|
||||
Versions.PRE_FLATTENING_MAPPING = null
|
||||
|
@ -135,7 +135,7 @@ class VersionMapping {
|
||||
// pre init stuff
|
||||
loadShapes(pixlyzerData["shapes"]?.asJsonObject)
|
||||
|
||||
loadBlockModels(pixlyzerData["models"].asJsonObject.toResourceLocationMap())
|
||||
loadBlockModels(pixlyzerData["models"]?.asJsonObject?.toResourceLocationMap() ?: mutableMapOf())
|
||||
|
||||
// enums
|
||||
loadEnumRegistry(version, pixlyzerData["equipment_slots"], equipmentSlotRegistry, DefaultRegistries.EQUIPMENT_SLOTS_REGISTRY)
|
||||
|
@ -157,6 +157,8 @@ class PlayConnection(
|
||||
}
|
||||
latch.waitForChange()
|
||||
}
|
||||
Log.info("Connecting to server: $address")
|
||||
network.connect(address)
|
||||
} catch (exception: Throwable) {
|
||||
Log.printException(exception, LogLevels.DEBUG)
|
||||
Log.fatal("Could not load version $version. This version seems to be unsupported!")
|
||||
@ -164,8 +166,6 @@ class PlayConnection(
|
||||
lastException = MappingsLoadingException("Mappings could not be loaded", exception)
|
||||
connectionState = ConnectionStates.FAILED_NO_RETRY
|
||||
}
|
||||
Log.info("Connecting to server: $address")
|
||||
network.connect(address)
|
||||
latch.countDown()
|
||||
}
|
||||
|
||||
|
@ -107,7 +107,7 @@ class PacketJoinGame(buffer: PlayInByteBuffer) : PlayS2CPacket() {
|
||||
hashedSeed = buffer.readLong()
|
||||
}
|
||||
if (buffer.versionId < ProtocolVersions.V_19W11A) {
|
||||
difficulty = Difficulties.byId(buffer.readUnsignedByte().toInt())
|
||||
difficulty = Difficulties.byId(buffer.readUnsignedByte())
|
||||
}
|
||||
maxPlayers = if (buffer.versionId < ProtocolVersions.V_1_16_2_RC1) {
|
||||
buffer.readByte().toInt()
|
||||
|
Loading…
x
Reference in New Issue
Block a user