Skip to content

Integrating Arch Ex into your mod

woodiertexas edited this page Oct 19, 2023 · 41 revisions

Under Construction

If you are running into problems with integrating Arch-Ex into your mod, join the Debuggy discord for help.

With JSON

If you rather use JSON to integrate with Architecture Extensions, refer to the documentation below:

For this to work, your json file(s) must be in either src/main/resources/staticdata/architecture_extensions/example.json or minecraft/staticdata/architecture_extensions/example.json

{
  "only_if_present": "yeef_pineapple",
  "name": "yeefpineapple_block",
  "base_block": "yeef_pineapple:yeef_block",
  "textures": "yeef_pineapple:block/yeef_block",
  "recipes": "sawing",
  "map_color": "fire",
  "types_to_generate": [
    "arch", "beam"
  ]
}

only_if_present: Arch-Ex only generates the blocks specified in this file if this mod is present. Can be omitted or set to null to load the JSON regardless if the specified mod is present or not.

name: This field is optional but it can be used to override a block's name.

base_block: The block(s) to use from your mod to generate Arch-Ex blocks with.

textures: The textures to use.

  • If your block is a log, use wood_with_log; wood_with_stem functions fairly similarly in the case of warped crimson.
  • If your block has top, side and bottom textures; use top_bottom.
  • If your block has top and side textures; use top.
  • If your block only uses one texture for all sides; do "all".
  • If need be, you can fall back to using "yeef_pineapple:block/yeef_block".

recipes: The type of recipe to generate.

  • stonecutting makes a stonecutter recipe Note: Also generates a crafting recipe.
  • sawing makes a tablesaw recipe
  • crafting makes a crafting table recipe only for specific block types. Note: Can generate one or more crafting recipes.

map_color: What color will this block be on a map. Refer to here for the full list of map colors.

types_to_generate: Arch-Ex will generate the blocktypes specified here. Refer to the block list for available types. Note: Metablocktypes are supported too! (Full list: "#wood", "#stone", "#aquatic_stone", "#processed_stone", "#brick", "#tile", "#crystal", "#terracotta", "#concrete", "#metal")

With Gradle

Architecture Extensions uses the Modrinth Maven, so if you are not sure on how to use the maven, read here.

In build.gradle add:

dependencies {
    // Your other dependencies for your project

    modImplementation "maven.modrinth:arch-ex:<versionID>"
}

Note: You can get version IDs here.

In quilt.mod.json, add

"entrypoints": {
    "init": "com.example.<modID>.ExampleMod",
    "architecture_extensions": "com.example.<modID>.ExampleModIntegration"
}

In src/main/java/com/example/<modID>/, add a java file named ExampleModIntegration and populate it with the following:

public final class ExampleModIntegration implements ArchExIntegration {
    @Override
    public void integrate(Context ctx) {
      BlockGroup stone = BlockGroup.of(
        new BlockGroup.groupedBlock(...)
      );
      //ctx.makeArchExBlocks(BlockType type, BlockGroup... groups);
      ctx.makeArchExBlocks(BlockType.ARCH, stone);
    }

    @Override
    public void onBlockCreated(BlockGroup group, BlockType blockType, Block baseBlock, Block block) {
        ItemGroupUtil.pull(ArchitectureExtensions.ITEM_GROUP, blockType, baseBlock, block.asItem());
    }
}

If your mod has a lot of blockgroups, you can do the following: ExampleModBlockGroups

public final class ExampleModBlockGroups {
    public static final BlockGroup STONE = BlockGroup.of(
        new BlockGroup.GroupedBlock("stone", Blocks.STONE, (type, textureId) -> "examplemod:block/malachite", RecipeConfigurator.STONECUTTER, MapColor.LIME_GREEN)
    )
}

Block List

A list of every Arch-Ex blocktype.

Stone/Processed Stone

arch
curve
octagonal_column
round_arch
roof
wall_column
wall_post

Wood

beam
crown_molding
fence_post
joist
lattice
round_fence_post
transom
post_cap
post_lantern

Metal

h_beam
i_beam
tube_metal

Anything

facade

This one very specific blocktype

rod; its just for the copper, bamboo and continuous end rods

Lang file stuff

If you're looking to translate arch-ex: Go here.

To give your mod's arch-ex blocks a proper name, you should put "architecture_extensions.grouped_block.<your_mod_block": "Your Mod Block" in your mod's lang file.