Updates backend dependencies and fixes amber random DNA implementation
This commit is contained in:
@@ -10,5 +10,5 @@ repositories {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
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.stonecutterBuild get() = extensions.getByType<StonecutterBuildExtension>()
|
||||||
val Project.stonecutterController get() = extensions.getByType<StonecutterControllerExtension>()
|
val Project.stonecutterController get() = extensions.getByType<StonecutterControllerExtension>()
|
||||||
|
|
||||||
val Project.common
|
val Project.common: Project
|
||||||
get() = requireNotNull(stonecutterBuild.node.sibling("common")) {
|
get() = rootProject.project(":common:${stonecutterBuild.current.version}")
|
||||||
"No common project for $project"
|
|
||||||
}
|
|
||||||
val Project.commonProject get() = rootProject.project(stonecutterBuild.current.project)
|
val Project.commonProject get() = rootProject.project(stonecutterBuild.current.project)
|
||||||
val Project.commonMod get() = commonProject.mod
|
val Project.commonMod get() = commonProject.mod
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ val commonResources: Configuration by configurations.creating {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
val commonPath = common.hierarchy.toString()
|
val commonPath = common.path
|
||||||
compileOnly(project(path = commonPath))
|
compileOnly(project(path = commonPath))
|
||||||
commonJava(project(path = commonPath, configuration = "commonJava"))
|
commonJava(project(path = commonPath, configuration = "commonJava"))
|
||||||
commonResources(project(path = commonPath, configuration = "commonResources"))
|
commonResources(project(path = commonPath, configuration = "commonResources"))
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
plugins {
|
plugins {
|
||||||
id("multiloader-common")
|
id("multiloader-common")
|
||||||
id("dev.architectury.loom")
|
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")
|
val is120 = project.path.contains("1.20")
|
||||||
|
|||||||
@@ -34,8 +34,8 @@ public class ModRecipeProvider {
|
|||||||
void fossilCleaning(ItemLike fossilBlock, ItemLike result, int count);
|
void fossilCleaning(ItemLike fossilBlock, ItemLike result, int count);
|
||||||
|
|
||||||
// Special cases
|
// 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) {
|
public static void registerRecipes(RecipeHelper helper) {
|
||||||
List<ItemLike> GYPSUM_COBBLESTONE_SMELTABLES = List.of(ModBlocks.GYPSUM_COBBLESTONE.get());
|
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.THESCELOSAURUS_EGG.get(), ModBlocks.INCUBATED_THESCELOSAURUS_EGG.get(), 1);
|
||||||
helper.incubating(ModBlocks.MUSSASAURUS_EGG.get(), ModBlocks.INCUBATED_MUSSASAURUS_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
|
@Override
|
||||||
public void amberRandomDNA(ItemLike testTube, ItemLike amber, ItemLike defaultDna, int count) {
|
public void amberRandomDNA(ItemLike testTube, ItemLike amber, ItemLike defaultDna, Object... weightedDnaAndCount) {
|
||||||
//? if >1.20.1 {
|
//? if >1.20.1 {
|
||||||
/*DNAExtractingRecipeBuilder.amberRandomDNAUniform(testTube, amber, defaultDna, count)
|
/*int count = getAmberRandomDNACount(weightedDnaAndCount);
|
||||||
.unlockedBy("has_amber", has(amber))
|
DNAExtractingRecipeBuilder builder = DNAExtractingRecipeBuilder.amberRandomDNAUniform(testTube, amber, defaultDna, count);
|
||||||
.save(output);
|
|
||||||
*///?} else {
|
addAmberRandomDNAWeights(builder, weightedDnaAndCount);
|
||||||
DNAExtractingRecipeBuilder.amberRandomDNAUniform(testTube, amber, defaultDna, count)
|
|
||||||
.unlockedBy("has_amber", has(amber))
|
builder.unlockedBy("has_amber", has(amber))
|
||||||
.save(output);
|
.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.name=Jurassic Revived
|
||||||
mod.id=jurassicrevived
|
mod.id=jurassicrevived
|
||||||
mod.group=net.cmr.jurassicrevived
|
mod.group=net.cmr.jurassicrevived
|
||||||
mod.version=0.224.0
|
mod.version=0.225.0
|
||||||
mod.author=CMR Team, Eli Gibbs
|
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.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
|
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
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.0-rc-1-all.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-9.5.0-bin.zip
|
||||||
networkTimeout=10000
|
|
||||||
validateDistributionUrl=true
|
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
|||||||
@@ -60,14 +60,14 @@ dependencies {
|
|||||||
|
|
||||||
|
|
||||||
legacyForge {
|
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)
|
accessTransformers.from(at.absolutePath)
|
||||||
validateAccessTransformers = true
|
validateAccessTransformers = true
|
||||||
|
|
||||||
val commonResources = project(":common").file("src/main/resources").absolutePath
|
val commonResources = project(":common").file("src/main/resources").absolutePath
|
||||||
val localResources = project.file("src/main/resources").absolutePath
|
val localResources = file("src/main/resources").absolutePath
|
||||||
val generatedResources = project.file("src/generated/resources").absolutePath
|
val generatedResources = file("src/generated/resources").absolutePath
|
||||||
|
|
||||||
fun net.neoforged.moddevgradle.dsl.RunModel.includeMixinConfigs() {
|
fun net.neoforged.moddevgradle.dsl.RunModel.includeMixinConfigs() {
|
||||||
programArguments.addAll(
|
programArguments.addAll(
|
||||||
@@ -79,19 +79,19 @@ legacyForge {
|
|||||||
runs {
|
runs {
|
||||||
register("client") {
|
register("client") {
|
||||||
client()
|
client()
|
||||||
ideName = "MinecraftForge Client (${project.path})"
|
ideName = "MinecraftForge Client (${path})"
|
||||||
logLevel = Level.TRACE
|
logLevel = Level.TRACE
|
||||||
includeMixinConfigs()
|
includeMixinConfigs()
|
||||||
}
|
}
|
||||||
register("gameTestServer") {
|
register("gameTestServer") {
|
||||||
type = "gameTestServer"
|
type = "gameTestServer"
|
||||||
ideName = "MinecraftForge GameTestServer (${project.path})"
|
ideName = "MinecraftForge GameTestServer (${path})"
|
||||||
logLevel = Level.TRACE
|
logLevel = Level.TRACE
|
||||||
includeMixinConfigs()
|
includeMixinConfigs()
|
||||||
}
|
}
|
||||||
register("data") {
|
register("data") {
|
||||||
data()
|
data()
|
||||||
ideName = "MinecraftForge Data (${project.path})"
|
ideName = "MinecraftForge Data (${path})"
|
||||||
logLevel = Level.TRACE
|
logLevel = Level.TRACE
|
||||||
programArguments.addAll(
|
programArguments.addAll(
|
||||||
"--mod", commonMod.id,
|
"--mod", commonMod.id,
|
||||||
@@ -104,7 +104,7 @@ legacyForge {
|
|||||||
}
|
}
|
||||||
register("server") {
|
register("server") {
|
||||||
server()
|
server()
|
||||||
ideName = "MinecraftForge Server (${project.path})"
|
ideName = "MinecraftForge Server (${path})"
|
||||||
logLevel = Level.TRACE
|
logLevel = Level.TRACE
|
||||||
includeMixinConfigs()
|
includeMixinConfigs()
|
||||||
}
|
}
|
||||||
|
|||||||
+30
-6
@@ -164,10 +164,34 @@ public class ForgeRecipeProvider extends RecipeProvider implements ModRecipeProv
|
|||||||
.save(output);
|
.save(output);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void amberRandomDNA(ItemLike testTube, ItemLike amber, ItemLike defaultDna, int count) {
|
public void amberRandomDNA(ItemLike testTube, ItemLike amber, ItemLike defaultDna, Object... weightedDnaAndCount) {
|
||||||
DNAExtractingRecipeBuilder.amberRandomDNAUniform(testTube, amber, defaultDna, count)
|
int count = getAmberRandomDNACount(weightedDnaAndCount);
|
||||||
.unlockedBy("has_amber", has(amber))
|
DNAExtractingRecipeBuilder builder = DNAExtractingRecipeBuilder.amberRandomDNAUniform(testTube, amber, defaultDna, count);
|
||||||
.save(output);
|
|
||||||
}
|
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 {
|
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)
|
accessTransformers.from(at.absolutePath)
|
||||||
validateAccessTransformers = true
|
validateAccessTransformers = true
|
||||||
|
|
||||||
val commonResources = project(":common").file("src/main/resources").absolutePath
|
val commonResources = project(":common").file("src/main/resources").absolutePath
|
||||||
val localResources = project.file("src/main/resources").absolutePath
|
val localResources = file("src/main/resources").absolutePath
|
||||||
val generatedResources = project.file("src/generated/resources").absolutePath
|
val generatedResources = file("src/generated/resources").absolutePath
|
||||||
|
|
||||||
runs {
|
runs {
|
||||||
register("client") {
|
register("client") {
|
||||||
client()
|
client()
|
||||||
ideName = "NeoForge Client (${project.path})"
|
ideName = "NeoForge Client (${path})"
|
||||||
}
|
}
|
||||||
if (stonecutter.eval(stonecutter.current.version, ">=1.21.4")) {
|
if (stonecutter.eval(stonecutter.current.version, ">=1.21.4")) {
|
||||||
register("clientData") {
|
register("clientData") {
|
||||||
clientData()
|
clientData()
|
||||||
ideName = "NeoForge Client Data (${project.path})"
|
ideName = "NeoForge Client Data (${path})"
|
||||||
}
|
}
|
||||||
register("serverData") {
|
register("serverData") {
|
||||||
serverData()
|
serverData()
|
||||||
ideName = "NeoForge Server Data (${project.path})"
|
ideName = "NeoForge Server Data (${path})"
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
register("data") {
|
register("data") {
|
||||||
data()
|
data()
|
||||||
ideName = "NeoForge Data (${project.path})"
|
ideName = "NeoForge Data (${path})"
|
||||||
programArguments.addAll(
|
programArguments.addAll(
|
||||||
"--mod", commonMod.id,
|
"--mod", commonMod.id,
|
||||||
"--all",
|
"--all",
|
||||||
@@ -99,7 +99,7 @@ neoForge {
|
|||||||
}
|
}
|
||||||
register("server") {
|
register("server") {
|
||||||
server()
|
server()
|
||||||
ideName = "NeoForge Server (${project.path})"
|
ideName = "NeoForge Server (${path})"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -181,12 +181,36 @@ public class NeoForgeRecipeProvider extends RecipeProvider implements ModRecipeP
|
|||||||
//?}
|
//?}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void amberRandomDNA(ItemLike testTube, ItemLike amber, ItemLike defaultDna, int count) {
|
public void amberRandomDNA(ItemLike testTube, ItemLike amber, ItemLike defaultDna, Object... weightedDnaAndCount) {
|
||||||
//? if >1.20.1 {
|
//? if >1.20.1 {
|
||||||
DNAExtractingRecipeBuilder.amberRandomDNAUniform(testTube, amber, defaultDna, count)
|
int count = getAmberRandomDNACount(weightedDnaAndCount);
|
||||||
.unlockedBy("has_amber", has(amber))
|
DNAExtractingRecipeBuilder builder = DNAExtractingRecipeBuilder.amberRandomDNAUniform(testTube, amber, defaultDna, count);
|
||||||
.save(output);
|
|
||||||
//?}
|
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 {
|
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("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) ...
|
// ... (Your version variables remain the same) ...
|
||||||
|
|||||||
Reference in New Issue
Block a user