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