Skip to content

Commit

Permalink
- 换个地方加载一言功能。
Browse files Browse the repository at this point in the history
  • Loading branch information
KasumiNova committed Jul 10, 2024
1 parent 1bab4f5 commit 1adb618
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 16 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ plugins {

// Project properties
group = "github.kasuminova.stellarcore"
version = "1.0.25"
version = "1.0.26"

// Set the toolchain version to decouple the Java we run Gradle with from the Java used to compile and run the mod
java {
Expand Down
17 changes: 17 additions & 0 deletions src/main/java/github/kasuminova/stellarcore/StellarCore.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
package github.kasuminova.stellarcore;

import github.kasuminova.stellarcore.client.hitokoto.HitokotoAPI;
import github.kasuminova.stellarcore.client.hitokoto.HitokotoResult;
import github.kasuminova.stellarcore.common.CommonProxy;
import github.kasuminova.stellarcore.common.config.StellarCoreConfig;
import github.kasuminova.stellarcore.mixin.StellarCoreEarlyMixinLoader;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.SidedProxy;
import net.minecraftforge.fml.common.event.*;
Expand Down Expand Up @@ -28,6 +32,19 @@ public class StellarCore {
public static CommonProxy proxy = null;
public static Logger log = null;

static {
if (StellarCoreConfig.FEATURES.hitokoto) {
new Thread(() -> {
Thread.currentThread().setName("Stellar Core Hitokoto Initializer");
String hitokoto = HitokotoAPI.getRandomHitokoto();
if (hitokoto == null || hitokoto.isEmpty()) {
return;
}
StellarCoreEarlyMixinLoader.LOG.info(StellarCoreEarlyMixinLoader.LOG_PREFIX + hitokoto);
}).start();
}
}

@Mod.EventHandler
public void construction(FMLConstructionEvent event) {
proxy.construction();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,21 +59,6 @@ public class StellarCoreLateMixinLoader implements ILateMixinLoader {
addModdedMixinCFG("mixins.stellar_core_thermalexpansion.json", "thermalexpansion");
}

static {
if (StellarCoreConfig.FEATURES.hitokoto) {
// TODO ?
Class<HitokotoResult> toInitialize = HitokotoResult.class;
new Thread(() -> {
Thread.currentThread().setName("Stellar Core Hitokoto Initializer");
String hitokoto = HitokotoAPI.getRandomHitokoto();
if (hitokoto == null || hitokoto.isEmpty()) {
return;
}
StellarCoreEarlyMixinLoader.LOG.info(StellarCoreEarlyMixinLoader.LOG_PREFIX + hitokoto);
}).start();
}
}

@Override
public List<String> getMixinConfigs() {
return new ArrayList<>(MIXIN_CONFIGS.keySet());
Expand Down

0 comments on commit 1adb618

Please # to comment.