Skip to content

Commit

Permalink
Merge branch '1.20.4' into 1.20.6
Browse files Browse the repository at this point in the history
  • Loading branch information
Urkaz committed Jul 14, 2024
2 parents 6b324fa + bdbbbb5 commit 3fea0d7
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 17 deletions.
10 changes: 7 additions & 3 deletions common/src/main/java/com/urkaz/moontools/UrkazMoonTools.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,17 @@
public class UrkazMoonTools {

public static void init() {
if (UMTExpectPlatform.isModLoaded(UMTConfigWrapper.CLOTH_CONFIG)) {
if (UMTExpectPlatform.isModLoaded(UMTConfigWrapper.CLOTH_CONFIG_ID)) {
AutoConfig.register(UMTConfigWrapper.UMTConfig.class, GsonConfigSerializer::new);
UMTConfigWrapper.setConfig(AutoConfig.getConfigHolder(UMTConfigWrapper.UMTConfig.class).getConfig());
}

ModCompatHandler.getInstance().registerModCompat(new EnhancedCelestialsModCompat());
ModCompatHandler.getInstance().registerModCompat(new LunarModCompat());
if (UMTExpectPlatform.isModLoaded(EnhancedCelestialsModCompat.MOD_ENHANCED_CELESTIALS_ID)) {
ModCompatHandler.getInstance().registerModCompat(new EnhancedCelestialsModCompat());
}
if (UMTExpectPlatform.isModLoaded(LunarModCompat.MOD_LUNAR_ID)) {
ModCompatHandler.getInstance().registerModCompat(new LunarModCompat());
}
}

public static void registryInit() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,18 @@

import com.urkaz.moontools.UMTConstants;
import com.urkaz.moontools.UMTExpectPlatform;
import com.urkaz.moontools.common.modcompat.handler.IMoonToolsModCompat;
import com.urkaz.moontools.common.modcompat.handler.ModCompatHandler;
import me.shedaniel.autoconfig.ConfigData;
import me.shedaniel.autoconfig.annotation.Config;
import me.shedaniel.autoconfig.annotation.ConfigEntry;
import org.jetbrains.annotations.Nullable;

import java.util.ArrayList;
import java.util.List;

public class UMTConfigWrapper {

private static UMTConfig instance;
public static final String CLOTH_CONFIG = "cloth-config";
public static final String CLOTH_CONFIG_ID = "cloth-config";

public static @Nullable UMTConfig getConfig() {
if (instance == null && UMTExpectPlatform.isModLoaded(CLOTH_CONFIG)) {
if (instance == null && UMTExpectPlatform.isModLoaded(CLOTH_CONFIG_ID)) {
instance = new UMTConfig();
}
return instance;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public int getLunarEventColor(Level world) {
for (IMoonToolsModCompat iMoonToolsModCompat : ModCompatList) {
int color = iMoonToolsModCompat.getLunarEventColor(world);
if (color != 0xffffffff)
break;
return color;
}
return 0xffffffff;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,18 @@

package com.urkaz.moontools.fabric;

import com.urkaz.moontools.UMTExpectPlatform;
import com.urkaz.moontools.UrkazMoonTools;
import com.urkaz.moontools.common.UMTRegistry;
import com.urkaz.moontools.common.modcompat.handler.ModCompatHandler;
import com.urkaz.moontools.fabric.modcompat.mods.CrimsonMoonModCompat;
import net.fabricmc.api.ModInitializer;
import net.minecraft.core.Registry;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.resources.ResourceLocation;

import java.util.function.BiConsumer;

public class UrkazMoonToolsFabric implements ModInitializer {

@Override
public void onInitialize() {
coreInit();
Expand All @@ -41,7 +40,9 @@ public void onInitialize() {
private void coreInit() {
UrkazMoonTools.init();

ModCompatHandler.getInstance().registerModCompat(new CrimsonMoonModCompat());
if (UMTExpectPlatform.isModLoaded(CrimsonMoonModCompat.MOD_CRIMSON_MOON_ID)) {
ModCompatHandler.getInstance().registerModCompat(new CrimsonMoonModCompat());
}
}

private void registryInit() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
public class UrkazMoonToolsModMenu implements ModMenuApi {
@Override
public ConfigScreenFactory<?> getModConfigScreenFactory() {
if (UMTExpectPlatform.isModLoaded(UMTConfigWrapper.CLOTH_CONFIG))
if (UMTExpectPlatform.isModLoaded(UMTConfigWrapper.CLOTH_CONFIG_ID))
return parent -> AutoConfig.getConfigScreen(UMTConfigWrapper.UMTConfig.class, parent).get();
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
@OnlyIn(Dist.CLIENT)
public class UMTConfigMenu {
public static void init() {
if (UMTExpectPlatform.isModLoaded(UMTConfigWrapper.CLOTH_CONFIG)) {
if (UMTExpectPlatform.isModLoaded(UMTConfigWrapper.CLOTH_CONFIG_ID)) {
ModLoadingContext.get().registerExtensionPoint(ConfigScreenHandler.ConfigScreenFactory.class,
() -> new ConfigScreenHandler.ConfigScreenFactory((mc, parent) -> AutoConfig.getConfigScreen(UMTConfigWrapper.UMTConfig.class, parent).get())
);
Expand Down

0 comments on commit 3fea0d7

Please sign in to comment.