Skip to content

Commit

Permalink
add comments and move where initializeAddon is called to a later point (
Browse files Browse the repository at this point in the history
#170)

* add comments and move where IGTAddon#initializeAddon is called to a later point

* Update MaterialPipeBlock.java

---------

Co-authored-by: KilaBash <[email protected]>
  • Loading branch information
screret and Yefancy authored Jul 16, 2023
1 parent f1efd37 commit 4f9d401
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 2 deletions.
1 change: 0 additions & 1 deletion common/src/main/java/com/gregtechceu/gtceu/GTCEu.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ public class GTCEu {

public static void init() {
LOGGER.info("{} is initializing on platform: {}", NAME, Platform.platformName());
AddonFinder.getAddons().forEach(IGTAddon::initializeAddon);
}

public static ResourceLocation id(String path) {
Expand Down
33 changes: 33 additions & 0 deletions common/src/main/java/com/gregtechceu/gtceu/api/addon/IGTAddon.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,40 +7,70 @@

public interface IGTAddon {

/**
* You can freely initialize blocks/items/etc. here, this runs after GTCEu has setup it's content
*/
void initializeAddon();

/**
* Call init on your custom TagPrefix class(es) here
*/
default void registerTagPrefixes() {

}

/**
* Call init on your custom Element class(es) here
*/
default void registerElements() {

}

/**
* Call init on your custom Material class(es) here
*/
default void registerMaterials() {

}

/**
* Call init on your custom Sound class(es) here
*/
default void registerSounds() {

}

/**
* Call init on your custom Cover class(es) here
*/
default void registerCovers() {

}

/**
* Call init on your custom RecipeType class(es) here
*/
default void registerRecipeTypes() {

}

/**
* Call init on your custom Machine class(es) here
*/
default void registerMachines() {

}

/**
* Call init on your custom IWorldGenLayer class(es) here
*/
default void registerWorldgenLayers() {

}

/**
* Call init on your custom VeinGenerator class(es) here
*/
default void registerVeinGenerators() {

}
Expand All @@ -49,6 +79,9 @@ default void initializeRecipes(Consumer<FinishedRecipe> provider) {

}

/**
* Register Material -> Casing block mappings here
*/
default void collectMaterialCasings(MaterialCasingCollectionEvent event) {

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public final NodeDataType getFallbackType() {

@Override
public String getDescriptionId() {
return getName().getString();
return pipeType.getTagPrefix().getUnlocalizedName(material);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package com.gregtechceu.gtceu.common;

import com.gregtechceu.gtceu.GTCEu;
import com.gregtechceu.gtceu.api.addon.AddonFinder;
import com.gregtechceu.gtceu.api.addon.IGTAddon;
import com.gregtechceu.gtceu.api.data.chemical.material.info.MaterialIconSet;
import com.gregtechceu.gtceu.api.data.chemical.material.info.MaterialIconType;
import com.gregtechceu.gtceu.api.data.tag.TagPrefix;
Expand Down Expand Up @@ -50,6 +52,7 @@ public static void init() {
GTFoods.init();
GTItems.init();
GregTechDatagen.init();
AddonFinder.getAddons().forEach(IGTAddon::initializeAddon);

// fabric exclusive, squeeze this in here to register before stuff is used
GTRegistries.REGISTRATE.registerRegistrate();
Expand Down

0 comments on commit 4f9d401

Please sign in to comment.