Unruled API (未受限 API)
Unruled API 是一个拓展了原版游戏规则的模组,为其他模组提供了新的游戏规则类型。
Unruled API 允许创建新形式的游戏规则,超越了原版仅限的整数和布尔值。
尽管不会自动注册它们,但此模组允许您轻松创建新的浮点数、长整型、双精度、字符串、文本和枚举驱动的游戏规则,使用`mc.recraftors.unruled_api.UnruledApi` 类的生成静态方法。
为了一致性,还创建了方法以允许实例化原版游戏规则。
示例:
java
public void gamerulesRegistration() {
myGameRule = registerGamerule("my_gamerule", category, UnruledApi.createFloat(1.5));
myOtherGameRule = registerGamerule("my_other_gamerule", category, UnruledApi.createString("some text"));
myLastGameRule = registerGamerule("my_last_gamerule", category, UnruledApi.createBoolean(false, (server, rule) -> {
onLastRuleChange(server, rule);
}));
}
每个规则也可以使用`IGameRulesProvider` 接口轻松查询。
示例:
java
String value = ((IGameRulesProvider)gamerules).unruled_getString(myStringGameRule);
float aFloat = ((IGameRulesProvider)gamerules).unruled_getFloat(myFloatGameRule);
如何在您的项目中使用
您可以使用 Modrinth maven 在您的项目中实现此模组。不要犹豫阅读 [官方文档](
添加 Modrinth maven 仓库
groovy
repositories {
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
}
}
导入模组
loom 示例:
groovy
dependencies {
// 使用 modApi 允许您的项目依赖项默认导入依赖项
modApi "maven.modrinth:unruled-api:${project.unruled_version}"
}
forgeGradle 示例:
groovy
dependencies {
implementation "maven.modrinth:unruled-api:${project.unruled_version}"
}
出于版权原因,我们要求您不要将此模组(JiJ、jar-in-a-jar、shadow 等)包含在您自己的内部。感谢您的理解。
截图:
Unruled API 1.2.1 - 1.21.5
Unruled API 1.2.1 - 1.21.3
Unruled API 1.2.1 - 1.21
Unruled API 1.2 - 1.21.5
* Adds server-bound rules (cannot have overrides)
* Adds gamerule commands category optional arguments (for easier navigation)
Unruled API 1.2 - 1.21.3
* Adds server-bound rules (cannot have overrides)
* Adds gamerule commands category optional arguments (for easier navigation)
Unruled API 1.2 - 1.21
* Adds server-bound rules (cannot have overrides)
* Adds gamerule commands category optional arguments (for easier navigation)
Unruled API 1.2 - 1.20.2
* Adds server-bound rules (cannot have overrides)
* Adds gamerule commands category optional arguments (for easier navigation)
Unruled API 1.2 - 1.20
* Adds server-bound rules (cannot have overrides)
* Adds gamerule commands category optional arguments (for easier navigation)
Unruled API 1.1.3 - 1.21.5
Fixed unreferenced refmap
Unruled API 1.1.3 - 1.21.3
Fixed unreferenced refmap
Unruled API 1.1.3 - 1.21
Fixed unreferenced refmap
Unruled API 1.1.3 - 1.20.2
Fixed unreferenced refmap
Unruled API 1.1.3 - 1.20
Fixed unreferenced refmap
Unruled API 1.1.2 - 1.21.5
Fixes accesswidener mapping name on universal build
Unruled API 1.1.2 - 1.21.3
Fixes accesswidener mapping name on universal build
Unruled API 1.1.2 - 1.21
Fixes accesswidener mapping name on universal build
Unruled API 1.1.2 - 1.20.2
Fixes accesswidener mapping name on universal build
Unruled API 1.1.2 - 1.20
Fixes accesswidener mapping name on universal build
Unruled API 1.1.1 - 1.21.5
Fixes universal build mod manifest files
Unruled API 1.1.1 - 1.21.3
Fixes universal build mod manifest files
Unruled API 1.1.1 - 1.21
Fixes universal build mod manifest files
Unruled API 1.1.1 - 1.20.2
Fixes universal build mod manifest files
Unruled API 1.1.1 - 1.20[.1]
Fixes universal build mod manifest files
Unruled API 1.1 - 1.21.5
* Introducing universal builds
* Reworked the overrides command to allow removing a set override from the game
Unruled API 1.1 - 1.21.3~4
* Introducing universal builds
* Reworked the overrides command to allow removing a set override from the game
* Moved 1.21.4 changes back to 1.21.3 as 1.21.1 version was breaking for it and 1.21.4 was actually compatible
Unruled API 1.1 - 1.21
* Introducing universal builds
* Reworked the overrides command to allow removing a set override from the game
Unruled API 1.1 - 1.20.2+
* Introducing universal builds
* Reworked the overrides command to allow removing a set override from the game
Unruled API 1.1 - 1.20[.1]
* Introducing universal builds
* Reworked the overrides command to allow removing a set override from the game
Unruled API 1.0 - Fabric 1.21.5
No feature change
Unruled API 1.0 - NeoForge 1.21.5
No feature change
Unruled API 1.0 - Fabric 1.21.4
* revamped gamerule registration system. This will likely break with earlier use of the library!
* added per-dimension gamerules overrides
* dynamic registries support
Unruled API 1.0 - Fabric 1.21
* revamped gamerule registration system. This will likely break with earlier use of the library!
* added per-dimension gamerules overrides
* dynamic registries support
Unruled API 1.0 - Fabric 1.20
* revamped gamerule registration system. This will likely break with earlier use of the library!
* added per-dimension gamerules overrides
* dynamic registries support
Unruled API 1.0 - NeoForge 1.21.4
* revamped gamerule registration system. This will likely break with earlier use of the library!
* added per-dimension gamerules overrides
* dynamic registries support
Unruled API 1.0 - NeoForge 1.21
* revamped gamerule registration system. This will likely break with earlier use of the library!
* added per-dimension gamerules overrides
* dynamic registries support
Unruled API 1.0 - NeoForge 1.20
* revamped gamerule registration system. This will likely break with earlier use of the library!
* added per-dimension gamerules overrides
* dynamic registries support
Unruled API 0.6 - NeoForge 1.21.4+
Now with Registry entry gamerules
Unruled API 0.6 - Fabric 1.21.4+
Now with Registry entry gamerules
Unruled API 0.6 - Fabric 1.21
Now with Registry entry gamerules
Unruled API 0.6 - NeoForge 1.21
Now with Registry entry gamerules
Unruled API 0.6 - NeoForge 1.20.x
Now with Registry entry gamerules
Unruled API 0.6 - Fabric 1.20.x
Now with Registry entry gamerules
Unruled API 0.5.1 - Fabric 1.20+
* Fixes an injection issue on 1.21.x game versions
Unruled API 0.5.1 - Forge 1.20+
* Fixes an injection issue on 1.21.x game versions
Unruled API 0.5 - Fabric 1.20.x
Now with validators and adapters.
#### 1.19 will no longer receive updates, unless for potential bug fixes, upon request.
Unruled API 0.5 - Forge 1.20.x
Now with validators and adapters.
### Last content update for Forge. Upcoming feature additions will still target the Fabric toolchain, but move from Forge to NeoForge.
(bug fixes for 0.5 will still come if need be, but nothing more)
Unruled API 0.4 - Fabric 1.20+
Added convenience methods and new entity selector gamerule
Unruled API 0.4 - Fabric 1.19
Added convenience methods and new entity selector gamerule
Unruled API 0.4 - Forge 1.20+
Added convenience methods and new entity selector gamerule
Unruled API 0.4 - Forge 1.19
Added convenience methods and new entity selector gamerule
Unruled API 0.3 - Forge 1.20
Fix build to integrate access transformer
Unruled API 0.3 - Forge 1.19
Fix build to integrate access transformer
Unruled API 0.3 - Forge 1.18
Fix build to integrate access transformer
Unruled API 0.2 - Fabric 1.20
Fix build jar to be imported in Architectury Loom projects
Unruled API 0.2 - Fabric 1.19
Fix build jar to be imported in Architectury Loom projects
Unruled API 0.2 - Fabric 1.18
Fix build jar to be imported in Architectury Loom projects
Unruled API 0.2 - Forge 1.20
Fix build jar to be imported in Architectury Loom projects
Unruled API 0.2 - Forge 1.19
Fix build jar to be imported in Architectury Loom projects
Unruled API 0.2 - Forge 1.18
Fix build jar to be imported in Architectury Loom projects
Unruled API 0.1 - Fabric 1.20
Contains:
* Floating gamerules
* Long gamerules
* Double gamerules
* String gamerules
* Text gamerules
* Enum gamerules
Warning, there yet is no implementation for Text gamerules editing in the world creation menu.
Unruled API 0.1 - Fabric 1.19
Contains:
* Floating gamerules
* Long gamerules
* Double gamerules
* String gamerules
* Text gamerules
* Enum gamerules
Warning, there yet is no implementation for Text gamerules editing in the world creation menu.
Unruled API 0.1 - Fabric 1.18
Contains:
* Floating gamerules
* Long gamerules
* Double gamerules
* String gamerules
* Text gamerules
* Enum gamerules
Warning, there yet is no implementation for Text gamerules editing in the world creation menu.
Unruled API 0.1 - Forge 1.20
Contains:
* Floating gamerules
* Long gamerules
* Double gamerules
* String gamerules
* Text gamerules
* Enum gamerules
Warning, there yet is no implementation for Text gamerules editing in the world creation menu.
Unruled API 0.1 - Forge 1.19
Contains:
* Floating gamerules
* Long gamerules
* Double gamerules
* String gamerules
* Text gamerules
* Enum gamerules
Warning, there yet is no implementation for Text gamerules editing in the world creation menu.
Unruled API 0.1 - Forge 1.18
Contains:
* Floating gamerules
* Long gamerules
* Double gamerules
* String gamerules
* Text gamerules
* Enum gamerules
Warning, there yet is no implementation for Text gamerules editing in the world creation menu.
收录