Updates backend dependencies and fixes amber random DNA implementation
This commit is contained in:
@@ -10,5 +10,5 @@ repositories {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation("dev.kikugie:stonecutter:0.7.11")
|
||||
implementation("dev.kikugie:stonecutter:0.9.5")
|
||||
}
|
||||
@@ -10,10 +10,9 @@ fun Project.prop(key: String): String? = findProperty(key)?.toString()
|
||||
val Project.stonecutterBuild get() = extensions.getByType<StonecutterBuildExtension>()
|
||||
val Project.stonecutterController get() = extensions.getByType<StonecutterControllerExtension>()
|
||||
|
||||
val Project.common
|
||||
get() = requireNotNull(stonecutterBuild.node.sibling("common")) {
|
||||
"No common project for $project"
|
||||
}
|
||||
val Project.common: Project
|
||||
get() = rootProject.project(":common:${stonecutterBuild.current.version}")
|
||||
|
||||
val Project.commonProject get() = rootProject.project(stonecutterBuild.current.project)
|
||||
val Project.commonMod get() = commonProject.mod
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ val commonResources: Configuration by configurations.creating {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
val commonPath = common.hierarchy.toString()
|
||||
val commonPath = common.path
|
||||
compileOnly(project(path = commonPath))
|
||||
commonJava(project(path = commonPath, configuration = "commonJava"))
|
||||
commonResources(project(path = commonPath, configuration = "commonResources"))
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
plugins {
|
||||
id("multiloader-common")
|
||||
id("dev.architectury.loom")
|
||||
id("architectury-plugin") version "3.4.162"
|
||||
id("architectury-plugin") version "3.5.166"
|
||||
}
|
||||
|
||||
val is120 = project.path.contains("1.20")
|
||||
|
||||
@@ -34,8 +34,8 @@ public class ModRecipeProvider {
|
||||
void fossilCleaning(ItemLike fossilBlock, ItemLike result, int count);
|
||||
|
||||
// Special cases
|
||||
void amberRandomDNA(ItemLike testTube, ItemLike amber, ItemLike defaultDna, int count);
|
||||
}
|
||||
void amberRandomDNA(ItemLike testTube, ItemLike amber, ItemLike defaultDna, Object... weightedDnaAndCount);
|
||||
}
|
||||
|
||||
public static void registerRecipes(RecipeHelper helper) {
|
||||
List<ItemLike> GYPSUM_COBBLESTONE_SMELTABLES = List.of(ModBlocks.GYPSUM_COBBLESTONE.get());
|
||||
@@ -646,6 +646,14 @@ public class ModRecipeProvider {
|
||||
helper.incubating(ModBlocks.THESCELOSAURUS_EGG.get(), ModBlocks.INCUBATED_THESCELOSAURUS_EGG.get(), 1);
|
||||
helper.incubating(ModBlocks.MUSSASAURUS_EGG.get(), ModBlocks.INCUBATED_MUSSASAURUS_EGG.get(), 1);
|
||||
|
||||
helper.amberRandomDNA(ModItems.TEST_TUBE.get(), ModItems.MOSQUITO_IN_AMBER.get(), ModItems.FROG_DNA.get(), 1);
|
||||
helper.amberRandomDNA(
|
||||
ModItems.TEST_TUBE.get(),
|
||||
ModItems.MOSQUITO_IN_AMBER.get(),
|
||||
ModItems.FROG_DNA.get(),
|
||||
ModItems.INDORAPTOR_DNA.get(), 0.0,
|
||||
ModItems.INDOMINUS_REX_DNA.get(), 0.0,
|
||||
ModItems.DISTORTUS_REX_DNA.get(), 0.0,
|
||||
1
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -285,16 +285,44 @@ public class FabricRecipeProvider extends net.fabricmc.fabric.api.datagen.v1.pro
|
||||
//?}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void amberRandomDNA(ItemLike testTube, ItemLike amber, ItemLike defaultDna, int count) {
|
||||
//? if >1.20.1 {
|
||||
/*DNAExtractingRecipeBuilder.amberRandomDNAUniform(testTube, amber, defaultDna, count)
|
||||
.unlockedBy("has_amber", has(amber))
|
||||
.save(output);
|
||||
*///?} else {
|
||||
DNAExtractingRecipeBuilder.amberRandomDNAUniform(testTube, amber, defaultDna, count)
|
||||
.unlockedBy("has_amber", has(amber))
|
||||
.save(output);
|
||||
//?}
|
||||
}
|
||||
@Override
|
||||
public void amberRandomDNA(ItemLike testTube, ItemLike amber, ItemLike defaultDna, Object... weightedDnaAndCount) {
|
||||
//? if >1.20.1 {
|
||||
/*int count = getAmberRandomDNACount(weightedDnaAndCount);
|
||||
DNAExtractingRecipeBuilder builder = DNAExtractingRecipeBuilder.amberRandomDNAUniform(testTube, amber, defaultDna, count);
|
||||
|
||||
addAmberRandomDNAWeights(builder, weightedDnaAndCount);
|
||||
|
||||
builder.unlockedBy("has_amber", has(amber))
|
||||
.save(output);
|
||||
*///?} else {
|
||||
int count = getAmberRandomDNACount(weightedDnaAndCount);
|
||||
DNAExtractingRecipeBuilder builder = DNAExtractingRecipeBuilder.amberRandomDNAUniform(testTube, amber, defaultDna, count);
|
||||
|
||||
addAmberRandomDNAWeights(builder, weightedDnaAndCount);
|
||||
|
||||
builder.unlockedBy("has_amber", has(amber))
|
||||
.save(output);
|
||||
//?}
|
||||
}
|
||||
|
||||
private static int getAmberRandomDNACount(Object... weightedDnaAndCount) {
|
||||
if (weightedDnaAndCount.length == 0 || !(weightedDnaAndCount[weightedDnaAndCount.length - 1] instanceof Number count)) {
|
||||
throw new IllegalArgumentException("amberRandomDNA requires the final argument to be the recipe count");
|
||||
}
|
||||
return count.intValue();
|
||||
}
|
||||
|
||||
private static void addAmberRandomDNAWeights(DNAExtractingRecipeBuilder builder, Object... weightedDnaAndCount) {
|
||||
if ((weightedDnaAndCount.length - 1) % 2 != 0) {
|
||||
throw new IllegalArgumentException("amberRandomDNA weights must be provided as ItemLike, weight pairs before the count");
|
||||
}
|
||||
|
||||
for (int i = 0; i < weightedDnaAndCount.length - 1; i += 2) {
|
||||
if (!(weightedDnaAndCount[i] instanceof ItemLike dnaItem) || !(weightedDnaAndCount[i + 1] instanceof Number weight)) {
|
||||
throw new IllegalArgumentException("amberRandomDNA weights must be provided as ItemLike, weight pairs before the count");
|
||||
}
|
||||
builder.addDNAWeight(dnaItem, weight.intValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@ fabric.loom.multiProjectOptimisation=true
|
||||
mod.name=Jurassic Revived
|
||||
mod.id=jurassicrevived
|
||||
mod.group=net.cmr.jurassicrevived
|
||||
mod.version=0.224.0
|
||||
mod.version=0.225.0
|
||||
mod.author=CMR Team, Eli Gibbs
|
||||
mod.description=A Minecraft mod that brings dinosaurs back to life using ancient DNA and modern technology\nBreed, study, and build your own prehistoric park with a wide variety of creatures...
|
||||
mod.license=CC-BY-ND-4.0
|
||||
|
||||
+2
-3
@@ -1,7 +1,6 @@
|
||||
#Tue Jun 09 09:04:12 EDT 2026
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.0-rc-1-all.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.5.0-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
||||
@@ -60,14 +60,14 @@ dependencies {
|
||||
|
||||
|
||||
legacyForge {
|
||||
val at = project.file("build/resources/main/META-INF/accesstransformer.cfg");
|
||||
val at = file("build/resources/main/META-INF/accesstransformer.cfg");
|
||||
|
||||
accessTransformers.from(at.absolutePath)
|
||||
validateAccessTransformers = true
|
||||
|
||||
val commonResources = project(":common").file("src/main/resources").absolutePath
|
||||
val localResources = project.file("src/main/resources").absolutePath
|
||||
val generatedResources = project.file("src/generated/resources").absolutePath
|
||||
val localResources = file("src/main/resources").absolutePath
|
||||
val generatedResources = file("src/generated/resources").absolutePath
|
||||
|
||||
fun net.neoforged.moddevgradle.dsl.RunModel.includeMixinConfigs() {
|
||||
programArguments.addAll(
|
||||
@@ -79,19 +79,19 @@ legacyForge {
|
||||
runs {
|
||||
register("client") {
|
||||
client()
|
||||
ideName = "MinecraftForge Client (${project.path})"
|
||||
ideName = "MinecraftForge Client (${path})"
|
||||
logLevel = Level.TRACE
|
||||
includeMixinConfigs()
|
||||
}
|
||||
register("gameTestServer") {
|
||||
type = "gameTestServer"
|
||||
ideName = "MinecraftForge GameTestServer (${project.path})"
|
||||
ideName = "MinecraftForge GameTestServer (${path})"
|
||||
logLevel = Level.TRACE
|
||||
includeMixinConfigs()
|
||||
}
|
||||
register("data") {
|
||||
data()
|
||||
ideName = "MinecraftForge Data (${project.path})"
|
||||
ideName = "MinecraftForge Data (${path})"
|
||||
logLevel = Level.TRACE
|
||||
programArguments.addAll(
|
||||
"--mod", commonMod.id,
|
||||
@@ -104,7 +104,7 @@ legacyForge {
|
||||
}
|
||||
register("server") {
|
||||
server()
|
||||
ideName = "MinecraftForge Server (${project.path})"
|
||||
ideName = "MinecraftForge Server (${path})"
|
||||
logLevel = Level.TRACE
|
||||
includeMixinConfigs()
|
||||
}
|
||||
|
||||
+30
-6
@@ -164,10 +164,34 @@ public class ForgeRecipeProvider extends RecipeProvider implements ModRecipeProv
|
||||
.save(output);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void amberRandomDNA(ItemLike testTube, ItemLike amber, ItemLike defaultDna, int count) {
|
||||
DNAExtractingRecipeBuilder.amberRandomDNAUniform(testTube, amber, defaultDna, count)
|
||||
.unlockedBy("has_amber", has(amber))
|
||||
.save(output);
|
||||
}
|
||||
@Override
|
||||
public void amberRandomDNA(ItemLike testTube, ItemLike amber, ItemLike defaultDna, Object... weightedDnaAndCount) {
|
||||
int count = getAmberRandomDNACount(weightedDnaAndCount);
|
||||
DNAExtractingRecipeBuilder builder = DNAExtractingRecipeBuilder.amberRandomDNAUniform(testTube, amber, defaultDna, count);
|
||||
|
||||
addAmberRandomDNAWeights(builder, weightedDnaAndCount);
|
||||
|
||||
builder.unlockedBy("has_amber", has(amber))
|
||||
.save(output);
|
||||
}
|
||||
|
||||
private static int getAmberRandomDNACount(Object... weightedDnaAndCount) {
|
||||
if (weightedDnaAndCount.length == 0 || !(weightedDnaAndCount[weightedDnaAndCount.length - 1] instanceof Number count)) {
|
||||
throw new IllegalArgumentException("amberRandomDNA requires the final argument to be the recipe count");
|
||||
}
|
||||
return count.intValue();
|
||||
}
|
||||
|
||||
private static void addAmberRandomDNAWeights(DNAExtractingRecipeBuilder builder, Object... weightedDnaAndCount) {
|
||||
if ((weightedDnaAndCount.length - 1) % 2 != 0) {
|
||||
throw new IllegalArgumentException("amberRandomDNA weights must be provided as ItemLike, weight pairs before the count");
|
||||
}
|
||||
|
||||
for (int i = 0; i < weightedDnaAndCount.length - 1; i += 2) {
|
||||
if (!(weightedDnaAndCount[i] instanceof ItemLike dnaItem) || !(weightedDnaAndCount[i + 1] instanceof Number weight)) {
|
||||
throw new IllegalArgumentException("amberRandomDNA weights must be provided as ItemLike, weight pairs before the count");
|
||||
}
|
||||
builder.addDNAWeight(dnaItem, weight.intValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,33 +61,33 @@ dependencies {
|
||||
}
|
||||
|
||||
neoForge {
|
||||
val at = project.file("build/resources/main/META-INF/accesstransformer.cfg");
|
||||
val at = file("build/resources/main/META-INF/accesstransformer.cfg");
|
||||
|
||||
accessTransformers.from(at.absolutePath)
|
||||
validateAccessTransformers = true
|
||||
|
||||
val commonResources = project(":common").file("src/main/resources").absolutePath
|
||||
val localResources = project.file("src/main/resources").absolutePath
|
||||
val generatedResources = project.file("src/generated/resources").absolutePath
|
||||
val localResources = file("src/main/resources").absolutePath
|
||||
val generatedResources = file("src/generated/resources").absolutePath
|
||||
|
||||
runs {
|
||||
register("client") {
|
||||
client()
|
||||
ideName = "NeoForge Client (${project.path})"
|
||||
ideName = "NeoForge Client (${path})"
|
||||
}
|
||||
if (stonecutter.eval(stonecutter.current.version, ">=1.21.4")) {
|
||||
register("clientData") {
|
||||
clientData()
|
||||
ideName = "NeoForge Client Data (${project.path})"
|
||||
ideName = "NeoForge Client Data (${path})"
|
||||
}
|
||||
register("serverData") {
|
||||
serverData()
|
||||
ideName = "NeoForge Server Data (${project.path})"
|
||||
ideName = "NeoForge Server Data (${path})"
|
||||
}
|
||||
} else {
|
||||
register("data") {
|
||||
data()
|
||||
ideName = "NeoForge Data (${project.path})"
|
||||
ideName = "NeoForge Data (${path})"
|
||||
programArguments.addAll(
|
||||
"--mod", commonMod.id,
|
||||
"--all",
|
||||
@@ -99,7 +99,7 @@ neoForge {
|
||||
}
|
||||
register("server") {
|
||||
server()
|
||||
ideName = "NeoForge Server (${project.path})"
|
||||
ideName = "NeoForge Server (${path})"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -181,12 +181,36 @@ public class NeoForgeRecipeProvider extends RecipeProvider implements ModRecipeP
|
||||
//?}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void amberRandomDNA(ItemLike testTube, ItemLike amber, ItemLike defaultDna, int count) {
|
||||
//? if >1.20.1 {
|
||||
DNAExtractingRecipeBuilder.amberRandomDNAUniform(testTube, amber, defaultDna, count)
|
||||
.unlockedBy("has_amber", has(amber))
|
||||
.save(output);
|
||||
//?}
|
||||
}
|
||||
@Override
|
||||
public void amberRandomDNA(ItemLike testTube, ItemLike amber, ItemLike defaultDna, Object... weightedDnaAndCount) {
|
||||
//? if >1.20.1 {
|
||||
int count = getAmberRandomDNACount(weightedDnaAndCount);
|
||||
DNAExtractingRecipeBuilder builder = DNAExtractingRecipeBuilder.amberRandomDNAUniform(testTube, amber, defaultDna, count);
|
||||
|
||||
addAmberRandomDNAWeights(builder, weightedDnaAndCount);
|
||||
|
||||
builder.unlockedBy("has_amber", has(amber))
|
||||
.save(output);
|
||||
//?}
|
||||
}
|
||||
|
||||
private static int getAmberRandomDNACount(Object... weightedDnaAndCount) {
|
||||
if (weightedDnaAndCount.length == 0 || !(weightedDnaAndCount[weightedDnaAndCount.length - 1] instanceof Number count)) {
|
||||
throw new IllegalArgumentException("amberRandomDNA requires the final argument to be the recipe count");
|
||||
}
|
||||
return count.intValue();
|
||||
}
|
||||
|
||||
private static void addAmberRandomDNAWeights(DNAExtractingRecipeBuilder builder, Object... weightedDnaAndCount) {
|
||||
if ((weightedDnaAndCount.length - 1) % 2 != 0) {
|
||||
throw new IllegalArgumentException("amberRandomDNA weights must be provided as ItemLike, weight pairs before the count");
|
||||
}
|
||||
|
||||
for (int i = 0; i < weightedDnaAndCount.length - 1; i += 2) {
|
||||
if (!(weightedDnaAndCount[i] instanceof ItemLike dnaItem) || !(weightedDnaAndCount[i + 1] instanceof Number weight)) {
|
||||
throw new IllegalArgumentException("amberRandomDNA weights must be provided as ItemLike, weight pairs before the count");
|
||||
}
|
||||
builder.addDNAWeight(dnaItem, weight.intValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -19,9 +19,9 @@ pluginManagement {
|
||||
}
|
||||
|
||||
plugins {
|
||||
id("dev.kikugie.stonecutter") version "0.7.11"
|
||||
id("dev.kikugie.stonecutter") version "0.9.5"
|
||||
id("org.gradle.toolchains.foojay-resolver-convention") version "1.0.0"
|
||||
id("dev.architectury.loom") version "1.9.436" apply false
|
||||
id("dev.architectury.loom") version "1.14.476" apply false
|
||||
}
|
||||
|
||||
// ... (Your version variables remain the same) ...
|
||||
|
||||
Reference in New Issue
Block a user