commodore-file

The commodore file format

Лицензия

Лицензия

MIT
Группа

Группа

me.lucko
Идентификатор

Идентификатор

commodore-file
Последняя версия

Последняя версия

1.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

commodore-file
The commodore file format
Ссылка на сайт

Ссылка на сайт

https://github.com/lucko/commodore-file
Система контроля версий

Система контроля версий

https://github.com/lucko/commodore-file

Скачать commodore-file

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/me.lucko/commodore-file/ -->
<dependency>
    <groupId>me.lucko</groupId>
    <artifactId>commodore-file</artifactId>
    <version>1.0</version>
</dependency>
// https://jarcasting.com/artifacts/me.lucko/commodore-file/
implementation 'me.lucko:commodore-file:1.0'
// https://jarcasting.com/artifacts/me.lucko/commodore-file/
implementation ("me.lucko:commodore-file:1.0")
'me.lucko:commodore-file:jar:1.0'
<dependency org="me.lucko" name="commodore-file" rev="1.0">
  <artifact name="commodore-file" type="jar" />
</dependency>
@Grapes(
@Grab(group='me.lucko', module='commodore-file', version='1.0')
)
libraryDependencies += "me.lucko" % "commodore-file" % "1.0"
[me.lucko/commodore-file "1.0"]

Зависимости

compile (1)

Идентификатор библиотеки Тип Версия
com.mojang » brigadier jar 1.0.17

Модули Проекта

Данный проект не имеет модулей.

commodore-file Javadocs Maven Central

The commodore file format is a simplified way of representing Brigadier command node trees in a string form.

This repository is a Java parser for the format.

Example

Below is an example commodore file for Minecraft's /time command:

time {
  set {
    day;
    noon;
    night;
    midnight;
    time brigadier:integer;
  }
  add {
    time brigadier:integer;
  }
  query {
    daytime;
    gametime;
    day;
  }
}

To parse to a brigadier CommandNode:

LiteralCommandNode<Sender> timeCommand = CommodoreFileReader.INSTANCE.parse(new File("time.commodore"));

This will return a command node equivalent to the following node as build with brigadier's API.

LiteralCommandNode<Sender> timeCommand = LiteralArgumentBuilder.literal("time")
        .then(LiteralArgumentBuilder.literal("set")
                .then(LiteralArgumentBuilder.literal("day"))
                .then(LiteralArgumentBuilder.literal("noon"))
                .then(LiteralArgumentBuilder.literal("night"))
                .then(LiteralArgumentBuilder.literal("midnight"))
                .then(RequiredArgumentBuilder.argument("time", IntegerArgumentType.integer())))
        .then(LiteralArgumentBuilder.literal("add")
                .then(RequiredArgumentBuilder.argument("time", IntegerArgumentType.integer())))
        .then(LiteralArgumentBuilder.literal("query")
                .then(LiteralArgumentBuilder.literal("daytime"))
                .then(LiteralArgumentBuilder.literal("gametime"))
                .then(LiteralArgumentBuilder.literal("day"))
        ).build();

Версии библиотеки

Версия
1.0