Fall back to the default item when rendering non-turtles

Closes #1328. This isn't an actual fix - I have no clue what's going on
there - but it should be less crashy.
This commit is contained in:
Jonathan Coates 2023-02-09 12:45:20 +00:00
parent 58f2c0bd71
commit 68f6fa9343
No known key found for this signature in database
GPG Key ID: B9E431FF07C98D06
1 changed files with 3 additions and 0 deletions

View File

@ -111,6 +111,9 @@ public TurtleSmartItemModel( IBakedModel familyModel, IBakedModel colourModel )
@Override
public IBakedModel resolve( @Nonnull IBakedModel originalModel, @Nonnull ItemStack stack, @Nullable ClientWorld world, @Nullable LivingEntity entity )
{
// Should never happen, but just in case!
if ( !(stack.getItem() instanceof ItemTurtle) ) return familyModel;
ItemTurtle turtle = (ItemTurtle) stack.getItem();
int colour = turtle.getColour( stack );
ITurtleUpgrade leftUpgrade = turtle.getUpgrade( stack, TurtleSide.LEFT );