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: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,9 @@ jobs:
if-no-files-found: error
retention-days: 30
path: |
build/libs/BaseMetals-2.6.1.112021.jar
build/libs/BaseMetals-2.6.1.112021-sources.jar
build/libs/BaseMetals-2.6.1.112021-javadoc.jar
build/libs/BaseMetals-2.6.2.112021.jar
build/libs/BaseMetals-2.6.2.112021-sources.jar
build/libs/BaseMetals-2.6.2.112021-javadoc.jar
build/release/SHA256SUMS
CHANGELOG.txt

Expand Down
12 changes: 12 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
Base Metals 2.6.2.112021 — Minecraft 1.12.2

- Updated to OreSpawn 4.1.6.112021. Install it on both the client and server.
Saved ore rules carry over when you move a world from 1.10.2 or 1.11.2,
and importing an old OreSpawn 3 config no longer replaces an existing
OreSpawn override.
- Fixed shallow molten metal so it burns on contact, just like deeper molten
metal. Mercury still behaves as before.
- The server now checks your Fantasy Level before you join and tells you
what to change if it doesn't match. Old configs without that setting
still use High Fantasy.

Base Metals 2.6.1.112021 — Minecraft 1.12.2

- Fixed recovery of mercury blocks, carbon powder, iron nuggets and metal door
Expand Down
21 changes: 13 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ Base Metals adds metals, alloys, equipment, building blocks, and the crackhammer
Crush ores into powder, smelt the powder into ingots, or combine it into alloy
blends. The metals also work with supported processing and tool-building mods.

This branch builds **2.6.1.112021** for Minecraft 1.12.2 and Forge. This update
fixes missing blocks and items when upgrading older Base Metals worlds. It
also keeps the gameplay fixes and optional Low Fantasy mode from 2.6.0. See the
[changelog](CHANGELOG.txt) for the release changes.
This branch builds **2.6.2.112021** for Minecraft 1.12.2 and Forge. I've
updated OreSpawn support so saved ore settings carry over when you move an
older world. This update also fixes shallow molten metal not burning on
contact and gives players a clear message if their Fantasy Level doesn't
match the server's. See the [changelog](CHANGELOG.txt) for the details.

## Installation

Expand All @@ -24,7 +25,8 @@ Install these mods on both the client and server:
- [MMDLib](https://www.curseforge.com/minecraft/mc-mods/mmdlib), tested with
`1.0.0-rc2.36`.
- [MMD OreSpawn](https://www.curseforge.com/minecraft/mc-mods/mmd-orespawn)
`4.1.0.112021` or newer in the 4.x line.
[`4.1.6.112021`](https://www.curseforge.com/minecraft/mc-mods/mmd-orespawn/files/9527784)
or newer in the 4.x line.
- [Base Metals](https://www.curseforge.com/minecraft/mc-mods/base-metals).

Put the jars in the instance's `mods` folder. Minecraft 1.12.2 runs on Java 8.
Expand All @@ -44,6 +46,8 @@ loss instead.

Test a complete copy of the world first. Containers and entities supplied by
other mods still need their own compatible versions and upgrade support.
When moving a world from 1.10.2 or 1.11.2, copy the whole world folder,
including `serverconfig`, to keep its saved OreSpawn rules.

## Metals and alloys

Expand Down Expand Up @@ -100,8 +104,9 @@ screen. Changes require a Minecraft restart.
It does not remove existing items or change ore generation.

An old configuration without `contentMode` still uses High Fantasy. The mode
applies to the whole Minecraft instance or server, not to one world. Clients
and servers must use the same mode.
applies to the whole Minecraft instance or server, not to one world. Use
the same Base Metals build and Fantasy Level on the client and server. If
the settings don't match, you'll see what to change before you join.

OreSpawn is the only Base Metals ore generator. Edit ore rules in OreSpawn,
not through MMDLib's old `using_orespawn` or `fallback_orespawn` switches.
Expand Down Expand Up @@ -143,7 +148,7 @@ The [build-script guide](gradle/README.md) explains the supporting scripts.
The [release guide](docs/releasing.md) covers publication from the MMD Actions tab.

Release artifacts use the Maven coordinates
`zone.moddev.mc.basemetals:BaseMetals:2.6.1.112021`. Java packages remain under
`zone.moddev.mc.basemetals:BaseMetals:2.6.2.112021`. Java packages remain under
`com.mcmoddev.basemetals`; this release does not move saved registry names.

Report bugs through the [issue tracker](https://github.com/MinecraftModDevelopmentMods/BaseMetals/issues).
Expand Down
8 changes: 4 additions & 4 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ enabled. Recipe-book unlocks operate independently of this setting.

An older `BaseMetals.cfg` without `contentMode` is treated exactly like an
explicit `high_fantasy` configuration. Unrecognized values are corrected to High
Fantasy. The mode is chosen when Minecraft starts. A client using a different
mode from the server is disconnected with an explanatory
Base Metals message before gameplay.
Fantasy. The mode is chosen when Minecraft starts. Use the same Base Metals
build and Fantasy Level on the server and client. If the settings differ,
Base Metals explains the mismatch before the player joins the world.

The mode belongs to the Minecraft instance or dedicated server, not to an
individual save. After a restart, the selected mode applies to every world
Expand All @@ -64,6 +64,6 @@ and saved-world profiles are not rewritten when the mode changes.
## OreSpawn dependency

Development, CI, and release qualification use the published OreSpawn
`4.1.0.112021` CurseForge artifact. Base Metals pins its exact CurseForge file
`4.1.6.112021` CurseForge artifact. Base Metals pins its exact CurseForge file
ID and SHA-256 and verifies the mod metadata and required client API classes
before accepting the dependency.
8 changes: 6 additions & 2 deletions docs/world-generation.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Base Metals world generation

Base Metals 2.6 requires OreSpawn 4.1.0.112021 or newer in the 4.x line.
This build requires OreSpawn 4.1.6.112021 or newer in the 4.x line.
OreSpawn is the only Base Metals ore generator. Base Metals does not register a
fallback generator.

Expand Down Expand Up @@ -48,7 +48,11 @@ OreSpawn 4 migrates `config/orespawn3/basemetals.json` into the same stable
rule IDs used by the native provider. Customized frequencies, heights and
disabled rules therefore remain associated with their Base Metals rules.
Previously generated `config/basemetals-orespawn.json` overrides also remain
valid and authoritative.
valid and take precedence over a first-time OreSpawn 3 import.

When moving a world from 1.10.2 or 1.11.2, copy the whole world folder,
including its `serverconfig` folder. OreSpawn keeps the world's saved ore
settings. Moving the world does not, by itself, regenerate existing chunks.

The legacy MMDLib settings named `using_orespawn` and `fallback_orespawn` are
not Base Metals OreSpawn 4 controls. Use the provider override or the per-world
Expand Down
8 changes: 4 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ org.gradle.parallel=false
net.minecraftforge.gradle.merge-source-sets=false

mod_group=zone.moddev.mc.basemetals
mod_version=2.6.1.112021
mod_version=2.6.2.112021

# Generic release-dispatcher metadata.
minecraft_version=1.12.2
Expand All @@ -31,9 +31,9 @@ mmdlib_version=1.0.0-rc2.36
mmdlib_sha256=FE2229E6755A5FD306C33CC22DCCF055378D371339133E4912C5DC9213E360AF

orespawn4_curse_project_id=245586
orespawn4_curse_file_id=9008120
orespawn4_version=4.1.0.112021
orespawn4_sha256=B3018214BD1A612309A78DF02C552C0948A8FCD3CF314F25D40071E8B4605670
orespawn4_curse_file_id=9527784
orespawn4_version=4.1.6.112021
orespawn4_sha256=DA6B243317E3365371C397CC9A895D108312F3437FB1797FBB5E8241525EA75F

# Rejection and migration fixture only; Base Metals no longer supports OS3.
orespawn3_curse_project_id=245586
Expand Down
2 changes: 2 additions & 0 deletions gradle/release/artifacts.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ tasks.register('verifyReleaseArtifacts') {
'com/mcmoddev/basemetals/items/ItemBaseMetalsBow.class',
// Returns the tool-material name expected by Ancient Warfare 2.
'com/mcmoddev/basemetals/items/ItemBaseMetalsHoe.class',
'com/mcmoddev/basemetals/block/BlockBaseMetalsMoltenFluid.class',
'com/mcmoddev/basemetals/items/MaterialRangedDamage.class',
// Replaces MMDLib's reference to a nonexistent bolt texture.
'com/mcmoddev/basemetals/client/renderer/RenderBaseMetalsBolt.class',
Expand All @@ -158,6 +159,7 @@ tasks.register('verifyReleaseArtifacts') {
'com/mcmoddev/basemetals/network/ClientContentModeConnectionHandler.class',
'com/mcmoddev/basemetals/network/ContentModeMessage.class',
'com/mcmoddev/basemetals/network/ContentModeNetwork.class',
'com/mcmoddev/basemetals/network/ContentModeNetwork$RejectModList.class',
'com/mcmoddev/basemetals/network/ContentModeNetwork$ServerHandler.class',
'com/mcmoddev/basemetals/recipe/ContentAcquisitionFilters.class',
'com/mcmoddev/basemetals/recipe/PlateRepairFactory.class',
Expand Down
50 changes: 35 additions & 15 deletions gradle/verification/packaged-forge-dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,15 @@ def originalArtifact = packagedForge.originalArtifact
def runtimeLogFailures = packagedForge.runtimeLogFailures
def stagePackagedForgeBase = packagedForge.stagePackagedForgeBase

// Check that OreSpawn is required and saved worldgen overrides are preserved.
// Importing an older OreSpawn file must not replace an existing override.
File existingOverrideRun = file("${buildDir}/packaged-forge-existing-override-run")
File existingOverrideMarker = new File(existingOverrideRun, 'basemetals-runtime-probe.properties')
File existingOverrideFile = new File(existingOverrideRun, 'config/basemetals-orespawn.json')
File existingOverrideLegacyFile = new File(existingOverrideRun, 'config/orespawn3/basemetals.json')
def legacyFixture = file('src/test/resources/orespawn3/basemetals-custom.json')
String ordinaryDimensions = 'orespawn:all_except_nether_end'
BigDecimal overrideNickelFrequency = 6.25
String expectedOverrideText
def prepareExistingOverride = tasks.register('preparePackagedForgeExistingOverrideRuntime') {
group = 'verification'
dependsOn releaseJar
Expand All @@ -34,9 +40,16 @@ def prepareExistingOverride = tasks.register('preparePackagedForgeExistingOverri
def explicitOverride = new JsonSlurper().parse(
file('docs/examples/basemetals-orespawn-disabled.json'))
explicitOverride.ores.each { id, rule -> rule.enabled = true }
new File(config, 'basemetals-orespawn.json').setText(
groovy.json.JsonOutput.prettyPrint(groovy.json.JsonOutput.toJson(explicitOverride))
+ System.lineSeparator(), 'UTF-8')
def nickel = explicitOverride.ores['basemetals:legacy/nickel_ore']
nickel.dimension_selectors[ordinaryDimensions].frequency = overrideNickelFrequency
expectedOverrideText = groovy.json.JsonOutput.prettyPrint(
groovy.json.JsonOutput.toJson(explicitOverride)) + System.lineSeparator()
existingOverrideFile.setText(expectedOverrideText, 'UTF-8')
copy {
from legacyFixture
into existingOverrideLegacyFile.parentFile
rename { 'basemetals.json' }
}
}
}

Expand Down Expand Up @@ -69,26 +82,33 @@ def previousExistingOverride = prepareExistingOverride
if (!existingOverrideMarker.isFile()) {
throw new GradleException("Existing OreSpawn 4 override ${phase} probe failed")
}
File override = new File(existingOverrideRun, 'config/basemetals-orespawn.json')
File worldProfile = new File(existingOverrideRun,
'world/serverconfig/orespawn-worldgen.json')
if (!override.isFile() || !worldProfile.isFile()) {
throw new GradleException('Existing OreSpawn 4 override or world snapshot is missing')
File report = new File(existingOverrideRun, 'config/orespawn-os3-migration-report.json')
if (!existingOverrideFile.isFile() || !worldProfile.isFile() || !report.isFile()) {
throw new GradleException('The OreSpawn override, migration report or world snapshot is missing')
}
def overrideJson = new JsonSlurper().parse(override)
def profile = new JsonSlurper().parse(worldProfile)
def overrideRules = overrideJson.ores.findAll { id, rule ->
id.startsWith('basemetals:legacy/')
if (existingOverrideFile.getText('UTF-8') != expectedOverrideText) {
throw new GradleException("OreSpawn 3 import rewrote the native override on ${phase}")
}
if (!existingOverrideLegacyFile.isFile() || !Arrays.equals(existingOverrideLegacyFile.bytes,
legacyFixture.bytes)) {
throw new GradleException("OreSpawn 3 import changed the original legacy file on ${phase}")
}
def profile = new JsonSlurper().parse(worldProfile)
def snapshotRules = profile.ores.findAll { id, rule ->
id.startsWith('basemetals:legacy/')
}
if (overrideRules.size() != 11 || snapshotRules.size() != 11
if (snapshotRules.size() != 11
|| !snapshotRules.every { id, rule ->
rule.enabled && rule.source_provider == 'basemetals'
}) {
throw new GradleException('Existing OreSpawn 4 override did not retain eleven stable rules')
}
def nickel = snapshotRules['basemetals:legacy/nickel_ore']
if (nickel.dimension_selectors[ordinaryDimensions]?.frequency != overrideNickelFrequency) {
throw new GradleException("OreSpawn 3 import displaced the native nickel frequency on ${phase}")
}
List<String> failures = runtimeLogFailures(existingOverrideRun)
if (!failures.isEmpty()) {
throw new GradleException("Existing OreSpawn 4 override ${phase} logged runtime failures:\n"
Expand All @@ -101,7 +121,7 @@ def previousExistingOverride = prepareExistingOverride

tasks.register('packagedForgeExistingOverrideRuntimeTest') {
group = 'verification'
description = 'Loads an existing translated OreSpawn 4 override and reloads its world snapshot.'
description = 'Checks native OreSpawn 4 override precedence on first OreSpawn 3 import and reload.'
dependsOn previousExistingOverride
}

Expand Down Expand Up @@ -148,7 +168,7 @@ tasks.register('packagedForgeMissingOreSpawnTest', Exec) {
if (!output.contains('MissingModsException')
|| !output.contains('basemetals')
|| !output.contains('orespawn')
|| !output.contains('4.1.0.112021')) {
|| !output.contains(project.orespawn4_version)) {
throw new GradleException('Missing OreSpawn 4 was not rejected by the Base Metals version contract')
}
}
Expand Down Expand Up @@ -199,7 +219,7 @@ tasks.register('packagedForgeOs3RejectionTest', Exec) {
if (!output.contains('MissingModsException')
|| !output.contains('basemetals')
|| !output.contains('orespawn')
|| !output.contains('4.1.0.112021')) {
|| !output.contains(project.orespawn4_version)) {
throw new GradleException('OreSpawn 3 was not rejected by the Base Metals version contract')
}
}
Expand Down
12 changes: 6 additions & 6 deletions gradle/verification/support.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ tasks.register('verifyReleaseConfiguration') {
description = 'Validates the complete Base Metals 1.12 release identity and dependency contract.'
dependsOn tasks.named('verifyReleaseToolchains')
doLast {
if (project.mod_version != '2.6.1.112021'
if (project.mod_version != '2.6.2.112021'
|| project.minecraft_version != '1.12.2'
|| project.forge_version != '14.23.5.2859'
|| project.mappings_channel != 'stable'
Expand Down Expand Up @@ -120,19 +120,19 @@ tasks.register('verifyReleaseConfiguration') {
throw new GradleException('Unexpected CurseForge publication contract')
}
if (dependencySpecs.mmdlib.version != '1.0.0-rc2.36'
|| dependencySpecs.orespawn4.version != '4.1.0.112021'
|| dependencySpecs.orespawn4.version != '4.1.6.112021'
|| dependencySpecs.orespawn3.version != '3.3.1.179') {
throw new GradleException('Unexpected MMDLib, OreSpawn 4, or OreSpawn 3 fixture version')
}
if (project.orespawn4_curse_project_id != '245586'
|| project.orespawn4_curse_file_id != '9008120'
|| project.orespawn4_sha256 != 'B3018214BD1A612309A78DF02C552C0948A8FCD3CF314F25D40071E8B4605670') {
|| project.orespawn4_curse_file_id != '9527784'
|| project.orespawn4_sha256 != 'DA6B243317E3365371C397CC9A895D108312F3437FB1797FBB5E8241525EA75F') {
throw new GradleException('Unexpected published OreSpawn 4.1 CurseForge artifact identity')
}
String source = file('src/main/java/com/mcmoddev/basemetals/BaseMetals.java').getText('UTF-8')
if (!source.contains('VERSION = "2.6.1.112021"')
if (!source.contains('VERSION = "2.6.2.112021"')
|| !source.contains('certificateFingerprint = ""')
|| !source.contains('required-after:orespawn@[4.1.0.112021,5.0.0)')) {
|| !source.contains("required-after:orespawn@[${project.orespawn4_version},5.0.0)")) {
throw new GradleException('Base Metals source version or unsigned fingerprint contract drifted')
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/mcmoddev/basemetals/BaseMetals.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
modid = BaseMetals.MODID,
name = BaseMetals.NAME,
version = BaseMetals.VERSION,
dependencies = "required-after:forge@[14.23.5.2859,);required-after:mmdlib;required-after:orespawn@[4.1.0.112021,5.0.0);after:tconstruct;after:conarm;after:thaumcraft;after:ic2;before:buildingbricks",
dependencies = "required-after:forge@[14.23.5.2859,);required-after:mmdlib;required-after:orespawn@[4.1.6.112021,5.0.0);after:tconstruct;after:conarm;after:thaumcraft;after:ic2;before:buildingbricks",
acceptedMinecraftVersions = "[1.12,1.12.2]",
guiFactory = "com.mcmoddev.basemetals.client.config.BaseMetalsGuiFactory",
certificateFingerprint = "",
Expand All @@ -45,7 +45,7 @@ public final class BaseMetals {
protected static final String NAME = "Base Metals";

/** Release version in the shared MMD major.minor.patch.target format. */
protected static final String VERSION = "2.6.1.112021";
protected static final String VERSION = "2.6.2.112021";

protected static final String UPDATEJSON = SharedStrings.UPDATE_JSON_URL
+ "BaseMetals/master/update.json";
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package com.mcmoddev.basemetals.block;

import com.mcmoddev.lib.block.BlockMoltenFluid;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.util.DamageSource;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.fluids.Fluid;

/** Makes shallow molten metal burn on contact. */
public final class BlockBaseMetalsMoltenFluid extends BlockMoltenFluid {
public BlockBaseMetalsMoltenFluid(final Fluid fluid) {
super(fluid);
}

@Override
public void onEntityCollision(final World world, final BlockPos pos, final IBlockState state,
final Entity entity) {
super.onEntityCollision(world, pos, state, entity);
if (world.isRemote || !(entity instanceof EntityLivingBase) || entity.isImmuneToFire()) {
return;
}

final IBlockState above = world.getBlockState(pos.up());
final double surface = pos.getY() + getFluidHeightForRender(world, pos, above);
if (entity.getEntityBoundingBox().minY >= surface || entity.isInLava()) {
return;
}

// Minecraft already handles deeper lava contact.
entity.attackEntityFrom(DamageSource.LAVA, 4.0F);
entity.setFire(15);
}
}
Loading
Loading