Customization - Randores/Randores2 GitHub Wiki

Customization

Overview

Randores 2 comes with the much requested feature of customization of ores and materials. Any property that Randores uses in its definitions can be edited, allowing you to simply tweak spawn rates, or to create your own custom set of ores.

How it Works

When a world is loaded, Randores will first check for a customization file, named either randores_custom.jlsc or randores_custom.cjlsc. If either of these files exists, custom definitions will be loaded from these files. If the definitions do not exist, Randores will simply generate random ones. Whenever a player joins a world with custom definitions, all the definitions are set to them through the network, so the server can decide what definitions a client sees in the world. Normally, Randores will not save the generated definitions, as they can be generated from the world again when needed. However, you can set the configuration option convert to true to force Randores to convert random generated definitions to custom definitions. When convert is true, the first time a world is loaded (without custom definitions), Randores will generate the random definitions and save them to randores_custom.jlsc. The next time the world is loaded, this file will be detected and the definitions will be treated as custom definitions.

A Note on Formats

You may notice that Randores recognizes two formats, JLSC and CJLSC. The JLSC format is the same as configuration format. The CJLSC format, on the other hand, is a byte-based format similar to NBT that can store all the same information as the JLSC format. CJLSC is significantly smaller and quicker to read. If a JLSC and CJLSC file both exist in a world folder, Randores will read the CJLSC one. It is recommended that you use the CJLSC format, however, if you want to be able to edit the file in a text editor, use the JLSC format.

Editing the Definitions

If you just want to quickly tweak some generated definitions, set convert to true in your config and edit the generated JLSC file with a text editor. Alternatively, I wrote up a small editor program that you can download here (make sure you download the -shadow.jar, as it comes packaged with all the required libraries). The RandoresEditor can read files in both JLSC and CJLSC formats, and it can export to either format as well. It allows you to add, remove, and edit the various properties of each definition. Below is a screen grab of the editor:

On the left is a list of all the definitions, and on the right are fields where you may set any of the properties of the definition. Below these two panes, and partially out of the image, you can add/edit/remove craftable items, properties, and abilities.

Setting up Definitions

If you generate a world and add custom definitions afterwards, the ores already generated will break. There are two ways to get around this:

  1. Generated the world, add the custom definitions, delete all the chunk data, and re-load the world
  2. Create a folder with the world name, and add the custom definitions. Generate the world with the name of the folder