Skip to content

Commit

Permalink
fix for 1.20
Browse files Browse the repository at this point in the history
  • Loading branch information
KrLite committed Mar 31, 2024
1 parent 65d49df commit 4d0d5ab
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 62 deletions.
2 changes: 1 addition & 1 deletion src/main/java/net/krlite/knowledges/KnowledgesHud.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public void render(DrawContext context, BiConsumer<RenderProxy, Representable<?>
boolean isFirstPerson = client.options.getPerspective().isFirstPerson();
boolean isSpectator = client.interactionManager != null && client.interactionManager.getCurrentGameMode() == GameMode.SPECTATOR;
boolean shouldRenderSpectatorCrosshair = ((InGameHudInvoker) client.inGameHud).invokeShouldRenderSpectatorCrosshair(rep.hitResult());
boolean isInDebugHud = client.getDebugHud().shouldShowDebugHud()
boolean isInDebugHud = client.options.debugEnabled
&& !client.options.hudHidden
&& !client.player.hasReducedDebugInfo()
&& !client.options.getReducedDebugInfo().getValue();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package net.krlite.knowledges.config.cache;

import com.mojang.authlib.GameProfile;
import com.mojang.authlib.yggdrasil.ProfileResult;
import net.krlite.knowledges.config.cache.base.Cache;
import net.minecraft.client.MinecraftClient;
import net.minecraft.entity.player.PlayerEntity;
Expand Down Expand Up @@ -53,12 +52,9 @@ public void run() {
LOGGER.info("Downloading player name for caching. UUID: {}", uuid);
callback.downloading.add(uuid);

ProfileResult profileResult = MinecraftClient.getInstance().getSessionService().fetchProfile(uuid, true);
if (profileResult == null) {
return;
}
GameProfile profile = new GameProfile(uuid, "???");
profile = MinecraftClient.getInstance().getSessionService().fillProfileProperties(profile, true);

GameProfile profile = profileResult.profile();
String name = profile.getName();
if (name == null || name.equals("???")) {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
@Mixin(ClientWorld.class)
public class ClientWorldMixin {
@Inject(method = "addEntity", at = @At("HEAD"))
private void addPlayer(Entity entity, CallbackInfo ci) {
private void addPlayer(int i, Entity entity, CallbackInfo ci) {
if (entity instanceof PlayerEntity player)
KnowledgesCommon.CACHE_USERNAME.put(player);
}
Expand Down

This file was deleted.

0 comments on commit 4d0d5ab

Please sign in to comment.