Skip to content
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

Allow Deepslate Hardness to be configured in the blocks config. #501

Merged
merged 12 commits into from
Aug 9, 2024

Conversation

Wmaxlees
Copy link

@Wmaxlees Wmaxlees commented Aug 6, 2024

Adds a new int config in the blocksitems.cfg file that allows modifying how hard deepslate is. Designed for people that like the look of deepslate but don't want to deal with the additional hardness introduced in their caves.

@Wmaxlees
Copy link
Author

Wmaxlees commented Aug 6, 2024

Created in reference to this comment: GTNewHorizons/GT-New-Horizons-Modpack#16436 (comment)

@Roadhog360
Copy link
Owner

Needs work needs to be a float multiplier instead of an int, this also applies to none of the other deepslate blocks. Tiles, bricks, ore all need work, and it needs to be multiplier based.

@Wmaxlees
Copy link
Author

Wmaxlees commented Aug 7, 2024

Updated to a float instead of an int. The stairs, bricks, slabs, etc are all based off of cobbled deepslate. Do you suggest I make cobbled deepslate hardness (and its derivatives) configurable as well? My interpretation of the request is that people may not want to deal with longer mining because they hit the deepslate layer, which cobbled deepslate wouldn't affect.

The deepslate ore is 1.5x the configured hardness so is already multiplier based.

@Roadhog360
Copy link
Owner

Updated to a float instead of an int. The stairs, bricks, slabs, etc are all based off of cobbled deepslate. Do you suggest I make cobbled deepslate hardness (and its derivatives) configurable as well? My interpretation of the request is that people may not want to deal with longer mining because they hit the deepslate layer, which cobbled deepslate wouldn't affect.

Yeah, but changing the hardness for just one block in the set wouldn't make any sense. Your config value is still not multiplier based as far as I can understand. The default value should produce the same hardness as vanilla.

The deepslate ore is 1.5x the configured hardness so is already multiplier based.

You seem to misunderstand my request. I'm saying your change should be a float multiplier that allows this specific value to be configured, and it'd change the other ones to be multiplier-based in the same way. 1.5 = vanilla deepslate 1 = stone

@Roadhog360
Copy link
Owner

This has been planned for a while anyways. If my communication on how this feature should function is insufficient, I can always just do it myself.

@Wmaxlees
Copy link
Author

Wmaxlees commented Aug 7, 2024

Ahh I understand now. Thanks for clarifying. Okay so I've compiled a list of all the deepslate blocks and their stone counterparts.

It seems like the best option based on these comparisons is to base all Deepslate hardnesses on the stone block specifically (maybe that's what you're already suggesting).

So all of the hardnesses except for Deepslate would be:

hardness = x * 1.5f

where x is the configurable multiplier and its default value is 2.3333333f.

And then specifically for Deepslate,

hardness = x * 0.857f * 1.5f = x * 1.2855f

Sound like what you were planning?

Item Vanilla Hardness Stone Version Stone Version Hardness Multiple of Stone Version Multiple of Stone Block Diff
Deepslate 3.0 Stone 1.5 2 2 1.5
Cobbled Deepslate 3.5 Cobblestone 2.0 1.75 2.33 1.5
Polished Deepslate 3.5 Smooth Stone 2.0 1.75 2.33 1.5
Deepslate Bricks 3.5 Stone Bricks 3.0 1.167 2.33 0.5
Deepslate Slab 3.5 Stone Slab 2.0 1.75 2.33 1.5
Deepslate Brick Slab 3.5 Stone Brick Slab 2.0 1.75 2.33 1.5
Cobbled Deepslate Stairs 3.5 Cobblestone Stairs 2.0 1.75 2.33 1.5
Polished Deepslate Stairs 3.5 Stone Stairs 1.5 2.33 2.33 2
Deepslate Brick Stairs 3.5 Stone Brick Stairs 1.5 2.33 2.33 2
Cobbled Deepslate Wall 3.5 Cobblestone Wall 2.0 1.75 2.33 1.5
Deepslate Brick Wall 3.5 Stone Brick Wall 1.5 2.33 2.33 2
Polished Deepslate Wall 3.5 ?? Stone Brick Wall ?? 1.5 2.33 2.33 2
Deepslate Tile Wall 3.5 ?? Stone Brick Wall ?? 1.5 2.33 2.33 2

@Roadhog360
Copy link
Owner

The problem is we need to figure out how to make them all just one multiplier. It would be quite bloated to have so many different values in the config file for the same feature.

@Wmaxlees
Copy link
Author

Wmaxlees commented Aug 7, 2024

Submitted a change. Let me know what you think. We still have just one config option. The math I wrote above is just part of the code.

@Roadhog360
Copy link
Owner

I think you misunderstood what I meant. I meant configuring the * 1.5 multiplier, not the base hardness. And I have been attempting to theory craft a way where * 1.5 would produce the default values currently in the mod, whereas 0 would produce values identical to the base blocks. We might have to multiply the multiplier, perhaps? Who knows.

The reason why the current suggested solution doesn't work is because it doesn't have a predictable effect on every deepslate block. Your defaults also no longer match the hardnesses in vanilla. It also has no effect on any of the deepslate ores seemingly. The current proposed changes modify the hardness values from vanilla and do not have a consistent effect across all deepslate, and isn't really clear to the player exactly what happens when it's modified, since 2.333333 is a weird value.

@Wmaxlees
Copy link
Author

Wmaxlees commented Aug 7, 2024

Another option would just be to have a flag.

So instead of deepslateHardness, we can just use useStoneHardnessForDeepslate

And then still just hardcode the hardness for whether that's enabled or not. Then we don't have to deal with any math.

eg:

// BlockDeepslate.java
this.setHardness(ConfigBlocksItems.useStoneHardnessForDeepslate ? 1.5 : 3.0);

// ModBlocks.java
COBBLED_DEEPSLATE(ConfigBlocksItems.enableDeepslate, new BaseBlock(Material.rock).setNames("cobbled_deepslate")
			.setBlockSound(ModSounds.soundDeepslate).setHardness(ConfigBlocksItems.useStoneHardnessForDeepslate ? 2.0 : 3.5).setResistance(6).setCreativeTab(EtFuturum.creativeTabBlocks)),

WDYT?

@Roadhog360
Copy link
Owner

Roadhog360 commented Aug 7, 2024

I think this is acceptable. Realistically if we made it multiplier based people would probably use 1.5 or 1, making it a flag is a good idea. There are mods that allow adjusting of hardnesses of other mods' blocks so people should use that if they need other values.

I think your idea is probably the best solution. Also should be in functions.cfg btw

Also you can remoce the ?? around deepslate tiles = stone bricks, I think this is an acceptable comparison. Their stone hardness value should be equivalent to whatever stone bricks get.

@Roadhog360
Copy link
Owner

Looks good. All that's left are the multipliers on the ores, and I can merge it

@Wmaxlees
Copy link
Author

Wmaxlees commented Aug 8, 2024

Sounds good. Tried to make some modifications for ores. Just tested it and it's not working, though. Will take another look soon

@Roadhog360
Copy link
Owner

What were you held up on? If you show your failed approaches I will do what I can to spot what went wrong.

@Wmaxlees
Copy link
Author

Wmaxlees commented Aug 8, 2024

Done. Hardness is working with ores now as well.

@Roadhog360
Copy link
Owner

Why the err.println?

@Wmaxlees
Copy link
Author

Wmaxlees commented Aug 8, 2024

Deleted. It was a leftover debug logging I missed deleting.

@Roadhog360
Copy link
Owner

Roadhog360 commented Aug 8, 2024

Looks good at a glance. I'll give it one final review after I get home from work. Thanks for working with me on this and being willing to discuss so many different approaches. Good work.

@Roadhog360 Roadhog360 merged commit 6a85865 into Roadhog360:master Aug 9, 2024
1 check passed
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