Skip to content

Commit

Permalink
[Shields] Fixed a crash when minecrafttas.com is unavailable (Minecra…
Browse files Browse the repository at this point in the history
  • Loading branch information
ScribbleTAS authored Aug 13, 2024
2 parents bf874c5 + 3bb3966 commit 0a38f1a
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/main/java/com/minecrafttas/tasmod/util/ShieldDownloader.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
*
* @author Scribble
*/
public class ShieldDownloader implements EventPlayerJoinedClientSide, EventOtherPlayerJoinedClientSide{
public class ShieldDownloader implements EventPlayerJoinedClientSide, EventOtherPlayerJoinedClientSide {
private final ResourceLocation bottleshield = new ResourceLocation("tasmod:textures/shields/bottleshield.png");
private final String defaultshield = "bottleshield";
private final String cacheLocation = "tasmod/shields/";
Expand All @@ -59,15 +59,19 @@ public ResourceLocation getResourceLocation(EntityLivingBase entitylivingbaseIn)
public void onPlayerJoinedClientSide(EntityPlayerSP player) {
onPlayerJoin(player.getGameProfile());
}

@Override
public void onOtherPlayerJoinedClientSide(GameProfile profile) {
onPlayerJoin(profile);
}

public void onPlayerJoin(GameProfile profile) {
String uuid = profile.getId().toString();
loadTexture(uuid);
Thread t = new Thread(() -> {
loadTexture(uuid);
}, "Shield downloader");
t.run();

// downloadFromTASTools(uuid, cacheLocation);
}

Expand Down Expand Up @@ -124,7 +128,7 @@ public ResourceLocation getResourceLocationOld(EntityLivingBase entitylivingbase
return bottleshield;
}
}

@Deprecated
public void downloadFromTASTools(String uuid, String location) {
String name = getShieldName(uuid);
Expand Down

0 comments on commit 0a38f1a

Please sign in to comment.