EnumeratorModule.java
2.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/*
* This file is part of LiteLoader.
* Copyright (C) 2012-16 Adam Mummery-Smith
* All Rights Reserved.
*/
package com.mumfrey.liteloader.api;
import com.mumfrey.liteloader.interfaces.ModularEnumerator;
import com.mumfrey.liteloader.launch.LoaderEnvironment;
import com.mumfrey.liteloader.launch.LoaderProperties;
import net.minecraft.launchwrapper.LaunchClassLoader;
/**
* LiteLoader Extensible API - Interface for objects which can enumerate mods in
* places.
*
* <p>EnumeratorModules plug into the LoaderEnumerator and are used to discover
* mod containers in various locations, for example searching in a specific
* folder for particular files.</p>
*
* @author Adam Mummery-Smith
*/
public interface EnumeratorModule
{
/**
* @param environment Loader environment
* @param properties Loader properties
*/
public abstract void init(LoaderEnvironment environment, LoaderProperties properties);
/**
* @param environment Loader environment
* @param properties Loader properties
*/
public abstract void writeSettings(LoaderEnvironment environment, LoaderProperties properties);
/**
* Find loadable mods in this enumerator's domain.
*
* <p>This method is called during loader PREINIT phase so <b>do not use any
* game classes here</b>!</p>
*
* @param enumerator
* @param profile
*/
public abstract void enumerate(ModularEnumerator enumerator, String profile);
/**
* Register loadable mods discovered in this enumerator's domain during the
* call to {@link #enumerate}, the enumerator module should call back
* against the enumerator itself to register containers it discovers using
* the registerModContainer() and registerTweakContainer() callbacks.
*
* <p>This method is called during loader PREINIT phase so <b>do not use any
* game classes here</b>!</p>
*
* @param enumerator
* @param profile
*/
public abstract void register(ModularEnumerator enumerator, String profile);
/**
* The enumerator module should inject (as required) any discovered
* containers into the classpath.
*
* <p>This method is called during the loader INIT phase.</p>
*
* @param enumerator
* @param classLoader
*/
public abstract void injectIntoClassLoader(ModularEnumerator enumerator, LaunchClassLoader classLoader);
/**
* The enumerator module should callback against the enumerator using the
* registerModsFrom() callback to register mods from discovered containers.
*
* <p>This method is called during the loader INIT phase</p>
*
* @param enumerator
* @param classLoader
*/
public abstract void registerMods(ModularEnumerator enumerator, LaunchClassLoader classLoader);
}