aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/api/objects/minecraft/ItemPackage.java
blob: fa85f23cf3859ea49f678e654852cd0834758c77 (plain)
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
package gtPlusPlus.api.objects.minecraft;

import cpw.mods.fml.common.event.FMLLoadCompleteEvent;
import gtPlusPlus.api.interfaces.RunnableWithInfo;
import gtPlusPlus.core.handler.COMPAT_HANDLER;

public abstract class ItemPackage implements RunnableWithInfo<String> {

	public ItemPackage() {
		this(false);
	}
	
	public ItemPackage(boolean hasExtraLateRun) {
		// Register for late run
		COMPAT_HANDLER.mObjectsToRunInPostInit.put(this);	
		if (hasExtraLateRun) {
			COMPAT_HANDLER.mObjectsToRunInOnLoadComplete.put(this);
		}		
		init();
	}	
	
	@Override
	public final void run() {
		generateRecipes();
	}

	@Override
	public final String getInfoData() {
		return errorMessage();
	}

	public abstract String errorMessage();
	
	public abstract boolean generateRecipes();
	
	private final void init() {
		items();
		blocks();
		fluids();
	}
	
	public abstract void items();
	
	public abstract void blocks();
	
	public abstract void fluids();
	
	/**
	 * Override this to handle GT Recipe map manipulation after they're Baked.
	 * @param event - the {@link FMLLoadCompleteEvent}.
	 * @return - Did we do anything?
	 */
	public boolean onLoadComplete(FMLLoadCompleteEvent event) {
		return false;
	};
	
	
}