    001/*
    002 * Forge Mod Loader
    003 * Copyright (c) 2012-2013 cpw.
    004 * All rights reserved. This program and the accompanying materials
    005 * are made available under the terms of the GNU Lesser Public License v2.1
    006 * which accompanies this distribution, and is available at
    007 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
    008 *
    009 * Contributors:
    010 *     cpw - implementation
    011 */
    012
    013package cpw.mods.fml.common;
    014
    015import java.io.File;
    016import java.security.cert.Certificate;
    017import java.util.Collections;
    018import java.util.List;
    019import java.util.Set;
    020
    021import com.google.common.eventbus.EventBus;
    022
    023import cpw.mods.fml.common.versioning.ArtifactVersion;
    024import cpw.mods.fml.common.versioning.DefaultArtifactVersion;
    025import cpw.mods.fml.common.versioning.VersionRange;
    026
    027public class DummyModContainer implements ModContainer
    028{
    029    private ModMetadata md;
    030    private ArtifactVersion processedVersion;
    031
    032    public DummyModContainer(ModMetadata md)
    033    {
    034        this.md = md;
    035    }
    036
    037    public DummyModContainer()
    038    {
    039    }
    040
    041    @Override
    042    public void bindMetadata(MetadataCollection mc)
    043    {
    044    }
    045
    046    @Override
    047    public List<ArtifactVersion> getDependants()
    048    {
    049        return Collections.emptyList();
    050    }
    051
    052    @Override
    053    public List<ArtifactVersion> getDependencies()
    054    {
    055        return Collections.emptyList();
    056    }
    057
    058    @Override
    059    public Set<ArtifactVersion> getRequirements()
    060    {
    061        return Collections.emptySet();
    062    }
    063
    064    @Override
    065    public ModMetadata getMetadata()
    066    {
    067        return md;
    068    }
    069
    070    @Override
    071    public Object getMod()
    072    {
    073        return null;
    074    }
    075
    076    @Override
    077    public String getModId()
    078    {
    079        return md.modId;
    080    }
    081
    082    @Override
    083    public String getName()
    084    {
    085        return md.name;
    086    }
    087
    088    @Override
    089    public String getSortingRules()
    090    {
    091        return "";
    092    }
    093
    094    @Override
    095    public File getSource()
    096    {
    097        return null;
    098    }
    099
    100    @Override
    101    public String getVersion()
    102    {
    103        return md.version;
    104    }
    105
    106    public boolean matches(Object mod)
    107    {
    108        return false;
    109    }
    110
    111    @Override
    112    public void setEnabledState(boolean enabled)
    113    {
    114    }
    115
    116    @Override
    117    public boolean registerBus(EventBus bus, LoadController controller)
    118    {
    119        return false;
    120    }
    121
    122    @Override
    123    public ArtifactVersion getProcessedVersion()
    124    {
    125        if (processedVersion == null)
    126        {
    127            processedVersion = new DefaultArtifactVersion(getModId(), getVersion());
    128        }
    129        return processedVersion;
    130    }
    131
    132    @Override
    133    public boolean isImmutable()
    134    {
    135        return false;
    136    }
    137
    138    @Override
    139    public boolean isNetworkMod()
    140    {
    141        return false;
    142    }
    143
    144    @Override
    145    public String getDisplayVersion()
    146    {
    147        return md.version;
    148    }
    149    @Override
    150    public VersionRange acceptableMinecraftVersionRange()
    151    {
    152        return Loader.instance().getMinecraftModContainer().getStaticVersionRange();
    153    }
    154
    155    @Override
    156    public Certificate getSigningCertificate()
    157    {
    158        return null;
    159    }
    160}