Add Grass Palette Group #3481

Merged
ancientmarinerdev merged 5 commits from grass_palette_group into master 2023-03-05 13:53:48 +01:00
Contributor

This pull request adds a grass_palette group, which finally completes the trio of grass_palette, foliage_palette, and water_palette.

I also added some code for when I get to adding biome coloured potted ferns in the future.

This pull request adds a `grass_palette` group, which finally completes the trio of `grass_palette`, `foliage_palette`, and `water_palette`. I also added some code for when I get to adding biome coloured potted ferns in the future.
FossFanatic added the
nodes
API
code quality
enhancement
labels 2023-02-24 15:07:35 +01:00
Ghost force-pushed grass_palette_group from d9c5e2fcb0 to 4882324ec8 2023-02-28 04:17:20 +01:00 Compare
ancientmarinerdev reviewed 2023-03-04 21:55:37 +01:00
@ -207,3 +208,3 @@
dig_by_water = 1, destroy_by_lava_flow = 1, dig_by_piston = 1,
flammable = 2, fire_encouragement = 60, fire_flammability = 100,
plant = 1, double_plant = 1, non_mycelium_plant = 1, compostability = 65
plant = 1, double_plant = 1, non_mycelium_plant = 1, compostability = 65, grass_palette = nil

Is this safe if it remains nil?

Is this safe if it remains nil?
Author
Contributor

It should be safe, I think?

I messed around in a world on this branch and have encountered no issues so far.

The game interprets nil as 0 when it comes to groups: https://minetest.gitlab.io/minetest/groups/#usage

It should be safe, I think? I messed around in a world on this branch and have encountered no issues so far. The game interprets `nil` as `0` when it comes to groups: https://minetest.gitlab.io/minetest/groups/#usage

I wouldn't assume that from those docs:

"When not defined, the rating of a group defaults to 0."

You have defined it, so this probably isn't relevant.

"Thus when you read groups, you must interpret nil and 0 as the same value, 0."

This means we need to interpret nil and zero as the same value, it doesn't say anything about what they do. Have you tested just setting nil and trying to retrieve it? C++ is a statically typed language and it isn't as friendly as lua if you put a non int in an int unless they've wrapped that code.

I wouldn't assume that from those docs: "When not defined, the rating of a group defaults to 0." You have defined it, so this probably isn't relevant. "Thus when you read groups, you must interpret nil and 0 as the same value, 0." This means we need to interpret nil and zero as the same value, it doesn't say anything about what they do. Have you tested just setting nil and trying to retrieve it? C++ is a statically typed language and it isn't as friendly as lua if you put a non int in an int unless they've wrapped that code.
Author
Contributor

I have set the grass_palette group of grass blocks to nil just to check for any crashes, and nothing has crashed.

Or is there a different way that you want me to test this out?

I have set the `grass_palette` group of grass blocks to `nil` just to check for any crashes, and nothing has crashed. Or is there a different way that you want me to test this out?

Nah. I think that is probably fine then. Thanks for checking. It puts my mind at rest.

Nah. I think that is probably fine then. Thanks for checking. It puts my mind at rest.
Author
Contributor

No problem. I can see why some would be afraid of the usage of nil, though.

Seems to be a case of déjà vu here as well.

No problem. I can see why some would be afraid of the usage of `nil`, though. Seems to be a case of déjà vu here as well.
FossFanatic marked this conversation as resolved
ancientmarinerdev force-pushed grass_palette_group from 4882324ec8 to 261b5dda98 2023-03-05 13:45:57 +01:00 Compare
ancientmarinerdev added this to the 0.83.0 - Safe and Sound milestone 2023-03-05 13:46:01 +01:00
ancientmarinerdev approved these changes 2023-03-05 13:47:37 +01:00
ancientmarinerdev left a comment
Owner

Looks good and works.

Code quality is improving all the time and I appreciate the fact there is no merge commit in there so I can rebase.

Looks good and works. Code quality is improving all the time and I appreciate the fact there is no merge commit in there so I can rebase.
ancientmarinerdev merged commit 25aff57076 into master 2023-03-05 13:53:48 +01:00
ancientmarinerdev deleted branch grass_palette_group 2023-03-05 13:53:57 +01:00
Sign in to join this conversation.
No reviewers
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: VoxeLibre/VoxeLibre#3481
No description provided.