Skip to content

Commit

Permalink
Check before casting.
Browse files Browse the repository at this point in the history
Fixes #388
  • Loading branch information
mitchej123 committed Mar 16, 2024
1 parent 464af94 commit 852bcbb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ pluginManagement {
}

plugins {
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.14'
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.18'
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ public static void markBlockTextureForUpdate(IIcon icon, IBlockAccess blockAcces
if (textureAtlasSprite != null && textureAtlasSprite.hasAnimationMetadata()) {
// null if called by anything but chunk render cache update (for example to get blocks rendered as items in
// inventory)
if (blockAccess instanceof ITexturesCache) {
((ITexturesCache) blockAccess).getRenderedTextures().add(textureAtlasSprite);
} else {
((IPatchedTextureAtlasSprite) textureAtlasSprite).markNeedsAnimationUpdate();
if (blockAccess instanceof ITexturesCache texturesCache) {
texturesCache.getRenderedTextures().add(textureAtlasSprite);
} else if(textureAtlasSprite instanceof IPatchedTextureAtlasSprite patchedSprite){
patchedSprite.markNeedsAnimationUpdate();
}
}
}
Expand Down

0 comments on commit 852bcbb

Please sign in to comment.