Skip to content

Commit

Permalink
1.20.6
Browse files Browse the repository at this point in the history
  • Loading branch information
TexBlock committed May 15, 2024
1 parent 9cf88fc commit 987c98e
Show file tree
Hide file tree
Showing 13 changed files with 79 additions and 104 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
## Changelog
- port to 1.20.5
- port to 1.20.6
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@

A dynamic lights mod for Minecraft.

<img alt="forge" height="56" src="https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/cozy/supported/forge_vector.svg">
<img alt="forge" height="56" src="https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/cozy/supported/forge_vector.svg"> (1.16.5~1.20.1)
<img alt="neoforge" height="56" src="https://github.com/mc-wiki/minecraft-mod-heywiki/blob/master/docs/supports_neoforge.svg?raw=true"> (≥1.20.1)
<img alt="fabric" height="56" src="https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/cozy/supported/fabric_vector.svg">
<img alt="architectury-api" height="56" src="https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/cozy/requires/architectury-api_vector.svg">

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class DynamicLightsConfig {
private static final ExplosiveLightingMode DEFAULT_CREEPER_LIGHTING_MODE = ExplosiveLightingMode.SIMPLE;
private static final ExplosiveLightingMode DEFAULT_TNT_LIGHTING_MODE = ExplosiveLightingMode.OFF;

public static final Path CONFIG_FILE_PATH = RyoamicLightsCompat.getConfigDir().resolve("ryoamiclights.toml");
public static final Path CONFIG_FILE_PATH = ModPlatform.getConfigDir().resolve("ryoamiclights.toml");
protected final FileConfig config;
private final RyoamicLights mod;
private DynamicLightsMode dynamicLightsMode;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package org.thinkingstudio.ryoamiclights;

import dev.architectury.injectables.annotations.ExpectPlatform;

import java.nio.file.Path;

public class ModPlatform {
@ExpectPlatform
public static boolean isModLoaded(String modid) {
throw new AssertionError();
}

@ExpectPlatform
public static boolean isDevEnvironment() {
throw new AssertionError();
}

@ExpectPlatform
public static Path getConfigDir() {
throw new AssertionError();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@

package org.thinkingstudio.ryoamiclights;

import dev.architectury.injectables.annotations.ExpectPlatform;

import java.nio.file.Path;

/**
* Represents a utility class for compatibility.
*
Expand All @@ -27,48 +23,34 @@ public final class RyoamicLightsCompat {
*
* @return {@code true} if Canvas is installed, else {@code false}
*/
@ExpectPlatform
public static boolean isCanvasInstalled() {
throw new AssertionError();
return ModPlatform.isModLoaded("canvas");
}

/**
* Returns whether Lil Tater Reloaded is installed.
*
* @return {@code true} if LTR is installed, else {@code false}
*/
@ExpectPlatform
public static boolean isLilTaterReloadedInstalled() {
throw new AssertionError();
return ModPlatform.isModLoaded("ltr");
}

/**
* Returns whether Sodium(Fabric) or Embeddium(Forge/NeoForge) is installed.
* Returns whether Sodium is installed.
*
* @return {@code true} if Sodium(Fabric) or Embeddium(Forge/NeoForge) is installed, else {@code false}
* @return {@code true} if Sodium is installed, else {@code false}
*/
@ExpectPlatform
public static boolean isSodiumInstalled() {
throw new AssertionError();
return ModPlatform.isModLoaded("sodium");
}

/**
* Returns whether Fabric API or Forgified Fabric API is installed.
*
* @return {@code true} if Fabric API or Forgified Fabric API is installed, else {@code false}
*/
@ExpectPlatform
public static boolean isFabricApiInstalled() {
throw new AssertionError();
}

@ExpectPlatform
public static boolean isDevEnvironment() {
throw new AssertionError();
}

@ExpectPlatform
public static Path getConfigDir() {
throw new AssertionError();
return ModPlatform.isModLoaded("fabric-api") | ModPlatform.isModLoaded("fabric_api");
}
}
3 changes: 1 addition & 2 deletions fabric/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
## Changelog
- remove the mixin for embeddium (only forge)
- remove architectury dependency
- port to 1.20.6
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package org.thinkingstudio.ryoamiclights.fabric;

import net.fabricmc.loader.api.FabricLoader;

import java.nio.file.Path;

public class ModPlatformImpl {
public static boolean isModLoaded(String modid) {
return FabricLoader.getInstance().isModLoaded(modid);
}

public static boolean isDevEnvironment() {
return FabricLoader.getInstance().isDevelopmentEnvironment();
}

public static Path getConfigDir() {
return FabricLoader.getInstance().getConfigDir();
}
}

This file was deleted.

10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
org.gradle.jvmargs=-Xmx2G
org.gradle.daemon=false

minecraft_version=1.20.5
minecraft_version=1.20.6
enabled_platforms=fabric,neoforge
yarn_mappings=1.20.5+build.1
yarn_mappings=1.20.6+build.1

archives_base_name=RyoamicLights
mod_version=0.2.5
maven_group=org.thinkingstudio.ryoamiclights

fabric_loader_version=0.15.2
fabric_api_version=0.97.6+1.20.5
fabric_loader_version=0.15.11
fabric_api_version=0.98.0+1.20.6
mod_menu_version=10.0.0-beta.1

neoforge_version=20.5.21-beta
neoforge_version=20.6.63-beta

obsidianui_version=0.2.1+mc1.20.4

Expand Down
3 changes: 1 addition & 2 deletions neoforge/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
## Changelog
- remove the mixin for embeddium (only forge)
- remove architectury dependency
- port to 1.20.6
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package org.thinkingstudio.ryoamiclights.neoforge;

import net.neoforged.fml.ModList;
import net.neoforged.fml.loading.FMLLoader;
import net.neoforged.fml.loading.FMLPaths;

import java.nio.file.Path;

public class ModPlatformImpl {
public static boolean isModLoaded(String modid) {
return ModList.get().isLoaded(modid);
}

public static boolean isDevEnvironment() {
return !FMLLoader.isProduction();
}

public static Path getConfigDir() {
return FMLPaths.CONFIGDIR.get();
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@ public RyoamicLightsNeoForgeMixinPlugin() {
this.conditionalMixins.put("org.thinkingstudio.ryoamiclights.neoforge.mixin.ltr.LilTaterBlocksMixin", ltrInstalled);
this.conditionalMixins.put("org.thinkingstudio.ryoamiclights.neoforge.mixin.ltr.LilTaterBlockEntityMixin", ltrInstalled);

//boolean embeddiumInstalled = RyoamicLightsCompat.isSodiumInstalled();
//this.conditionalMixins.put("org.thinkingstudio.ryoamiclights.neoforge.mixin.embeddium.ArrayLightDataCacheMixin", embeddiumInstalled);
//this.conditionalMixins.put("org.thinkingstudio.ryoamiclights.neoforge.mixin.embeddium.FlatLightPipelineMixin", embeddiumInstalled);
//this.conditionalMixins.put("org.thinkingstudio.ryoamiclights.neoforge.mixin.embeddium.LightDataAccessMixin", embeddiumInstalled);

boolean forgifiedFabricApiInstalled = RyoamicLightsCompat.isFabricApiInstalled();
this.conditionalMixins.put("org.thinkingstudio.ryoamiclights.neoforge.mixin.fabricapi.AoCalculatorMixin", forgifiedFabricApiInstalled);
}
Expand Down

0 comments on commit 987c98e

Please sign in to comment.