reformatted all src files (#141)
This commit is contained in:
@@ -19,58 +19,48 @@
|
||||
package appeng.client.render.model;
|
||||
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import appeng.core.AppEng;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
|
||||
import net.minecraft.client.resources.IResourceManager;
|
||||
import net.minecraft.client.resources.IResourceManagerReloadListener;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.model.ICustomModelLoader;
|
||||
import net.minecraftforge.client.model.IModel;
|
||||
|
||||
import appeng.core.AppEng;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
* Manages built-in models.
|
||||
*/
|
||||
public class BuiltInModelLoader implements ICustomModelLoader
|
||||
{
|
||||
public class BuiltInModelLoader implements ICustomModelLoader {
|
||||
|
||||
private final Map<String, IModel> builtInModels;
|
||||
private final Map<String, IModel> builtInModels;
|
||||
|
||||
public BuiltInModelLoader( Map<String, IModel> builtInModels )
|
||||
{
|
||||
this.builtInModels = ImmutableMap.copyOf( builtInModels );
|
||||
}
|
||||
public BuiltInModelLoader(Map<String, IModel> builtInModels) {
|
||||
this.builtInModels = ImmutableMap.copyOf(builtInModels);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean accepts( ResourceLocation modelLocation )
|
||||
{
|
||||
if( !modelLocation.getResourceDomain().equals( AppEng.MOD_ID ) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean accepts(ResourceLocation modelLocation) {
|
||||
if (!modelLocation.getResourceDomain().equals(AppEng.MOD_ID)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return this.builtInModels.containsKey( modelLocation.getResourcePath() );
|
||||
}
|
||||
return this.builtInModels.containsKey(modelLocation.getResourcePath());
|
||||
}
|
||||
|
||||
@Override
|
||||
public IModel loadModel( ResourceLocation modelLocation ) throws Exception
|
||||
{
|
||||
return this.builtInModels.get( modelLocation.getResourcePath() );
|
||||
}
|
||||
@Override
|
||||
public IModel loadModel(ResourceLocation modelLocation) throws Exception {
|
||||
return this.builtInModels.get(modelLocation.getResourcePath());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResourceManagerReload( IResourceManager resourceManager )
|
||||
{
|
||||
for( IModel model : this.builtInModels.values() )
|
||||
{
|
||||
if( model instanceof IResourceManagerReloadListener )
|
||||
{
|
||||
( (IResourceManagerReloadListener) model ).onResourceManagerReload( resourceManager );
|
||||
}
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void onResourceManagerReload(IResourceManager resourceManager) {
|
||||
for (IModel model : this.builtInModels.values()) {
|
||||
if (model instanceof IResourceManagerReloadListener) {
|
||||
((IResourceManagerReloadListener) model).onResourceManagerReload(resourceManager);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user