微型多方块库

一个用于简单创建多方块结构的微型jar-in-jar库

基础库

一个用于简单创建多方块的轻量库

旨在作为包含自身多个方块、但仍表现为单个方块的方块(例如床、门等……)不要与多方块结构混淆!!

(由于它是一个库,单独下载它没有意义)

特性

超级简单

创建任意大小的多方块只需重写一个方法并添加一个方块实体即可。所有破坏和放置逻辑都已为你完成。

支持 Jar-in-Jar

因为我讨厌为每个模组下载成千上万的依赖项,所以整个库都被设计为 jar-in-jar,这意味着它会被包含在你的模组 jar 中,玩家无需下载任何额外依赖项

多方块预览

允许开发者针对特定的多方块启用放置预览。当玩家手持该多方块时,会在客户端渲染该多方块的透明预览(见画廊中的图片)。在 forge 和 neoforge 上可以通过客户端配置禁用

共享 Blockstate

允许注册在更新时自动在整个多方块中同步的 blockstate,非常适合模组兼容性

支持

如果你是开发者并且遇到了一些问题/有建议,直接在 discord(nikdo53)或 github 上私信我,我拉钩保证会尽快回复你(除非你住在美国,而对我来说那大概是凌晨 3 点😬)

安装说明

首先,获取 modrinth maven 仓库 url 并将其放入你的 build.gradle 的 repository 块中。

repositories {
    //some other repositories you might have
    
    exclusiveContent {
        forRepository {
            maven {
                name = "Modrinth"
                url = "https://api.modrinth.com/maven"
            }
        }
       // forRepositories(fg.repository) // Only add this if you're using ForgeGradle, otherwise remove this line
        filter {
            includeGroup "maven.modrinth"
        }
    }
}

然后添加以下内容到你的 gradle.properties:

# this example is for neoforge 1.21.1
# replace with the newest version for your mc version and loader!
tiny_multiblock_lib_version=neo-1.21.1-3.0

最后,根据你的 loader/gradle 插件,将依赖添加到你的 build.gradle 中

Neoforge MDG 或 NG

jarJar(implementation("maven.modrinth:tiny-multiblock-lib:${tiny_multiblock_lib_version}"))

Forge FG

  1. 通过在你的 minecraft 块之前任意位置添加 jarJar.enable() 来启用 jarjar
  2. 将这一行添加到 dependencies 中:
implementation(fg.deobf(jarJar("maven.modrinth:tiny-multiblock-lib:${tiny_multiblock_lib_version}")))

Forge MDGL

jarJar(modImplementation("maven.modrinth:tiny-multiblock-lib:${tiny_multiblock_lib_version}"))

Fabric

modImplementation(include("maven.modrinth:tiny-multiblock-lib:${tiny_multiblock_lib_version}"))

Multiloader

整个库都是用 multiloader 编写的,任何你想引用的内容都是 common 的,这意味着你可以直接将任意版本添加为 common 依赖,然后分别将 jar in jar 添加到各个 loader 中