Fixes and cleanup
- Compile error fixes (blame @biggles2206). Fixes #53. - UVLModelLoader is now cross compatible with vanilla (vanilla can use uvl parents who have vanilla parents). - Due to it, now using uvlMarker instead of .uvl. - General code reformatting and cleanup.
This commit is contained in:
@@ -57,7 +57,6 @@ import net.minecraftforge.client.model.ICustomModelLoader;
|
||||
import net.minecraftforge.client.model.IModel;
|
||||
import net.minecraftforge.client.model.ModelLoader;
|
||||
import net.minecraftforge.client.model.animation.ModelBlockAnimation;
|
||||
import net.minecraftforge.client.model.pipeline.LightUtil;
|
||||
import net.minecraftforge.client.model.pipeline.UnpackedBakedQuad;
|
||||
import net.minecraftforge.client.model.pipeline.VertexLighterFlat;
|
||||
import net.minecraftforge.common.model.IModelState;
|
||||
@@ -69,6 +68,8 @@ public enum UVLModelLoader implements ICustomModelLoader
|
||||
{
|
||||
INSTANCE;
|
||||
|
||||
private static final Gson gson = new Gson();
|
||||
|
||||
private static final Constructor<? extends IModel> vanillaModelWrapper;
|
||||
private static final Field faceBakery;
|
||||
|
||||
@@ -153,7 +154,15 @@ public enum UVLModelLoader implements ICustomModelLoader
|
||||
@Override
|
||||
public boolean accepts( ResourceLocation modelLocation )
|
||||
{
|
||||
return modelLocation.getResourcePath().endsWith( ".uvl" );
|
||||
try
|
||||
{
|
||||
return gson.fromJson( new InputStreamReader( Minecraft.getMinecraft().getResourceManager().getResource( modelLocation ).getInputStream() ), UVLMarker.class ).uvlMarker;
|
||||
}
|
||||
catch( IOException e )
|
||||
{
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -322,4 +331,9 @@ public enum UVLModelLoader implements ICustomModelLoader
|
||||
|
||||
}
|
||||
|
||||
class UVLMarker
|
||||
{
|
||||
boolean uvlMarker = false;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user