-
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
28 changed files
with
462 additions
and
128 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,37 @@ | ||
# gradle | ||
|
||
.gradle/ | ||
build/ | ||
out/ | ||
classes/ | ||
|
||
# eclipse | ||
|
||
*.launch | ||
|
||
# idea | ||
|
||
.idea/ | ||
*.iml | ||
out/ | ||
*.ipr | ||
*.iws | ||
*.iml | ||
.idea/* | ||
!.idea/scopes | ||
|
||
# vscode | ||
# eclipse | ||
eclipse | ||
*.launch | ||
.settings | ||
.metadata | ||
.classpath | ||
.project | ||
|
||
# vscode | ||
.settings/ | ||
.vscode/ | ||
bin/ | ||
.classpath | ||
.project | ||
|
||
# macos | ||
|
||
*.DS_Store | ||
|
||
# fabric | ||
|
||
run/ | ||
|
||
# java | ||
|
||
hs_err_*.log | ||
replay_*.log | ||
*.hprof | ||
*.jfr | ||
|
||
# other | ||
run/ | ||
runs/ | ||
bin/ | ||
classes/ |
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,46 +1,56 @@ | ||
plugins | ||
subprojects | ||
{ | ||
id "fabric-loom" version "1.7-SNAPSHOT" | ||
} | ||
apply plugin: "java" | ||
java.toolchain.languageVersion = JavaLanguageVersion.of(java_version) | ||
|
||
version = project.mod_version | ||
group = project.maven_group | ||
|
||
base | ||
{ | ||
archivesName = "${project.archives_base_name}-FABRIC-${project.minecraft_version}" | ||
} | ||
|
||
repositories | ||
{ | ||
maven { url = "https://maven.parchmentmc.org/" } | ||
} | ||
|
||
dependencies | ||
{ | ||
minecraft "com.mojang:minecraft:${project.minecraft_version}" | ||
mappings loom.layered() | ||
base | ||
{ | ||
officialMojangMappings() | ||
parchment("org.parchmentmc.data:parchment-${project.mappings_version}@zip") | ||
archivesName = "${mod_jar_name}-${project.name.toUpperCase()}-${minecraft_version}" | ||
} | ||
|
||
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}" | ||
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" | ||
} | ||
|
||
processResources | ||
{ | ||
inputs.property "version", project.version | ||
filesMatching("fabric.mod.json") { expand "version": project.version } | ||
} | ||
processResources | ||
{ | ||
var replaceProperties = | ||
[ | ||
"mod_name" : mod_name, | ||
"mod_jar_name" : mod_jar_name, | ||
"mod_id" : mod_id, | ||
"mod_group" : mod_group, | ||
"mod_author" : mod_author, | ||
"version" : version, | ||
"license" : license, | ||
"homepage" : homepage, | ||
"source_url" : source_url, | ||
"issue_tracker" : issue_tracker, | ||
"mod_description" : mod_description, | ||
"minecraft_version" : minecraft_version, | ||
"java_version" : java_version, | ||
"version_range_fabric" : version_range_fabric, | ||
"version_range_forge" : version_range_forge, | ||
"version_range_neoforge" : version_range_neoforge, | ||
"fabric_loader_version" : fabric_loader_version, | ||
"fabric_api_version" : fabric_api_version, | ||
"forge_version" : forge_version, | ||
"neoforge_version" : neoforge_version, | ||
] | ||
|
||
filesMatching(["pack.mcmeta", "fabric.mod.json", "META-INF/mods.toml", "META-INF/neoforge.mods.toml", "*.mixins.json"]) | ||
{ | ||
expand replaceProperties | ||
} | ||
inputs.properties replaceProperties | ||
} | ||
|
||
tasks.withType(JavaCompile).configureEach { it.options.release = 21 } | ||
tasks.withType(JavaCompile).configureEach { it.options.encoding = "UTF-8" } | ||
|
||
java | ||
{ | ||
withSourcesJar() | ||
if (project.name != "common") | ||
{ | ||
dependencies | ||
{ | ||
compileOnly project(":common") | ||
} | ||
|
||
sourceCompatibility = JavaVersion.VERSION_21 | ||
targetCompatibility = JavaVersion.VERSION_21 | ||
processResources { from project(":common").sourceSets.main.resources } | ||
tasks.named("compileJava", JavaCompile) { source project(":common").sourceSets.main.allSource } | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
plugins | ||
{ | ||
id "fabric-loom" version "${fabric_loom_version}" | ||
} | ||
|
||
repositories | ||
{ | ||
maven { url = "https://maven.parchmentmc.org/" } | ||
} | ||
|
||
dependencies | ||
{ | ||
minecraft "com.mojang:minecraft:${minecraft_version}" | ||
mappings loom.layered { | ||
officialMojangMappings() | ||
parchment("org.parchmentmc.data:parchment-${parchment_minecraft}:${parchment_version}@zip") | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
common/src/main/java/com/mt1006/irondoorkey/IronDoorKeyCommon.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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.mt1006.irondoorkey; | ||
|
||
import com.mojang.logging.LogUtils; | ||
import net.minecraft.core.registries.Registries; | ||
import net.minecraft.resources.ResourceLocation; | ||
import net.minecraft.tags.TagKey; | ||
import net.minecraft.world.level.block.Block; | ||
import org.slf4j.Logger; | ||
|
||
public class IronDoorKeyCommon | ||
{ | ||
public static final String MOD_ID = "irondoorkey"; | ||
public static final Logger LOGGER = LogUtils.getLogger(); | ||
|
||
public static final TagKey<Block> OPENABLE = TagKey.create(Registries.BLOCK, ResourceLocation.fromNamespaceAndPath(MOD_ID, "openable")); | ||
} |
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
28 changes: 28 additions & 0 deletions
28
common/src/main/resources/data/irondoorkey/advancement/recipes/tools/iron_door_key.json
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"parent": "minecraft:recipes/root", | ||
"criteria": | ||
{ | ||
"has_redstone": { | ||
"conditions": | ||
{ | ||
"items": [{ "items": "minecraft:redstone" }] | ||
}, | ||
"trigger": "minecraft:inventory_changed" | ||
}, | ||
"has_the_recipe": | ||
{ | ||
"conditions": { "recipe": "irondoorkey:iron_door_key" }, | ||
"trigger": "minecraft:recipe_unlocked" | ||
} | ||
}, | ||
"requirements": [ | ||
[ | ||
"has_the_recipe", | ||
"has_redstone" | ||
] | ||
], | ||
"rewards": | ||
{ | ||
"recipes": [ "irondoorkey:iron_door_key" ] | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...ata/irondoorkey/recipe/iron_door_key.json → ...ata/irondoorkey/recipe/iron_door_key.json
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
File renamed without changes.
File renamed without changes
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
plugins | ||
{ | ||
id "fabric-loom" version "${fabric_loom_version}" | ||
} | ||
|
||
dependencies | ||
{ | ||
minecraft "com.mojang:minecraft:${minecraft_version}" | ||
mappings loom.layered { | ||
officialMojangMappings() | ||
parchment("org.parchmentmc.data:parchment-${parchment_minecraft}:${parchment_version}@zip") | ||
} | ||
|
||
modImplementation "net.fabricmc:fabric-loader:${fabric_loader_version}" | ||
modImplementation "net.fabricmc.fabric-api:fabric-api:${fabric_api_version}" | ||
} |
11 changes: 1 addition & 10 deletions
11
...om/mt1006/irondoorkey/IronDoorKeyMod.java → ...om/mt1006/irondoorkey/IronDoorKeyMod.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,29 +1,20 @@ | ||
package com.mt1006.irondoorkey; | ||
|
||
import com.mojang.logging.LogUtils; | ||
import net.fabricmc.api.ModInitializer; | ||
import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents; | ||
import net.minecraft.core.Registry; | ||
import net.minecraft.core.registries.BuiltInRegistries; | ||
import net.minecraft.core.registries.Registries; | ||
import net.minecraft.resources.ResourceLocation; | ||
import net.minecraft.tags.TagKey; | ||
import net.minecraft.world.item.CreativeModeTabs; | ||
import net.minecraft.world.item.Item; | ||
import net.minecraft.world.level.block.Block; | ||
import org.slf4j.Logger; | ||
|
||
public class IronDoorKeyMod implements ModInitializer | ||
{ | ||
public static final String MOD_ID = "irondoorkey"; | ||
public static final Logger LOGGER = LogUtils.getLogger(); | ||
|
||
private static final Item ITEM_IRON_DOOR_KEY = new IronDoorKeyItem(); | ||
public static final TagKey<Block> OPENABLE = TagKey.create(Registries.BLOCK, ResourceLocation.fromNamespaceAndPath(MOD_ID, "openable")); | ||
|
||
@Override public void onInitialize() | ||
{ | ||
Registry.register(BuiltInRegistries.ITEM, ResourceLocation.fromNamespaceAndPath(MOD_ID, "iron_door_key"), ITEM_IRON_DOOR_KEY); | ||
Registry.register(BuiltInRegistries.ITEM, ResourceLocation.fromNamespaceAndPath(IronDoorKeyCommon.MOD_ID, "iron_door_key"), ITEM_IRON_DOOR_KEY); | ||
ItemGroupEvents.modifyEntriesEvent(CreativeModeTabs.TOOLS_AND_UTILITIES).register((content) -> content.accept(ITEM_IRON_DOOR_KEY)); | ||
} | ||
} |
Oops, something went wrong.