Skip to content

Commit

Permalink
new: backport to 1.20.1
Browse files Browse the repository at this point in the history
  • Loading branch information
CamperSamu committed Apr 18, 2024
1 parent 90393ce commit 1d0440b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
org.gradle.jvmargs=-Xmx1G
# Fabric Properties
# check these on https://modmuss50.me/fabric.html
minecraft_version=1.20.4
yarn_mappings=1.20.4+build.3
loader_version=0.15.3
minecraft_version=1.20.1
yarn_mappings=1.20.1+build.10
loader_version=0.15.10
# Mod Properties
mod_version=0.2
maven_group=com.campersamu
archives_base_name=chatheads
# Dependencies
# check this on https://modmuss50.me/fabric.html
fabric_version=0.91.3+1.20.4
papi_version=2.3.0+1.20.3
polymer_version=0.7.4+1.20.4
fabric_version=0.92.1+1.20.1
papi_version=2.1.3+1.20.1
polymer_version=0.5.19+1.20.1
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.campersamu.chatheads.mixin;

import com.mojang.authlib.GameProfile;
import com.mojang.authlib.minecraft.MinecraftProfileTexture;
import net.minecraft.network.ClientConnection;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.PlayerManager;
import net.minecraft.server.network.ConnectedClientData;
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.text.TextColor;
import org.slf4j.Logger;
Expand Down Expand Up @@ -36,7 +36,7 @@ public abstract class DownloadHeadOnJoin {

//Mixin into the player connect/join event and downlaod the skin for the player (needs a server restart to update)
@Inject(method = "onPlayerConnect", at = @At("HEAD"))
private void chatheads$invokeDownloadOnJoin(ClientConnection connection, ServerPlayerEntity player, ConnectedClientData clientData, CallbackInfo ci) {
private void chatheads$invokeDownloadOnJoin(ClientConnection connection, ServerPlayerEntity player, CallbackInfo ci) {
final var profile = player.getGameProfile();
//Use a new Thread since downloading a skin is slow and would slow down the player joining process
new Thread(() -> {
Expand All @@ -51,7 +51,7 @@ public abstract class DownloadHeadOnJoin {
@Unique
private TextColor[][] chatheads$getPlayerHead(final GameProfile profile, final ServerPlayerEntity player){
//get skin url
final String playerSkinUrl = server.getSessionService().getTextures(profile).skin().getUrl();
final String playerSkinUrl = server.getSessionService().getTextures(profile, false).get(MinecraftProfileTexture.Type.SKIN).getUrl();

//return default head if null
if (playerSkinUrl == null) return DEFAULT_HEAD_TEXTURE;
Expand Down

0 comments on commit 1d0440b

Please sign in to comment.