2012-03-30 14:11:13 +00:00
|
|
|
/*
|
2013-03-08 00:25:48 +00: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 12:38:11 +00:00
|
|
|
*
|
2013-03-08 00:25:48 +00:00
|
|
|
* Contributors:
|
|
|
|
* cpw - implementation
|
2012-03-30 14:11:13 +00:00
|
|
|
*/
|
2013-03-08 00:25:48 +00:00
|
|
|
|
2014-09-23 05:01:24 +00:00
|
|
|
package net.minecraftforge.fml.common;
|
2012-04-02 22:09:06 +00:00
|
|
|
|
2012-04-18 18:03:30 +00:00
|
|
|
import java.io.File;
|
2015-11-04 22:37:15 +00:00
|
|
|
import java.net.URL;
|
2012-12-18 00:55:46 +00:00
|
|
|
import java.security.cert.Certificate;
|
2012-04-03 03:06:30 +00:00
|
|
|
import java.util.List;
|
2013-06-27 12:38:11 +00:00
|
|
|
import java.util.Map;
|
2012-08-23 17:43:25 +00:00
|
|
|
import java.util.Set;
|
2012-04-03 03:06:30 +00:00
|
|
|
|
2014-09-23 05:01:24 +00:00
|
|
|
import net.minecraftforge.fml.common.versioning.ArtifactVersion;
|
|
|
|
import net.minecraftforge.fml.common.versioning.VersionRange;
|
|
|
|
|
2013-06-27 12:38:11 +00:00
|
|
|
import com.google.common.collect.ImmutableMap;
|
2012-07-22 14:26:38 +00:00
|
|
|
import com.google.common.eventbus.EventBus;
|
2012-05-11 19:18:26 +00:00
|
|
|
|
2012-04-05 20:22:47 +00:00
|
|
|
/**
|
|
|
|
* The container that wraps around mods in the system.
|
2012-07-14 17:58:46 +00: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 21:01:27 +00:00
|
|
|
*
|
2012-04-05 20:22:47 +00:00
|
|
|
* @author cpw
|
2012-07-30 21:01:27 +00:00
|
|
|
*
|
2012-04-05 20:22:47 +00:00
|
|
|
*/
|
2012-03-30 14:11:13 +00:00
|
|
|
|
2012-04-05 14:07:52 +00:00
|
|
|
public interface ModContainer
|
|
|
|
{
|
2013-12-17 15:51:00 +00:00
|
|
|
public static enum Disableable {
|
|
|
|
YES, RESTART, NEVER, DEPENDENCIES;
|
|
|
|
}
|
2012-04-05 20:22:47 +00:00
|
|
|
/**
|
2012-07-22 14:26:38 +00:00
|
|
|
* The globally unique modid for this mod
|
2012-04-05 20:22:47 +00:00
|
|
|
*/
|
2012-07-22 14:26:38 +00:00
|
|
|
String getModId();
|
2012-07-14 17:58:46 +00:00
|
|
|
|
2012-05-10 13:42:31 +00:00
|
|
|
/**
|
2012-07-22 14:26:38 +00:00
|
|
|
* A human readable name
|
2012-05-10 13:42:31 +00:00
|
|
|
*/
|
2012-07-14 17:58:46 +00:00
|
|
|
|
2012-07-22 14:26:38 +00:00
|
|
|
String getName();
|
2012-07-14 17:58:46 +00:00
|
|
|
|
2012-04-05 20:22:47 +00:00
|
|
|
/**
|
2012-07-22 14:26:38 +00:00
|
|
|
* A human readable version identifier
|
2012-04-05 20:22:47 +00:00
|
|
|
*/
|
2012-07-22 14:26:38 +00:00
|
|
|
String getVersion();
|
2012-07-14 17:58:46 +00:00
|
|
|
|
2012-04-05 20:22:47 +00:00
|
|
|
/**
|
2012-07-22 14:26:38 +00:00
|
|
|
* The location on the file system which this mod came from
|
2012-04-05 20:22:47 +00:00
|
|
|
*/
|
2012-04-18 18:03:30 +00:00
|
|
|
File getSource();
|
2012-07-14 17:58:46 +00:00
|
|
|
|
2012-05-10 13:42:31 +00:00
|
|
|
/**
|
2012-07-22 14:26:38 +00:00
|
|
|
* The metadata for this mod
|
2012-04-05 20:22:47 +00:00
|
|
|
*/
|
2012-07-22 14:26:38 +00:00
|
|
|
ModMetadata getMetadata();
|
2012-07-14 17:58:46 +00:00
|
|
|
|
2012-04-05 20:22:47 +00:00
|
|
|
/**
|
2012-07-22 14:26:38 +00:00
|
|
|
* Attach this mod to it's metadata from the supplied metadata collection
|
2012-04-05 20:22:47 +00:00
|
|
|
*/
|
2012-07-22 14:26:38 +00:00
|
|
|
void bindMetadata(MetadataCollection mc);
|
2012-07-14 17:58:46 +00:00
|
|
|
|
2012-04-05 20:22:47 +00:00
|
|
|
/**
|
2012-07-22 14:26:38 +00:00
|
|
|
* Set the enabled/disabled state of this mod
|
2012-04-05 20:22:47 +00:00
|
|
|
*/
|
2012-07-22 14:26:38 +00:00
|
|
|
void setEnabledState(boolean enabled);
|
2012-07-14 17:58:46 +00:00
|
|
|
|
2012-04-05 20:22:47 +00:00
|
|
|
/**
|
2012-07-22 14:26:38 +00:00
|
|
|
* A list of the modids that this mod requires loaded prior to loading
|
2012-04-05 20:22:47 +00:00
|
|
|
*/
|
2012-08-23 17:43:25 +00:00
|
|
|
Set<ArtifactVersion> getRequirements();
|
2012-07-14 17:58:46 +00:00
|
|
|
|
2012-04-05 20:22:47 +00:00
|
|
|
/**
|
2012-07-22 14:26:38 +00:00
|
|
|
* A list of modids that should be loaded prior to this one. The special
|
2013-01-17 04:49:09 +00:00
|
|
|
* value <strong>*</strong> indicates to load <em>after</em> any other mod.
|
2012-04-05 20:22:47 +00:00
|
|
|
*/
|
2012-07-30 21:01:27 +00:00
|
|
|
List<ArtifactVersion> getDependencies();
|
2012-07-14 17:58:46 +00:00
|
|
|
|
2012-04-05 20:22:47 +00:00
|
|
|
/**
|
2012-07-22 14:26:38 +00:00
|
|
|
* A list of modids that should be loaded <em>after</em> this one. The
|
2013-01-17 04:49:09 +00:00
|
|
|
* special value <strong>*</strong> indicates to load <em>before</em> any
|
2012-07-22 14:26:38 +00:00
|
|
|
* other mod.
|
2012-04-05 20:22:47 +00:00
|
|
|
*/
|
2012-07-30 21:01:27 +00:00
|
|
|
List<ArtifactVersion> getDependants();
|
2012-07-14 17:58:46 +00:00
|
|
|
|
2012-04-05 20:22:47 +00:00
|
|
|
/**
|
2012-07-22 14:26:38 +00:00
|
|
|
* A representative string encapsulating the sorting preferences for this
|
|
|
|
* mod
|
2012-04-05 20:22:47 +00:00
|
|
|
*/
|
2012-07-22 14:26:38 +00:00
|
|
|
String getSortingRules();
|
2012-07-14 17:58:46 +00:00
|
|
|
|
2012-04-05 20:22:47 +00:00
|
|
|
/**
|
2012-07-22 14:26:38 +00:00
|
|
|
* Register the event bus for the mod and the controller for error handling
|
2012-07-30 21:01:27 +00:00
|
|
|
* Returns if this bus was successfully registered - disabled mods and other
|
2012-07-22 14:26:38 +00:00
|
|
|
* mods that don't need real events should return false and avoid further
|
|
|
|
* processing
|
2012-07-30 21:01:27 +00:00
|
|
|
*
|
2012-07-22 14:26:38 +00:00
|
|
|
* @param bus
|
|
|
|
* @param controller
|
2012-04-05 20:22:47 +00:00
|
|
|
*/
|
2012-07-22 14:26:38 +00:00
|
|
|
boolean registerBus(EventBus bus, LoadController controller);
|
2012-07-14 17:58:46 +00:00
|
|
|
|
2012-04-05 20:22:47 +00:00
|
|
|
/**
|
2012-07-22 14:26:38 +00:00
|
|
|
* Does this mod match the supplied mod
|
2012-07-30 21:01:27 +00:00
|
|
|
*
|
2012-07-22 14:26:38 +00:00
|
|
|
* @param mod
|
2012-04-05 20:22:47 +00:00
|
|
|
*/
|
2012-07-22 14:26:38 +00:00
|
|
|
boolean matches(Object mod);
|
2012-07-14 17:58:46 +00:00
|
|
|
|
2012-05-14 05:38:53 +00:00
|
|
|
/**
|
2012-07-22 14:26:38 +00:00
|
|
|
* Get the actual mod object
|
2012-05-14 05:38:53 +00:00
|
|
|
*/
|
2012-07-22 14:26:38 +00:00
|
|
|
Object getMod();
|
2012-07-14 17:58:46 +00:00
|
|
|
|
2012-07-30 21:01:27 +00:00
|
|
|
ArtifactVersion getProcessedVersion();
|
|
|
|
|
2012-08-04 15:26:51 +00:00
|
|
|
boolean isImmutable();
|
2012-08-06 13:52:42 +00:00
|
|
|
|
2012-08-26 14:45:00 +00:00
|
|
|
String getDisplayVersion();
|
2012-10-02 05:29:46 +00:00
|
|
|
|
|
|
|
VersionRange acceptableMinecraftVersionRange();
|
2012-12-18 00:55:46 +00:00
|
|
|
|
|
|
|
Certificate getSigningCertificate();
|
2013-06-27 12:38:11 +00:00
|
|
|
|
|
|
|
public static final Map<String,String> EMPTY_PROPERTIES = ImmutableMap.of();
|
|
|
|
Map<String,String> getCustomModProperties();
|
2013-07-02 15:11:50 +00:00
|
|
|
|
|
|
|
public Class<?> getCustomResourcePackClass();
|
2013-09-27 14:45:20 +00:00
|
|
|
|
|
|
|
Map<String, String> getSharedModDescriptor();
|
2013-12-17 15:51:00 +00:00
|
|
|
|
|
|
|
Disableable canBeDisabled();
|
2014-01-02 16:51:16 +00:00
|
|
|
|
|
|
|
String getGuiClassName();
|
2014-01-25 11:17:14 +00:00
|
|
|
|
|
|
|
List<String> getOwnedPackages();
|
2015-02-22 02:33:30 +00:00
|
|
|
|
|
|
|
boolean shouldLoadInEnvironment();
|
2015-11-04 22:37:15 +00:00
|
|
|
|
|
|
|
URL getUpdateUrl();
|
2016-05-04 01:26:52 +00:00
|
|
|
|
|
|
|
void setClassVersion(int classVersion);
|
|
|
|
|
|
|
|
int getClassVersion();
|
2012-03-30 14:11:13 +00:00
|
|
|
}
|