-
Notifications
You must be signed in to change notification settings - Fork 21
Unlock all osm.json5 configuration features #51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
d072214 to
761d608
Compare
There was a problem hiding this 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
BlockMapperclass to handle material replacements from configuration while preserving block state properties from Terra-- - Refactors
RealWorldGeneratorto useBlockDatainstead ofMaterialfor 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.
src/main/java/de/btegermany/terraplusminus/gen/RealWorldGenerator.java
Outdated
Show resolved
Hide resolved
src/main/java/de/btegermany/terraplusminus/gen/BlockMapper.java
Outdated
Show resolved
Hide resolved
src/main/java/de/btegermany/terraplusminus/gen/RealWorldGenerator.java
Outdated
Show resolved
Hide resolved
|
We should deprecate and add a warning to the old redundant options. Server Owner should switch to the osm.json way. |
761d608 to
7479de8
Compare
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.
7479de8 to
adca0bc
Compare
Support block state properties in
osm.json5The 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.json5are now kept for generation.This feature is not extended to the plugin's
config.ymlto encourage usage ofosm.json5for advanced use cases.Make Terra+- material replacement from Terra-- generation optional
Terra+- has the following configuration options :
surface_materialbuilding_outlines_materialroad_materialpath_materialThese options are used to replace blocks generated by Terra-- with what is configured in
config.yml, assuming the defaultosm.json5has 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.ymland 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.