1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-08-29 16:47:56 +00:00

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

View File

@@ -111,6 +111,9 @@ public class TurtleSmartItemModel implements IBakedModel
@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 );