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
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ jobs:
set -euo pipefail
bundle="$RUNNER_TEMP/release-input"
mkdir -p "$bundle"
cp build/libs/ModernMetals-2.5.1.112021{,-sources,-javadoc}.jar "$bundle/"
cp build/libs/ModernMetals-2.5.2.112021{,-sources,-javadoc}.jar "$bundle/"
cp build/release/SHA256SUMS CHANGELOG.txt "$bundle/"
./gradlew verifyPreparedReleaseArtifacts verifyMavenCoordinates \
-PpreparedReleaseDir="$bundle" \
Expand Down Expand Up @@ -205,9 +205,9 @@ jobs:
if-no-files-found: error
retention-days: 30
path: |
build/libs/ModernMetals-2.5.1.112021.jar
build/libs/ModernMetals-2.5.1.112021-sources.jar
build/libs/ModernMetals-2.5.1.112021-javadoc.jar
build/libs/ModernMetals-2.5.2.112021.jar
build/libs/ModernMetals-2.5.2.112021-sources.jar
build/libs/ModernMetals-2.5.2.112021-javadoc.jar
build/release/SHA256SUMS
CHANGELOG.txt

Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
2.5.2.112021 for 1.12.2

Use the published MMDLib 1.0.0-rc3 and MMD OreSpawn 4.1.6.112021.
Checked alongside Base Metals 2.6.2.112021.
Molten metal now burns on contact with the liquid surface.
Restored missing German, Russian and Simplified Chinese translations.
Fixed black backgrounds on ore overlays so the stone texture shows through.
Old 1.12.2 worlds can load past obsolete crusher recipes with empty outputs.

2.5.1.112021 for 1.12.2

- Updated the build to ForgeGradle 7 and moved Modern Metals to the ModDev Zone namespace.
Expand Down
19 changes: 12 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ Modern Metals adds industrial metals and alloys, including aluminum, chromium,
osmium and titanium. It adds their ores and molten forms, equipment, building
blocks and Crack Hammer processing.

Install Forge 14.23.5.2859, [MMDLib 1.0.0-rc2.36][mmdlib] and
[OreSpawn 4.1.3.112021][orespawn]. Modern Metals also works alongside
[Base Metals 2.6.1.112021][basemetals]. Base Metals supplies additional
For Modern Metals 2.5.2.112021, install Forge 14.23.5.2859,
[MMDLib 1.0.0-rc3][mmdlib] and
[OreSpawn 4.1.6.112021][orespawn]. Modern Metals also works alongside
[Base Metals 2.6.2.112021][basemetals]. Base Metals supplies additional
ingredients for alloys that use its steel, zinc, brass or nickel.

The Modern Metals settings are available from Forge's Mods list and OreSpawn's
Expand All @@ -20,15 +21,19 @@ Titanium is made from rutile and magnesium by default. The optional titanium
ore rule can be enabled in OreSpawn. Existing chunks keep their ores. OreSpawn
uses its native profile for new chunks and can import supported legacy files.
Back up a world and its configs before upgrading from OreSpawn 3.
Raw OreSpawn 1 files need to be converted on 1.10.2 or 1.11.2 before
moving the saved OreSpawn 4 profile to 1.12.2.

[mmdlib]: https://www.curseforge.com/minecraft/mc-mods/mmdlib/files/2712947
[orespawn]: https://maven.moddev.zone/releases/zone/moddev/mc/orespawn/OreSpawn/4.1.3.112021/
[basemetals]: https://maven.moddev.zone/releases/zone/moddev/mc/basemetals/BaseMetals/2.6.1.112021/
[mmdlib]: https://www.curseforge.com/minecraft/mc-mods/mmdlib/files/9414723
[orespawn]: https://www.curseforge.com/minecraft/mc-mods/mmd-orespawn/files/9527784
[basemetals]: https://www.curseforge.com/minecraft/mc-mods/base-metals/files/9532211

## Building

The Gradle wrapper runs on Java 17, ForgeGradle's Mavenizer uses Java 25, and
the game and compiler use Java 8. Run `./gradlew check build
the game and compiler use Java 8. Before importing into Eclipse or building,
run `python gradle/stage-legacy-dependencies.py .gradle/legacy-dependencies`
from the project root. Then run `./gradlew check build
verifyProjectResources writeReleaseChecksums prepareEclipse`. To stage a
local mirror first, run `python gradle/stage-legacy-dependencies.py <directory>`
and pass `-PlegacyDependencyVerificationRepository=<directory>` to Gradle.
Expand Down
8 changes: 4 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ mappings_version=39-1.12

mod_id=modernmetals
mod_group=zone.moddev.mc.modernmetals
mod_version=2.5.1.112021
mod_version=2.5.2.112021
mod_artifact=ModernMetals
loader_name=forge
loader_code=1
Expand All @@ -26,8 +26,8 @@ curseforge_project_id=244357
cf_requirements=mmd-orespawn,mmdlib
orespawn_curse_project_id=245586
coreplugin=zone.moddev.mc.modernmetals.compat.ModernMetalsLoadingPlugin
orespawn_version=4.1.3.112021
orespawn_version_range=[4.1.3.112021,5.0.0)
orespawn_version=4.1.6.112021
orespawn_version_range=[4.1.6.112021,5.0.0)

mmdlib_version=1.0.0-rc2.36
mmdlib_version=1.0.0-rc3
forge_installer_sha256=DBBA1CD1BF34A4B82148BAC50A6150F63FFCB2D5DC7D88A0508C27FDCFF15B76
16 changes: 8 additions & 8 deletions gradle/dependencies.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
[
{
"id": "mmdlib",
"coordinate": "curse.maven:mmdlib-261744:2712947",
"coordinate": "curse.maven:mmdlib-261744:9414723",
"repository": "https://www.cursemaven.com",
"sha256": "FE2229E6755A5FD306C33CC22DCCF055378D371339133E4912C5DC9213E360AF",
"sha256": "B35CD5A4454B03D43744EE263BD92A4B718660557C360F961B65A6303A80F88C",
"runtime": true
},
{
"id": "orespawn",
"coordinate": "zone.moddev.mc.orespawn:OreSpawn:4.1.3.112021",
"repository": "https://maven.moddev.zone/releases",
"sha256": "5B5929CCDEB055679FD6D7B9629BF94F06085A6ECD791FD08D0500F666C079DD",
"coordinate": "curse.maven:mmd-orespawn-245586:9527784",
"repository": "https://www.cursemaven.com",
"sha256": "DA6B243317E3365371C397CC9A895D108312F3437FB1797FBB5E8241525EA75F",
"runtime": true
},
{
"id": "basemetals",
"coordinate": "zone.moddev.mc.basemetals:BaseMetals:2.6.1.112021",
"repository": "https://maven.moddev.zone/releases",
"sha256": "FBAE982E308DCC1AC4281A5372560D06C8BB3A027EE290EDA4AC6875F5680FDC",
"coordinate": "curse.maven:base-metals-240967:9532211",
"repository": "https://www.cursemaven.com",
"sha256": "0CFD379FA059974E8DBA2AC743FF3E1E8E8183E48DA87BD63377E2EF0FB30312",
"runtime": false
},
{
Expand Down
6 changes: 3 additions & 3 deletions gradle/release/artifacts.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ tasks.register('verifyReleaseConfiguration') {
group = 'verification'
dependsOn tasks.named('verifyJava8Toolchain')
doLast {
if (project.group != 'zone.moddev.mc.modernmetals' || project.version != '2.5.1.112021'
if (project.group != 'zone.moddev.mc.modernmetals' || project.version != '2.5.2.112021'
|| project.minecraft_version != '1.12.2' || project.forge_version != '14.23.5.2859'
|| project.mappings_channel != 'stable' || project.mappings_version != '39-1.12') {
throw new GradleException('Modern Metals target, mappings or Maven identity changed.')
Expand All @@ -47,8 +47,8 @@ tasks.register('verifyReleaseConfiguration') {
if (!source.contains('VERSION = "' + project.version + '"') || !source.contains('MODID = "modernmetals"')) {
throw new GradleException('The mod identity differs from the build metadata.')
}
if (project.orespawn_version != '4.1.3.112021'
|| project.orespawn_version_range != '[4.1.3.112021,5.0.0)'
if (project.orespawn_version != '4.1.6.112021'
|| project.orespawn_version_range != '[4.1.6.112021,5.0.0)'
|| !source.contains('required-after:orespawn@' + project.orespawn_version_range)
|| !source.contains('required-after:forge@[14.23.5.2859,)')) {
throw new GradleException('The OreSpawn or Forge runtime requirement changed.')
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/zone/moddev/mc/modernmetals/ModernMetals.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
modid = ModernMetals.MODID,
name = ModernMetals.NAME,
version = ModernMetals.VERSION,
dependencies = "required-after:forge@[14.23.5.2859,);required-after:mmdlib@[1.0.0-rc2,2.0.0);required-after:orespawn@[4.1.3.112021,5.0.0);after:basemetals;after:tconstruct;after:conarm;before:buildingbricks",
dependencies = "required-after:forge@[14.23.5.2859,);required-after:mmdlib@[1.0.0-rc2,2.0.0);required-after:orespawn@[4.1.6.112021,5.0.0);after:basemetals;after:tconstruct;after:conarm;before:buildingbricks",
acceptedMinecraftVersions = "[1.12.2]",
updateJSON = ModernMetals.UPDATEJSON,
guiFactory = "zone.moddev.mc.modernmetals.client.ModernMetalsGuiFactory")
Expand All @@ -49,7 +49,7 @@ public class ModernMetals {
* increased whenever a change is made that has the potential to break
* compatibility with other mods that depend on this one.
*/
protected static final String VERSION = "2.5.1.112021";
protected static final String VERSION = "2.5.2.112021";

protected static final String UPDATEJSON = SharedStrings.UPDATE_JSON_URL + "ModernMetals/master/update.json";

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package zone.moddev.mc.modernmetals.block;

import com.mcmoddev.lib.block.BlockMMDOre;
import com.mcmoddev.lib.material.MMDMaterial;
import net.minecraft.util.BlockRenderLayer;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

/** Lets the stone show through the ore texture's transparent pixels. */
public final class OverlayOreBlock extends BlockMMDOre {
public OverlayOreBlock(final MMDMaterial material) {
super(material);
}

@Override
@SideOnly(Side.CLIENT)
public BlockRenderLayer getRenderLayer() {
return BlockRenderLayer.CUTOUT_MIPPED;
}
}
21 changes: 20 additions & 1 deletion src/main/java/zone/moddev/mc/modernmetals/init/Blocks.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
import com.mcmoddev.lib.data.SharedStrings;
import com.mcmoddev.lib.init.Materials;
import com.mcmoddev.lib.material.MMDMaterial;
import com.mcmoddev.lib.util.Oredicts;
import zone.moddev.mc.modernmetals.ModernMetals;
import zone.moddev.mc.modernmetals.block.OverlayOreBlock;
import zone.moddev.mc.modernmetals.data.MaterialNames;

import net.minecraft.block.Block;
Expand Down Expand Up @@ -43,13 +45,30 @@ public static void init() {
.filter(materialName -> !Materials.getMaterialByName(materialName).isEmpty())
.forEach(materialName -> {
final MMDMaterial material = Materials.getMaterialByName(materialName);
Arrays.asList(Names.BLOCK, Names.PLATE, Names.ORE, Names.BARS, Names.DOOR, Names.TRAPDOOR,
create(Names.BLOCK, material);
create(Names.PLATE, material);
createOre(material);
Arrays.asList(Names.BARS, Names.DOOR, Names.TRAPDOOR,
Names.BUTTON, Names.SLAB, Names.DOUBLE_SLAB, Names.LEVER, Names.PRESSURE_PLATE,
Names.STAIRS, Names.WALL).stream()
.forEach(name -> create(name, material));
});
}

private static void createOre(final MMDMaterial material) {
if (MaterialNames.THORIUM.equals(material.getName())) {
create(Names.ORE, material);
} else if (material.hasOre() && !material.hasBlock(Names.ORE) && isNameEnabled(Names.ORE)) {
final Block ore = addBlock(new OverlayOreBlock(material), Names.ORE, material,
ItemGroups.getTab(SharedStrings.TAB_BLOCKS));
material.addNewBlock(Names.ORE, ore);
final String prefix = getOredictFromName(Names.ORE);
if (prefix != null) {
Oredicts.registerOre(prefix + material.getCapitalizedName(), ore);
}
}
}

private static boolean filterFunc(final Block block) {
return block.getRegistryName().getNamespace().equals(ModernMetals.MODID);
}
Expand Down
38 changes: 31 additions & 7 deletions src/main/java/zone/moddev/mc/modernmetals/init/Fluids.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,19 @@

import javax.annotation.Nonnull;

import com.mcmoddev.lib.block.InteractiveFluidBlock;
import com.mcmoddev.lib.block.BlockMoltenFluid;
import com.mcmoddev.lib.data.SharedStrings;
import com.mcmoddev.lib.material.MMDMaterial;
import com.mcmoddev.lib.init.Materials;
import com.mcmoddev.lib.util.Config.Options;
import zone.moddev.mc.modernmetals.data.MaterialNames;
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;

/**
* This class initializes all fluids in Modern Metals.
Expand Down Expand Up @@ -39,16 +45,34 @@ public static void init() {
.filter(Options::isFluidEnabled).forEach(materialName -> {
final MMDMaterial material = Materials.getMaterialByName(materialName);
addFluid(material, 2000, 10000, getTemperature(materialName), 10);
material.setFluidBlockGetter(name -> new InteractiveFluidBlock(material.getFluid(), (world, entity) -> {
if (!world.isRemote) {
entity.attackEntityFrom(DamageSource.LAVA, 4.0F);
entity.setFire(4);
}
}));
material.setFluidBlockGetter(name -> new MoltenMetalBlock(material.getFluid()));
addFluidBlock(material);
});
}

private static final class MoltenMetalBlock extends BlockMoltenFluid {
MoltenMetalBlock(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 double surface = pos.getY() + getFluidHeightForRender(world, pos, world.getBlockState(pos.up()));
if (entity.getEntityBoundingBox().minY >= surface || entity.isInLava()) {
return;
}

// Minecraft handles damage once the entity enters the deeper lava contact bounds.
entity.attackEntityFrom(DamageSource.LAVA, 4.0F);
entity.setFire(15);
}
}

private static int getTemperature(@Nonnull final String name) {
switch (name) {
case MaterialNames.ALUMINUM:
Expand Down
20 changes: 20 additions & 0 deletions src/main/java/zone/moddev/mc/modernmetals/util/EventHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,28 @@
import zone.moddev.mc.modernmetals.init.Fluids;
import zone.moddev.mc.modernmetals.init.Items;
import zone.moddev.mc.modernmetals.init.Materials;
import com.google.common.collect.ImmutableSet;
import com.mcmoddev.lib.events.MMDLibRegisterBlocks;
import com.mcmoddev.lib.events.MMDLibRegisterFluids;
import com.mcmoddev.lib.events.MMDLibRegisterItems;
import com.mcmoddev.lib.events.MMDLibRegisterMaterials;
import com.mcmoddev.lib.registry.recipe.ICrusherRecipe;
import java.util.Set;

import zone.moddev.mc.modernmetals.ModernMetals;

import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.fml.common.Mod.EventBusSubscriber;
import net.minecraftforge.fml.common.eventhandler.EventPriority;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;

@EventBusSubscriber(modid=ModernMetals.MODID)
public class EventHandler {
private static final Set<String> LEGACY_EMPTY_CRUSHER_RECIPES = ImmutableSet.of(
"blocklapis_to_air", "orelapis_to_air", "blockredstone_to_air",
"oreredstone_to_air", "quartz_block_to_air", "orequartz_to_air", "stone_slab_to_air");

@SubscribeEvent
public static void mmdlibRegisterMaterials(final MMDLibRegisterMaterials event) {
Expand All @@ -40,6 +47,19 @@ public static void mmdlibRegisterFluids(final MMDLibRegisterFluids event) {
Fluids.init();
}

@SubscribeEvent(priority = EventPriority.LOWEST)
public static void onRemapLegacyCrusherRecipes(final RegistryEvent.MissingMappings<ICrusherRecipe> event) {
for (final RegistryEvent.MissingMappings.Mapping<ICrusherRecipe> mapping : event.getAllMappings()) {
// Older builds registered these empty outputs under either namespace.
final String namespace = mapping.key.getNamespace();
if (mapping.getAction() == RegistryEvent.MissingMappings.Action.DEFAULT
&& ("mmdlib".equals(namespace) || ModernMetals.MODID.equals(namespace))
&& LEGACY_EMPTY_CRUSHER_RECIPES.contains(mapping.key.getPath())) {
mapping.ignore();
}
}
}

/**
*
* @param event The Event.
Expand Down
Loading
Loading