Skip to content

Commit

Permalink
minor cleanups to fabric
Browse files Browse the repository at this point in the history
  • Loading branch information
Revxrsal committed Dec 29, 2024
1 parent de15e2f commit 5238e24
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 31 deletions.
22 changes: 11 additions & 11 deletions examples/fabric-mod/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,20 @@ repositories {
maven("https://maven.fabricmc.net/")
}

val minecraft_version = "1.21"
val yarn_mappings = "1.21+build.9"
val loader_version = "0.16.7"
val fabric_version = "0.102.0+1.21"
val permissions_version = "0.3.1"
val minecraftVersion = "1.21"
val yarnMappings = "1.21+build.9"
val loaderVersion = "0.16.7"
val fabricVersion = "0.102.0+1.21"
val permissionsVersion = "0.3.1"

dependencies {
implementation(project(":common"))
implementation(project(":brigadier"))
modImplementation(project(":fabric"))
mappings("net.fabricmc:yarn:${yarn_mappings}:v2")
minecraft("com.mojang:minecraft:${minecraft_version}")
modImplementation("net.fabricmc:fabric-loader:${loader_version}")
include("me.lucko:fabric-permissions-api:${permissions_version}")?.let { modImplementation(it) }
mappings("net.fabricmc:yarn:${yarnMappings}:v2")
minecraft("com.mojang:minecraft:${minecraftVersion}")
modImplementation("net.fabricmc:fabric-loader:${loaderVersion}")
include("me.lucko:fabric-permissions-api:${permissionsVersion}")?.let { modImplementation(it) }
}

java.toolchain.languageVersion.set(JavaLanguageVersion.of(21))
Expand All @@ -37,8 +37,8 @@ tasks {
filesMatching("fabric.mod.json") {
expand(mapOf(
"version" to project.version,
"loader_version" to loader_version,
"minecraft_version" to minecraft_version
"loader_version" to loaderVersion,
"minecraft_version" to minecraftVersion
))
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import revxrsal.commands.fabric.FabricLamp;

public class FabricTestMod implements DedicatedServerModInitializer {

@Override public void onInitializeServer() {
var lamp = FabricLamp.builder().build();
lamp.register(new GreetCommand());
Expand Down
42 changes: 23 additions & 19 deletions fabric/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,35 +14,39 @@ repositories {
maven("https://maven.fabricmc.net/")
}

val minecraft_version = "1.21"
val yarn_mappings = "1.21+build.9"
val loader_version = "0.16.7"
val fabric_version = "0.102.0+1.21"
val permissions_version = "0.3.1"
val java_version = 21
val minecraftVersion = "1.21"
val yarnMappings = "1.21+build.9"
val loaderVersion = "0.16.7"
val fabricVersion = "0.102.0+1.21"
val permissionsVersion = "0.3.1"
val javaVersion = 21

dependencies {
implementation(project(":common"))
implementation(project(":brigadier"))
minecraft("com.mojang:minecraft:${minecraft_version}")
mappings("net.fabricmc:yarn:${yarn_mappings}:v2")
modImplementation("net.fabricmc:fabric-loader:${loader_version}")
modImplementation("net.fabricmc.fabric-api:fabric-api:${fabric_version}")
include("me.lucko:fabric-permissions-api:${permissions_version}")?.let { modImplementation(it) }
minecraft("com.mojang:minecraft:${minecraftVersion}")
mappings("net.fabricmc:yarn:${yarnMappings}:v2")
modImplementation("net.fabricmc:fabric-loader:${loaderVersion}")
modImplementation("net.fabricmc.fabric-api:fabric-api:${fabricVersion}")
include("me.lucko:fabric-permissions-api:${permissionsVersion}")?.let {
modImplementation(it)
}
}

java.toolchain.languageVersion.set(JavaLanguageVersion.of(java_version))
java.toolchain.languageVersion.set(JavaLanguageVersion.of(javaVersion))

tasks {
processResources {
filesMatching("fabric.mod.json") {
expand(mapOf(
"version" to project.version,
"java_version" to java_version,
"loader_version" to loader_version,
"fabric_version" to fabric_version,
"minecraft_version" to minecraft_version
))
expand(
mapOf(
"version" to project.version,
"java_version" to javaVersion,
"loader_version" to loaderVersion,
"fabric_version" to fabricVersion,
"minecraft_version" to minecraftVersion
)
)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import me.lucko.fabric.api.permissions.v0.Permissions;
import net.minecraft.command.CommandSource;
import net.minecraft.server.command.ServerCommandSource;
import revxrsal.commands.annotation.DistributeOnMethods;
import revxrsal.commands.annotation.NotSender;

Expand Down

0 comments on commit 5238e24

Please sign in to comment.