ForgePatch/src/main/java/net/minecraftforge/fml/common/ModContainer.java

160 lines
3.8 KiB
Java
Raw Normal View History

2012-03-30 14:11:13 +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
*
* Contributors:
* cpw - implementation
2012-03-30 14:11:13 +00:00
*/
2014-09-23 05:01:24 +00:00
package net.minecraftforge.fml.common;
import java.io.File;
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;
import java.util.Map;
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;
import com.google.common.collect.ImmutableMap;
2012-07-22 14:26:38 +00:00
import com.google.common.eventbus.EventBus;
/**
* 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>
*
* @author cpw
*
*/
2012-03-30 14:11:13 +00:00
public interface ModContainer
{
public static enum Disableable {
YES, RESTART, NEVER, DEPENDENCIES;
}
/**
2012-07-22 14:26:38 +00:00
* The globally unique modid for this mod
*/
2012-07-22 14:26:38 +00:00
String getModId();
/**
2012-07-22 14:26:38 +00:00
* A human readable name
*/
2012-07-22 14:26:38 +00:00
String getName();
/**
2012-07-22 14:26:38 +00:00
* A human readable version identifier
*/
2012-07-22 14:26:38 +00:00
String getVersion();
/**
2012-07-22 14:26:38 +00:00
* The location on the file system which this mod came from
*/
File getSource();
/**
2012-07-22 14:26:38 +00:00
* The metadata for this mod
*/
2012-07-22 14:26:38 +00:00
ModMetadata getMetadata();
/**
2012-07-22 14:26:38 +00:00
* Attach this mod to it's metadata from the supplied metadata collection
*/
2012-07-22 14:26:38 +00:00
void bindMetadata(MetadataCollection mc);
/**
2012-07-22 14:26:38 +00:00
* Set the enabled/disabled state of this mod
*/
2012-07-22 14:26:38 +00:00
void setEnabledState(boolean enabled);
/**
2012-07-22 14:26:38 +00:00
* A list of the modids that this mod requires loaded prior to loading
*/
Set<ArtifactVersion> getRequirements();
/**
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.
*/
List<ArtifactVersion> getDependencies();
/**
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.
*/
List<ArtifactVersion> getDependants();
/**
2012-07-22 14:26:38 +00:00
* A representative string encapsulating the sorting preferences for this
* mod
*/
2012-07-22 14:26:38 +00:00
String getSortingRules();
/**
2012-07-22 14:26:38 +00:00
* 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 14:26:38 +00:00
* mods that don't need real events should return false and avoid further
* processing
*
2012-07-22 14:26:38 +00:00
* @param bus
* @param controller
*/
2012-07-22 14:26:38 +00:00
boolean registerBus(EventBus bus, LoadController controller);
/**
2012-07-22 14:26:38 +00:00
* Does this mod match the supplied mod
*
2012-07-22 14:26:38 +00:00
* @param mod
*/
2012-07-22 14:26:38 +00:00
boolean matches(Object mod);
/**
2012-07-22 14:26:38 +00:00
* Get the actual mod object
*/
2012-07-22 14:26:38 +00:00
Object getMod();
ArtifactVersion getProcessedVersion();
boolean isImmutable();
String getDisplayVersion();
VersionRange acceptableMinecraftVersionRange();
2012-12-18 00:55:46 +00:00
Certificate getSigningCertificate();
public static final Map<String,String> EMPTY_PROPERTIES = ImmutableMap.of();
Map<String,String> getCustomModProperties();
public Class<?> getCustomResourcePackClass();
Map<String, String> getSharedModDescriptor();
Disableable canBeDisabled();
2014-01-02 16:51:16 +00:00
String getGuiClassName();
2014-01-25 11:17:14 +00:00
List<String> getOwnedPackages();
boolean shouldLoadInEnvironment();
URL getUpdateUrl();
void setClassVersion(int classVersion);
int getClassVersion();
2012-03-30 14:11:13 +00:00
}