Skip to content

Commit e7b07b5

Browse files
authored
Fix EventHandlers (#6)
1 parent eeaade7 commit e7b07b5

File tree

4 files changed

+124
-1
lines changed

4 files changed

+124
-1
lines changed

dependencies.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ dependencies {
4848
// Hard Dependencies
4949
devOnlyNonPublishable(rfg.deobf("curse.maven:gregtech-ce-unofficial-557242:5519022")) // CEu 2.8.10
5050
//devOnlyNonPublishable(rfg.deobf(project.files("libs/gregtech-1.12.2-2.8.9-beta-dev.jar"))) // CEu pr 2.8.10
51-
devOnlyNonPublishable(rfg.deobf("curse.maven:shadowfacts-forgelin-248453:2785465")) // Forgelin 1.8.4
51+
devOnlyNonPublishable(rfg.deobf("curse.maven:forgelin-continuous-456403:6142081")) // Forgelin-Continuous 2.1.10.0
5252

5353
// Debug Thaumcraft
5454
if (project.debug_all.toBoolean() || project.debug_thaumcraft.toBoolean()) {
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package com.github.gtexpert.gtbm.api.unification.material;
2+
3+
import static gregtech.api.unification.material.info.MaterialFlags.*;
4+
5+
import gregtech.api.unification.material.Materials;
6+
7+
import com.github.gtexpert.gtbm.api.util.Mods;
8+
9+
public class GTBMMaterialFlags {
10+
11+
public static void init() {
12+
if (Mods.Forestry.isModLoaded()) {
13+
// Copper
14+
Materials.Copper.addFlags(GENERATE_GEAR);
15+
16+
// Tin
17+
Materials.Tin.addFlags(GENERATE_GEAR);
18+
19+
// Iron
20+
Materials.Iron.addFlags(GENERATE_FINE_WIRE, GENERATE_FOIL);
21+
22+
// Bronze
23+
Materials.Bronze.addFlags(GENERATE_FINE_WIRE);
24+
25+
// Rose Gold
26+
Materials.RoseGold.addFlags(GENERATE_FOIL);
27+
}
28+
}
29+
}
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
package com.github.gtexpert.gtbm.api.unification.material;
2+
3+
/**
4+
* Material Registration.
5+
* <p>
6+
* All Material Builders should follow this general formatting:
7+
* <p>
8+
* material = new MaterialBuilder(id, name)
9+
* .ingot().fluid().ore() <--- types
10+
* .color().iconSet() <--- appearance
11+
* .flags() <--- special generation
12+
* .element() / .components() <--- composition
13+
* .toolStats() <---
14+
* .oreByProducts() | additional properties
15+
* ... <---
16+
* .blastTemp() <--- blast temperature
17+
* .build();
18+
* <p>
19+
* Use defaults to your advantage! Some defaults:
20+
* - iconSet: DULL
21+
* - color: 0xFFFFFF
22+
*/
23+
public class GTBMMaterials {
24+
/*
25+
* FOR ADDON DEVELOPERS:
26+
*
27+
* GTCEu will not take more than 3000 IDs. Anything past ID 2999
28+
* is considered FAIR GAME, take whatever you like.
29+
*
30+
* If you would like to reserve IDs, feel free to reach out to the
31+
* development team and claim a range of IDs! We will mark any
32+
* claimed ranges below this comment. Max value is 32767.
33+
*
34+
* - Gregicality: 3000-19999
35+
* - Gregification: 20000-20999
36+
* - HtmlTech: 21000-21499
37+
* - GregTech Food Option: 21500-22499
38+
* - FREE RANGE 22500-23599
39+
* - MechTech: 23600-23999
40+
* - FREE RANGE 24000-31999
41+
* - Reserved for CraftTweaker: 32000-32767
42+
*/
43+
44+
// Element Materials
45+
46+
// First Degree Materials
47+
48+
// Second Degree Materials
49+
50+
// Third Degree Materials
51+
52+
// Organic Chemistry Materials
53+
54+
// Unknown Composition Materials
55+
56+
public static void registerMaterialsHigh() {
57+
GTBMMaterialFlags.init();
58+
}
59+
60+
public static void registerMaterialsLow() {}
61+
62+
public static void registerMaterialsLowest() {}
63+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package com.github.gtexpert.gtbm.common;
2+
3+
import net.minecraftforge.fml.common.Mod;
4+
import net.minecraftforge.fml.common.eventhandler.EventPriority;
5+
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
6+
7+
import gregtech.api.unification.material.event.MaterialEvent;
8+
9+
import com.github.gtexpert.gtbm.api.ModValues;
10+
import com.github.gtexpert.gtbm.api.unification.material.GTBMMaterials;
11+
12+
@Mod.EventBusSubscriber(modid = ModValues.MODID)
13+
public class GTBMEventHandlers {
14+
15+
public GTBMEventHandlers() {}
16+
17+
@SubscribeEvent(priority = EventPriority.HIGH)
18+
public static void registerMaterialsHigh(MaterialEvent event) {
19+
GTBMMaterials.registerMaterialsHigh();
20+
}
21+
22+
@SubscribeEvent(priority = EventPriority.LOW)
23+
public static void registerMaterialsLow(MaterialEvent event) {
24+
GTBMMaterials.registerMaterialsLow();
25+
}
26+
27+
@SubscribeEvent(priority = EventPriority.LOWEST)
28+
public static void registerMaterialsLowest(MaterialEvent event) {
29+
GTBMMaterials.registerMaterialsLowest();
30+
}
31+
}

0 commit comments

Comments
 (0)