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 @@ -111,9 +111,9 @@ jobs:
if-no-files-found: error
retention-days: 30
path: |
build/libs/SkysGrassSlabs-1.1.2.2603002.jar
build/libs/SkysGrassSlabs-1.1.2.2603002-sources.jar
build/libs/SkysGrassSlabs-1.1.2.2603002-javadoc.jar
build/libs/SkysGrassSlabs-1.1.3.2603002.jar
build/libs/SkysGrassSlabs-1.1.3.2603002-sources.jar
build/libs/SkysGrassSlabs-1.1.3.2603002-javadoc.jar
build/release/SHA256SUMS
CHANGELOG.md

Expand Down
13 changes: 10 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
# Changelog

## 1.1.3.2603002 - Minecraft 26.3 (NeoForge)

- Fixed crashes when starting the mod or loading a world with newer NeoForge
26.3 builds. Earlier 26.3 builds still work.
- You can keep your existing worlds and `skysgrassslabs-common.toml`. Blocks,
recipes and terrain smoothing are unchanged.

## 1.1.2.2603002 - Minecraft 26.3 (NeoForge)

- Ported the accepted NeoForge release to Minecraft 26.3.
- Added the Minecraft 26.3 NeoForge build.
- Preserved blocks, recipes, configuration, world data and legacy upgrades.

## 1.1.2.2602002 - Minecraft 26.2 (NeoForge)
Expand All @@ -13,7 +20,7 @@
## 1.1.1.2602002 - Minecraft 26.2 (NeoForge)

- Added the NeoForge 26.2 build with the same blocks, recipes, world
smoothing and upgrade support as the accepted 26.1.2 build.
smoothing and upgrade support as the 26.1.2 build.
- Updated grass light checks, carpet references and recipe-book displays for
Minecraft 26.2.
- Retained translated names for all four items in 18 language variants.
Expand Down Expand Up @@ -81,7 +88,7 @@

## 1.0.1.118021 - Minecraft 1.18.2

- Brought the accepted dirt, grass and dirt path slabs, turf and terrain
- Brought dirt, grass and dirt path slabs, turf and terrain
smoothing forward to Minecraft 1.18.2.
- Kept both slab orientations, waterlogging, snowy caps, path alignment,
grass spreading, turf recipes and sheep interaction.
Expand Down
49 changes: 28 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,47 @@
# Sky's Grass Slabs

Sky's Grass Slabs adds dirt, grass and lowered dirt path slabs, along with a
thin layer of turf. Grass spreads naturally between full blocks and slabs,
while new Overworld terrain uses grass slabs to soften suitable one block
steps.
Sky's Grass Slabs adds dirt, grass and lowered dirt path slabs, plus a thin
layer of turf. Grass spreads between blocks, slabs and turf, and grass slabs
soften one block steps in newly generated Overworld terrain.

This branch is for Minecraft 26.3. Version `1.1.2.2603002` requires NeoForge
26.3.0.1-beta and Java 25.
This branch is for Minecraft 26.3. Version `1.1.3.2603002` requires NeoForge
26.3.0.1-beta or a compatible newer 26.3 build, and Java 25.

## Installation

Place the mod jar in the `mods` folder. It must be installed on both the client
and server for multiplayer. Back up an existing world before adding, removing
or updating world changing mods.

## Highlights

- Place dirt, grass and dirt path slabs in either half of a block.
- Combine two matching slabs into the corresponding vanilla block.
- Let grass spread between full blocks, slabs and turf.
- Use a shovel on dirt or grass slabs to create lowered dirt path slabs.
- Cut turf from grass without consuming the shovel.
- Let sheep eat turf and regrow their wool.
- Add grass slabs to suitable slopes in newly generated Overworld chunks.
- Display biome colours and snowy edges that match the surrounding terrain.
- Use standard Minecraft waterlogging behaviour on slabs.
- Use translated names in 18 supported language variants.
- Recover selected grass slabs and grass carpet when replacing a compatible
older mod.
## Using the mod

- Place slabs in either half of a block. Two matching slabs combine into the
corresponding vanilla block.
- Use a shovel on dirt or grass slabs to make a dirt path slab.
- Craft grass and a shovel into turf. The shovel is returned unchanged.
- Let sheep eat turf to regrow their wool.

Grass follows the surrounding biome colour, and slabs show snow when it is
nearby. Slabs can also be waterlogged. Block names are translated into 18
language variants.

World smoothing affects new chunks only and can be turned off in the config.
The mod can also recover supported slabs and grass carpet from older mods;
read the upgrade guide before removing one from an existing world.

## This update

Version `1.1.3.2603002` fixes crashes when starting the mod or loading a world
with newer NeoForge 26.3 builds. Earlier 26.3 builds still work. You can keep
your existing worlds and `skysgrassslabs-common.toml`; no settings need to be
changed.

## Guides

- [Gameplay and recipes](docs/GAMEPLAY.md)
- [Configuration](docs/CONFIGURATION.md)
- [Upgrading an older world](docs/WORLD-UPGRADES.md)
- [Release notes](docs/RELEASE-1.1.2.2603002.md)
- [Release notes](docs/RELEASE-1.1.3.2603002.md)

## License

Expand Down
11 changes: 8 additions & 3 deletions docs/CONFIGURATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ first time. Stop the game or server before editing it, then restart to apply
changes. On a dedicated server, the server's configuration controls world
generation and world upgrades.

Newer NeoForge 26.3 builds call this configuration scope `LOCAL` rather than
`COMMON`. The file remains `skysgrassslabs-common.toml`; existing settings do
not need to be moved or recreated.

When upgrading from an earlier release, the mod copies valid settings from
`skysgrassslabs.cfg` if the TOML file does not already exist. The old file is
kept. An existing TOML file always takes priority.
Expand Down Expand Up @@ -46,9 +50,10 @@ the other legacy replacement option.

## Related game rules

Turf and grass behaviour use Minecraft random ticks. Setting `randomTickSpeed`
to zero pauses spreading, grass decay and delayed turf support checks.
Turf and grass behaviour use Minecraft random ticks. Setting
`minecraft:random_tick_speed` to zero pauses spreading, grass decay and delayed
turf support checks.

Sheep respect the `mobGriefing` game rule. With mob griefing enabled they eat
Sheep respect the `minecraft:mob_griefing` game rule. With mob griefing enabled they eat
and remove turf without a drop. With it disabled they can still perform their
normal eating behaviour and regrow wool, but the turf remains.
2 changes: 1 addition & 1 deletion docs/GAMEPLAY.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Turf spreads grass to nearby dirt and dirt slabs. Placing turf directly on a
dirt slab consumes the turf and changes the slab into a grass slab without
changing whether it is in the top or bottom half.

Sheep can eat turf and regrow their wool. Turf eaten while `mobGriefing` is
Sheep can eat turf and regrow their wool. Turf eaten while `minecraft:mob_griefing` is
enabled is removed without dropping an item.

## Crafting
Expand Down
11 changes: 11 additions & 0 deletions docs/RELEASE-1.1.3.2603002.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Sky's Grass Slabs 1.1.3 for Minecraft 26.3

This update fixes crashes when starting the mod or loading a world with
newer NeoForge 26.3 builds. Earlier 26.3 builds still work.

You can keep your existing worlds and `skysgrassslabs-common.toml`. No
settings need to be changed, and blocks, recipes and terrain smoothing work
as before.

Requires Minecraft 26.3, NeoForge 26.3.0.1-beta or a compatible newer 26.3
build, and Java 25.
2 changes: 1 addition & 1 deletion docs/WORLD-UPGRADES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ world has been checked in game.

## Sky's Grass Slabs content

Install `SkysGrassSlabs-1.1.2.2603002.jar` before opening a world that used an
Install `SkysGrassSlabs-1.1.3.2603002.jar` before opening a world that used an
earlier release. The permanent dirt slab, grass slab, path slab and turf IDs
are unchanged.

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ mod_name=Sky's Grass Slabs
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
mod_license=LGPL-2.1-only
# The mod version. See https://semver.org/
mod_version=1.1.2.2603002
mod_version=1.1.3.2603002
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
# This should match the base package used for the mod sources.
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
import net.minecraft.world.level.levelgen.Heightmap;
import net.minecraft.world.level.levelgen.placement.PlacedFeature;
import net.neoforged.neoforge.registries.NeoForgeRegistries;
import net.neoforged.neoforge.common.world.BiomeModifier.Phase;
import net.neoforged.neoforge.common.world.ModifiableBiomeInfo.BiomeInfo;
import zone.moddev.mc.skysgrassslabs.SkysGrassSlabs;
import zone.moddev.mc.skysgrassslabs.init.ModBlocks;
import zone.moddev.mc.skysgrassslabs.world.GrassSlabSmoothingFeature;
Expand Down Expand Up @@ -40,6 +42,46 @@ public static void smoothingIsFirstVegetationFeature(GameTestHelper helper) {
helper.succeed();
}

public static void bothModifierSignaturesPreservePhaseOrderAndDeduplication(GameTestHelper helper) {
var biome = helper.getLevel().getBiome(helper.absolutePos(BlockPos.ZERO));
var value = biome.value();
var original = new BiomeInfo(value.getModifiedClimateSettings(), value.getAttributes(),
value.getModifiedSpecialEffects(), value.getGenerationSettings());
var key = biome.unwrapKey().orElseThrow();
var legacy = BiomeInfo.Builder.copyOf(key, original);
var current = BiomeInfo.Builder.copyOf(key, original);
var step = GenerationStep.Decoration.VEGETAL_DECORATION;
for (var builder : java.util.List.of(legacy, current)) {
builder.getGenerationSettings().getFeatures(step).removeIf(feature ->
feature.value().feature().value() instanceof GrassSlabSmoothingFeature);
}
var before = java.util.List.copyOf(current.getGenerationSettings().getFeatures(step));
var modifier = zone.moddev.mc.skysgrassslabs.world.SmoothingBiomeModifier.INSTANCE;
for (Phase phase : Phase.values()) {
if (phase == Phase.AFTER_EVERYTHING) {
continue;
}
modifier.modify(biome, phase, legacy);
modifier.modify(helper.getLevel().registryAccess(), biome, phase, current);
require(helper, legacy.getGenerationSettings().getFeatures(step).equals(before)
&& current.getGenerationSettings().getFeatures(step).equals(before),
"a nonfinal phase changed vegetation features");
}
modifier.modify(biome, Phase.AFTER_EVERYTHING, legacy);
modifier.modify(helper.getLevel().registryAccess(), biome, Phase.AFTER_EVERYTHING, current);
var expected = java.util.List.copyOf(legacy.getGenerationSettings().getFeatures(step));
require(helper, current.getGenerationSettings().getFeatures(step).equals(expected),
"the two loader entry points changed feature order");
require(helper, expected.size() == before.size() + 1
&& expected.getFirst().value().feature().value() instanceof GrassSlabSmoothingFeature,
"smoothing was not inserted exactly once at index zero");
modifier.modify(helper.getLevel().registryAccess(), biome, Phase.AFTER_EVERYTHING, current);
modifier.modify(biome, Phase.AFTER_EVERYTHING, current);
require(helper, current.getGenerationSettings().getFeatures(step).equals(expected),
"repeat calls duplicated the smoothing feature");
helper.succeed();
}

public static void smoothingIsBorderSafeAndIdempotent(GameTestHelper helper) {
ChunkPos owner = ChunkPos.containing(helper.absolutePos(new BlockPos(1, 2, 1)));
int y = 120;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "minecraft:function",
"environment": "minecraft:default",
"function": "skysgrassslabs:worldgen/both_modifier_signatures_preserve_phase_order_and_deduplication",
"max_ticks": 100,
"structure": "minecraft:empty"
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public final class SkysGrassSlabs {
/** Stable mod identifier and resource namespace. */
public static final String MOD_ID = "skysgrassslabs";
public static final String NAME = "Sky's Grass Slabs";
public static final String VERSION = "1.1.2.2603002";
public static final String VERSION = "1.1.3.2603002";
public static final Logger LOGGER = LogManager.getLogger();

/** Registers content, configuration, world generation, and persistent state. */
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package zone.moddev.mc.skysgrassslabs.config;

import net.neoforged.fml.config.ModConfig;

/** Keeps the same local configuration scope across the NeoForge 26.3 rename. */
final class NeoForgeConfigType {
private NeoForgeConfigType() {
}

static ModConfig.Type local() {
// Resolve names at runtime so one jar supports both loader versions.
try {
return ModConfig.Type.valueOf("LOCAL");
} catch (IllegalArgumentException missingLocalName) {
return ModConfig.Type.valueOf("COMMON");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import java.util.List;
import org.apache.commons.lang3.tuple.Pair;
import net.neoforged.neoforge.common.ModConfigSpec;
import net.neoforged.fml.config.ModConfig;
import net.neoforged.fml.loading.FMLPaths;
import net.neoforged.fml.ModContainer;
import zone.moddev.mc.skysgrassslabs.SkysGrassSlabs;
Expand All @@ -32,7 +31,7 @@ public final class SkysGrassSlabsConfig {
}

public static void register(ModContainer container) {
container.registerConfig(ModConfig.Type.COMMON, SPEC, FILE_NAME);
container.registerConfig(NeoForgeConfigType.local(), SPEC, FILE_NAME);
}

public static void migrateLegacyConfig() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.mojang.serialization.MapCodec;
import java.util.List;
import net.minecraft.core.Holder;
import net.minecraft.core.RegistryAccess;
import net.minecraft.tags.BiomeTags;
import net.minecraft.world.level.biome.Biome;
import net.minecraft.world.level.levelgen.GenerationStep;
Expand Down Expand Up @@ -34,6 +35,12 @@ public void modify(Holder<Biome> biome, Phase phase, BiomeInfo.Builder builder)
}
}

/** Newer NeoForge builds provide registry access alongside the biome. */
public void modify(RegistryAccess registries, Holder<Biome> biome,
Phase phase, BiomeInfo.Builder builder) {
modify(biome, phase, builder);
}

@Override
public MapCodec<? extends BiomeModifier> codec() {
return CODEC;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ public void playerAndMaintainerDocumentsExist() {
assertTrue(Files.isRegularFile(Path.of("docs/GAMEPLAY.md")));
assertTrue(Files.isRegularFile(Path.of("docs/WORLD-UPGRADES.md")));
assertFalse(Files.exists(Path.of("docs/REPOSITORY.md")));
assertTrue(Files.isRegularFile(Path.of("docs/RELEASE-1.1.2.2603002.md")));
assertTrue(Files.isRegularFile(Path.of("docs/RELEASE-1.1.3.2603002.md")));
assertTrue(Files.isRegularFile(Path.of("docs/BETA-0.2.0.118021.md")));
}

@Test
public void releaseIdentityAndLicenseAreStable() throws Exception {
String properties = Files.readString(Path.of("gradle.properties"), StandardCharsets.UTF_8);
assertTrue(properties.contains("mod_version=1.1.2.2603002"));
assertTrue(properties.contains("mod_version=1.1.3.2603002"));
assertTrue(properties.contains("mod_license=LGPL-2.1-only"));
assertEquals("LGPL-2.1-only", Files.readString(Path.of("LICENSE.spdx"), StandardCharsets.UTF_8).trim());
assertTrue(Files.readString(Path.of("NOTICE"), StandardCharsets.UTF_8)
Expand Down Expand Up @@ -117,7 +117,7 @@ public void commonConfigAndWorldStateUsePermanentKeys() throws Exception {
assertTrue(config.contains("push(\"compat\")"));
assertTrue(config.contains("define(FORCE_REPLACE_BUILDINGBRICKS_SLABS, false)"));
assertTrue(config.contains("define(FORCE_REPLACE_GRASS_SLABS_MOD_CONTENT, false)"));
assertTrue(main.contains("VERSION = \"1.1.2.2603002\""));
assertTrue(main.contains("VERSION = \"1.1.3.2603002\""));
assertTrue(state.contains("skysgrassslabs_world_state"));
assertTrue(state.contains("SCHEMA_VERSION = 1"));
assertTrue(state.contains("schema_version"));
Expand Down Expand Up @@ -302,9 +302,9 @@ public void continuousIntegrationTargetsTheStableBranchAndArtifacts() throws Exc
}
String ci = Files.readString(Path.of(".github/workflows/ci.yml"),
StandardCharsets.UTF_8);
assertTrue(ci.contains("SkysGrassSlabs-1.1.2.2603002.jar"));
assertTrue(ci.contains("SkysGrassSlabs-1.1.2.2603002-sources.jar"));
assertTrue(ci.contains("SkysGrassSlabs-1.1.2.2603002-javadoc.jar"));
assertTrue(ci.contains("SkysGrassSlabs-1.1.3.2603002.jar"));
assertTrue(ci.contains("SkysGrassSlabs-1.1.3.2603002-sources.jar"));
assertTrue(ci.contains("SkysGrassSlabs-1.1.3.2603002-javadoc.jar"));
assertTrue(ci.contains("if-no-files-found: error"));
assertTrue(ci.contains("java-version: '25.0.3+9.0.LTS'"));
assertTrue(ci.contains("--offline --no-daemon"));
Expand Down
Loading
Loading