Skip to content

Commit

Permalink
Don't tick avatars if the player doesn't exist
Browse files Browse the repository at this point in the history
Add a message if the texture couldn't be read
Fix Incorrect UV on Avatar Wizard Cape
  • Loading branch information
UnlikePaladin committed Jul 4, 2024
1 parent 99882a9 commit 0f4d65f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions common/src/main/java/org/figuramc/figura/FiguraMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,10 @@ public static void tick() {
popPushProfiler("files");
LocalAvatarLoader.tick();
LocalAvatarFetcher.tick();
popPushProfiler("avatars");
AvatarManager.tickLoadedAvatars();
if (Minecraft.getInstance().player != null) {
popPushProfiler("avatars");
AvatarManager.tickLoadedAvatars();
}
popPushProfiler("chatPrint");
FiguraLuaPrinter.printChatFromQueue();
popPushProfiler("emojiAnim");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public FiguraTexture read(@LuaNotNil String name, @LuaNotNil Object object) {
image = NativeImage.read(null, bais);
bais.close();
} catch (Exception e) {
throw new LuaError(e.getMessage());
throw new LuaError("Could not read image: " + e.getMessage());
}

return register(name, image, false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ else if (hasCapeOrElytra)
if (hasCape) {
Group cape = model.addGroup(Cape, FiguraVec3.of(0, 24, 2), root);
Cube cube = model.addCube("Cape", FiguraVec3.of(-5, 8, 2), FiguraVec3.of(10, 16, 1), cape);
cube.generateBoxFaces(0, 0, capeTex, 1, hasPlayer ? 2 : 1);
cube.generateBoxFaces(0, 0, capeTex, 1, 1);
}

//elytra
Expand Down

0 comments on commit 0f4d65f

Please sign in to comment.