Скачать LimLib — Minecraft Моды — MetaMods

LimLib

Активный

Установок

0

Последнее обновление

2 года назад
Клиент
Библиотеки

A library that I use for my mods, featuring utilities to simplify Config declaration (using annotations, like the hold forge), Registration (also using annotations), Declaration of commands (no annotations this time, but scripting to make them A LOT more readable than the vanilla way) and many more misc things

 

 

Example of a command declared using my system: 

 

CommandManager.registerCmd(TestCommand.class, "enter_dim", s->s.hasPermission(2), "/test_commands enter <entities?> <dimension?>", new EntitiesArg(true), new DimensionArg());

public static int enter_dim(CommandContext<CommandSourceStack> ctx, Collection<? extends Entity> entities, ServerLevel dim) { ...

 

 ^ this will result in a command /test_commands enter <entities> <dimension> where 'entities' and 'dimension' are facultative

 

 

Example of config using my annotations:


@Config(cmt = "simple boolean") //we simply add a comment, it makes no sense to test if a boolean is inside a range or in a set of valid states

public static boolean nice_boolean = true; //the default value of a config is read from the static field itself

 

@Config(cmt = "an int, within a range", min = "0", max = "10") //note: min/max are strings to circumvent the Typing limitations of annotations

public static int such_range = 3;

 

 

Example of block (and it's item) being registered using my annotations (by default derive the registry name from the class name):


public static class TestBlock extends Block {

 

@RegisterBlock

public static RegistryObject<Block> R_BLOCK;

 

@RegisterBlockItem

public static RegistryObject<Item> R_ITEM;

...

 

Участники проекта
limachi_

limachi_