Skip to content

Commit 52597c3

Browse files
committed
Update build script and fix token in ExampleMod
1 parent 945572e commit 52597c3

File tree

3 files changed

+22
-10
lines changed

3 files changed

+22
-10
lines changed

fabric/build.gradle.kts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
val moduleName by extra("dev.faststats.fabric")
2+
3+
plugins {
4+
id("fabric-loom") version ("1.15-SNAPSHOT")
5+
}
6+
7+
dependencies {
8+
api(project(":core"))
9+
mappings(loom.officialMojangMappings())
10+
minecraft("com.mojang:minecraft:1.21.11")
11+
modCompileOnly("net.fabricmc.fabric-api:fabric-api:0.139.4+1.21.11")
12+
modImplementation("net.fabricmc:fabric-loader:0.18.4")
13+
}
Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,16 @@
11
plugins {
2-
id("net.fabricmc.fabric-loom-remap") version "1.14-SNAPSHOT"
3-
}
4-
5-
loom {
6-
splitEnvironmentSourceSets()
2+
id("fabric-loom")
73
}
84

95
dependencies {
106
implementation(project(":fabric"))
117
mappings(loom.officialMojangMappings())
128
minecraft("com.mojang:minecraft:1.21.11")
13-
modImplementation("net.fabricmc:fabric-loader:0.18.4")
9+
modCompileOnly("net.fabricmc:fabric-loader:0.18.4")
1410
}
1511

1612
tasks.jar {
17-
from(project(":fabric").tasks.jar)
18-
from(project(":core").tasks.jar)
13+
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
14+
from(project(":fabric").sourceSets["main"].output)
15+
from(project(":core").sourceSets["main"].output)
1916
}

fabric/example-mod/src/main/java/com/example/ExampleMod.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
import dev.faststats.fabric.FabricMetrics;
77
import net.fabricmc.api.ModInitializer;
88

9+
import java.net.URI;
10+
911
public class ExampleMod implements ModInitializer {
1012
// context-aware error tracker, automatically tracks errors in the same class loader
1113
public static final ErrorTracker ERROR_TRACKER = ErrorTracker.contextAware();
@@ -14,7 +16,7 @@ public class ExampleMod implements ModInitializer {
1416
public static final ErrorTracker CONTEXT_UNAWARE_ERROR_TRACKER = ErrorTracker.contextUnaware();
1517

1618
private final Metrics metrics = FabricMetrics.factory()
17-
//.url(URI.create("https://metrics.example.com/v1/collect")) // For self-hosted metrics servers only
19+
.url(URI.create("https://metrics.example.com/v1/collect")) // For self-hosted metrics servers only
1820

1921
// Custom example charts
2022
// For this to work you have to create a corresponding data source in your project settings first
@@ -31,7 +33,7 @@ public class ExampleMod implements ModInitializer {
3133

3234
.debug(true) // Enable debug mode for development and testing
3335

34-
.token("sadlskmsldmkfglsdkmfgksjdfhngkjd") // required -> token can be found in the settings of your project
36+
.token("YOUR_TOKEN_HERE") // required -> token can be found in the settings of your project
3537
.create("example-mod"); // your mod id as defined in fabric.mod.json
3638

3739
public void doSomethingWrong() {

0 commit comments

Comments
 (0)