Skip to content

Commit

Permalink
Major refactor
Browse files Browse the repository at this point in the history
* Rewrite to be compatible with 1.18.2 (pkstDev)
* Switch config to Omega Config (altasE)
* Sorted mod class files (pkstDev)
* Small changes (pkstDev)

Co-Authored-By: altasE <[email protected]>
  • Loading branch information
Flamarine and altasE committed Apr 29, 2022
1 parent 4a78235 commit 3f659f7
Show file tree
Hide file tree
Showing 14 changed files with 392 additions and 399 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.idea/
.gradle/

build/
run/
86 changes: 0 additions & 86 deletions build.gradle

This file was deleted.

74 changes: 74 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
plugins {
kotlin("jvm")
id("fabric-loom")
`maven-publish`
java
}

group = property("maven_group")!!
version = "${property("mod_version")}-mc${property("minecraft_version")}"

repositories {
maven("https://jitpack.io")
}

dependencies {
minecraft("com.mojang:minecraft:${property("minecraft_version")}")
mappings("net.fabricmc:yarn:${property("yarn_mappings")}:v2")
modImplementation("net.fabricmc:fabric-loader:${property("loader_version")}")

modImplementation("net.fabricmc:fabric-language-kotlin:${property("fabric_kotlin_version")}")
modImplementation("net.fabricmc.fabric-api:fabric-api:${property("fabric_api_version")}")

include("com.github.Draylar.omega-config:omega-config-base:${property("omega_config_version")}")
modImplementation("com.github.Draylar.omega-config:omega-config-base:${property("omega_config_version")}")
}

tasks {

processResources {
inputs.property("version", project.version)
filesMatching("fabric.mod.json") {
expand(mutableMapOf("version" to project.version))
}
}

jar {
from("LICENSE")
}

publishing {
publications {
create<MavenPublication>("mavenJava") {
artifact(remapJar) {
builtBy(remapJar)
}
artifact(kotlinSourcesJar) {
builtBy(remapSourcesJar)
}
}
}

// select the repositories you want to publish to
repositories {
// uncomment to publish to the local maven
// mavenLocal()
}
}

compileKotlin {
kotlinOptions.jvmTarget = "17"
}

}

java {
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
// if it is present.
// If you remove this line, sources will not be generated.
withSourcesJar()
}



// configure the maven publication
36 changes: 12 additions & 24 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,25 +1,13 @@
kotlin.code.style=official
org.gradle.jvmargs=-Xmx1G

# Fabric Properties
# Check these on https://modmuss50.me/fabric.html
minecraft_version=1.18
yarn_mappings=1.18+build.1
loader_version=0.12.8

#Fabric api
fabric_version=0.44.0+1.18

loom_version=0.10-SNAPSHOT

#Paradox config
config_version=0.5.1-beta

# Mod Properties
mod_version = 1.4.1-1.18
maven_group = dev.intelligentcreations
archives_base_name = randore

# Kotlin
kotlin_version=1.6.0
fabric_kotlin_version=1.7.0+kotlin.1.6.0
archives_base_name=Randore-fabric
maven_group=dev.intelligentcreations
loom_version=0.12-SNAPSHOT
minecraft_version=1.18.2
yarn_mappings=1.18.2+build.2
loader_version=0.13.3
fabric_kotlin_version=1.7.1+kotlin.1.6.10
fabric_api_version=0.48.0+1.18.2
mod_version=2.0.0
omega_config_version=1.2.3-1.18.1

org.gradle.jvmargs=-Xmx4000m
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
16 changes: 0 additions & 16 deletions settings.gradle

This file was deleted.

16 changes: 16 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
rootProject.name = "Randore-fabric"
pluginManagement {
repositories {
mavenCentral()
maven("https://maven.fabricmc.net/") {
name = "Fabric"
}
gradlePluginPortal()
}

plugins {
id("fabric-loom") version "0.11-SNAPSHOT"
id("org.jetbrains.kotlin.jvm") version "1.6.10"
}

}
22 changes: 22 additions & 0 deletions src/main/kotlin/dev/intelligentcreations/randore/Randore.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package dev.intelligentcreations.randore

import dev.intelligentcreations.randore.blocks.BlockInit
import dev.intelligentcreations.randore.config.RandoreConfig
import dev.intelligentcreations.randore.worldgen.OregenInit
import draylar.omegaconfig.OmegaConfig
import net.fabricmc.api.ModInitializer
import org.slf4j.Logger
import org.slf4j.LoggerFactory


object Randore : ModInitializer {
val LOGGER: Logger = LoggerFactory.getLogger("Rand'Ore")
const val MOD_ID = "randore"
val CONFIG: RandoreConfig = OmegaConfig.register(RandoreConfig::class.java)

override fun onInitialize() {
BlockInit.registerBlocks()
OregenInit.registerOregen()
LOGGER.info("Initialized.")
}
}
34 changes: 0 additions & 34 deletions src/main/kotlin/dev/intelligentcreations/randore/RandoreConfig.kt

This file was deleted.

Loading

0 comments on commit 3f659f7

Please sign in to comment.