Skip to content

Conversation

@SmylerMC
Copy link
Contributor

@SmylerMC SmylerMC commented Oct 27, 2025

Support block state properties in osm.json5

The world generator previously only kept the materials from the block states generated by Terra--, when it supports properties as well. This made it impossible, for example, to generate waterlogged stairs or persistent leaves.

This is now fixed and properties specified in osm.json5 are now kept for generation.

This feature is not extended to the plugin's config.yml to encourage usage of osm.json5 for advanced use cases.

Make Terra+- material replacement from Terra-- generation optional

Terra+- has the following configuration options :

  • surface_material
  • building_outlines_material
  • road_material
  • path_material

These options are used to replace blocks generated by Terra-- with what is configured in config.yml, assuming the default osm.json5 has not been modified. This means there are effectively two ways to configure the same thing, both of which can break the other.

This PR deprecates the previously mentioned configuration options, removing them from the default config.yml and logging warning on server start when they are being used.

This switches the default generation for new Terra+- installation to the same style as Terra++, leaving existing installation untouched until the warning is addressed by the server operator.

Other changes

Light cleanup in RealWorldGenerator.

@SmylerMC SmylerMC force-pushed the feat/unlock-osm-json5 branch 2 times, most recently from d072214 to 761d608 Compare November 15, 2025 17:02
@SmylerMC SmylerMC marked this pull request as ready for review November 15, 2025 17:28
@Zoriot Zoriot mentioned this pull request Dec 5, 2025
10 tasks
@Zoriot Zoriot requested review from Zoriot and Copilot December 5, 2025 22:30
@Zoriot Zoriot added this to the v1.6.0 milestone Dec 5, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends Terra-- block state support in osm.json5 to preserve block properties during generation, and makes the Terra+- material replacement behavior optional by allowing config values to be omitted or set to null.

  • Introduces BlockMapper class to handle material replacements from configuration while preserving block state properties from Terra--
  • Refactors RealWorldGenerator to use BlockData instead of Material for better property support
  • Removes deprecated helper method and cleans up unused code

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
src/main/java/de/btegermany/terraplusminus/gen/BlockMapper.java New class implementing a builder pattern to map Terra-- block states to Bukkit block data with optional material replacements from config
src/main/java/de/btegermany/terraplusminus/gen/RealWorldGenerator.java Refactored to use BlockMapper and BlockData for preserving block state properties; added @OverRide annotations and cleaned up unused methods
src/main/java/de/btegermany/terraplusminus/utils/ConfigurationHelper.java Removed getMaterial helper method that is no longer needed with the new BlockMapper approach

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Zoriot
Copy link
Collaborator

Zoriot commented Dec 5, 2025

We should deprecate and add a warning to the old redundant options. Server Owner should switch to the osm.json way.

@Zoriot Zoriot removed this from the v1.6.0 milestone Jan 1, 2026
@Zoriot Zoriot removed the enhancement label Jan 1, 2026
@SmylerMC SmylerMC force-pushed the feat/unlock-osm-json5 branch from 761d608 to 7479de8 Compare January 2, 2026 17:13
Did not work, and if they did, they would have caused issues due to confusions between surface and ground.
Also cleanups RealWorldGenerator.
This commit removes the 'building_outlines_material', 'road_material' and 'path_material' options from the default configuration and warns server administrators that use them.

That means any new installation of the plugin will now fully use osm.json5 and therefore have the same generation as Terra++ (bricks, gray concrete and grass paths for building outlines, roads, and paths respectively).

Any older installation with an existing config file containing the deprecated options will keep generating the same and log warnings on server startups encouraging server admins to make modifications to osm.json5. If the config options still use the old default value, generation will use bricks, gray concrete powder and moss blocks.

The surface_material config option is left untouched as it does not conflict with osm.json5, despite having its own problems.
@SmylerMC SmylerMC force-pushed the feat/unlock-osm-json5 branch from 7479de8 to adca0bc Compare January 3, 2026 15:01
@SmylerMC
Copy link
Contributor Author

SmylerMC commented Jan 3, 2026

Rebased, and added adca0bc to actually deprecate the config options in conflict with osm.json5 as asked by @Zoriot .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants