CraftCoreLIB

CraftCoreLIB

Cross-Platform library providing registgries and utils for mod developers.

16 downloads 0 followers

CraftCoreLIB

CraftCoreLib is a cross-plaftorm library built for developers for simplify registries on multiloader and many more features!

Registries

This lib provides core code for simple registries like blocks, items, creativetabs to recipetypes, recipe serializers menu and more coming!!

Usage Example

public class ModBlocks {

  // Simple Block registration
  public static final ObjectRegistries<Block> MY_BLOCK = ObjectRegistries.registerBlock(
  ResourceLocation.fromNamespaceAndPath("yourmoid", "my_block"),
    ()-> new Block(BlockBehaviour.Properties.of()));

    // It must stay empty, call it on related Init class(for fabric the one implementing ModInitializer for neoforge the class with the @Mod annotation)
    public static void init() {}

}

And initialize all our registris on our setup:

  • Fabric -> ModInitializer class
  • NeoForge -> @Mod annotation class
// Placeholder
public void init() {
  ModBlocks.init();

}

then if Neoforge do this:

private void onRegister(RegisterEvent event) {
  ObjectRegistries.createAll("yourmoid", event.getRegistry());
}

if Fabric inside ModInitializer, after all your init add this:

 ObjectRegistries.createAll("yourmoid");

Configs

CraftCoreLIB also provides a dedicated config system with a custom config screen compatible with other mods!!

Usage Example

public class ModConfig {

    //You can choose 3 different config types: CLIENT, SERVER,COMMON
    public static final ConfigCategory MY_COOL_CATEGORY = ConfigCategory.create("my_cool_category", ConfigType.CLIENT)
            .title("my_cool_category");


    public static final ConfigValue<Boolean> MY_CONDITION = MY_COOL_CATEGORY
            .define("my_condition", false)
            //Translatable Name -> define the name inside your localisation default en_su.json
            .name("config.mymodid.mycondition")
            //Translatable Description -> define the description inside your localisation default en_su.json
            .comment("config.mymodid.mycondition.dec");

    // Accept countless categories
    public static void init() {
        ConfigManager.register("mymodid", MY_COOL_CATEGORY);
    }
}

Config Screen

It features a dedicated Config Screen easy to access. It also fetch for all the available mod with config, IT'S NOT A MODLIST MENU, IT ONLY SHOWS MOD WITH CONFIGS!!

ConfigScreen

Network Builder

It features:

  • Custom Packet creation and handling
  • Network Creation
  • Network Registration

Chek more on GitHub

Report issues on Discord GitHub Issues

My Other Projects

discord link image curseforge page link modrinth page link
Version Minecraft Loader Download

CraftCoreLIB 1.0

1.0

1.21.1
fabric
Download

CraftCoreLIB 1.0

1.0

1.21.1
neoforge
Download