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-06-27 08:38:11 -04:00
|
|
|
*
|
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
|
|
|
|
2012-04-02 18:09:06 -04:00
|
|
|
package cpw.mods.fml.common;
|
|
|
|
|
|
2012-04-18 14:03:30 -04:00
|
|
|
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;
|
2013-06-27 08:38:11 -04:00
|
|
|
import java.util.Map;
|
2012-08-23 13:43:25 -04:00
|
|
|
import java.util.Set;
|
2012-04-02 23:06:30 -04:00
|
|
|
|
2013-06-27 08:38:11 -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
|
|
|
|
2012-07-30 17:01:27 -04:00
|
|
|
import cpw.mods.fml.common.versioning.ArtifactVersion;
|
2012-10-02 01:29:46 -04:00
|
|
|
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.
|
2012-07-14 13:58:46 -04:00
|
|
|
* <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-07-30 17:01:27 -04:00
|
|
|
*
|
2012-04-05 16:22:47 -04:00
|
|
|
* @author cpw
|
2012-07-30 17:01:27 -04:00
|
|
|
*
|
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-14 13:58:46 -04:00
|
|
|
|
2012-05-10 09:42:31 -04:00
|
|
|
/**
|
2012-07-22 11:56:38 -02:30
|
|
|
* A human readable name
|
2012-05-10 09:42:31 -04:00
|
|
|
*/
|
2012-07-14 13:58:46 -04:00
|
|
|
|
2012-07-22 11:56:38 -02:30
|
|
|
String getName();
|
2012-07-14 13:58:46 -04:00
|
|
|
|
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-07-14 13:58:46 -04:00
|
|
|
|
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
|
|
|
*/
|
2012-04-18 14:03:30 -04:00
|
|
|
File getSource();
|
2012-07-14 13:58:46 -04:00
|
|
|
|
2012-05-10 09:42:31 -04:00
|
|
|
/**
|
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-07-14 13:58:46 -04:00
|
|
|
|
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-07-14 13:58:46 -04:00
|
|
|
|
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-07-14 13:58:46 -04:00
|
|
|
|
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
|
|
|
*/
|
2012-08-23 13:43:25 -04:00
|
|
|
Set<ArtifactVersion> getRequirements();
|
2012-07-14 13:58:46 -04:00
|
|
|
|
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
|
|
|
*/
|
2012-07-30 17:01:27 -04:00
|
|
|
List<ArtifactVersion> getDependencies();
|
2012-07-14 13:58:46 -04:00
|
|
|
|
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
|
|
|
*/
|
2012-07-30 17:01:27 -04:00
|
|
|
List<ArtifactVersion> getDependants();
|
2012-07-14 13:58:46 -04:00
|
|
|
|
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-07-14 13:58:46 -04:00
|
|
|
|
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
|
2012-07-30 17:01:27 -04:00
|
|
|
* 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-30 17:01:27 -04:00
|
|
|
*
|
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-07-14 13:58:46 -04:00
|
|
|
|
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-30 17:01:27 -04:00
|
|
|
*
|
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-14 13:58:46 -04:00
|
|
|
|
2012-05-14 01:38:53 -04:00
|
|
|
/**
|
2012-07-22 11:56:38 -02:30
|
|
|
* Get the actual mod object
|
2012-05-14 01:38:53 -04:00
|
|
|
*/
|
2012-07-22 11:56:38 -02:30
|
|
|
Object getMod();
|
2012-07-14 13:58:46 -04:00
|
|
|
|
2012-07-30 17:01:27 -04:00
|
|
|
ArtifactVersion getProcessedVersion();
|
|
|
|
|
|
2012-08-04 11:26:51 -04:00
|
|
|
boolean isImmutable();
|
2012-08-06 09:52:42 -04:00
|
|
|
|
|
|
|
|
boolean isNetworkMod();
|
2012-08-26 10:45:00 -04:00
|
|
|
|
|
|
|
|
String getDisplayVersion();
|
2012-10-02 01:29:46 -04:00
|
|
|
|
|
|
|
|
VersionRange acceptableMinecraftVersionRange();
|
2012-12-17 19:55:46 -05:00
|
|
|
|
|
|
|
|
Certificate getSigningCertificate();
|
2013-06-27 08:38:11 -04:00
|
|
|
|
|
|
|
|
public static final Map<String,String> EMPTY_PROPERTIES = ImmutableMap.of();
|
|
|
|
|
Map<String,String> getCustomModProperties();
|
2013-07-02 11:11:50 -04:00
|
|
|
|
|
|
|
|
public Class<?> getCustomResourcePackClass();
|
2013-09-27 10:45:20 -04:00
|
|
|
|
|
|
|
|
Map<String, String> getSharedModDescriptor();
|
2012-03-30 10:11:13 -04:00
|
|
|
}
|