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