Regolith is an Addon Compiler for the Bedrock Edition of Minecraft.

Overview

regolith

Regolith is an Addon Compiler for the Bedrock Edition of Minecraft.

Much like bridge v2, Regolith introduces the concept of a "project folder", where your addons are written, including the RP, the BP, and any models, textures or configuration files. This single-folder-structure is great for version control, and allows you to keep your "source-of-truth" outside of com.mojang.

In the simplest case, Regolith allows you to "compile" (copy) your RP and BP from the project folder, into the com.mojang folder. During the copy, Regolith will run a series of "filters" on the files, allowing you to programmatically transform them as they are copied into com.mojang. This allows you to transform your addon non-destructively, and to introduce new syntax into addons.

Value Preposition

Fundamentally, Regolith is nothing new. Many tools like this exist, such as the bridge v2 plugin system, or even something like Gulp or SASS.

The value preposition for Regolith is that it allows many tools, in many languages and pay-structures to work together in a single, unified compilation flow.

Hobbiests can use the Standard Library, or write their own filters. Marketplace teams can write proprietary filters, or internal filters.

Compilation Flow

The compilation flow in Regolith is like this:

  • Copy RP and BP into a temp folder.
  • Run each filter in order, allowing it to destructively edit temp
  • Copy RP and BP from temp into com.mojang, or another export target

Filters

A filter is any process that edits/adds/deletes files inside of the temp folder. Each filter is allowed to change this folder, before passing the results along to the next filter. That allows filters to build on each other.

Examples of potential filters:

  • A filter that removes all comments from json, allowing the next filter(s) to read json without needing to handle comments
  • A filter which automatically generates texture_list.json
  • A filter which takes a .psd file, and automatically exports the png, allowing you to work directly in photoshop, without needing to export the files each time you edit it.
  • A filter which generates 1.10 format items, based on item-textures in a specific folder.
  • A filter which automatically inserts your team-branding maps or entities.

Local Filters

Local filters are files that you write yourself, and place into the regolith project. These can be written in Java, Python, or Node JS. You can run register these files as a filter, and they will be run during compilation.

Online Filters

You can also reference filters from github, by simply adding the github link as a filter. The relevant files will be downloaded into the regolith cache, and then run.

Standard Library

The Regolith Standard Library is a git repository which contains "official" filters. This is the safest way to use Regolith, and the least technical.

Source for all standard library filters can be found here

Running

Install Golang

Installation and beginners guide.

Install Dependencies

go get -u ./... to recursively install all dependencies.

Run

Run with go run .\main.go

Building as an .exe

You can build either with GoReleaser, or natively

Install GoReleaser

go install github.com/goreleaser/[email protected]

Build

./scripts/build-local.sh

Or

go build

Comments
  • [Design decision] Handling virtual environments for Python

    [Design decision] Handling virtual environments for Python

    This issue will be used as a thread to discuss the possible changes to venvPath setting.

    Current implementation

    Regolith config.json file has currently 4 depth levels.

    1. Root - defined by the Bedrock-OSS/project-config-standard
    2. "regolith" - the root of the regolith configuration
    3. "profiles" - a list of profiles. A profile is a single task that you can trigger with regolith run command
    4. "filters" - a filter is a single action within the profile (it can be a python, js or shell script)

    Currently the venvPath is a property of a profile. Adding that configuration to the file will cause creation of a single python environment for all filters in the profile. Skipping that property will (the default behavior) creates separate venv for every filter in .regolith/cache/<filter path>/venv.

    venvPath can be either relative or absolute path. If user choose to put relative path in there it will create the virtual environment in a path relative to .regolith/venvs/.

    Problems

    1. Where in the config.json should we put the venvPath property

    1.1. It should be the property for entire project (inside "regolith") 1.2 It should be the property of a profile (regolith -> profiles -> [profile name]). This is the current solution. 1.3 It should be the proprety of a filter (regolith -> profiles -> -> filters -> [filter name]).

    2. If the path is relative, what should be the root

    2.1. .regolith/venvs/<user path> - This is the current solution 2.2. .regolith/cache/<user path> - The problem of this solution is that we already use .regolith/cache/<filter name> for caching filters. If someone choose to name the venv the same as the filter it could create some collisions. 2.3 .regolith/cache/venvs/<user path> - with this solution i suggest moving the filter cache from .regolith/cache/<filter name> to .regolith/cache/filters/<filter name>.

    3. What should be the default behavior

    3.1. Separate venv for every filter - This is the current solution 3.2. Separate venv for every profile 3.3. Everything should use single venv

    4. Should we allow absolute paths

    4.1. Yes 4.2. No

    opened by Nusiq 7
  • Regolith cannot be used without git

    Regolith cannot be used without git

    What do we want to do here?

    Could not install dependency github.com/Bedrock-OSS/regolith-filters//texture_list: error downloading 'https://github.com/Bedrock-OSS/regolith-filters.git': git must be available and on the PATH
    
    bug 
    opened by SirLich 6
  • `RP` and `BP` folders aren't auto-saved in git repo, causing warning after cloning

    `RP` and `BP` folders aren't auto-saved in git repo, causing warning after cloning

    1. regolith init in a repo
    2. Create a resource pack (but not a behavior pack)
    3. regolith run should work
    4. Commit and push changes
    5. Clone the repo
    6. regolith install-all
    7. regolith run

    Expected: No warnings

    Actual: [WARN] resource folder "./packs/BP" does not exist

    Notes: If regolith init added a .gitkeep file to RP and BP we wouldn't have this problem as they'd be copied over in the clone :)

    opened by mark-wiemer 4
  • Fix problems with the documentation

    Fix problems with the documentation

    • [x] Fix the "Suggest changes to this page." links
    • [x] Fix the Search bar
    • [x] Mention winget in the documentatino
    • [x] Mention regolith-update.ps1 script in the documentation
    opened by Nusiq 3
  • Add user configuration

    Add user configuration

    First commit added basic user_config reader:

    • project.app_data_storage - replaces the useAppData property form the config.json file
    • user.name - replaces the name property in config file created by 'regolith init'
    • resolvers - is a list of URLs to 'resolver.json' files. This property is only partially implemented. Currently it only uses the first item from the list or the default value if the 'config.toml' doesn't specify any.
    opened by Nusiq 3
  • Add `regolith exec <filter-name> [arguments...]` command

    Add `regolith exec [arguments...]` command

    This idea is a result of a discussion about #191 and #190 on discord.

    The exec command will be able to run filters on the source files of the project. The filters that are intended for this purpose will need to specify that in their filter.json file using new property - canModifySource (the name of the property is yet to be decided).

    The user will be able to force non-exec filters to be used that way by using the --force flag.

    feature 
    opened by Nusiq 3
  • Change module name to `github.com/Bedrock-OSS/regolith`

    Change module name to `github.com/Bedrock-OSS/regolith`

    Hello everyone,

    I've recently tried to install regolith using go install github.com/Bedrock-OSS/regolith, which didn't work as the module name was bedrock-oss.github.com/regolith. The old module name is sadly not importable from anywhere outside the project, including from go install as Go is looking for the source code using that URL.

    This PR replaces the module name with the right one for the project: github.com/Bedrock-OSS/regolith

    Hope this helps and looking forward to further contributing on this project, Kevin

    opened by Unkn0wnCat 3
  • Recycled copy problems

    Recycled copy problems

    These problems are most likely closely related to each other so I put 3 in one issue:

    Discord discussion starts with this message: https://discord.com/channels/494194063730278411/896876881410936853/984897287425781811

    (1) Generating files from custom filter fails

    image

    • [x] reproduce
    • [x] fix

    (2) Permissions problems

    image image image image

    • [ ] reproduce
    • [ ] fix

    (3) Infinite filter data nesting

    image image

    • [x] reproduce
    • won't fix. This is an issue of a filter.
    opened by Nusiq 3
  • Add safeguard for data files

    Add safeguard for data files

    While having windows explorer open with packs/data/gametests folder, I ran regolith, which failed with error:

    [INFO]  Moving files to target directory.
    [ERROR] Failed to run profile "dev"
    [+]: Exporting project failed.
    [+]: Failed to clear filter data path "./packs/data".
    [+]: remove ./packs/data\gametests: The process cannot access the file because it is being used by another process.
    

    This caused packs/data folder to become empty (except for empty gametests folder), while the data files were still in .regolith/tmp/data.

    Thinking, that the issue will fix itself, I ran it again and regolith removed .regolith/tmp and copied empty data folder there, which resulted in loosing data folder completely (fortunately I still had the changes on git).

    Since any error regarding clearing filter data or moving filter data back to the packs folder results in potential data loss, I suggest adding some kind of safeguard to it as well as clear message to the user.

    Suggestion

    After error, that might result in potential data loss, we should display a clear message to the user like

    The data folder might potentially be corrupted, please copy them from .regolith/tmp/data to packs/data manually.
    

    Additionally we could save a json file inside .regolith folder with information about it and in case a user wouldn't notice this message, we would block any further executions of regolith with message

    The data folder might potentially be corrupted, please copy them from .regolith/tmp/data to packs/data manually. 
    If you already did it, run regolith again with --force flag
    

    The --force flag would remove that json file or modify it to clear the information and run regolith normally.

    opened by stirante 3
  • `regolith install` creates empty folders with remote filters names

    `regolith install` creates empty folders with remote filters names

    After running regolith install with these filters, folders are created called templater & functioner

    
            "filters": [
              {
                "url": "github.com/Hatchibombotar/useful-regolith-filters//templater"
              },
              {
                "url": "github.com/Hatchibombotar/useful-regolith-filters//functioner"
              }
            ]
    

    image

    bug 
    opened by Hatchibombotar 3
  • Global settings

    Global settings

    Right now, we have some things set per-filter. This could get annoying, since I guess usually these settings will be the same. Example: dataPath.

    The solution is to allow profile-specific data to be set in the top level. The properties inside individual profiles therefore only overrides these values.

    This is a really nice flow I used in Echo:NPC.

    feature needs discussion 
    opened by SirLich 3
  • Remote filters won't copy data unless data folder exists before running

    Remote filters won't copy data unless data folder exists before running

    After setting up the exportData key on a remote filter.json the data will never export unless a per-existing data folder is included before runtime. filter data created during tmp runtime without per-existing filter data folder won't get exported.

    opened by evilguy50 1
  • Add config for `regolith config <language>_command`

    Add config for `regolith config _command`

    Add config that let user specify where to look for the executable for a filter type.

    • python.command - Python (default python)
    • python.install_command - Python (default pip)
    • deno.command - Deno (default deno)
    • dotnet.command - .NET (default dotnet)
    • java.command - Java (default java)
    • nim.command - Nim (default nim)
    • nim.install_command - Nim (default nimble)
    • node.command - Node JS (default node)
    • node.install_command - Node JS (default npm)
    feature needs discussion 
    opened by Nusiq 0
  • FILTER_DIR environment variable is the same as ROOT_DIR

    FILTER_DIR environment variable is the same as ROOT_DIR

    Both of the variables are the same. FILTER_DIR should be an absolute path to the cache directory, where currently ran filter is. Try:

    process.env["ROOT_DIR"] == process.env["FILTER_DIR"] //true
    
    opened by Hatchibombotar 1
  • Update script should download installer to a temporary file

    Update script should download installer to a temporary file

    Currently you need to either run terminal as admin or run it somewhere, where it can create files. Otherwise it will fail.

    Solution would be to save to a temporary file.

    opened by stirante 0
  • Add regolith to popular package managers

    Add regolith to popular package managers

    In order of priority:

    1. winget OS: Windows Requires a custom publisher app for GoReleaser, which should just make a PR to https://github.com/microsoft/winget-pkgs https://docs.microsoft.com/en-us/windows/package-manager/package/repository Example PR: https://github.com/microsoft/winget-pkgs/pull/4738

    2. apt OS: Linux https://askubuntu.com/questions/16446/how-to-get-my-software-into-ubuntu The easiest way would be to push to launchpad PPA https://help.launchpad.net/Packaging/PPA Requires a custom publisher app for GoReleaser, which should push the binaries with a secret key to PPA

    3. scoop (optional) OS: Windows Seems like require an initial PR like this one https://github.com/ScoopInstaller/Main/pull/558 After that either you get some access to modify your file or they update it themselves (no clue) https://github.com/ScoopInstaller/Main/blob/master/bucket/lazydocker.json GoReleaser already has support for scoop https://goreleaser.com/customization/scoop/

    4. chocolatey (optional) OS: Windows Requires to just run a command from GoReleaser to publish the package with secret key https://docs.chocolatey.org/en-us/create/create-packages-quick-start

    5. homebrew (optional) OS: MacOS GoReleaser already has support for homebrew https://goreleaser.com/customization/homebrew/

    opened by stirante 0
  • Add `regolith run [profile] --selcted-filters <pattern>` (we need better name for the flag)

    Add `regolith run [profile] --selcted-filters ` (we need better name for the flag)

    The --selected-filters flag would let you provide a pattern used for selecting which filters should be executed from the profile.

    Examples:

    • 1 - first filter
    • ..3 - first 3 filters
    • 2..4 - filters 2,3,4
    • 2,4,1 - filters 2,4,1 (in that order (?))
    feature 
    opened by Nusiq 2
Releases(1.0.3)
Owner
Bedrock OSS
Bedrock OSS exists as a centralized platform for creating Bedrock Minecraft Educational Content and Tools.
Bedrock OSS
mcstatusgo is a pure Go Minecraft service status checker for Java edition Minecraft servers

mcstatusgo is a pure Go Minecraft service status checker for Java edition Minecraft servers. mcstatusgo supports requesting information through the status and query protocols.

Milad Noorzaie 2 Aug 12, 2022
Go Minecraft Client

Steven Not actively maintained anymore A work in progress Minecraft client in Go. Don't expect it to go anywhere, just doing this for fun. Images Buil

Matthew Collins 290 Dec 23, 2022
⛏ 🐹 Minecraft Protocol implementation in Go

illustration by @talentlessguy Install Go 1.16.x is required to use this library go get github.com/BRA1L0R/go-mcproto Opening a connection client := m

Pietro Tamilia 31 Sep 20, 2022
Minecraft server made in go, faster and better!

ElytraGo Minecraft server made in go, faster and better! Project is in early stage, but I'm trying continuously update it with new lines of code :)) L

Michał Kowal 34 Dec 9, 2022
Quick and dirty Minecraft player head to SVG converter

Head SVG Quick and dirty Minecraft player head to SVG converter. Can be used to generate player head icons. Usage usage: Head SVG [-h|--help] -n|--nam

PotatoMaster101 1 May 29, 2022
Minecraft server implementation using Golang

Deepslate Deepslate is a Minecraft server implementation in Go. Deepslate if WIP and currently not available for installation Goals First implementati

virusbear 1 Nov 19, 2021
Multicluster mesh addon: An enhanced addon created with addon-framework

Multicluster Mesh Addon multicluster-mesh-addon is an enhanced addon created wit

Morven Cao 0 Feb 11, 2022
Minecraft Bedrock Edition server software written in Go

Dragonfly Dragonfly is a heavily asynchronous server software for Minecraft Bedrock Edition written in Go.

Dragonfly 462 Jan 3, 2023
A structure generating tool for Minecraft Bedrock Edition that supporting various platforms

FastBuilder Phoenix Description FastBuilder is a structure generating tool for Minecraft Bedrock Edition that supporting various platforms. The Phoeni

null 1 Dec 10, 2021
A utility for modifying chunks in Minecraft: Bedrock Edition LevelDB

MC-BE-Chunk-Editor A utility for modifying chunks in Minecraft: Bedrock Edition

EngineersBox 0 Feb 16, 2022
Minecraft-operator - A Kubernetes operator for Minecraft Java Edition servers

Minecraft Operator A Kubernetes operator for dedicated servers of the video game

James Laverack 8 Dec 15, 2022
mcstatusgo is a pure Go Minecraft service status checker for Java edition Minecraft servers

mcstatusgo is a pure Go Minecraft service status checker for Java edition Minecraft servers. mcstatusgo supports requesting information through the status and query protocols.

Milad Noorzaie 2 Aug 12, 2022
steal minecraft (bedrock) skins

skinsteal steal everyone on the servers skin ❤️ to gophertunnel for being awesome https://streamable.com/7niuie to setup: build main.go run output bin

null 15 May 10, 2021
steal minecraft (bedrock) skins

skinsteal steal everyone on the servers skin ❤️ to gophertunnel for being awesome https://streamable.com/7niuie to setup: build main.go run output bin

null 17 Jul 14, 2021
minectl 🗺 is a cli for creating Minecraft (java or bedrock) server on different cloud provider.

minectl ?? minectl️️ is a cli for creating Minecraft (java or bedrock) server on different cloud provider. It is a private side project of me, to lear

Engin Diri 108 Jan 3, 2023
Simple Minecraft Bedrock reverse proxy

BedProx [WIP] Simple Minecraft Bedrock reverse proxy Features Reverse Proxy HAProxy Protocol Support (NOT TESTED) Webhooks REST API How to use/deploy

Hendrik Schlehlein 7 Sep 7, 2022
Render minecraft: bedrock worlds using dragonfly

worldrenderer render minecraft: bedrock worlds using dragonfly

Tal 8 Dec 25, 2022
A library designed for hosting Minecraft: Java Edition listeners.

expresso A library designed for hosting Minecraft: Java Edition listeners. Features Hosting listeners. All handshake, status, and login state packets.

Tal 3 Jul 29, 2022
A new Minecraft: Pi Edition Launcher

Pipan About [TODO] Building Pipan is a go project. go build and then run the resultant executable. You will need go >= 1.16 for module support, and a

RandomSoup 4 Oct 11, 2022
Go compiler made from scratch, which can compile itself. It's going to be the smallest and simplest go compiler in the world.

Babygo, a go compiler made from scratch Babygo is a small and simple go compiler. (Smallest and simplest in the world, I believe.) It is made from scr

DQNEO 231 Jan 8, 2023