mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-17 11:35:08 -04:00
Don't crash if textures for mobs aren't found.
This commit is contained in:
parent
87a61e26e2
commit
a3ebaf75e5
@ -1,5 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
|
||||||
namespace ClassicalSharp.Model {
|
namespace ClassicalSharp.Model {
|
||||||
|
|
||||||
@ -20,12 +21,15 @@ namespace ClassicalSharp.Model {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if( !cache.TryGetValue( modelName, out model ) ) {
|
if( !cache.TryGetValue( modelName, out model ) ) {
|
||||||
model = InitModel( modelName );
|
try {
|
||||||
if( model != null ) {
|
model = InitModel( modelName );
|
||||||
cache[modelName] = model;
|
} catch( FileNotFoundException ) {
|
||||||
} else {
|
model = null;
|
||||||
model = cache["humanoid"]; // fallback to default
|
Utils.LogWarning( modelName + " not found, falling back to human default." );
|
||||||
}
|
}
|
||||||
|
if( model == null )
|
||||||
|
model = cache["humanoid"]; // fallback to default
|
||||||
|
cache[modelName] = model;
|
||||||
}
|
}
|
||||||
return model;
|
return model;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user