跳到正文

RetroCommands

作者:Slainlight

Retro Commands built on Fabric for b1.7.3, but it also works in Multiplayer and has an API.

收藏

截图

介绍

中文介绍正在准备中,下面暂时显示原文。

Retro Commands for b1.7.3

  • it works on servers
  • it has an extensible API.
  • No dependencies required

Optional Dependencies

  • To access /tp with dimensions, install STAPI
  • To access /gamemode, install BHCreative

Help

  • Use /help in-game

API

Note: Please make Retro Commands optional!!

build.gradle

repositories {
    exclusiveContent {
        forRepository {
            maven {
                name = "Modrinth"
                url = "https://api.modrinth.com/maven"
            }
        }
        filter {
            includeGroup "maven.modrinth"
        }
    }
}

dependencies {
    def retroCommandsJar = configurations.detachedConfiguration(
      dependencies.create("maven.modrinth:retrocommands:${project.properties['retrocommands_version']}")
    )
    retroCommandsJar.transitive = false
    modLocalRuntime files(zipTree(retroCommandsJar.singleFile).matching { include 'META-INF/jars/*.jar' }.files)
}

or build.gradle.kts if that’s your tempo

repositories {
    exclusiveContent {
         forRepository {
                 maven("https://api.modrinth.com/maven")
         }
         filter {
                 includeGroup("maven.modrinth")
         }
    }
}

dependencies {
        val retroCommandsJar = configurations.detachedConfiguration(
            dependencies.create("maven.modrinth:retrocommands:${project.properties["retrocommands_version"]}")
          ).apply { isTransitive = false }
          modLocalRuntime(files(zipTree(retroCommandsJar.singleFile).matching { include("META-INF/jars/*.jar") }.files))
    }
}

fabric.mod.json

  "suggests": {
    "retrocommands": "*"
  },

in your mods initialization

public static void init_of_some_sort()
{
    if (FabricLoader.getInstance().isModLoaded("retrocommands")){
        MyModsCommands.add();
    }
}

implement api.com.periut.retrocommands.Command

register with api.com.periut.retrocommands.CommandRegistry
CommandRegistry.add(new Command())

new Command() replaced with your custom command.

Add your own summon command for your entities

Use api.com.periut.retrocommands.SummonRegistry
SummonRegistry.add(…)

Examples from util.com.periut.retrocommands.VanillaMobs

SummonRegistry.add(Creeper.class, (world, pos, param) -> {
    Creeper creeper = new Creeper(world);

    if (param.length > 5)
        if (!param[5].isEmpty())
            if (param[5].charAt(0) != '0')
                ((EntityAccessor) creeper).getDataTracker().setInt(17, (byte) 1);

    return creeper;
}, "{charged (0 or 1)}");

SummonRegistry.add(Sheep.class, (world, pos, param) -> {
    int color = Integer.parseInt(param[5]);
    int has_wool = 1;
    if (param.length > 6)
        has_wool = Integer.parseInt(param[6]);
    Sheep sheep = new Sheep(world);
    sheep.setSheared(has_wool == 0);
    sheep.setColour(color);
    return sheep;
}, "{wool color meta} {has wool (0/1)} ");

Configuration

Cryonic Config is required for this feature.
This file generates when using a command for the first time
To disable commands go to {mc_dir}/config/retrocommands.json and in the json under “disabledCommands”, set the value to commands you want to disable separated by commas
Examples:

{
  "disabledCommands": "help,give,hat"
}
{
  "disabledCommands": "hat"
}

评论

登录后评论和评分

Slainlight 的其他作品

查看全部 →