fixed PackFormatsDefinition

This commit is contained in:
FlorianMichael 2023-03-15 21:23:26 +01:00
parent 1c46fab9b0
commit 5ad8380cd0

View File

@ -32,7 +32,7 @@ public class PackFormatsDefinition {
private final static Map<Integer, GameVersion> protocolMap = new HashMap<>();
public static void load() {
registerVersion(ProtocolVersion.v1_19_4, 12, "1.19.4");
registerVersion(ProtocolVersion.v1_19_4, 13, "1.19.4");
registerVersion(ProtocolVersion.v1_19_3, 12, "1.19.3");
registerVersion(ProtocolVersion.v1_19_1, 9, "1.19.2");
registerVersion(ProtocolVersion.v1_19, 9, "1.19");
@ -79,7 +79,7 @@ public class PackFormatsDefinition {
}
final GameVersion gameVersion = protocolMap.get(nativeVersion);
if (!gameVersion.getName().equals(SharedConstants.getGameVersion().getName()) || !gameVersion.getId().equals(SharedConstants.getGameVersion().getId()) || gameVersion.getResourceVersion(ResourceType.SERVER_DATA) != SharedConstants.getGameVersion().getResourceVersion(ResourceType.SERVER_DATA)) {
if (!gameVersion.getName().equals(SharedConstants.getGameVersion().getName()) || !gameVersion.getId().equals(SharedConstants.getGameVersion().getId()) || gameVersion.getResourceVersion(ResourceType.CLIENT_RESOURCES) != SharedConstants.getGameVersion().getResourceVersion(ResourceType.CLIENT_RESOURCES)) {
throw new RuntimeException("The current version has no pack format registered");
}
}
@ -118,7 +118,7 @@ public class PackFormatsDefinition {
@Override
public int getResourceVersion(ResourceType type) {
if (type == ResourceType.SERVER_DATA) {
if (type == ResourceType.CLIENT_RESOURCES) {
return packFormat;
}
throw new UnsupportedOperationException();