Harvest Levels do not work higher than 4
jsabol opened this issue · 4 comments
Versions
- Silent Gear: 1.18.2-2.10.16
- Silent's Gems: N/A
- Silent Lib: 1.18.2-6.2.0
- Forge: 1802.3.6-build.140
- Modpack: All The Mods 7 0.4.32
- Optifine Installed: No
Expected Behavior
I created a datapack to add new materials based on the allthemods ores (allthemodium, vibranium, unobtainium). I expect to be able to set a harvest_level
of 5, 6, and 7 and harvest ATM ores with my Silent Gear tools according to those levels.
Actual Behavior
The tools I added with my datapack (harvest level 5, 6, 7) do not register as able to mine the associated ores (allthemodium, vibranium, unobtainium). The One Probe shows that the tools will not work, and as you would expect, the ores take a long time to break and do not drop anything.
Links/Images
- My datapack I was working on creating: SGear-Allthemodium.zip
- Image where you can see my allthemodium paxel cannot mine vibranium
- Code where the ATM modpack sets up the 5, 6, and 7th level tiers at: ToolTiers.java
- In my investigation, I noticed that GearHelper.java uses this switch in getTier when checking if a block is breakable, which only returns vanilla tiers.
Steps to Reproduce the Problem
- Download the SGear-Allthemodium.zip and install as a resource pack and datapack
- Make an allthemodium, vibranium, and unobtainium paxel.
- Attempt to break vibranium ore with any of the three tools. It will not work. Attempt to break the unobtainium ore with vibranium or unobtainium. It will not work.
This issue should be resolved in version 3.6.0 and higher (Minecraft 1.20.1). Materials can now specify any Tier
defined by vanilla or a mod. This replaces the harvest level stat. There are no plans to backport the changes to earlier versions at this time.
Code changes here: 59e581a...156eadd
Harvest levels higher than 4 are discarded and capped at 4 (vanilla netherite). A short-term fix could be to do a lookup in the ToolSortingRegistry from Forge based on the harvest level int and return that tier rather than only selecting from the vanilla tiers. A longer term solution might be to register tool tiers to the ToolSortingRegistry (I think this can be done during datapack loading). For every harvest level above 4, register a new tier. (Ideally, check to see if a tier is already registered and use that instead, there is no support for same level tiers.)
Relevant code:
Silent-Gear/src/main/java/net/silentchaos512/gear/util/GearHelper.java
Lines 441 to 470 in d2169a2
I can understand a 4 cap but cannot understand why lower than 4 on some mods just do not work... I am guessing inter-compatible something needs to be manually added