Fix auth server url

This commit is contained in:
fullwall 2024-08-19 20:43:26 +08:00
parent 44c697180f
commit ca12c83c25
3 changed files with 3 additions and 4 deletions

View File

@ -565,7 +565,7 @@ public class NMSImpl implements NMSBridge {
if (!(sessionService instanceof YggdrasilMinecraftSessionService)) if (!(sessionService instanceof YggdrasilMinecraftSessionService))
return sessionService.fetchProfile(profile.getId(), requireSecure).profile(); return sessionService.fetchProfile(profile.getId(), requireSecure).profile();
URL url = HttpAuthenticationService URL url = HttpAuthenticationService
.constantURL(getAuthServerBaseUrl() + "profile/" + UndashedUuid.toString(profile.getId())); .constantURL(getAuthServerBaseUrl() + "/" + UndashedUuid.toString(profile.getId()));
url = HttpAuthenticationService.concatenateURL(url, "unsigned=" + !requireSecure); url = HttpAuthenticationService.concatenateURL(url, "unsigned=" + !requireSecure);
MinecraftClient client = (MinecraftClient) MINECRAFT_CLIENT.invoke(sessionService); MinecraftClient client = (MinecraftClient) MINECRAFT_CLIENT.invoke(sessionService);
MinecraftProfilePropertiesResponse response = client.get(url, MinecraftProfilePropertiesResponse.class); MinecraftProfilePropertiesResponse response = client.get(url, MinecraftProfilePropertiesResponse.class);

View File

@ -6,7 +6,6 @@ import org.bukkit.craftbukkit.v1_21_R1.entity.CraftCod;
import org.bukkit.craftbukkit.v1_21_R1.entity.CraftEntity; import org.bukkit.craftbukkit.v1_21_R1.entity.CraftEntity;
import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.nms.v1_21_R1.util.EntityMoveControl;
import net.citizensnpcs.nms.v1_21_R1.util.ForwardingNPCHolder; import net.citizensnpcs.nms.v1_21_R1.util.ForwardingNPCHolder;
import net.citizensnpcs.nms.v1_21_R1.util.NMSBoundingBox; import net.citizensnpcs.nms.v1_21_R1.util.NMSBoundingBox;
import net.citizensnpcs.nms.v1_21_R1.util.NMSImpl; import net.citizensnpcs.nms.v1_21_R1.util.NMSImpl;
@ -130,7 +129,7 @@ public class CodController extends MobEntityController {
this.moveControl = this.oldMoveController; this.moveControl = this.oldMoveController;
} }
if (!npc.useMinecraftAI() && this.moveControl == this.oldMoveController) { if (!npc.useMinecraftAI() && this.moveControl == this.oldMoveController) {
this.moveControl = new EntityMoveControl(this); this.moveControl = new MoveControl(this);
} }
} }
super.customServerAiStep(); super.customServerAiStep();

View File

@ -544,7 +544,7 @@ public class NMSImpl implements NMSBridge {
if (!(sessionService instanceof YggdrasilMinecraftSessionService)) if (!(sessionService instanceof YggdrasilMinecraftSessionService))
return sessionService.fetchProfile(profile.getId(), requireSecure).profile(); return sessionService.fetchProfile(profile.getId(), requireSecure).profile();
URL url = HttpAuthenticationService URL url = HttpAuthenticationService
.constantURL(getAuthServerBaseUrl() + "profile/" + UndashedUuid.toString(profile.getId())); .constantURL(getAuthServerBaseUrl() + "/" + UndashedUuid.toString(profile.getId()));
url = HttpAuthenticationService.concatenateURL(url, "unsigned=" + !requireSecure); url = HttpAuthenticationService.concatenateURL(url, "unsigned=" + !requireSecure);
MinecraftClient client = (MinecraftClient) MINECRAFT_CLIENT.invoke(sessionService); MinecraftClient client = (MinecraftClient) MINECRAFT_CLIENT.invoke(sessionService);
MinecraftProfilePropertiesResponse response = client.get(url, MinecraftProfilePropertiesResponse.class); MinecraftProfilePropertiesResponse response = client.get(url, MinecraftProfilePropertiesResponse.class);