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