Skip to content

Commit 6eaa6e0

Browse files
committed
Add dependency:fabric-api-v0.34.2+1.16
1 parent ff57ef3 commit 6eaa6e0

File tree

5 files changed

+68
-66
lines changed

5 files changed

+68
-66
lines changed

build.gradle

Lines changed: 59 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
plugins {
2-
id 'fabric-loom' version '0.7-SNAPSHOT'
3-
id 'maven-publish'
2+
id 'fabric-loom' version '0.7-SNAPSHOT'
3+
id 'maven-publish'
44
}
55

66
sourceCompatibility = JavaVersion.VERSION_1_8
@@ -11,84 +11,85 @@ version = 'v' + project.mod_version + '-' + new Date().format('yyMMdd')
1111
group = project.maven_group
1212

1313
repositories {
14-
// Add repositories to retrieve artifacts from in here.
15-
// You should only use this when depending on other mods because
16-
// Loom adds the essential maven repositories to download Minecraft and libraries from automatically.
17-
// See https://docs.gradle.org/current/userguide/declaring_repositories.html
18-
// for more information about repositories.
19-
maven {
20-
url "https://www.cursemaven.com"
21-
}
14+
// Add repositories to retrieve artifacts from in here.
15+
// You should only use this when depending on other mods because
16+
// Loom adds the essential maven repositories to download Minecraft and libraries from automatically.
17+
// See https://docs.gradle.org/current/userguide/declaring_repositories.html
18+
// for more information about repositories.
19+
maven {
20+
url "https://www.cursemaven.com"
21+
}
2222
}
2323

2424
dependencies {
25-
// To change the versions see the gradle.properties file
26-
minecraft "com.mojang:minecraft:${project.minecraft_version}"
27-
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
28-
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
25+
// To change the versions see the gradle.properties file
26+
minecraft "com.mojang:minecraft:${project.minecraft_version}"
27+
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
28+
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
29+
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
2930

30-
modImplementation("curse.maven:carpet-349239:${project.carpet_core_version}")
31+
modImplementation("curse.maven:carpet-349239:${project.carpet_core_version}")
3132

32-
// PSA: Some older mods, compiled on Loom 0.2.1, might have outdated Maven POMs.
33-
// You may need to force-disable transitiveness on them.
33+
// PSA: Some older mods, compiled on Loom 0.2.1, might have outdated Maven POMs.
34+
// You may need to force-disable transitiveness on them.
3435
}
3536

3637
processResources {
37-
inputs.property "version", project.version
38+
inputs.property "version", project.version
3839

39-
filesMatching("fabric.mod.json") {
40-
expand "version": project.version
41-
}
40+
filesMatching("fabric.mod.json") {
41+
expand "version": project.version
42+
}
4243
}
4344

4445
tasks.withType(JavaCompile).configureEach {
45-
// ensure that the encoding is set to UTF-8, no matter what the system default is
46-
// this fixes some edge cases with special characters not displaying correctly
47-
// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
48-
// If Javadoc is generated, this must be specified in that task too.
49-
it.options.encoding = "UTF-8"
46+
// ensure that the encoding is set to UTF-8, no matter what the system default is
47+
// this fixes some edge cases with special characters not displaying correctly
48+
// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
49+
// If Javadoc is generated, this must be specified in that task too.
50+
it.options.encoding = "UTF-8"
5051

51-
// The Minecraft launcher currently installs Java 8 for users, so your mod probably wants to target Java 8 too
52-
// JDK 9 introduced a new way of specifying this that will make sure no newer classes or methods are used.
53-
// We'll use that if it's available, but otherwise we'll use the older option.
54-
def targetVersion = 8
55-
if (JavaVersion.current().isJava9Compatible()) {
56-
it.options.release = targetVersion
57-
}
52+
// The Minecraft launcher currently installs Java 8 for users, so your mod probably wants to target Java 8 too
53+
// JDK 9 introduced a new way of specifying this that will make sure no newer classes or methods are used.
54+
// We'll use that if it's available, but otherwise we'll use the older option.
55+
def targetVersion = 8
56+
if (JavaVersion.current().isJava9Compatible()) {
57+
it.options.release = targetVersion
58+
}
5859
}
5960

6061
java {
61-
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
62-
// if it is present.
63-
// If you remove this line, sources will not be generated.
64-
withSourcesJar()
62+
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
63+
// if it is present.
64+
// If you remove this line, sources will not be generated.
65+
withSourcesJar()
6566
}
6667

6768
jar {
68-
from("LICENSE") {
69-
rename { "${it}_${project.archivesBaseName}"}
70-
}
69+
from("LICENSE") {
70+
rename { "${it}_${project.archivesBaseName}" }
71+
}
7172
}
7273

7374
// configure the maven publication
7475
publishing {
75-
publications {
76-
mavenJava(MavenPublication) {
77-
// add all the jars that should be included when publishing to maven
78-
artifact(remapJar) {
79-
builtBy remapJar
80-
}
81-
artifact(sourcesJar) {
82-
builtBy remapSourcesJar
83-
}
84-
}
85-
}
76+
publications {
77+
mavenJava(MavenPublication) {
78+
// add all the jars that should be included when publishing to maven
79+
artifact(remapJar) {
80+
builtBy remapJar
81+
}
82+
artifact(sourcesJar) {
83+
builtBy remapSourcesJar
84+
}
85+
}
86+
}
8687

87-
// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
88-
repositories {
89-
// Add repositories to publish to here.
90-
// Notice: This block does NOT have the same function as the block in the top level.
91-
// The repositories here will be used for publishing your artifact, not for
92-
// retrieving dependencies.
93-
}
88+
// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
89+
repositories {
90+
// Add repositories to publish to here.
91+
// Notice: This block does NOT have the same function as the block in the top level.
92+
// The repositories here will be used for publishing your artifact, not for
93+
// retrieving dependencies.
94+
}
9495
}

src/main/java/io/github/optijava/opt_carpet_addition/OptCarpetAddition.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
import carpet.CarpetSettings;
66
import carpet.patches.EntityPlayerMPFake;
77
import com.mojang.brigadier.CommandDispatcher;
8-
import io.github.optijava.opt_carpet_addition.command.ListAdvanceCommand;
9-
import io.github.optijava.opt_carpet_addition.command.PlayerTpCommand;
8+
import io.github.optijava.opt_carpet_addition.commands.ListAdvanceCommand;
9+
import io.github.optijava.opt_carpet_addition.commands.PlayerTpCommand;
1010
import net.fabricmc.api.ModInitializer;
1111
import net.minecraft.server.command.ServerCommandSource;
1212
import net.minecraft.server.network.ServerPlayerEntity;

src/main/java/io/github/optijava/opt_carpet_addition/command/ListAdvanceCommand.java renamed to src/main/java/io/github/optijava/opt_carpet_addition/commands/ListAdvanceCommand.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package io.github.optijava.opt_carpet_addition.command;
1+
package io.github.optijava.opt_carpet_addition.commands;
22

33
import com.mojang.brigadier.CommandDispatcher;
44
import com.mojang.brigadier.builder.LiteralArgumentBuilder;

src/main/java/io/github/optijava/opt_carpet_addition/command/PlayerTpCommand.java renamed to src/main/java/io/github/optijava/opt_carpet_addition/commands/PlayerTpCommand.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package io.github.optijava.opt_carpet_addition.command;
1+
package io.github.optijava.opt_carpet_addition.commands;
22

33
import carpet.CarpetSettings;
44
import carpet.patches.EntityPlayerMPFake;
@@ -19,6 +19,10 @@
1919

2020
public class PlayerTpCommand {
2121

22+
private PlayerTpCommand() {
23+
24+
}
25+
2226
private static final String COMMAND_PREFIX = "player";
2327

2428
public static void registerCommands(CommandDispatcher<ServerCommandSource> dispatcher) {

src/main/resources/fabric.mod.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"schemaVersion": 1,
33
"id": "opt-carpet-addition",
44
"version": "${version}",
5-
65
"name": "Opt-Carpet-Addition",
76
"description": "An extension mod of fabric-carpet.",
87
"authors": [
@@ -12,10 +11,8 @@
1211
"homepage": "https://github.com/OptiJava/OptCarpetAddition",
1312
"sources": "https://github.com/OptiJava/OptCarpetAddition"
1413
},
15-
1614
"license": "CC0-1.0",
1715
"icon": "assets/modid/icon.png",
18-
1916
"environment": "*",
2017
"entrypoints": {
2118
"main": [
@@ -25,10 +22,10 @@
2522
"mixins": [
2623
"opt-carpet-addition.mixins.json"
2724
],
28-
2925
"depends": {
3026
"fabricloader": ">=0.7.4",
3127
"minecraft": "1.16.x",
28+
"fabric": "*",
3229
"carpet": ">=1.4.40+v210608"
3330
},
3431
"suggests": {

0 commit comments

Comments
 (0)