Sueta

ID Converter

1.2.3

Convert item IDs to Material names. (Or back) Supports data values and the new 1.13 Materials!

·Plugin

Made in Germany with love (and beer)

This is a small program to convert numeric item IDs in (config) files to the names of the Material enums and to the new changed Materials from the 1.13 release. It will also try to convert data values to the new separated 1.13 IDs (or back). (Currently only supported if they are separated by a colon)

While this conversion should work in most cases doing this automatically is error-prone, so you should go and check if it found every ID and didn't replace too much.

In the case of an unknown ID it will replace it with UNKNOWN_<found id> and it might add a NOTE_<id>:<message> to it when an ID/Material was irreplaceably removed.

Command Line

IDConverter is runable from the command line (e.g. for servers).
The syntax is: IDConverter.jar <file/folder name>
You can either input a single file in which you want to convert it or a full folder to convert all files in it.

Optional parameters:

-rf,--replace-from

The type of ID to replace from. Possible values: numeric, legacy (pre 1.13), flattening
Default: numeric

-rt,--replace-to

The type of ID to replace to. Possible values: numeric, legacy (pre 1.13), flattening
Default: flattening

-r,--regex <regex>

Regex for matching the ID string. Needs to have 3 groups. (One before, one the ID and the third the stuff after the ID)
Default: depending on replace-from

-d,--depth <amount>

Amount of sub folders that should be searched though.
Default: 1

-f,--file-match <regex>

Files need to match this regex for the tool to replace stuff inside them
Default: \w+\.yml

-l,--lowercase true/false

Should the material name be lowercase?
Default: true

GUI

When started directly it will open a GUI where you can select all the settings.

As a library

You can also use IDConverter as a library. The easiest is probably to just shade in the IdMappings class and use the IdMappings#get(IdType,String) method to get the Mapping for a certain string by its type.

Maven repository:

<repository>
    <id>minebench-repo</id>
    <url>https://repo.minebench.de/</url>
</repository>

Maven dependency:

<dependency>
    <groupId>de.themoep.idconverter</groupId>
    <artifactId>mappings</artifactId>
    <version>1.2-SNAPSHOT</version>
</dependency>

Example

example: 1:1
another: 3

would convert to

example: granite
another: grass

with the default settings.


ToDo

Contact me if you need any of these:

  • Plugin
  • Export mappings to file (csv)
  • Import mappings from file
  • Configurable data separator
  • Progress bar
  • Preset for replacement target strings (e.g. to replace a number to Material.ID)

Links

Source: https://github.com/Phoenix616/IDConverter/
Dev-builds: https://ci.minebench.de/job/IDConverter/
License: GPLv3

Donations

If this tool has helped you I would really appreciate it if you bought me a beer!
E.g. via Patreon or Paypal or a crypto coin:
Ðoge: D7G4Svo7GTNHpuhjwUBj2k7qANnZHwYD4p
BTC: 1EXMFRknc7kLwCmM1zf5LXNnPD4ihVCEhQ

Other Resources


This resource is distributed without any warranty or liability by the author.

Similar projects

Plugin →