Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
plugins {
id 'fabric-loom' version '0.11-SNAPSHOT'
id 'fabric-loom' version '1.10-SNAPSHOT'
id 'maven-publish'
}

sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17

archivesBaseName = project.archives_base_name
version = project.mod_version
group = project.maven_group
Expand All @@ -32,14 +29,6 @@ dependencies {
modApi("me.shedaniel.cloth:cloth-config-fabric:${project.version_cloth_api}") {
exclude(group: "net.fabricmc.fabric-api")
}

// Performance mods
modRuntimeOnly "maven.modrinth:lithium:${project.version_lithium}"
modRuntimeOnly "maven.modrinth:phosphor:${project.version_phosphor}"
modRuntimeOnly "maven.modrinth:ferrite-core:${project.version_ferrite_core}"
modRuntimeOnly "maven.modrinth:lazydfu:${project.version_lazydfu}"
modRuntimeOnly "maven.modrinth:ksyxis:${project.version_ksyxis}"
modRuntimeOnly "maven.modrinth:c2me-fabric:${project.version_c2me}"
}


Expand All @@ -56,6 +45,17 @@ tasks.withType(JavaCompile).configureEach {
it.options.release = 17
}

loom {
splitEnvironmentSourceSets()

mods {
"modid" {
sourceSet sourceSets.main
sourceSet sourceSets.client
}
}

}
java {
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
// if it is present.
Expand Down
24 changes: 7 additions & 17 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,18 @@ org.gradle.jvmargs=-Xmx1G

# Fabric Properties
# check these on https://fabricmc.net/develop
minecraft_version=1.18.1
yarn_mappings=1.18.1+build.22
loader_version=0.13.1
minecraft_version=1.21.5
yarn_mappings=1.21.5+build.1
loader_version=0.16.10

# Mod Properties
mod_version = 0.0.1-beta.2+1.18.1-fabric
mod_version = 0.0.1-beta.1+1.21.5-fabric
maven_group = com.github.einjerjar.mc
archives_base_name = mc-alias

# Dependencies
fabric_version=0.46.4+1.18
fabric_version=0.119.5+1.21.5

# Config
version_cloth_api=6.1.48
version_mod_menu=3.0.1


# Performance
version_lithium=mc1.18.1-0.7.7
version_phosphor=mc1.18.x-0.8.1
version_ferrite_core=4.1.1
version_lazydfu=0.1.2
version_ksyxis=1.1
version_c2me=0.2.0+alpha.6.53+1.18.1
version_servercore=1.2.7-1.18.1
version_cloth_api=18.0.145
version_mod_menu=14.0.0
6 changes: 4 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
zipStorePath=wrapper/dists
45 changes: 31 additions & 14 deletions gradlew

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 10 additions & 2 deletions src/main/java/com/einjerjar/mc/mcalias/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,23 @@ public void onInitialize() {
.executes(context -> {
try {
String args = MessageArgumentType.getMessage(context, "args").getString();
return server.getCommandManager().execute(context.getSource(), s2 + " " + args);
return context.getSource()
.getServer()
.getCommandManager()
.getDispatcher() // get the Brigadier dispatcher :contentReference[oaicite:6]{index=6}
.execute(s2 + " " + args, context.getSource()); // matches execute(String,S) :contentReference[oaicite:7]{index=7}
} catch (Exception ex) {
ex.printStackTrace();
}
return 0;
}))
.executes(context -> {
try {
return server.getCommandManager().execute(context.getSource(), s2);
return context.getSource()
.getServer()
.getCommandManager()
.getDispatcher()
.execute(s2, context.getSource()); // omit trailing space when args is empty :contentReference[oaicite:8]{index=8}
} catch (Exception ex) {
ex.printStackTrace();
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
},

"depends": {
"fabricloader": ">=0.12.12",
"fabricloader": ">=0.16.10",
"fabric": "*",
"minecraft": "1.18.x",
"minecraft": "1.21.5",
"java": ">=17"
}
}