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

Hardness and harvest level doesn't correspond #410

Closed
3 tasks done
Saturn1B opened this issue May 15, 2023 · 10 comments
Closed
3 tasks done

Hardness and harvest level doesn't correspond #410

Saturn1B opened this issue May 15, 2023 · 10 comments
Labels
bug Something isn't working

Comments

@Saturn1B
Copy link

Issue description

I've tried creating a new block of gold variant, set it's hardness value at 3 and harvest level at 2, the same as gold block, but I can still mine it with a wooden axe and much more quickly than it should be.

How to reproduce this issue?

1 - Create a project in mcreator 2023.1 with fabric generator for 1.19.2
2 - Create a new block
3 - Set it's hardness value and and harvest level in properties
4 - Save mod element
5 - Run client
6 - Constat

Operating system

Windows

Details

Mcreator version 2023.1
Generator for Fabric 1.19.2 - 0.67.1

Example workspace

https://drive.google.com/file/d/18t65xbcf8V066F08OkYbHYiqc_s1GLod/view?usp=sharing

Logs

No response

Issue tracker rule checks (please read carefully)

@Saturn1B Saturn1B added the bug Something isn't working label May 15, 2023
@Katalijst
Copy link

@Goldorion Does the same for me, I don't see any code generated related to the "Tool harvest level".
Tested on version 1.9.7

@purejosh
Copy link
Contributor

This was present in my previous report #387, and it's still present in 1.9.9. Just realized my new mod will be completely pointless to release, since it relies on mining levels to prevent progression jumps.

@purejosh
Copy link
Contributor

Additionally, I did sanity check this in Forge, and it operates with no issues. Probably a simple syntax error in the block's java file.

@Goldorion
Copy link
Owner

This was present in my previous report #387, and it's still present in 1.9.9. Just realized my new mod will be completely pointless to release, since it relies on mining levels to prevent progression jumps.

If you have the fix, you're welcome to open a PR (even if I have an idea to improve a little bit the system I think)

@purejosh
Copy link
Contributor

If I have some free time this weekend, I'll take a look at it. 👍

@purejosh
Copy link
Contributor

Mining levels in Fabric are controlled via tags.
https://fabricmc.net/wiki/tutorial:mining_levels

@Goldorion
Copy link
Owner

And this is how it's done in the generator too.

@purejosh
Copy link
Contributor

purejosh commented Oct 13, 2023

I was able to fix it. The tag folder you're putting the .json into is incorrect.

If you're using needs_diamond_tool.json, it goes in \src\main\resources\data\minecraft\tags\blocks.
If you're using needs_tool_level_N.json, it goes in \src\main\resources\data\fabric\tags\blocks.

The needs_tool_level_N tag needs to be in blocks, not in mineable. Moving the files from \src\main\resources\data\fabric\tags\blocks\mineable up one directory to \src\main\resources\data\fabric\tags\blocks and reloading the game fixed the issue.

I submitted a PR to update the yaml, to get the right directory for the tag. 🙂

image
image

@purejosh
Copy link
Contributor

purejosh commented Oct 13, 2023

In block.definition.yaml:

  - template: block/mineable_level_tag.json.ftl
    writer: json
    variables: level=0
    name: "@RESROOT/data/fabric/tags/blocks/needs_tool_level_0.json"
  - template: block/mineable_level_tag.json.ftl
    writer: json
    variables: level=1
    name: "@RESROOT/data/fabric/tags/blocks/needs_tool_level_1.json"
  - template: block/mineable_level_tag.json.ftl
    writer: json
    variables: level=2
    name: "@RESROOT/data/fabric/tags/blocks/needs_tool_level_2.json"
  - template: block/mineable_level_tag.json.ftl
    writer: json
    variables: level=3
    name: "@RESROOT/data/fabric/tags/blocks/needs_tool_level_3.json"
  - template: block/mineable_level_tag.json.ftl
    writer: json
    variables: level=4
    name: "@RESROOT/data/fabric/tags/blocks/needs_tool_level_4.json"
  - template: block/mineable_level_tag.json.ftl
    writer: json
    variables: level=5
    name: "@RESROOT/data/fabric/tags/blocks/needs_tool_level_5.json"
  - template: block/mineable_level_tag.json.ftl
    writer: json
    variables: level=6
    name: "@RESROOT/data/fabric/tags/blocks/needs_tool_level_6.json"
  - template: block/mineable_level_tag.json.ftl
    writer: json
    variables: level=7
    name: "@RESROOT/data/fabric/tags/blocks/needs_tool_level_7.json"

purejosh added a commit to purejosh/Fabric-Generator-MCreator that referenced this issue Oct 13, 2023
Changes directory for block mining level tag.
@bombaatomowa123456
Copy link

does it happen on 1.19.2 please tell me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants