Skip to content

Commit

Permalink
Update to 1.20.5 + groundwork
Browse files Browse the repository at this point in the history
  • Loading branch information
andantet committed Feb 4, 2024
1 parent fd041d2 commit 5b48903
Show file tree
Hide file tree
Showing 10 changed files with 53 additions and 65 deletions.
30 changes: 5 additions & 25 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//file:noinspection All

plugins {
id "fabric-loom" version "1.4-SNAPSHOT"
id "fabric-loom" version "1.5-SNAPSHOT"
id "org.jetbrains.kotlin.jvm"
id "maven-publish"
}
Expand Down Expand Up @@ -55,20 +55,16 @@ dependencies {
modImplementation "net.fabricmc.fabric-api:fabric-api:$fabric_version"
modImplementation "net.fabricmc:fabric-language-kotlin:$fabric_kotlin_version"

modImplementation "com.ptsmods:devlogin:$devlogin_version"

// test
testImplementation sourceSets.main.output
testImplementation "org.apache.logging.log4j:log4j-slf4j2-impl:2.21.1"

testClientImplementation sourceSets.main.output
testClientImplementation sourceSets.client.output
testClientImplementation sourceSets.test.output
}

loom {
runtimeOnlyLog4j = true

accessWidenerPath = file("src/main/resources/${mod_id}.accesswidener")

mods {
mod_id {
sourceSet sourceSets.main
Expand All @@ -77,24 +73,8 @@ loom {
}

runs {
authenticatedClient {
client()
name("Minecraft Client (Authenticated)")
programArg("--msa")
}

testClient {
client()
name("Minecraft Client (Test)")
source(sourceSets.testClient)
runDir("runtest")
}

testClientAuthenticated {
inherit(testClient)
name("Minecraft Client (Test Authenticated)")
programArg("--msa")
runDir("runtest")
client {
ideConfigGenerated(false)
}

testServer {
Expand Down
16 changes: 7 additions & 9 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,17 @@ org.gradle.parallel=true

# Fabric Properties
# check these on https://fabricmc.net/develop
minecraft_version=1.20.3-pre2
yarn_build=2
loader_version=0.14.24
minecraft_version=23w51b
yarn_build=4
loader_version=0.15.6

kotlin_version=1.9.20
fabric_kotlin_version=1.10.13+kotlin.1.9.20
# Dependencies
fabric_version=0.94.0+1.20.5

devlogin_version=3.4.1
kotlin_version=1.9.22
fabric_kotlin_version=1.10.17+kotlin.1.9.22

# Mod Properties
mod_version=1.0.0
maven_group=net.mcbrawls
mod_id=packmanager

# Dependencies
fabric_version=0.90.12+1.20.3
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
15 changes: 0 additions & 15 deletions src/main/java/net/mcbrawls/packmanager/mixin/ExampleMixin.java

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package net.mcbrawls.packmanager.mixin;

import net.mcbrawls.packmanager.ResourcePackEnvironment;
import net.minecraft.server.world.ServerWorld;
import org.spongepowered.asm.mixin.Mixin;

@Mixin(ServerWorld.class)
public class ServerWorldMixin implements ResourcePackEnvironment {
}
16 changes: 8 additions & 8 deletions src/main/kotlin/net/mcbrawls/packmanager/PackManager.kt
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package net.mcbrawls.packmanager

import net.fabricmc.api.ModInitializer
import net.fabricmc.api.DedicatedServerModInitializer
import org.slf4j.LoggerFactory

object PackManager : ModInitializer {
private val logger = LoggerFactory.getLogger("packmanager")
object PackManager : DedicatedServerModInitializer {
const val MOD_ID = "packmanager"
const val MOD_NAME = "Pack Manager"

override fun onInitialize() {
// This code runs as soon as Minecraft is in a mod-load-ready state.
// However, some things (like resources) may still be uninitialized.
// Proceed with mild caution.
logger.info("Hello Fabric world!")
private val logger = LoggerFactory.getLogger(MOD_NAME)

override fun onInitializeServer() {
logger.info("Initializing $MOD_NAME")
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package net.mcbrawls.packmanager

/**
* An environment which can handle resource packs.
*/
interface ResourcePackEnvironment {

}
19 changes: 13 additions & 6 deletions src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,20 @@
"id": "packmanager",
"version": "${version}",
"name": "Pack Manager",
"description": "This is an example description! Tell everyone what your mod is about!",
"description": "A library for managing resource packs within contexts.",
"authors": [
"Me!"
"Andante"
],
"contact": {
"homepage": "https://fabricmc.net/",
"sources": "https://github.com/FabricMC/fabric-example-mod"
"homepage": "https://github.com/mcbrawls/packmanager",
"sources": "https://github.com/mcbrawls/packmanager",
"issues": "https://github.com/mcbrawls/packmanager/issues"
},
"license": "CC0-1.0",
"license": "MIT",
"icon": "assets/packmanager/icon.png",
"environment": "*",
"entrypoints": {
"main": [
"server": [
{
"value": "net.mcbrawls.packmanager.PackManager",
"adapter": "kotlin"
Expand All @@ -25,6 +26,12 @@
"mixins": [
"packmanager.mixins.json"
],
"accessWidener": "packmanager.accesswidener",
"custom": {
"loom:injected_interfaces": {
"net/minecraft/server/world/ServerWorld": [ "net/mcbrawls/packmanager/ResourcePackEnvironment" ]
}
},
"depends": {
"fabricloader": ">=0.14.24",
"minecraft": "~1.20.2",
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/packmanager.accesswidener
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
accessWidener v2 named
2 changes: 1 addition & 1 deletion src/main/resources/packmanager.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"package": "net.mcbrawls.packmanager.mixin",
"compatibilityLevel": "JAVA_17",
"mixins": [
"ExampleMixin"
"ServerWorldMixin"
],
"injectors": {
"defaultRequire": 1
Expand Down

0 comments on commit 5b48903

Please sign in to comment.