Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 0.2.4.112021

- Updated for Building Pieces 0.3.8.112021.
- Added the missing recipe-book unlocks for crafting and rebuilding pieces.
- Made the next recipes appear while the crafting table is still open.

## 0.2.3.112021

- Updated for Building Pieces 0.3.7.112021. Matching corners can be crafted back
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ holds plant blocks, not ordinary seeds or unrelated items.
Use the versions for **Minecraft 1.12.2**, with **Forge 14.23.5.2859** and
**Java 8**. You'll need:

- **Sky's Building Pieces 0.3.7.112021** and this add-on.
- **Sky's Building Pieces 0.3.8.112021** and this add-on.
- **Biomes O' Plenty 7.0.1.2445**.

Put all three main jars in `mods` on both the client and server.
Expand Down
12 changes: 12 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -729,6 +729,11 @@ def configureEclipseBuildship = tasks.register('configureEclipseBuildship') {
'gradle.user.home': gradle.gradleUserHomeDir.canonicalPath,
'override.workspace.settings': 'true'
].each { key, value -> preferences.setProperty(key, value) }
List<String> arguments = preferences.getProperty('arguments', '').tokenize(' ')
arguments.removeAll { it.startsWith('-PbuildingPiecesCoreDir=') || it.startsWith('-PbuildingPiecesCoreVersion=') }
arguments.add('-PbuildingPiecesCoreDir=' + relativePath(coreDirectory))
if (localCoreVersion.isPresent()) arguments.add('-PbuildingPiecesCoreVersion=' + effectiveCoreVersion)
preferences.setProperty('arguments', arguments.join(' '))
preferencesFile.parentFile.mkdirs()
preferencesFile.withOutputStream { preferences.store(it, 'Generated Buildship configuration.') }
}
Expand Down Expand Up @@ -808,3 +813,10 @@ tasks.register('verifyEclipseProductionClasspath') {
tasks.named('check') {
dependsOn tasks.named('verifyReleaseMetadata')
}

apply from: 'gradle/recipe-advancements.gradle'

ext.configureRecipeBookRun = configureFromForgeRun
ext.recipeBookLogConfiguration = new File(coreDirectory, 'src/integrationTest/resources/log4j2.xml').toURI().toString()
ext.recipeBookExtraMods = configurations.bopRelease
apply from: 'gradle/recipe-book-verification.gradle'
13 changes: 12 additions & 1 deletion docs/BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Use Java 17 for Gradle and Temurin 8.0.502+7 for production. Set
`SBP_JAVA8_HOME` to the Java 8 installation. The wrapper uses Gradle 9.6.1
and ForgeGradle 7.0.34 for Minecraft 1.12.2.

Check out Building Pieces 0.3.7.112021 at the exact release commit in
Check out Building Pieces 0.3.8.112021 at the exact release commit in
`gradle/core-dependency.properties`, then run its `gradlew jar` task.
Build this add-on with:

Expand All @@ -23,3 +23,14 @@ candidate; it requires an explicit core directory and is rejected in CI.
Use `genEclipseRuns eclipse` with the same core-directory property to prepare
the IDE. Ordinary client and server launches exclude unit tests and the
build-only runtime probe. Release preparation is covered in [the release guide](RELEASING.md).

## Recipe-book resources

The build generates unlock advancements from `src/main/recipe-book/recipes.json`.
The runtime checks compare those entries with the registered recipes and exercise
inventory discovery, crafting-table discovery and recipe-book persistence.
Optional catalogue entries load only when their recipe exists.

Recipe unlocks have no shared advancement parent. Minecraft 1.12 walks that
visibility tree recursively when loading completed progress, which can overflow
with a large catalogue. The inventory and crafting unlock criteria are unchanged.
2 changes: 1 addition & 1 deletion docs/RECIPES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Crafting

Use core 0.3.7.112021 for ordinary crafting recipes. No template or cutting tool
Use core 0.3.8.112021 for ordinary crafting recipes. No template or cutting tool
is required. All ingredients must be the same material, including wood type.

- Three full blocks in a row make six horizontal slabs.
Expand Down
6 changes: 6 additions & 0 deletions docs/RELEASE-0.2.4.112021.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Recipe book update for Minecraft 1.12.2

Recipes now appear in the recipe book when you obtain their ingredients.
Crafting a piece also reveals its next cuts and recombination recipes while
the crafting table is open. Saved blocks, items and crafting quantities are
unchanged.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ release_enabled=true
curseforge_project_id=1755976
mod_name=Sky's Building Pieces - Biomes O Plenty
mod_license=LGPL-2.1-only
mod_version=0.2.3.112021
mod_version=0.2.4.112021
mod_group=zone.moddev.mc.skysbuildingpiecesbop
mod_authors=SkyBlade1978
mod_description=Biomes O Plenty building pieces with ordinary crafting recipes and optional legacy recovery. No world generation.
4 changes: 2 additions & 2 deletions gradle/core-dependency.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repository=MinecraftModDevelopmentMods/SkysBuildingPieces
commit=813de06e066d405aa55828daf3b03f56ef38afef
version=0.3.7.112021
commit=af3ce9b73d215a2f9e27a11324da56a752e4edac
version=0.3.8.112021
api=1
bop_file=3558882
bop_sha256=1C53D3EE39F557162591F618C58B79DC6861D24522EF785794EE4A815F8A3908
46 changes: 46 additions & 0 deletions gradle/recipe-advancements.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import groovy.json.JsonOutput
import groovy.json.JsonSlurper

// Recipe IDs and exact ingredient variants are checked against the live registry.
def recipeBookManifest = layout.projectDirectory.file('src/main/recipe-book/recipes.json')
def recipeBookOutput = layout.buildDirectory.dir('generated/recipe-advancements')
def generateRecipeAdvancements = tasks.register('generateRecipeAdvancements') {
inputs.file(recipeBookManifest)
outputs.dir(recipeBookOutput)
doLast {
File output = recipeBookOutput.get().asFile
delete output
List entries = new JsonSlurper().parse(recipeBookManifest.asFile) as List
Set<String> ids = new HashSet<>()
entries.each { entry ->
String recipe = entry.recipe
String owner = project.mod_id
if (entry.owner != owner || !ids.add(recipe) || entry.ingredients.isEmpty()) {
throw new GradleException("Invalid recipe-book entry: ${recipe}")
}
String path = recipe.split(':', 2)[1]
Map criteria = [:]
List<String> requirements = []
entry.ingredients.eachWithIndex { ingredient, index ->
String key = entry.ingredients.size() == 1 ? 'has_ingredient' : 'has_ingredient_' + index
criteria[key] = [trigger: 'minecraft:inventory_changed', conditions: [items: [ingredient]]]
requirements.add(key)
}
criteria.has_the_recipe = [trigger: 'minecraft:recipe_unlocked', conditions: [recipe: recipe]]
requirements.add('has_the_recipe')
// A shared parent makes 1.12 recurse through thousands of learned recipes on login.
// Independent hidden unlocks keep the same recipe-book behaviour without that recursion.
Map advancement = [rewards: [recipes: [recipe]],
criteria: criteria, requirements: [requirements]]
if (project.mod_id != 'skysgrassslabs') {
// Optional catalogues and recovery recipes must not leave phantom unlocks.
advancement.conditions = [[type: 'skysbuildingpieces:recipe_exists', recipe: recipe]]
}
File target = new File(output, "assets/${owner}/advancements/recipes/${path}.json")
target.parentFile.mkdirs()
target.setText(JsonOutput.prettyPrint(JsonOutput.toJson(advancement)) + '\n', 'UTF-8')
}
}
}
sourceSets.main.resources.srcDir(generateRecipeAdvancements)
tasks.named('processResources') { dependsOn generateRecipeAdvancements }
53 changes: 53 additions & 0 deletions gradle/recipe-book-verification.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
// Recipe-book checks get their own server runs rather than sharing one long gameplay tick.
def bookDirectory = layout.buildDirectory.dir('recipe-book-test-run')
def prepareBook = tasks.register('prepareRecipeBookTest') {
dependsOn tasks.named('integrationTestModJar')
doLast {
File directory = bookDirectory.get().asFile
if (directory.canonicalFile != new File(buildDir, 'recipe-book-test-run').canonicalFile) {
throw new GradleException('Recipe-book verification must stay inside the build directory')
}
delete directory
copy {
from tasks.named('integrationTestModJar', Jar).flatMap { it.archiveFile }
into new File(directory, 'mods')
}
new File(directory, 'eula.txt').setText('eula=true\n', 'UTF-8')
['banned-players.json', 'banned-ips.json', 'ops.json', 'whitelist.json'].each {
new File(directory, it).setText('[]\n', 'UTF-8')
}
new File(directory, 'server.properties').setText('''level-name=world
level-seed=4815162342
online-mode=false
server-ip=127.0.0.1
server-port=0
generate-structures=false
spawn-animals=false
spawn-monsters=false
max-tick-time=120000
''', 'UTF-8')
if (project.ext.has('recipeBookExtraMods')) {
copy { from project.ext.recipeBookExtraMods; into new File(directory, 'mods') }
}
}
}
def bookTasks = [:]
['fresh', 'reload'].each { phase ->
bookTasks[phase] = tasks.register('integrationRecipeBook' + phase.capitalize() + 'Process', JavaExec) {
dependsOn phase == 'fresh' ? prepareBook : bookTasks.fresh
workingDir bookDirectory
systemProperty 'skysbuildingpieces.integrationPhase', 'recipe-book-' + phase
systemProperty 'log4j.configurationFile', project.ext.recipeBookLogConfiguration
project.ext.configureRecipeBookRun(delegate, 'runServer')
doLast {
if (!new File(bookDirectory.get().asFile, 'world/recipe-book-' + phase + '.pass').isFile()) {
throw new GradleException('Recipe-book ' + phase + ' verification did not complete')
}
if (!fileTree(new File(bookDirectory.get().asFile, 'crash-reports')).isEmpty()) {
throw new GradleException('Recipe-book verification produced a crash report')
}
}
}
}
tasks.register('integrationRecipeBookTest') { dependsOn bookTasks.reload }
tasks.named('check') { dependsOn tasks.named('integrationRecipeBookTest') }
2 changes: 1 addition & 1 deletion gradle/release.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ tasks.register('verifyReleaseBundleContract') {
group = 'verification'
dependsOn tasks.named('writeReleaseChecksums')
doLast {
File bundle = layout.buildDirectory.dir('release-bundle-test').get().asFile
File bundle = layout.buildDirectory.dir("release-bundle-test/${project.version}").get().asFile
List<String> filenames = releaseFiles.get().collect { it.toString() }
copy {
from layout.buildDirectory.dir('libs')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
name = "Sky's Building Pieces - Biomes O Plenty",
version = SkysBuildingPiecesBop.VERSION,
acceptedMinecraftVersions = "[1.12.2]",
dependencies = "required-after:skysbuildingpieces@[0.3.7.112021,0.4);required-after:biomesoplenty@[7.0.1,8.0);before:buildingbricks")
dependencies = "required-after:skysbuildingpieces@[0.3.8.112021,0.4);required-after:biomesoplenty@[7.0.1,8.0);before:buildingbricks")
public final class SkysBuildingPiecesBop {
public static final String ID = "skysbuildingpiecesbop", VERSION = "0.2.3.112021";
public static final String ID = "skysbuildingpiecesbop", VERSION = "0.2.4.112021";
@Mod.Instance(ID)
public static SkysBuildingPiecesBop INSTANCE;

Expand Down
Loading
Loading