VoltzEngine-Project / Engine

Minecraft modding core lib
Other
13 stars 11 forks source link

Implement property system #66

Closed DarkGuardsman closed 7 years ago

DarkGuardsman commented 7 years ago

To improve the functionality of modifying common data we should switch over to using JSON files. These files will store information such as block name, localization key, hardness, resistance, and recipes. This way we do not need to worry about code implementation when handling each part. Instead, VE will read in the files and inject the data where it is needed. Additionally, this files can be used to register the block and item block without specifically the exacts for each.

To go with this VE should scan an external folder that will allow for overrides. This way a user can change the values of the internal data per modpack. With limits on what can and can't be overridden.

Example file:

{
    "block": 
    {
        "name":"block",
        "class":"BlockMeta",
        "Item":"ItemBlockMeta",
        "hardness":5,
        "resistance":5,
        "localization":"tile.#mod#.block",
        "recipes":
        {
            "1":
            {
                "type":"shaped",
                "output":
                {
                    "item":"this",
                    "meta":0,
                    "nbt":"none"
                },
                "recipe":"abc-abc-abc",
                "components":
                {
                    "a":"apple",
                    "b":"bow:0",
                    "c": {
                        "item":"stone",
                        "meta":2
                    }

                }
            },
            "2":
            {
                "type":"shaped",
                "output":
                {
                    "item":"this",
                    "meta":1,
                    "nbt":"none"
                },
                "recipe":"abc-abc-abc",
                "components":
                {
                    "a":"apple",
                    "b":"bow:0",
                    "c": {
                        "item":"stone",
                        "meta":3
                    }

                }
            }
        }
    }
}
DarkGuardsman commented 7 years ago

Has been implemented as BlockBase.java in VoltzEngine and supports loading most properties through JSON.