Croparia-IF

Croparia-IF

Mod

Adding crops that can grow many kinds of materials, plus tons of customizable features.

Client and server Game MechanicsTechnologyUtility

38.7k downloads
8 followers
Follow Save
Filter loader...
Filter versions...
Filter channels...

Fix tons of bugs found during static code view by Codex (LMAO)

fix incompatibility with Tom's Simple Storage

NOTE⚠️: Breaking changes are present. You may need to clear your config files & data generators to avoid issues.

Gameplay:

  • Unify translations for elemental things.
  • Fix compatibility issues with Tom's Simple Storage.
  • Fix REI issue on server side.
  • Fix crash on duplicate crops.
  • Fix crop command not working.

Technical:

  • (Extracted) Placeholder API
    • Extracted from Generator API, allow placeholders to be defined conveniently.
    • Originally, placeholder can only be defined each time with non-structured string. Now it is redesigned with OOP style.
      • For example, previously you need to define a placeholder or an ID like this:
        static Placeholder<ResourceLocation> ID = Placeholder.of("\\{my_id}", id -> id.toString());
        static Placeholder<ResourceLocation> ID_NAMESPACE = Placeholder.of("\\{my_id_namespace}", id -> id.toString());
        static Placeholder<ResourceLocation> ID_PATH = Placeholder.of("\\{my_id_path}", id -> id.toString());
        
        static void foo() {
            ResourceLocation myId = new ResourceLocation("example", "my_entry");
            String id = ID.replace("{my_id}", myId);
            String namespace = ID.replace("{my_id_namespace}", myId);
            String path = ID.replace("{my_id_path}", myId);
        }
        
        Now you can define it like this:
        static Placeholder<MyEntry> PLACEHOLDER = Placeholder.build(node -> node.then(
            Pattern.compile("id"), TypeMapper.of(entry -> entry.getId()), Placeholder.ID
        ));
        
        static void foo() {
            MyEntry entry = new MyEntry(ResourceLocation.parse("example:my_entry"));
            String id = PLACEHOLDER.replace("{id}", entry);
            String namespace = PLACEHOLDER.replace("{id.namespace}", entry);
            String path = PLACEHOLDER.replace("{id.path}", entry);
        }
        
    • The old placeholders are removed, you can use the new place.holder style instead.
  • (Update) Generator API
    • Updated to use the new Placeholder API.
    • AggregatedGenerator now supports accumulative mode, just like the LangGenerator.
  • (Update) Element API
    • Element is back to enum.
  • (Update) Codec API
    • Fix MultiFieldCodec encoding.
    • TestedFieldCodec is removed, MutilFieldCodec now calls TestedCodec directly.
  • Support json & toml for data generator, toml is now suggested
  • Material count (default to 2) is now specified in crop definitions instead of data generators
  • fix datapack reload trigger not working
  • fix Repo API

BREAKING CHANGES IS INCLUDED

Gameplay:

  • Add elemental soaking, which allows players to transform a block near an elemental stone into another.
  • Ritual recipe can upgrade enchantments of items.
  • Add sound effects for recipes.
  • Some directories are renamed/moved, you may need to reset config to make it work.
  • Modify some of the recipes.
  • Elemental liquid buckets are renamed from "xxx_bucket" to "bucket_xxx", may result in item-missing.
  • Elemental items are renamed from "elemental_xxx" to "gem_xxx", may result in item-missing.

Dev:

  • (Modify) Generator API
    • PackHandler is less bound to this mod and can be instantiated & registered anywhere. See example.
    • Almost everything is generated via Generator API now. Including crops and elements' recipes, tags, lang, item & block models, etc.
    • Generator files are now more generically formatted and can be compiled into JSON with DgCompiler. A generator file should be ended with .cdg (abbreviated from "croparia data generator").
    • The registry to be iterated is now specifiable via @registry={id}. See example and available built-in registries.
    • If you want to add your own built-in generators in your mod, place your .cdg files under src/main/resources/data-generators/{namespace}/{path}/ so that Croparia will try move them under {packhandler_root}/generators (Non-override). Namespace and path are derived from the id of a PackHandler.
    • 3 generator types are provided: croparia:default(default), croparia:composite and croparia:lang, can be specified via @type={type}.
  • (Modify) Element API
    • Automatically register bucket, fluid, potion and liquid block when instantiating an element. See usage.
    • Supports Generator API.
  • (Modify) Crop API
    • File format is renewed.
    • Crop type is only used to specify the texture of crops, and is not limited to a set of values.
    • Supports Generator API.
  • (Modify) Recipe API
    • Now use custom recipe entries that support SlotDisplay to provide better consistency of recipe format.
    • TypedSerializer and DisplayableRecipe allow developers to handle registries in a more generic way. See example.
  • (Modify) Recipe Wizard
    • Support custom recipe wizard templates located at {pack_path}/recipe_wizard/, using the format of .cdg.
    • Match specific template via block pointed with @block={block_input}.
  • (New) Json API
    • Used to conveniently build JSON via Java. See example.
  • (New) Codec API
    • Allows extending codecs
    • Allows multiple codecs for 1 field name, or multiple field names for 1 codec.

TODO:

  • Complete recipe wizard templates.
  • fix recipe error in dedicated server