Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ repositories {
maven { url = "https://maven.createmod.net" } // Ponder, Flywheel
maven { url = "https://jitpack.io" }
maven { url = "https://maven.firstdark.dev/snapshots" } // LDLib2
maven { url = "https://maven.ringlo.im/releases" } // AbyssLib(Reginth 注册框架 + 分区创造栏)
}

base {
Expand Down Expand Up @@ -118,6 +119,12 @@ configurations {
dependencies {
implementation "net.neoforged:neoforge:${neo_version}"

// AbyssLib:Reginth 注册框架(fork 自 Registrate)+ 分区创造栏。
// 坐标带 MC 线后缀(abysslib-1.21.1),26.1 线是 abysslib-26.1.2 —— 两条线同 group、
// 同 mod_version,artifactId 不区分 MC 版本会互相覆盖,别漏掉后缀。
// 注册框架的类就在这个 jar 里(不再有上游 com.tterrag.registrate 依赖,也不要再 jarJar 它)。
implementation "com.altnoir:abysslib-1.21.1:${abysslib_version}"

// Curios
compileOnly "top.theillusivec4.curios:curios-neoforge:${curios_version}:api"
runtimeOnly "top.theillusivec4.curios:curios-neoforge:${curios_version}"
Expand Down
6 changes: 5 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,14 @@ mae_version=1.0.2
ponder_version=1.0.81
flywheel_version=1.0.6

# AbyssLib(Reginth 注册框架 + 分区创造栏)。坐标是 com.altnoir:abysslib-<MC 线>:<版本>,
# artifactId 里的 MC 后缀由 AbyssLib 的 mod_mc_suffix 决定,写漏会解析不到。
abysslib_version=1.0.0

mod_id=mia
mod_name=Memento In Abyss
mod_license=MIT
mod_version=0.1.0-alpha.30
mod_version=0.2.0-alpha.31
mod_group_id=com.altnoir.mia
mod_authors=Altnoir, lonelyicer, zljtt, zhaijineet
mod_description=Memento In Abyss.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.1-bin.zip
distributionUrl=https\://mirrors.cloud.tencent.com/gradle/gradle-9.6.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
312 changes: 312 additions & 0 deletions src/generated/resources/assets/mia/lang/en_ud.json

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions src/generated/resources/assets/mia/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@
"block.mia.verdant_stairs": "Verdant Stairs",
"block.mia.verdant_stem": "Verdant Stem",
"block.mia.verdant_trapdoor": "Verdant Trapdoor",
"config.jade.plugin_mia.spawner_cooldown": "Abyss Spawner Cooldown",
"container.mia.artifact.smithing.title": "Artifact Smithing Table",
"curios.identifier.whistle": "Whistle",
"curios.modifiers.whistle": "Whistle Attributes",
Expand Down Expand Up @@ -214,6 +215,11 @@
"item.minecraft.splash_potion.effect.long_haste": "Splash Potion of Long Haste",
"item.minecraft.splash_potion.effect.strong_haste": "Splash Potion of Strong Haste",
"itemgroup.mia": "Memento In Abyss",
"itemgroup.mia.section.artifacts": "Artifacts",
"itemgroup.mia.section.building": "Building Blocks",
"itemgroup.mia.section.functional": "Functional Blocks",
"itemgroup.mia.section.items": "Items",
"itemgroup.mia.section.natural": "Natural Blocks",
"itemgroup.mia_artifact": "Memento In Abyss: Artifact",
"key.categories.mia": "Memento In Abyss",
"key.mia.skill_dial": "Skill Dial",
Expand Down
40 changes: 38 additions & 2 deletions src/main/java/com/altnoir/mia/MIA.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
package com.altnoir.mia;

import com.altnoir.abysslib.reginth.Reginth;
import com.altnoir.mia.core.curse.CurseManager;
import com.altnoir.mia.core.event.EventHandle;
import com.altnoir.mia.core.spawner.AbyssTrialSpawnerManager;
import com.altnoir.mia.datagen.MiaLangData;
import com.altnoir.mia.init.*;
import com.altnoir.mia.init.worldgen.*;
import com.mojang.logging.LogUtils;
import net.minecraft.resources.ResourceLocation;
import net.neoforged.bus.api.IEventBus;
import net.neoforged.bus.api.SubscribeEvent;
import net.neoforged.fml.ModContainer;
Expand All @@ -22,16 +25,49 @@ public class MIA {
public static final String MOD_NAME = "Memento In Abyss";
public static final Logger LOGGER = LogUtils.getLogger();

/**
* 注册框架实例(AbyssLib 的 Reginth,fork 自上游 Registrate)。
* <p>
* 1.21.1 线的 {@code Reginth.create()} 会**自行**从 {@code ModList} 找到本模组的
* event bus 并挂上监听(26.1 线不会,那边要手调 {@code registerEventListeners}),
* 所以这里不需要额外注册。类就在 abysslib-1.21.1 的 jar 里,不要再 jarJar 上游 Registrate。
* <p>
* 方块/物品的分区归属由各自注册类用 {@code MIA.registrate().defaultCreativeSection(...)}
* 声明,所以这里**不**设全局默认标签页。
*/
private static final Reginth REGINTH = Reginth.create(MOD_ID);

public static Reginth registrate() {
return REGINTH;
}

/**
* 本模组命名空间下的资源 id(与上游 Registrate 的 {@code modLoc} 等价)。
*/
public static ResourceLocation asResource(String path) {
return ResourceLocation.fromNamespaceAndPath(MOD_ID, path);
}

public static final CurseManager CURSE_MANAGER = new CurseManager();
public static final AbyssTrialSpawnerManager SPAWNER_MANAGER = new AbyssTrialSpawnerManager();

public MIA(IEventBus modEventBus, ModContainer modContainer) {
LOGGER.info("{} {}+{} initializing...", MOD_NAME, MiaBuildInfo.VERSION, MiaBuildInfo.GIT_COMMIT);

// 语言键:迁移到 Reginth 后 en_us.json 由 Reginth 独家写入,MIA 的键挂到它的 LANG provider 上。
// 必须在这里(早于 datagen 事件)注册,否则 Reginth 的 provider 已经建好、加不进去了。
MiaLangData.register();

modEventBus.addListener(this::commonSetup);

MiaItems.register(modEventBus);
MiaBlocks.register(modEventBus);
// 物品也全部走 Reginth 了,MiaItems 里没有 DeferredRegister 需要注册;
// 但要和 MiaBlocks 一样在这里**显式加载**(同样因为注册表在类初始化时填充)。
MiaItems.bootstrap();
// MiaBlocks 不再需要注册:方块(含它们的 BlockItem)已经全部走 Reginth,
// Reginth.create(MOD_ID) 自己会把监听器挂到 mod event bus 上。
// 但必须在这里**显式加载** MiaBlocks:它的注册表是在类初始化时(REGINTH 字段 +
// 每条 REGINTH.object(...))填充的,晚于 RegisterEvent 加载就等于方块全丢了。
MiaBlocks.bootstrap();
MiaBlockEntities.register(modEventBus);
MiaItemGroups.register(modEventBus);

Expand Down
Loading