fix(multiplayer): force using authlib-injector in multiplayer mode.

This commit is contained in:
huanghongxun
2022-10-30 13:43:38 +08:00
parent 11a1c37765
commit a70e53364d
5 changed files with 75 additions and 9 deletions

View File

@@ -67,6 +67,10 @@ public class OfflineAccount extends Account {
}
}
public AuthlibInjectorArtifactProvider getDownloader() {
return downloader;
}
@Override
public UUID getUUID() {
return uuid;
@@ -91,7 +95,7 @@ public class OfflineAccount extends Account {
invalidate();
}
private boolean loadAuthlibInjector(Skin skin) {
protected boolean loadAuthlibInjector(Skin skin) {
if (skin == null) return false;
if (skin.getType() == Skin.Type.DEFAULT) return false;
TextureModel defaultModel = TextureModel.detectUUID(getUUID());
@@ -158,7 +162,8 @@ public class OfflineAccount extends Account {
server.start();
try {
server.addCharacter(new YggdrasilServer.Character(uuid, username, skin.load(username).run()));
server.addCharacter(new YggdrasilServer.Character(uuid, username,
skin != null ? skin.load(username).run() : null));
} catch (IOException e) {
// ignore
} catch (Exception e) {