    001    package cpw.mods.fml.common;
    002
    003    import java.io.File;
    004    import java.util.Collections;
    005    import java.util.List;
    006    import java.util.Set;
    007
    008    import com.google.common.eventbus.EventBus;
    009
    010    import cpw.mods.fml.common.versioning.ArtifactVersion;
    011    import cpw.mods.fml.common.versioning.DefaultArtifactVersion;
    012    import cpw.mods.fml.common.versioning.VersionRange;
    013
    014    public class DummyModContainer implements ModContainer
    015    {
    016        private ModMetadata md;
    017        private ArtifactVersion processedVersion;
    018
    019        public DummyModContainer(ModMetadata md)
    020        {
    021            this.md = md;
    022        }
    023
    024        public DummyModContainer()
    025        {
    026        }
    027
    028        @Override
    029        public void bindMetadata(MetadataCollection mc)
    030        {
    031        }
    032
    033        @Override
    034        public List<ArtifactVersion> getDependants()
    035        {
    036            return Collections.emptyList();
    037        }
    038
    039        @Override
    040        public List<ArtifactVersion> getDependencies()
    041        {
    042            return Collections.emptyList();
    043        }
    044
    045        @Override
    046        public Set<ArtifactVersion> getRequirements()
    047        {
    048            return Collections.emptySet();
    049        }
    050
    051        @Override
    052        public ModMetadata getMetadata()
    053        {
    054            return md;
    055        }
    056
    057        @Override
    058        public Object getMod()
    059        {
    060            return null;
    061        }
    062
    063        @Override
    064        public String getModId()
    065        {
    066            return md.modId;
    067        }
    068
    069        @Override
    070        public String getName()
    071        {
    072            return md.name;
    073        }
    074
    075        @Override
    076        public String getSortingRules()
    077        {
    078            return "";
    079        }
    080
    081        @Override
    082        public File getSource()
    083        {
    084            return null;
    085        }
    086
    087        @Override
    088        public String getVersion()
    089        {
    090            return md.version;
    091        }
    092
    093        public boolean matches(Object mod)
    094        {
    095            return false;
    096        }
    097
    098        @Override
    099        public void setEnabledState(boolean enabled)
    100        {
    101        }
    102
    103        @Override
    104        public boolean registerBus(EventBus bus, LoadController controller)
    105        {
    106            return false;
    107        }
    108
    109        @Override
    110        public ArtifactVersion getProcessedVersion()
    111        {
    112            if (processedVersion == null)
    113            {
    114                processedVersion = new DefaultArtifactVersion(getModId(), getVersion());
    115            }
    116            return processedVersion;
    117        }
    118
    119        @Override
    120        public boolean isImmutable()
    121        {
    122            return false;
    123        }
    124
    125        @Override
    126        public boolean isNetworkMod()
    127        {
    128            return false;
    129        }
    130
    131        @Override
    132        public String getDisplayVersion()
    133        {
    134            return md.version;
    135        }
    136        @Override
    137        public VersionRange acceptableMinecraftVersionRange()
    138        {
    139            return Loader.instance().getMinecraftModContainer().getStaticVersionRange();
    140        }
    141    }