First progress on forge support

- add forge module
- github actions build and release
- aim for all-in-one jar supporting both fabric and forge

**NOTICE**
Forge support is not currently working.

Signed-off-by: Lucas Petrino <nsx1lucas@gmail.com>
This commit is contained in:
2024-01-15 23:21:57 +13:00
parent 4eaf638e42
commit 5ab33b1e63
19 changed files with 368 additions and 30 deletions

View File

@@ -3,15 +3,11 @@ package me.lucaslah.weatherchanger.fabric;
import me.lucaslah.weatherchanger.WeatherChanger;
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientLifecycleEvents;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
public class WeatherChangerFabric implements ClientModInitializer {
public static final Logger LOGGER = LogManager.getLogger("weather-changer");
@Override
public void onInitializeClient() {
WeatherChanger.init();
WeatherChanger.init(new WeatherChangerPlatformImpl());
ClientLifecycleEvents.CLIENT_STOPPING.register(client -> WeatherChanger.shutdown());
}
}

View File

@@ -1,16 +1,19 @@
package me.lucaslah.weatherchanger.fabric;
import me.lucaslah.weatherchanger.WeatherChangerPlatform;
import me.lucaslah.weatherchanger.keybinding.KeybindingManager;
import net.fabricmc.loader.api.FabricLoader;
import java.nio.file.Path;
public class WeatherChangerExpectPlatformImpl {
public static Path getConfigDirectory() {
public class WeatherChangerPlatformImpl implements WeatherChangerPlatform {
@Override
public Path getConfigDirectory() {
return FabricLoader.getInstance().getConfigDir();
}
public static KeybindingManager getKeybindingManager() {
@Override
public KeybindingManager getKeybindingManager() {
return new FabricKeybindingManager();
}
}