Files
MinecraftForge/src/main/java/cpw/mods/fml/common/ModContainer.java
T

143 lines
3.5 KiB
Java
Raw Normal View History

2012-03-30 10:11:13 -04:00
/*
2013-03-07 19:25:48 -05:00
* Forge Mod Loader
* Copyright (c) 2012-2013 cpw.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Lesser Public License v2.1
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
*
2013-03-07 19:25:48 -05:00
* Contributors:
* cpw - implementation
2012-03-30 10:11:13 -04:00
*/
2013-03-07 19:25:48 -05:00
package cpw.mods.fml.common;
import java.io.File;
2012-12-17 19:55:46 -05:00
import java.security.cert.Certificate;
2012-04-02 23:06:30 -04:00
import java.util.List;
import java.util.Map;
import java.util.Set;
2012-04-02 23:06:30 -04:00
import com.google.common.collect.ImmutableMap;
2012-07-22 11:56:38 -02:30
import com.google.common.eventbus.EventBus;
2012-05-11 15:18:26 -04:00
import cpw.mods.fml.common.versioning.ArtifactVersion;
import cpw.mods.fml.common.versioning.VersionRange;
2012-07-23 22:50:37 -02:30
2012-04-05 16:22:47 -04:00
/**
* The container that wraps around mods in the system.
* <p>
* The philosophy is that individual mod implementation technologies should not
* impact the actual loading and management of mod code. This interface provides
* a mechanism by which we can wrap actual mod code so that the loader and other
* facilities can treat mods at arms length.
* </p>
*
2012-04-05 16:22:47 -04:00
* @author cpw
*
2012-04-05 16:22:47 -04:00
*/
2012-03-30 10:11:13 -04:00
2012-04-05 10:07:52 -04:00
public interface ModContainer
{
2012-04-05 16:22:47 -04:00
/**
2012-07-22 11:56:38 -02:30
* The globally unique modid for this mod
2012-04-05 16:22:47 -04:00
*/
2012-07-22 11:56:38 -02:30
String getModId();
/**
2012-07-22 11:56:38 -02:30
* A human readable name
*/
2012-07-22 11:56:38 -02:30
String getName();
2012-04-05 16:22:47 -04:00
/**
2012-07-22 11:56:38 -02:30
* A human readable version identifier
2012-04-05 16:22:47 -04:00
*/
2012-07-22 11:56:38 -02:30
String getVersion();
2012-04-05 16:22:47 -04:00
/**
2012-07-22 11:56:38 -02:30
* The location on the file system which this mod came from
2012-04-05 16:22:47 -04:00
*/
File getSource();
/**
2012-07-22 11:56:38 -02:30
* The metadata for this mod
2012-04-05 16:22:47 -04:00
*/
2012-07-22 11:56:38 -02:30
ModMetadata getMetadata();
2012-04-05 16:22:47 -04:00
/**
2012-07-22 11:56:38 -02:30
* Attach this mod to it's metadata from the supplied metadata collection
2012-04-05 16:22:47 -04:00
*/
2012-07-22 11:56:38 -02:30
void bindMetadata(MetadataCollection mc);
2012-04-05 16:22:47 -04:00
/**
2012-07-22 11:56:38 -02:30
* Set the enabled/disabled state of this mod
2012-04-05 16:22:47 -04:00
*/
2012-07-22 11:56:38 -02:30
void setEnabledState(boolean enabled);
2012-04-05 16:22:47 -04:00
/**
2012-07-22 11:56:38 -02:30
* A list of the modids that this mod requires loaded prior to loading
2012-04-05 16:22:47 -04:00
*/
Set<ArtifactVersion> getRequirements();
2012-04-05 16:22:47 -04:00
/**
2012-07-22 11:56:38 -02:30
* A list of modids that should be loaded prior to this one. The special
2013-01-16 23:49:09 -05:00
* value <strong>*</strong> indicates to load <em>after</em> any other mod.
2012-04-05 16:22:47 -04:00
*/
List<ArtifactVersion> getDependencies();
2012-04-05 16:22:47 -04:00
/**
2012-07-22 11:56:38 -02:30
* A list of modids that should be loaded <em>after</em> this one. The
2013-01-16 23:49:09 -05:00
* special value <strong>*</strong> indicates to load <em>before</em> any
2012-07-22 11:56:38 -02:30
* other mod.
2012-04-05 16:22:47 -04:00
*/
List<ArtifactVersion> getDependants();
2012-04-05 16:22:47 -04:00
/**
2012-07-22 11:56:38 -02:30
* A representative string encapsulating the sorting preferences for this
* mod
2012-04-05 16:22:47 -04:00
*/
2012-07-22 11:56:38 -02:30
String getSortingRules();
2012-04-05 16:22:47 -04:00
/**
2012-07-22 11:56:38 -02:30
* Register the event bus for the mod and the controller for error handling
* Returns if this bus was successfully registered - disabled mods and other
2012-07-22 11:56:38 -02:30
* mods that don't need real events should return false and avoid further
* processing
*
2012-07-22 11:56:38 -02:30
* @param bus
* @param controller
2012-04-05 16:22:47 -04:00
*/
2012-07-22 11:56:38 -02:30
boolean registerBus(EventBus bus, LoadController controller);
2012-04-05 16:22:47 -04:00
/**
2012-07-22 11:56:38 -02:30
* Does this mod match the supplied mod
*
2012-07-22 11:56:38 -02:30
* @param mod
2012-04-05 16:22:47 -04:00
*/
2012-07-22 11:56:38 -02:30
boolean matches(Object mod);
/**
2012-07-22 11:56:38 -02:30
* Get the actual mod object
*/
2012-07-22 11:56:38 -02:30
Object getMod();
ArtifactVersion getProcessedVersion();
boolean isImmutable();
boolean isNetworkMod();
String getDisplayVersion();
VersionRange acceptableMinecraftVersionRange();
2012-12-17 19:55:46 -05:00
Certificate getSigningCertificate();
public static final Map<String,String> EMPTY_PROPERTIES = ImmutableMap.of();
Map<String,String> getCustomModProperties();
public Class<?> getCustomResourcePackClass();
Map<String, String> getSharedModDescriptor();
2012-03-30 10:11:13 -04:00
}