Skip to content

Commit

Permalink
Merge pull request #5 from EpimorphicPioneers/update
Browse files Browse the repository at this point in the history
Update MonoLib
  • Loading branch information
DancingSnow0517 authored Sep 7, 2024
2 parents 7b7ec43 + d5b8709 commit 7c3f3cf
Show file tree
Hide file tree
Showing 13 changed files with 94 additions and 125 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ version = "${mod_version}" + (buildNumber != null ? "-build.${System.getenv("GIT
apply from: "$rootDir/gradle/scripts/architectury_loom.gradle"
apply from: "$rootDir/gradle/scripts/capabilities.gradle"
apply from: "$rootDir/gradle/scripts/repositories.gradle"
apply from: "$rootDir/gradle/scripts/dependencies.gradle"
apply from: "$rootDir/dependencies.gradle"
apply from: "$rootDir/gradle/scripts/resources.gradle"
apply from: "$rootDir/gradle/scripts/jars.gradle"
apply from: "$rootDir/gradle/scripts/publishing.gradle"
Expand Down
8 changes: 4 additions & 4 deletions gradle/scripts/dependencies.gradle → dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ dependencies {

// Mixin Extras
implementation(annotationProcessor("io.github.llamalad7:mixinextras-common:${this.forge.versions.mixinextras.get()}"))
api(include("io.github.llamalad7:mixinextras-forge:${this.forge.versions.mixinextras.get()}"))
api("io.github.llamalad7:mixinextras-forge:${this.forge.versions.mixinextras.get()}")

/* -------------------------------------------------- Libraries -------------------------------------------------- */

Expand All @@ -35,7 +35,7 @@ dependencies {

modCompileOnly(forge.jei.common.api) { transitive = false } // JEI
modCompileOnly(forge.jei.forge.api) { transitive = false }
modImplementation(forge.jei.forge.impl) { transitive = false }
modCompileOnly(forge.jei.forge.impl) { transitive = false }

modCompileOnly forge.rei.plugin // REI
modCompileOnly forge.rei.api
Expand All @@ -53,8 +53,8 @@ dependencies {

if (System.getenv("RUN_SERVER") == null) {
modRuntimeOnly(forge.shimmer.forge) { transitive = false } // Shimmer
modRuntimeOnly("maven.modrinth:embeddium:0.2.10+mc1.20.1") // Embeddium
modRuntimeOnly("maven.modrinth:oculus:1.20.1-1.6.9") // Oculus
modRuntimeOnly("maven.modrinth:embeddium:0.3.19+mc1.20.1") // Embeddium
modRuntimeOnly("maven.modrinth:oculus:1.20.1-1.7.0") // Oculus
}
//modRuntimeOnly(forge.worldStripper)
}
20 changes: 10 additions & 10 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ dependencyResolutionManagement {

// Mod Dependencies Versions
// Common
def jeiVersion = "15.2.0.27"
def reiVersion = "12.0.684"
def emiVersion = "1.1.4"
def ae2Version = "15.0.18"
def jeiVersion = "15.12.1.46"
def reiVersion = "12.1.725"
def emiVersion = "1.1.11"
def ae2Version = "15.2.11"
def kjsVersion = "2001.6.5-build.7"
def gtmVersion = "1.2.3.a"
def gtmVersion = "1.4.0"

// Forge
def forgeVersion = "47.2.0"
Expand All @@ -39,11 +39,11 @@ dependencyResolutionManagement {
def architecturyLoomVersion = "1.6-SNAPSHOT"
def macheteVersion = "1.+"
def configurationVersion = "2.2.0"
def ldLibVersion = "1.0.25.l"
def ldLibVersion = "1.0.26.b"
def mixinextrasVersion = "0.3.2"
def shimmerVersion = "0.2.2"
def monomorphismLibVersion = "1.0.10-build.17"
def shimmerVersion = "0.2.4"
def spotlessVersion = "7.0.0.BETA1"
def monoLibVersion = "1.2.0-build.33"

forge {
version("forgeShortVersion", forgeVersion)
Expand Down Expand Up @@ -93,8 +93,8 @@ dependencyResolutionManagement {
def gtm = version("gtm", gtmVersion)
library("gtm", "com.gregtechceu.gtceu", "gtceu-${minecraftVersion}").versionRef(gtm)

def monomorphismLib = version("monomorphism", monomorphismLibVersion)
library("monomorphism", "com.epimorphismmc.monomorphism", "monomorphism-${minecraftVersion}").versionRef(monomorphismLib)
def monoLib = version("monomorphism", monoLibVersion)
library("monomorphism", "com.epimorphismmc.monomorphism", "monomorphism-${minecraftVersion}").versionRef(monoLib)
}

libs {
Expand Down
16 changes: 11 additions & 5 deletions src/main/java/com/example/examplemod/ExampleGTAddon.java
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
package com.example.examplemod;

import com.epimorphismmc.monomorphism.MOGTAddon;

import com.gregtechceu.gtceu.api.addon.GTAddon;
import com.gregtechceu.gtceu.api.addon.IGTAddon;
import com.gregtechceu.gtceu.api.registry.registrate.GTRegistrate;

@GTAddon
public class ExampleGTAddon extends MOGTAddon {
public class ExampleGTAddon implements IGTAddon {

public ExampleGTAddon() {
super(ExampleMod.MODID);
@Override
public GTRegistrate getRegistrate() {
return ExampleMod.REGISTRATE;
}

@Override
public void initializeAddon() {}

@Override
public String addonModId() {
return ExampleMod.MODID;
}
}
79 changes: 10 additions & 69 deletions src/main/java/com/example/examplemod/ExampleMod.java
Original file line number Diff line number Diff line change
@@ -1,88 +1,29 @@
package com.example.examplemod;

import com.example.examplemod.client.ClientProxy;
import com.example.examplemod.common.CommonProxy;
import com.example.examplemod.config.ExampleConfigHolder;
import com.example.examplemod.data.ExampleLangHandler;

import com.epimorphismmc.monomorphism.MOMod;
import com.epimorphismmc.monomorphism.datagen.MOProviderTypes;
import com.epimorphismmc.monomorphism.registry.registrate.MORegistrate;
import com.epimorphismmc.monomorphism.integration.registrate.MORegistrate;
import com.epimorphismmc.monomorphism.utility.DistLogger;

import com.gregtechceu.gtceu.utils.FormattingUtil;

import com.lowdragmc.lowdraglib.networking.INetworking;

import net.minecraft.resources.ResourceLocation;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.fml.common.Mod;

import org.slf4j.Logger;

// The value here should match an entry in the META-INF/mods.toml file
@Mod(ExampleMod.MODID)
public class ExampleMod extends MOMod<CommonProxy> {
public interface ExampleMod {
// Define mod id in a common place for everything to reference
public static final String MODID = "examplemod";
public static final String NAME = "Example Mod";

public static ExampleMod instance;

public ExampleMod() {
super();
}
String MODID = "examplemod";

@Override
public String getModId() {
return MODID;
}

@Override
public String getModName() {
return NAME;
}

@Override
protected void onModConstructed() {
instance = this;
ExampleConfigHolder.init();
}
String NAME = "Example Mod";

@Override
@OnlyIn(Dist.CLIENT)
protected CommonProxy createClientProxy() {
return new ClientProxy();
}
Logger LOGGER = new DistLogger(NAME);

@Override
@OnlyIn(Dist.DEDICATED_SERVER)
protected CommonProxy createServerProxy() {
return new CommonProxy();
}
MORegistrate REGISTRATE = MORegistrate.create(MODID);

@Override
public void addDataGenerator(MORegistrate registrate) {
registrate.addDataGenerator(MOProviderTypes.MO_LANG, ExampleLangHandler::init);
static ExampleMod instance() {
return ExampleModCommon.instance;
}

public static ResourceLocation id(String path) {
static ResourceLocation id(String path) {
return new ResourceLocation(MODID, FormattingUtil.toLowerCaseUnder(path));
}

public static Logger logger() {
return instance.getLogger();
}

public static CommonProxy proxy() {
return instance.getProxy();
}

public static MORegistrate registrate() {
return instance.getRegistrate();
}

public static INetworking network() {
return instance.getNetwork();
}
}
14 changes: 14 additions & 0 deletions src/main/java/com/example/examplemod/ExampleModBootstrap.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.example.examplemod;

import com.example.examplemod.client.ExampleModClient;

import net.minecraftforge.fml.DistExecutor;
import net.minecraftforge.fml.common.Mod;

// The value here should match an entry in the META-INF/mods.toml file
@Mod(ExampleModCommon.MODID)
public class ExampleModBootstrap {
public ExampleModBootstrap() {
DistExecutor.unsafeRunForDist(() -> ExampleModClient::new, () -> ExampleModServer::new);
}
}
20 changes: 20 additions & 0 deletions src/main/java/com/example/examplemod/ExampleModCommon.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.example.examplemod;

import com.example.examplemod.config.ExampleConfigHolder;
import com.example.examplemod.data.ExampleLangHandler;

import com.epimorphismmc.monomorphism.integration.registrate.providers.MOProviderTypes;

public class ExampleModCommon implements ExampleMod {

public static ExampleModCommon instance;

public ExampleModCommon() {
super();
instance = this;
ExampleConfigHolder.init();
REGISTRATE.addDataGenerator(MOProviderTypes.MO_LANG, ExampleLangHandler::init);

LOGGER.info("ExampleMod's Initialization Completed!");
}
}
8 changes: 8 additions & 0 deletions src/main/java/com/example/examplemod/ExampleModServer.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.example.examplemod;

public class ExampleModServer extends ExampleModCommon {

public ExampleModServer() {
super();
}
}
15 changes: 0 additions & 15 deletions src/main/java/com/example/examplemod/client/ClientProxy.java

This file was deleted.

13 changes: 13 additions & 0 deletions src/main/java/com/example/examplemod/client/ExampleModClient.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.example.examplemod.client;

import com.example.examplemod.ExampleModCommon;

import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;

@OnlyIn(Dist.CLIENT)
public class ExampleModClient extends ExampleModCommon {
public ExampleModClient() {
super();
}
}
18 changes: 0 additions & 18 deletions src/main/java/com/example/examplemod/common/CommonProxy.java

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package com.example.examplemod.config;

import com.example.examplemod.ExampleMod;
import com.example.examplemod.ExampleModCommon;

import dev.toma.configuration.Configuration;
import dev.toma.configuration.config.Config;
import dev.toma.configuration.config.format.ConfigFormats;

@Config(id = ExampleMod.MODID)
@Config(id = ExampleModCommon.MODID)
public class ExampleConfigHolder {
public static ExampleConfigHolder INSTANCE;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.example.examplemod.data;

import com.epimorphismmc.monomorphism.datagen.lang.MOLangProvider;
import com.epimorphismmc.monomorphism.integration.registrate.providers.MOLangProvider;

public class ExampleLangHandler {

Expand Down

0 comments on commit 7c3f3cf

Please sign in to comment.