forked from DrFair/ExampleMod
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExampleMod.java
More file actions
73 lines (55 loc) · 2.72 KB
/
ExampleMod.java
File metadata and controls
73 lines (55 loc) · 2.72 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
package examplemod;
import examplemod.Loaders.*;
import examplemod.examples.maps.biomes.ExampleBiome;
import necesse.engine.modLoader.annotations.ModEntry;
import necesse.engine.sound.SoundSettings;
import necesse.engine.sound.gameSound.GameSound;
@ModEntry
public class ExampleMod {
// Global access point for mod settings
public static ExampleModSettings settings;
// We define our static registered objects here, so they can be referenced elsewhere
public static ExampleBiome EXAMPLE_BIOME;
public static GameSound EXAMPLESOUND;
public static SoundSettings EXAMPLESOUNDSETTINGS;
// Load settings for the example mod from the external file defined in ExampleModSettings
public ExampleModSettings initSettings() {
settings = new ExampleModSettings();
return settings;
}
public void init() {
System.out.println("Hello world from my example mod!");
settings.logLoadedSettings(); // log the loaded settings for debug
// Register Tech Trees
ExampleModTech.load();
// Register categories first: Used by Items/Objects to appear correctly in Creative/crafting trees
ExampleModCategories.load();
// Register packets early: Anything networked (mobs, settlers, job UIs, events) can safely reference packet IDs
ExampleModPackets.load();
// Core content building blocks first: Tiles/Objects/Items are referenced by biomes, incursions, mobs, projectiles, buffs, etc.
ExampleModTiles.load();
ExampleModObjects.load();
ExampleModItems.load();
// Combat + entity registries next: Projectiles and buffs often reference items/mobs, and mobs can reference buffs/projectiles.
ExampleModProjectiles.load();
ExampleModBuffs.load();
ExampleModMobs.load();
// Settlement systems after mobs/items exist: Settlers are mobs; jobs can reference settlers, items, and packets/UI.
ExampleModSettlers.load();
ExampleModJobs.load();
// World generation last-ish: Biomes/incursions can safely reference all registered tiles/objects/mobs/items now.
ExampleModBiomes.load();
ExampleModIncursions.load();
// Events after everything is registered: Lets event listeners safely reference IDs and content without ordering surprises.
ExampleModEvents.load();
// Journal last: JournalEntry.addMobEntries() resolves MobRegistry immediately at registration time.
ExampleModJournal.load();
}
public void initResources() {
ExampleModResources.load();
}
public void postInit() {
// load our recipes from the ExampleRecipes class so we can keep this class easy to read
ExampleModRecipes.registerRecipes();
}
}