diff --git a/.gitignore b/.gitignore index efd59e2..5752fc5 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,5 @@ run fabric2/run_client/ fabric/run_client/ + +logs/ diff --git a/CHANGELOG.md b/CHANGELOG.md index 39d0f43..77a84e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,3 @@ -### 3.4.2 +### 4.0.0 -- Fix Crash on fabric -- Removed Infested Stone for spawning \ No newline at end of file +- Updated to 1.20.4 diff --git a/build.gradle b/build.gradle index d97a25a..84be77e 100644 --- a/build.gradle +++ b/build.gradle @@ -1,71 +1,68 @@ plugins { - id("dev.nanite.mlp") version("0.0.3") - id("java") - id "me.modmuss50.mod-publish-plugin" version "0.3.0" - - id("fabric-loom") version("1.4.2") apply(false) - id 'net.neoforged.gradle' version '[6.0.18,6.2)' apply(false) + id("dev.nanite.mlp") version("0.1.1") + id("java-library") + id("maven-publish") + id("me.modmuss50.mod-publish-plugin") version "0.3.0" } + java.toolchain.languageVersion = JavaLanguageVersion.of(17) multiLoader.root() { minecraftVersion.set(project.property("minecraft_version")) modID.set(project.property("mod_id")) splitSources.set(true) + convertAccessWidener.set(true) accessWidenerFile.set(project(":common").file("src/main/resources/${mod_id}.accesswidener")) - dataGen { useFabric.set(project(":common").file("src/generated/resources")) - useForge.set(project(":forge").file("src/generated/resources")) } - } allprojects { - def isSnapshot = providers.environmentVariable('SNAPSHOT').is("true") + def isSnapshot = providers.environmentVariable("SNAPSHOT").map {it == "true"}.getOrElse(false) version = "${mod_version}+mc${minecraft_version}${isSnapshot ? '-SNAPSHOT' : ''}" setArchivesBaseName("${mod_name}-${project.name}".toLowerCase()) - group = project.property("maven_group") + group = "com.unrealdinnerbone" + + } subprojects { - apply plugin: 'dev.nanite.mlp' + + + apply plugin: 'java-library' apply plugin: 'maven-publish' + apply plugin: 'dev.nanite.mlp' - afterEvaluate { - project.sourceSets.main.resources.srcDir(project.file('src/generated/resources')) - } - base { - archivesName = "${mod_name}-${project.name}".toLowerCase() - } + sourceSets.main.resources.srcDir project.file('src/generated/resources') - tasks.withType(ProcessResources).configureEach { - outputs.upToDateWhen { false } - } + java.toolchain.languageVersion = JavaLanguageVersion.of(17) + + base { + archivesName = "${project.property("mod_name")}-${project.name}".toLowerCase() + } repositories { - mavenLocal() maven { name = "Creeperhost" url = uri("https://maven.creeperhost.net/") } maven { - name = "nanite" - url = uri("https://maven.nanite.dev/snapshots") - } - maven { - name = "UnRealDinnerbone" - url = "https://maven.unreal.codes/releases" + name = "Nanite" + url = "https://maven.nanite.dev/releases" } } + tasks.withType(ProcessResources).configureEach { + outputs.upToDateWhen { false } + } publishing { repositories { if (providers.environmentVariable("NANITE_TOKEN").isPresent()) { maven { - def isSnapshot = providers.environmentVariable('SNAPSHOT').is("true") + def isSnapshot = providers.environmentVariable("SNAPSHOT").map {it == "true"}.getOrElse(false) url "https://maven.nanite.dev/${isSnapshot ? 'snapshots' : 'releases'}" credentials { username = "nanite" @@ -75,13 +72,14 @@ subprojects { } } publications { - mavenJava(MavenPublication) { + register("mavenJava", MavenPublication) { groupId project.group artifactId project.getArchivesBaseName() } } } + } @@ -103,13 +101,17 @@ publishMods { modLoaders.add("forge") } + def neoOptions = publishOptions { + file = project.provider { project(":neo").tasks.jar }.flatMap { it.archiveFile } + displayName = "${project.name} Neo ${mod_version}+mc${minecraft_version}" + modLoaders.add("neoforge") + } + + def curseForgeOptions = curseforgeOptions { accessToken = providers.environmentVariable("CURSE_TOKEN") - projectId = project.property("curse_id") + projectId = "${curse_id}" minecraftVersions.add("${minecraft_version}") - requires { - slug = "trenzalore" - } } curseforge("curseforgeFabric") { @@ -123,5 +125,12 @@ publishMods { from(curseForgeOptions, forgeOptions) } + curseforge("curseforgeNeoForge") { + from(curseForgeOptions, neoOptions) + } + } + + + diff --git a/common/build.gradle b/common/build.gradle index 12e3d17..062535d 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -3,5 +3,5 @@ multiLoader.common() publishing.publications.mavenJava.from components.java dependencies { - implementation("com.unrealdinnerbone:trenzalore-common:${project.property("trenzalore_version")}+mc${project.property("minecraft_version")}-SNAPSHOT") + implementation("com.unrealdinnerbone:trenzalore-common:${project.property("trenzalore_version")}+mc${project.property("minecraft_version")}") } \ No newline at end of file diff --git a/common/src/generated/resources/.cache/12b48ce80665160388e37efcbe6ffc9c320247a7 b/common/src/generated/resources/.cache/12b48ce80665160388e37efcbe6ffc9c320247a7 index ca8122d..a659f66 100644 --- a/common/src/generated/resources/.cache/12b48ce80665160388e37efcbe6ffc9c320247a7 +++ b/common/src/generated/resources/.cache/12b48ce80665160388e37efcbe6ffc9c320247a7 @@ -1,2 +1,2 @@ -// 1.20.1 2023-08-20T09:33:14.6325483 Just Another Mining Dimension/Language (en_us) -4d0b94d0ebdcaaafe16d0133c0028cf20bec5a5f assets\jamd\lang\en_us.json +// 1.20.4 2023-12-31T21:15:52.9836649 Just Another Mining Dimension/Language (en_us) +d18e932526fabcfa1f61561fb911af2af2e722d2 assets\jamd\lang\en_us.json diff --git a/common/src/generated/resources/.cache/1d8aa9c5d04d534625d05e0315fa2dfc314eb45b b/common/src/generated/resources/.cache/1d8aa9c5d04d534625d05e0315fa2dfc314eb45b index c4b9207..e7bfaca 100644 --- a/common/src/generated/resources/.cache/1d8aa9c5d04d534625d05e0315fa2dfc314eb45b +++ b/common/src/generated/resources/.cache/1d8aa9c5d04d534625d05e0315fa2dfc314eb45b @@ -1,10 +1,10 @@ -// 1.20.1 2023-08-20T09:33:14.6340461 Just Another Mining Dimension/Model Definitions +// 1.20.4 2023-12-31T21:15:52.9863671 Just Another Mining Dimension/Model Definitions bf3a9f8231659d8cbc7ea68a7cdde8e3b029071f assets\jamd\blockstates\end_portal.json 7e626048016ba0c9d3b92a12b89eb0ec4d6fe677 assets\jamd\models\block\nether_portal.json 2d9db6c9191663e8106bc53141670ea054209f9a assets\jamd\models\block\portal_block.json 6b50f23823f194ff35bcec0e1694e77efd20e385 assets\jamd\blockstates\nether_portal.json c43b79f0a1988c4d812f8e77f1c7506d596430a0 assets\jamd\models\item\end_portal.json 098aa69a37ff6ca1b266436f24e891314007f976 assets\jamd\blockstates\portal_block.json -76633e08f2190391221ca5bc14b6536cda1b87a9 assets\jamd\models\item\nether_portal.json 6048ff3f9c71f641213c1d7aa6d605d9b23fed72 assets\jamd\models\block\end_portal.json +76633e08f2190391221ca5bc14b6536cda1b87a9 assets\jamd\models\item\nether_portal.json 155f13040d10cd90e514a56c4d7338c0db232883 assets\jamd\models\item\portal_block.json diff --git a/common/src/generated/resources/.cache/2a895680709e271705f445e2c6f6dbca16550c92 b/common/src/generated/resources/.cache/2a895680709e271705f445e2c6f6dbca16550c92 index 09b92ed..af4c09a 100644 --- a/common/src/generated/resources/.cache/2a895680709e271705f445e2c6f6dbca16550c92 +++ b/common/src/generated/resources/.cache/2a895680709e271705f445e2c6f6dbca16550c92 @@ -1,7 +1,7 @@ -// 1.20.1 2023-08-20T09:33:14.633546 Just Another Mining Dimension/JAMD World Data +// 1.20.4 2023-12-31T21:15:52.9851725 Just Another Mining Dimension/JAMD World Data e022cecafe8e7e93c9e3e503c46197cf1fb33450 data\jamd\dimension_type\mining.json 9493a2c0221f086efbb4263f171937a72c6d6992 data\jamd\worldgen\biome\end.json -ac9e79911103955c5e8d0b82bd377f175796afac data\jamd\worldgen\biome\mining.json +ef6de3478b3faf584bda19d292e42bf38c666765 data\jamd\worldgen\biome\mining.json 5015669d20cfba456749215c51c22bc7ace1d4b3 data\jamd\dimension_type\nether.json cbc1941a40b6da486531a2010be4e6db0866e4f4 data\jamd\dimension_type\end.json 9eb37f0889d455d2929fd947bb4667057ba1b0fe data\jamd\worldgen\biome\nether.json diff --git a/common/src/generated/resources/.cache/3803046a7d7b7ce0a060be8ae0299aa98c17094c b/common/src/generated/resources/.cache/3803046a7d7b7ce0a060be8ae0299aa98c17094c index c4a5e17..614ebb0 100644 --- a/common/src/generated/resources/.cache/3803046a7d7b7ce0a060be8ae0299aa98c17094c +++ b/common/src/generated/resources/.cache/3803046a7d7b7ce0a060be8ae0299aa98c17094c @@ -1,3 +1,3 @@ -// 1.20.1 2023-08-20T09:33:14.6345452 Just Another Mining Dimension/Tags for minecraft:block +// 1.20.4 2023-12-31T21:15:52.9866822 Just Another Mining Dimension/Tags for minecraft:block d21a5dcdd4b5cd0b493217e7e9e4aa477a755db8 data\minecraft\tags\blocks\mineable\pickaxe.json d21a5dcdd4b5cd0b493217e7e9e4aa477a755db8 data\minecraft\tags\blocks\needs_diamond_tool.json diff --git a/common/src/generated/resources/.cache/4b9da48b48cbb77fa11342e113f8c9a9cb9c99c1 b/common/src/generated/resources/.cache/4b9da48b48cbb77fa11342e113f8c9a9cb9c99c1 index 58304fb..e2004bb 100644 --- a/common/src/generated/resources/.cache/4b9da48b48cbb77fa11342e113f8c9a9cb9c99c1 +++ b/common/src/generated/resources/.cache/4b9da48b48cbb77fa11342e113f8c9a9cb9c99c1 @@ -1,7 +1,7 @@ -// 1.20.1 2023-08-20T09:33:14.6350463 Just Another Mining Dimension/Recipes -6a1227f9e0b372e3546b782215347c8c76dd6f4f data\jamd\advancements\recipes\transportation\nether_portal_block.json -be575abba95e7f591761941b8ce7b15805dd16f5 data\jamd\advancements\recipes\transportation\end_portal_block.json -64a379634715c9f4ea69b6fc5a330a0008cbb33f data\jamd\recipes\portal_block.json -351ba1cdc449781ef49cc5cdb4bfdd5bc5722a13 data\jamd\recipes\nether_portal_block.json -a202bbb60a616a623a317c3b0902f18436701002 data\jamd\recipes\end_portal_block.json -8be629b04926b089b8c6acc497e9fed86ca0ae1b data\jamd\advancements\recipes\transportation\portal_block.json +// 1.20.4 2023-12-31T21:15:52.9871834 Just Another Mining Dimension/Recipes +4d6b8136d5ff79eb4469ecbc72396d94fd25af20 data\jamd\advancements\recipes\transportation\nether_portal_block.json +20e233e25e1b3488c1d968a1230f04ef41f4e97a data\jamd\advancements\recipes\transportation\end_portal_block.json +f956a1ca3452cba931d99b28820a4e0e73ad2624 data\jamd\recipes\portal_block.json +79a197aae235dfbca7663473a2ad3e7483842e94 data\jamd\recipes\nether_portal_block.json +6893e3a682595a9cf169036ba333467142cab2ff data\jamd\recipes\end_portal_block.json +98ed8e49a380927bcf6b3bf26ccc62a8389b53e6 data\jamd\advancements\recipes\transportation\portal_block.json diff --git a/common/src/generated/resources/.cache/e360e4cfe8a52d2933ccfa99feb357854d82856f b/common/src/generated/resources/.cache/e360e4cfe8a52d2933ccfa99feb357854d82856f index 08af990..698ad3d 100644 --- a/common/src/generated/resources/.cache/e360e4cfe8a52d2933ccfa99feb357854d82856f +++ b/common/src/generated/resources/.cache/e360e4cfe8a52d2933ccfa99feb357854d82856f @@ -1,4 +1,4 @@ -// 1.20.1 2023-08-20T09:33:14.633546 Just Another Mining Dimension/Block Loot Tables +// 1.20.4 2023-12-31T21:15:52.9846687 Just Another Mining Dimension/Block Loot Tables d02ea46f3e4060ea18cb73c3b3fe1f1738d4e47c data\jamd\loot_tables\blocks\portal_block.json 8f213054226c115851779a7dd3fb5e0cfb8323f9 data\jamd\loot_tables\blocks\end_portal.json d4122e44c4d0d50740cfa507d4d05078c7163a7d data\jamd\loot_tables\blocks\nether_portal.json diff --git a/common/src/generated/resources/.cache/e579368e5ce100f0caf83470459223110b73fa16 b/common/src/generated/resources/.cache/e579368e5ce100f0caf83470459223110b73fa16 new file mode 100644 index 0000000..c8b9001 --- /dev/null +++ b/common/src/generated/resources/.cache/e579368e5ce100f0caf83470459223110b73fa16 @@ -0,0 +1,2 @@ +// 1.20.4 2023-12-31T21:15:52.9856762 Just Another Mining Dimension/Advancements +f34c43720484aabd95e66cd03d741a74ddc92be3 data\jamd\advancements\enter_mining_dimension.json diff --git a/common/src/generated/resources/assets/jamd/lang/en_us.json b/common/src/generated/resources/assets/jamd/lang/en_us.json index 1e383a9..1caaa54 100644 --- a/common/src/generated/resources/assets/jamd/lang/en_us.json +++ b/common/src/generated/resources/assets/jamd/lang/en_us.json @@ -1,4 +1,6 @@ { + "advancements.jamd.mining.description": "Enter the Mining Dimension", + "advancements.jamd.mining.title": "To Infinity and Underground", "biome.jamd.end": "End Mining", "biome.jamd.mining": "Mining", "biome.jamd.nether": "Nether Mining", diff --git a/common/src/generated/resources/data/jamd/advancements/enter_mining_dimension.json b/common/src/generated/resources/data/jamd/advancements/enter_mining_dimension.json new file mode 100644 index 0000000..6a0ecf1 --- /dev/null +++ b/common/src/generated/resources/data/jamd/advancements/enter_mining_dimension.json @@ -0,0 +1,27 @@ +{ + "criteria": { + "enter_dimension": { + "conditions": { + "to": "jamd:mining" + }, + "trigger": "minecraft:changed_dimension" + } + }, + "display": { + "description": { + "translate": "advancements.jamd.mining.description" + }, + "icon": { + "item": "jamd:portal_block" + }, + "title": { + "translate": "advancements.jamd.mining.title" + } + }, + "requirements": [ + [ + "enter_dimension" + ] + ], + "sends_telemetry_event": true +} \ No newline at end of file diff --git a/common/src/generated/resources/data/jamd/advancements/recipes/transportation/end_portal_block.json b/common/src/generated/resources/data/jamd/advancements/recipes/transportation/end_portal_block.json index 99a6d43..413360a 100644 --- a/common/src/generated/resources/data/jamd/advancements/recipes/transportation/end_portal_block.json +++ b/common/src/generated/resources/data/jamd/advancements/recipes/transportation/end_portal_block.json @@ -22,14 +22,13 @@ }, "requirements": [ [ - "has_diamond_pick", - "has_the_recipe" + "has_the_recipe", + "has_diamond_pick" ] ], "rewards": { "recipes": [ "jamd:end_portal_block" ] - }, - "sends_telemetry_event": false + } } \ No newline at end of file diff --git a/common/src/generated/resources/data/jamd/advancements/recipes/transportation/nether_portal_block.json b/common/src/generated/resources/data/jamd/advancements/recipes/transportation/nether_portal_block.json index de7dbad..a38ac15 100644 --- a/common/src/generated/resources/data/jamd/advancements/recipes/transportation/nether_portal_block.json +++ b/common/src/generated/resources/data/jamd/advancements/recipes/transportation/nether_portal_block.json @@ -22,14 +22,13 @@ }, "requirements": [ [ - "has_diamond_pick", - "has_the_recipe" + "has_the_recipe", + "has_diamond_pick" ] ], "rewards": { "recipes": [ "jamd:nether_portal_block" ] - }, - "sends_telemetry_event": false + } } \ No newline at end of file diff --git a/common/src/generated/resources/data/jamd/advancements/recipes/transportation/portal_block.json b/common/src/generated/resources/data/jamd/advancements/recipes/transportation/portal_block.json index 0a18eda..66a95c0 100644 --- a/common/src/generated/resources/data/jamd/advancements/recipes/transportation/portal_block.json +++ b/common/src/generated/resources/data/jamd/advancements/recipes/transportation/portal_block.json @@ -22,14 +22,13 @@ }, "requirements": [ [ - "has_diamond_pick", - "has_the_recipe" + "has_the_recipe", + "has_diamond_pick" ] ], "rewards": { "recipes": [ "jamd:portal_block" ] - }, - "sends_telemetry_event": false + } } \ No newline at end of file diff --git a/common/src/generated/resources/data/jamd/recipes/end_portal_block.json b/common/src/generated/resources/data/jamd/recipes/end_portal_block.json index 4dd61f9..19415c1 100644 --- a/common/src/generated/resources/data/jamd/recipes/end_portal_block.json +++ b/common/src/generated/resources/data/jamd/recipes/end_portal_block.json @@ -16,6 +16,5 @@ ], "result": { "item": "jamd:end_portal" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/common/src/generated/resources/data/jamd/recipes/nether_portal_block.json b/common/src/generated/resources/data/jamd/recipes/nether_portal_block.json index e3176f4..8e422d9 100644 --- a/common/src/generated/resources/data/jamd/recipes/nether_portal_block.json +++ b/common/src/generated/resources/data/jamd/recipes/nether_portal_block.json @@ -16,6 +16,5 @@ ], "result": { "item": "jamd:nether_portal" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/common/src/generated/resources/data/jamd/recipes/portal_block.json b/common/src/generated/resources/data/jamd/recipes/portal_block.json index 88de21a..5e5d826 100644 --- a/common/src/generated/resources/data/jamd/recipes/portal_block.json +++ b/common/src/generated/resources/data/jamd/recipes/portal_block.json @@ -16,6 +16,5 @@ ], "result": { "item": "jamd:portal_block" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/common/src/generated/resources/data/jamd/worldgen/biome/mining.json b/common/src/generated/resources/data/jamd/worldgen/biome/mining.json index 63dbe6e..fe40d42 100644 --- a/common/src/generated/resources/data/jamd/worldgen/biome/mining.json +++ b/common/src/generated/resources/data/jamd/worldgen/biome/mining.json @@ -25,6 +25,7 @@ "minecraft:ore_redstone", "minecraft:ore_redstone_lower", "minecraft:ore_diamond", + "minecraft:ore_diamond_medium", "minecraft:ore_diamond_large", "minecraft:ore_diamond_buried", "minecraft:ore_lapis", diff --git a/common/src/main/java/com/unrealdinnerbone/jamd/WorldType.java b/common/src/main/java/com/unrealdinnerbone/jamd/WorldType.java index a6dcc90..1fa0c9e 100644 --- a/common/src/main/java/com/unrealdinnerbone/jamd/WorldType.java +++ b/common/src/main/java/com/unrealdinnerbone/jamd/WorldType.java @@ -148,6 +148,14 @@ public void export(MinecraftServer server) throws IllegalStateException, IOExcep } } + public String getAdvancementTitleKey() { + return "advancements." + JAMD.MOD_ID + "." + name + ".title"; + } + + public String getAdvancementDescriptionKey() { + return "advancements." + JAMD.MOD_ID + "." + name + ".description"; + } + public List getFeatures(MinecraftServer server) { List features = new ArrayList<>(); diff --git a/common/src/main/java/com/unrealdinnerbone/jamd/world/CustomFlatLevelGeneratorSettings.java b/common/src/main/java/com/unrealdinnerbone/jamd/world/CustomFlatLevelGeneratorSettings.java index 85cebad..3b82676 100644 --- a/common/src/main/java/com/unrealdinnerbone/jamd/world/CustomFlatLevelGeneratorSettings.java +++ b/common/src/main/java/com/unrealdinnerbone/jamd/world/CustomFlatLevelGeneratorSettings.java @@ -10,11 +10,11 @@ import net.minecraft.world.level.levelgen.flat.FlatLayerInfo; import net.minecraft.world.level.levelgen.flat.FlatLevelGeneratorSettings; import net.minecraft.world.level.levelgen.placement.PlacedFeature; +import org.jetbrains.annotations.NotNull; import java.util.List; import java.util.Optional; -@SuppressWarnings("OptionalUsedAsFieldOrParameterType") public class CustomFlatLevelGeneratorSettings extends FlatLevelGeneratorSettings { public static final Codec CODEC = RecordCodecBuilder.create((instance) -> @@ -29,6 +29,7 @@ public static CustomFlatLevelGeneratorSettings create(Holder holder, List } @Override + @NotNull public BiomeGenerationSettings adjustGenerationSettings(Holder holder) { if (!holder.equals(this.biome)) { return holder.value().getGenerationSettings(); diff --git a/fabric/build.gradle b/fabric/build.gradle index 144aa56..3a3b3a0 100644 --- a/fabric/build.gradle +++ b/fabric/build.gradle @@ -3,12 +3,13 @@ multiLoader.fabric() { fabricApiVersion.set("${fabric_version}") } -publishing.publications.mavenJava.from components.java - dependencies { - modImplementation("com.unrealdinnerbone:trenzalore-fabric:${project.property("trenzalore_version")}+mc${project.property("minecraft_version")}-SNAPSHOT") + modImplementation("com.unrealdinnerbone:trenzalore-fabric:${project.property("trenzalore_version")}+mc${project.property("minecraft_version")}") } + +publishing.publications.mavenJava.from components.java + remapJar { setArchivesBaseName("${project.property("mod_name")}-${project.name}".toLowerCase()) -} +} \ No newline at end of file diff --git a/fabric/src/main/java/com/unrealdinnerbone/jamd/data/AdvancementProvider.java b/fabric/src/main/java/com/unrealdinnerbone/jamd/data/AdvancementProvider.java new file mode 100644 index 0000000..ef9b33c --- /dev/null +++ b/fabric/src/main/java/com/unrealdinnerbone/jamd/data/AdvancementProvider.java @@ -0,0 +1,38 @@ +package com.unrealdinnerbone.jamd.data; + +import com.unrealdinnerbone.jamd.JAMD; +import com.unrealdinnerbone.jamd.JAMDRegistry; +import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput; +import net.fabricmc.fabric.api.datagen.v1.provider.FabricAdvancementProvider; +import net.minecraft.advancements.Advancement; +import net.minecraft.advancements.AdvancementHolder; +import net.minecraft.advancements.AdvancementType; +import net.minecraft.advancements.critereon.ChangeDimensionTrigger; +import net.minecraft.network.chat.Component; +import net.minecraft.resources.ResourceLocation; + +import java.util.function.Consumer; + +public class AdvancementProvider extends FabricAdvancementProvider { + + protected AdvancementProvider(FabricDataOutput output) { + super(output); + } + + @Override + public void generateAdvancement(Consumer consumer) { + consumer.accept(Advancement.Builder.advancement() + .display( + JAMDRegistry.OVERWORLD.getItem().get(), + Component.translatable(JAMDRegistry.OVERWORLD.getAdvancementTitleKey()), + Component.translatable(JAMDRegistry.OVERWORLD.getAdvancementDescriptionKey()), + null, + AdvancementType.TASK, + true, + true, + false + ) + .addCriterion("enter_dimension", ChangeDimensionTrigger.TriggerInstance.changedDimensionTo(JAMDRegistry.OVERWORLD.getKey().level())) + .build(new ResourceLocation(JAMD.MOD_ID, "enter_mining_dimension"))); + } +} diff --git a/fabric/src/main/java/com/unrealdinnerbone/jamd/data/JAMDData.java b/fabric/src/main/java/com/unrealdinnerbone/jamd/data/JAMDData.java index f7639da..3af290b 100644 --- a/fabric/src/main/java/com/unrealdinnerbone/jamd/data/JAMDData.java +++ b/fabric/src/main/java/com/unrealdinnerbone/jamd/data/JAMDData.java @@ -34,6 +34,7 @@ public void onInitializeDataGenerator(FabricDataGenerator fabricDataGenerator) { pack.addProvider(ModelProvider::new); pack.addProvider(RecipeProvider::new); pack.addProvider(LootTableProvider::new); + pack.addProvider(AdvancementProvider::new); } @Override diff --git a/fabric/src/main/java/com/unrealdinnerbone/jamd/data/LangProvider.java b/fabric/src/main/java/com/unrealdinnerbone/jamd/data/LangProvider.java index 52fad85..374e7c1 100644 --- a/fabric/src/main/java/com/unrealdinnerbone/jamd/data/LangProvider.java +++ b/fabric/src/main/java/com/unrealdinnerbone/jamd/data/LangProvider.java @@ -20,5 +20,7 @@ public void generateTranslations(TranslationBuilder translationBuilder) { translationBuilder.add("biome.jamd.mining", "Mining"); translationBuilder.add("biome.jamd.nether", "Nether Mining"); translationBuilder.add("biome.jamd.end", "End Mining"); + translationBuilder.add(JAMDRegistry.OVERWORLD.getAdvancementTitleKey(), "To Infinity and Underground"); + translationBuilder.add(JAMDRegistry.OVERWORLD.getAdvancementDescriptionKey(), "Enter the Mining Dimension"); } } diff --git a/fabric/src/main/java/com/unrealdinnerbone/jamd/data/RecipeProvider.java b/fabric/src/main/java/com/unrealdinnerbone/jamd/data/RecipeProvider.java index 4d4c0e1..ad9215f 100644 --- a/fabric/src/main/java/com/unrealdinnerbone/jamd/data/RecipeProvider.java +++ b/fabric/src/main/java/com/unrealdinnerbone/jamd/data/RecipeProvider.java @@ -4,8 +4,8 @@ import com.unrealdinnerbone.jamd.JAMDRegistry; import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput; import net.fabricmc.fabric.api.datagen.v1.provider.FabricRecipeProvider; -import net.minecraft.data.recipes.FinishedRecipe; import net.minecraft.data.recipes.RecipeCategory; +import net.minecraft.data.recipes.RecipeOutput; import net.minecraft.data.recipes.ShapedRecipeBuilder; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.Items; @@ -19,7 +19,7 @@ public RecipeProvider(FabricDataOutput output) { } @Override - public void buildRecipes(Consumer exporter) { + public void buildRecipes(RecipeOutput exporter) { ShapedRecipeBuilder.shaped(RecipeCategory.TRANSPORTATION, JAMDRegistry.OVERWORLD.getBlock().get()) .pattern("OOO") .pattern("OPO") diff --git a/forge/build.gradle b/forge/build.gradle index 9024f7d..8d08ed8 100644 --- a/forge/build.gradle +++ b/forge/build.gradle @@ -2,14 +2,7 @@ multiLoader.forge() { forgeVersion.set("${forge_version}") } -publishing { - publications { - mavenJava(MavenPublication) { - from components.java - fg.component(it) - } - } -} +publishing.publications.mavenJava.artifact jar repositories { maven { @@ -22,17 +15,8 @@ repositories { dependencies { - implementation(fg.deobf("com.unrealdinnerbone:trenzalore-forge:${project.property("trenzalore_version")}+mc${project.property("minecraft_version")}-SNAPSHOT")) { + implementation(fg.deobf("com.unrealdinnerbone:trenzalore-forge:${project.property("trenzalore_version")}+mc${project.property("minecraft_version")}")) { transitive = true } - implementation fg.deobf("mekanism:Mekanism:${mekanism_version}") - minecraftLibrary("com.unrealdinnerbone:UnRealConfig-gson:12.3.4") - runtimeOnly fg.deobf("com.sunekaer.mods:ToolKit-forge:3.0.2-build.23+mc1.20.1") - runtimeOnly fg.deobf("dev.architectury:architectury-forge:9.0.8") - - +// implementation fg.deobf("mekanism:Mekanism:${mekanism_version}") } - -jar { - setArchivesBaseName("${project.property("mod_name")}-${project.name}".toLowerCase()) -} \ No newline at end of file diff --git a/forge/src/generated/resources/.cache/103d9f3f36b01595f1aa5172191e60eff02e6924 b/forge/src/generated/resources/.cache/103d9f3f36b01595f1aa5172191e60eff02e6924 deleted file mode 100644 index 2459259..0000000 --- a/forge/src/generated/resources/.cache/103d9f3f36b01595f1aa5172191e60eff02e6924 +++ /dev/null @@ -1,2 +0,0 @@ -// 1.20.1 2023-08-19T10:52:23.3247975 Registries -2eee261321d66c2b3e28de27bcf92c1a547daeb9 data/jamd/forge/biome_modifier/add_self.json diff --git a/forge/src/generated/resources/data/jamd/forge/biome_modifier/add_self.json b/forge/src/generated/resources/data/jamd/forge/biome_modifier/add_self.json deleted file mode 100644 index 0ad39a9..0000000 --- a/forge/src/generated/resources/data/jamd/forge/biome_modifier/add_self.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "type": "jamd:jamd" -} \ No newline at end of file diff --git a/forge/src/main/java/com/unrealdinnerbone/jamd/JAMDDataForge.java b/forge/src/main/java/com/unrealdinnerbone/jamd/JAMDDataForge.java index 61162e8..55dbd21 100644 --- a/forge/src/main/java/com/unrealdinnerbone/jamd/JAMDDataForge.java +++ b/forge/src/main/java/com/unrealdinnerbone/jamd/JAMDDataForge.java @@ -5,10 +5,11 @@ import net.minecraft.core.RegistrySetBuilder; import net.minecraft.data.DataProvider; import net.minecraft.data.PackOutput; +import net.minecraft.data.registries.RegistriesDatapackGenerator; +import net.minecraft.data.registries.RegistryPatchGenerator; import net.minecraft.data.worldgen.BootstapContext; import net.minecraft.resources.ResourceKey; import net.minecraft.resources.ResourceLocation; -import net.minecraftforge.common.data.DatapackBuiltinEntriesProvider; import net.minecraftforge.common.world.BiomeModifier; import net.minecraftforge.data.event.GatherDataEvent; import net.minecraftforge.registries.ForgeRegistries; @@ -32,12 +33,11 @@ private static void createBiomeModifiers(BootstapContext bootstap bootstapContext.register(ADD_SELF, JAMDBiomeModifier.INSTANCE); } - private static class BiomeModifiers extends DatapackBuiltinEntriesProvider { + private static class BiomeModifiers extends RegistriesDatapackGenerator { public BiomeModifiers(PackOutput output, CompletableFuture registries) { - super(output, registries, builder, Set.of(JAMD.MOD_ID)); + super(output, RegistryPatchGenerator.createLookup(registries, builder).thenApply(RegistrySetBuilder.PatchedRegistries::patches), Set.of(JAMD.MOD_ID)); } } - } diff --git a/forge/src/main/java/com/unrealdinnerbone/jamd/JAMDForge.java b/forge/src/main/java/com/unrealdinnerbone/jamd/JAMDForge.java index 15a3d88..c08b00b 100644 --- a/forge/src/main/java/com/unrealdinnerbone/jamd/JAMDForge.java +++ b/forge/src/main/java/com/unrealdinnerbone/jamd/JAMDForge.java @@ -1,8 +1,6 @@ package com.unrealdinnerbone.jamd; -import com.unrealdinnerbone.jamd.api.FeatureTypeRegistry; import com.unrealdinnerbone.jamd.command.JamdCommand; -import com.unrealdinnerbone.jamd.compact.MekenismOreCompact; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.RegisterCommandsEvent; import net.minecraftforge.event.server.ServerStartingEvent; @@ -19,7 +17,8 @@ public JAMDForge() { } public static void registerCompact() { - FeatureTypeRegistry.register("mekanism", MekenismOreCompact::new); + //Todo register compact +// FeatureTypeRegistry.register("mekanism", MekenismOreCompact::new); } public void onRegisterCommands(RegisterCommandsEvent event) { diff --git a/forge/src/main/java/com/unrealdinnerbone/jamd/compact/MekenismOreCompact.java b/forge/src/main/java/com/unrealdinnerbone/jamd/compact/MekenismOreCompact.java index cedae57..262cfa5 100644 --- a/forge/src/main/java/com/unrealdinnerbone/jamd/compact/MekenismOreCompact.java +++ b/forge/src/main/java/com/unrealdinnerbone/jamd/compact/MekenismOreCompact.java @@ -1,30 +1,31 @@ -package com.unrealdinnerbone.jamd.compact; - -import com.mojang.serialization.Codec; -import com.unrealdinnerbone.jamd.OresCodec; -import com.unrealdinnerbone.jamd.api.IFeatureTypeCompact; -import mekanism.common.world.ResizableOreFeatureConfig; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.world.level.levelgen.placement.PlacementModifier; - -import java.util.List; - -public class MekenismOreCompact implements IFeatureTypeCompact { - - private static final ResourceLocation FEATURE_TYPE = new ResourceLocation("mekanism", "ore"); - - @Override - public OresCodec parse(ResizableOreFeatureConfig config, List placementModifiers) { - return new OresCodec(config.size().getAsInt(), config.discardChanceOnAirExposure().getAsFloat(), placementModifiers, config.targetStates()); - } - - @Override - public Codec getCodec() { - return ResizableOreFeatureConfig.CODEC; - } - - @Override - public ResourceLocation getFeatureType() { - return FEATURE_TYPE; - } -} +//Todo Add Mekanism Support Back +//package com.unrealdinnerbone.jamd.compact; +// +//import com.mojang.serialization.Codec; +//import com.unrealdinnerbone.jamd.OresCodec; +//import com.unrealdinnerbone.jamd.api.IFeatureTypeCompact; +//import mekanism.common.world.ResizableOreFeatureConfig; +//import net.minecraft.resources.ResourceLocation; +//import net.minecraft.world.level.levelgen.placement.PlacementModifier; +// +//import java.util.List; +// +//public class MekenismOreCompact implements IFeatureTypeCompact { +// +// private static final ResourceLocation FEATURE_TYPE = new ResourceLocation("mekanism", "ore"); +// +// @Override +// public OresCodec parse(ResizableOreFeatureConfig config, List placementModifiers) { +// return new OresCodec(config.size().getAsInt(), config.discardChanceOnAirExposure().getAsFloat(), placementModifiers, config.targetStates()); +// } +// +// @Override +// public Codec getCodec() { +// return ResizableOreFeatureConfig.CODEC; +// } +// +// @Override +// public ResourceLocation getFeatureType() { +// return FEATURE_TYPE; +// } +//} diff --git a/gradle.properties b/gradle.properties index 3a90588..0fb46c9 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ # Project -mod_version=3.4.2 +mod_version=4.0.0 maven_group=com.unrealdinnerbone curse_id=422981 mod_name=JAMD @@ -8,17 +8,18 @@ mod_id=jamd # Common -minecraft_version=1.20.1 +minecraft_version=1.20.4 # Forge -forge_version=47.1.3 +forge_version=49.0.13 -# Fabric -fabric_version=0.83.1+1.20.1 -fabric_loader_version=0.14.21 +neo_version=20.4.70-beta + +fabric_version=0.91.2+1.20.4 +fabric_loader_version=0.15.1 # Other -trenzalore_version=3.3.10 +trenzalore_version=4.0.1 # Gradle org.gradle.jvmargs=-Xmx3G diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index db9a6b8..a595206 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/neo/build.gradle b/neo/build.gradle new file mode 100644 index 0000000..85f7258 --- /dev/null +++ b/neo/build.gradle @@ -0,0 +1,11 @@ +multiLoader.neo() { + neoVersion.set("${neo_version}") +} + + +dependencies { + implementation("com.unrealdinnerbone:trenzalore-neo:${project.property("trenzalore_version")}+mc${project.property("minecraft_version")}") +} + +publishing.publications.mavenJava.from components.java + diff --git a/neo/src/main/java/com/unrealdinnerbone/jamd/JAMDNeo.java b/neo/src/main/java/com/unrealdinnerbone/jamd/JAMDNeo.java new file mode 100644 index 0000000..2379374 --- /dev/null +++ b/neo/src/main/java/com/unrealdinnerbone/jamd/JAMDNeo.java @@ -0,0 +1,33 @@ +package com.unrealdinnerbone.jamd; + +import com.unrealdinnerbone.jamd.command.JamdCommand; +import net.neoforged.bus.api.IEventBus; +import net.neoforged.fml.common.Mod; +import net.neoforged.neoforge.common.NeoForge; +import net.neoforged.neoforge.event.RegisterCommandsEvent; +import net.neoforged.neoforge.event.server.ServerStartingEvent; + +@Mod(JAMD.MOD_ID) +public class JAMDNeo { + + public JAMDNeo() { + JAMD.init(); + NeoForge.EVENT_BUS.addListener(this::onRegisterCommands); + NeoForge.EVENT_BUS.addListener(this::onStart); + registerCompact(); + } + + public static void registerCompact() { + //Todo re add compact +// FeatureTypeRegistry.register("mekanism", MekenismOreCompact::new); + } + + public void onRegisterCommands(RegisterCommandsEvent event) { + JamdCommand.register(event.getDispatcher()); + } + + public void onStart(ServerStartingEvent event) { + JAMD.onServerStart(event.getServer()); + } + +} \ No newline at end of file diff --git a/neo/src/main/java/com/unrealdinnerbone/jamd/compact/MekenismOreCompact.java b/neo/src/main/java/com/unrealdinnerbone/jamd/compact/MekenismOreCompact.java new file mode 100644 index 0000000..e53ff46 --- /dev/null +++ b/neo/src/main/java/com/unrealdinnerbone/jamd/compact/MekenismOreCompact.java @@ -0,0 +1,28 @@ +//Todo Readd Support +//package com.unrealdinnerbone.jamd.compact; +// +//import com.unrealdinnerbone.jamd.OresCodec; +//import net.minecraft.resources.ResourceLocation; +//import net.minecraft.world.level.levelgen.placement.PlacementModifier; +// +//import java.util.List; +// +//public class MekenismOreCompact implements IFeatureTypeCompact { +// +// private static final ResourceLocation FEATURE_TYPE = new ResourceLocation("mekanism", "ore"); +// +// @Override +// public OresCodec parse(ResizableOreFeatureConfig config, List placementModifiers) { +// return new OresCodec(config.size().getAsInt(), config.discardChanceOnAirExposure().getAsFloat(), placementModifiers, config.targetStates()); +// } +// +// @Override +// public Codec getCodec() { +// return ResizableOreFeatureConfig.CODEC; +// } +// +// @Override +// public ResourceLocation getFeatureType() { +// return FEATURE_TYPE; +// } +//} diff --git a/neo/src/main/resources/META-INF/accesstransformer.cfg b/neo/src/main/resources/META-INF/accesstransformer.cfg new file mode 100644 index 0000000..83f2979 --- /dev/null +++ b/neo/src/main/resources/META-INF/accesstransformer.cfg @@ -0,0 +1,6 @@ +public net.minecraft.world.level.levelgen.flat.FlatLevelGeneratorSettings biome +public net.minecraft.world.level.levelgen.feature.configurations.OreConfiguration$TargetBlockState (Lnet/minecraft/world/level/levelgen/structure/templatesystem/RuleTest;Lnet/minecraft/world/level/block/state/BlockState;)V +public net.minecraft.world.level.levelgen.placement.HeightRangePlacement height +public net.minecraft.world.level.levelgen.placement.CountPlacement count +public net.minecraft.world.level.levelgen.heightproviders.ConstantHeight value +public net.minecraft.world.level.biome.BiomeGenerationSettings featureSet diff --git a/neo/src/main/resources/META-INF/mods.toml b/neo/src/main/resources/META-INF/mods.toml new file mode 100644 index 0000000..372468c --- /dev/null +++ b/neo/src/main/resources/META-INF/mods.toml @@ -0,0 +1,29 @@ +modLoader = "javafml" +loaderVersion = "[44,)" +license = "All Rights Reserved unless stated otherwise. Distribution permission is given to FeedTheBeast and CurseForge for use in modpacks" +[[mods]] +modId = "jamd" +version = "${mod_version}" +displayName = "Just Another Mining Dimension" +logoFile = "assets/jamd/logo.png" +credits = "" +authors = "UnRealDinnerbone" +description = "Adds a mining dimension to the game." +[[dependencies.jamd]] +modId = "forge" +mandatory = true +versionRange = "[44,)" +ordering = "NONE" +side = "BOTH" +[[dependencies.jamd]] +modId = "minecraft" +mandatory = true +versionRange = "[${minecraft_version}]" +ordering = "NONE" +side = "BOTH" +[[dependencies.jamd]] +modId = "trenzalore" +mandatory = true +versionRange = "[${trenzalore_version},)" +ordering = "NONE" +side = "BOTH" \ No newline at end of file diff --git a/neo/src/main/resources/META-INF/services/com.unrealdinnerbone.trenzalore.api.platform.services.IRegistry b/neo/src/main/resources/META-INF/services/com.unrealdinnerbone.trenzalore.api.platform.services.IRegistry new file mode 100644 index 0000000..f35df00 --- /dev/null +++ b/neo/src/main/resources/META-INF/services/com.unrealdinnerbone.trenzalore.api.platform.services.IRegistry @@ -0,0 +1,2 @@ +com.unrealdinnerbone.jamd.JAMDRegistry +com.unrealdinnerbone.jamd.JAMDForgeRegistry \ No newline at end of file diff --git a/settings.gradle b/settings.gradle index 062c3a4..2d10b71 100644 --- a/settings.gradle +++ b/settings.gradle @@ -12,4 +12,4 @@ pluginManagement { } } -include("common", "fabric", "forge") \ No newline at end of file +include("common", "neo", "fabric", "forge") \ No newline at end of file