-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
151 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,71 +1,71 @@ | ||
plugins { | ||
id 'fabric-loom' version '1.7-SNAPSHOT' | ||
id 'maven-publish' | ||
id 'fabric-loom' version '1.8-SNAPSHOT' | ||
id 'maven-publish' | ||
} | ||
|
||
version = project.mod_version | ||
group = project.maven_group | ||
|
||
base { | ||
archivesName = project.archives_base_name | ||
archivesName = project.archives_base_name | ||
} | ||
|
||
loom { | ||
splitEnvironmentSourceSets() | ||
|
||
mods { | ||
"growmeal-fabric" { | ||
sourceSet sourceSets.main | ||
sourceSet sourceSets.client | ||
} | ||
} | ||
mods { | ||
"growmeal-fabric" { | ||
sourceSet sourceSets.main | ||
sourceSet sourceSets.client | ||
} | ||
} | ||
} | ||
|
||
dependencies { | ||
minecraft "com.mojang:minecraft:${project.minecraft_version}" | ||
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2" | ||
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}" | ||
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" | ||
minecraft "com.mojang:minecraft:${project.minecraft_version}" | ||
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2" | ||
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}" | ||
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" | ||
} | ||
|
||
processResources { | ||
inputs.property "version", project.version | ||
inputs.property "version", project.version | ||
|
||
filesMatching("fabric.mod.json") { | ||
expand "version": project.version | ||
} | ||
filesMatching("fabric.mod.json") { | ||
expand "version": project.version | ||
} | ||
} | ||
|
||
tasks.withType(JavaCompile).configureEach { | ||
it.options.release = 21 | ||
it.options.release = 21 | ||
} | ||
|
||
java { | ||
withSourcesJar() | ||
withSourcesJar() | ||
|
||
sourceCompatibility = JavaVersion.VERSION_21 | ||
targetCompatibility = JavaVersion.VERSION_21 | ||
sourceCompatibility = JavaVersion.VERSION_21 | ||
targetCompatibility = JavaVersion.VERSION_21 | ||
} | ||
|
||
jar { | ||
from("LICENSE") { | ||
rename { "${it}_${project.base.archivesName.get()}"} | ||
} | ||
from("LICENSE") { | ||
rename { "${it}_${project.base.archivesName.get()}"} | ||
} | ||
} | ||
|
||
// configure the maven publication | ||
publishing { | ||
publications { | ||
mavenJava(MavenPublication) { | ||
from components.java | ||
} | ||
} | ||
publications { | ||
mavenJava(MavenPublication) { | ||
from components.java | ||
} | ||
} | ||
|
||
// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing. | ||
repositories { | ||
// Add repositories to publish to here. | ||
// Notice: This block does NOT have the same function as the block in the top level. | ||
// The repositories here will be used for publishing your artifact, not for | ||
// retrieving dependencies. | ||
} | ||
// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing. | ||
repositories { | ||
// Add repositories to publish to here. | ||
// Notice: This block does NOT have the same function as the block in the top level. | ||
// The repositories here will be used for publishing your artifact, not for | ||
// retrieving dependencies. | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
pluginManagement { | ||
repositories { | ||
maven { | ||
name = 'Fabric' | ||
url = 'https://maven.fabricmc.net/' | ||
} | ||
mavenCentral() | ||
gradlePluginPortal() | ||
} | ||
repositories { | ||
maven { | ||
name = 'Fabric' | ||
url = 'https://maven.fabricmc.net/' | ||
} | ||
mavenCentral() | ||
gradlePluginPortal() | ||
} | ||
} |
26 changes: 19 additions & 7 deletions
26
src/main/java/com/builtbroken/sbmgrowmeal/GrowmealFabric.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,37 @@ | ||
package com.builtbroken.sbmgrowmeal; | ||
|
||
import java.util.function.Function; | ||
|
||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
import net.fabricmc.api.ModInitializer; | ||
import net.minecraft.item.Item; | ||
import net.minecraft.registry.Registries; | ||
import net.minecraft.registry.Registry; | ||
import net.minecraft.registry.RegistryKey; | ||
import net.minecraft.registry.RegistryKeys; | ||
import net.minecraft.util.Identifier; | ||
|
||
public class GrowmealFabric implements ModInitializer { | ||
|
||
public static final String MOD_ID = "sbmgrowmeal"; | ||
public static final String MOD_NAME = "SBM Growmeal"; | ||
public static final String MOD_ID = "sbmgrowmeal"; | ||
public static final String MOD_NAME = "SBM Growmeal"; | ||
|
||
public static final Logger LOGGER = LoggerFactory.getLogger(MOD_NAME); | ||
|
||
public static final Item GROWMEAL = new GrowmealItem(new Item.Settings()); | ||
public static final Item GROWMEAL = register("growmeal", GrowmealItem::new); | ||
|
||
@Override | ||
public void onInitialize() { | ||
|
||
} | ||
|
||
@Override | ||
public void onInitialize() { | ||
Registry.register(Registries.ITEM, Identifier.of(MOD_ID, "growmeal"), GROWMEAL); | ||
} | ||
private static <T extends Item> T register(String id, Function<Item.Settings, T> factory) { | ||
Identifier guid = Identifier.of(MOD_ID, id); | ||
RegistryKey<Item> key = RegistryKey.of(RegistryKeys.ITEM, guid); | ||
Item.Settings settings = (new Item.Settings()).registryKey(key); | ||
T item = factory.apply(settings); | ||
return Registry.register(Registries.ITEM, guid, item); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.