CoreProvider.java
2.39 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
package com.mumfrey.liteloader.api;
import net.minecraft.network.INetHandler;
import net.minecraft.network.play.server.SPacketJoinGame;
import com.mumfrey.liteloader.common.GameEngine;
import com.mumfrey.liteloader.core.LiteLoaderMods;
/**
* LiteLoader Extensible API - API Core Provider
*
* Core Providers are objects whose lifecycle is equivalent to the run time of
* game and thus the entire lifecycle of your API, they are instanced early in
* the loader startup process. CoreProviders can implement any Observer
* interface as appropriate and are automatically considered when allocating
* Observers to callback lists.
*
* @author Adam Mummery-Smith
*/
public interface CoreProvider extends TickObserver, WorldObserver, ShutdownObserver, PostRenderObserver
{
public abstract void onInit();
/**
* During the postInit phase, the mods which were discovered during preInit
* phase are initialised and the interfaces are allocated. This callback is
* invoked at the very start of the postInit phase, before mods are
* initialised but after the point at which it is safe to assume it's ok to
* access game classes. This is the first point at which the Minecraft game
* instance should be referenced. Be aware that certain game classes (such
* as the EntityRenderer) are NOT initialised at this point.
*
* @param engine
*/
public abstract void onPostInit(GameEngine<?, ?> engine);
/**
* Once the mods are initialised and the interfaces have been allocated,
* this callback is invoked to allow the CoreProvider to perform any tasks
* which should be performed in the postInit phase but after mods have been
* initialised.
*
* @param mods
*/
public abstract void onPostInitComplete(LiteLoaderMods mods);
/**
* Called once startup is complete and the game loop begins running. This
* callback is invoked immediately prior to the first "tick" event and
* immediately <b>after</b> the the "late init" phase for mods
* (InitCompleteListener).
*/
public abstract void onStartupComplete();
/**
* Called immediately on joining a single or multi-player world when the
* JoinGame packet is received. Only called on the client.
*
* @param netHandler
* @param loginPacket
*/
public abstract void onJoinGame(INetHandler netHandler, SPacketJoinGame loginPacket);
}