GregTechCE / GregTech

GregTech rewrite for modern versions of Minecraft
GNU Lesser General Public License v3.0
269 stars 149 forks source link

[BUG] Cannot chop down trees with GTCE axes #1704

Open Exzept1on opened 3 years ago

Exzept1on commented 3 years ago

Describe the bug You can't break trees from the DynamicTrees TFC mod

Versions Forge: 2855 GTCE: 1.17.0 Modpack: TerraFirmaGreg-1.12.2-R2.7.5 Addons: -

Setup + Steps To Reproduce

  1. Install both mods or install modpack.
  2. Enter in the world.
  3. Get yourself a GT axe..
  4. Try to break tree.
  5. Nothing happenned.

I also found a problem on GitHub Dynamic trees TFC, but they say that this is a GTCE problem. https://github.com/Gaelmare/dynamictreestfc/issues/31

warjort commented 3 years ago

This looks like it would be relatively simple to fix.

In ToolMetaItem:

    @Override
    public Set<String> getToolClasses(ItemStack stack)
        T metaToolValueItem = getItem(stack);
        if (metaToolValueItem != null) {
            IToolStats toolStats = metaToolValueItem.getToolStats();
            return toolStats.getToolClasses(stack);
        }
        return Collections.emptySet();
    }

In IToolStats:

    // Nothing by default
    default Set<String> getToolClasses(ItemStack stack) {
        return Collections.emptySet();
    }

Then implement it for each tool, e.g. in ToolAxe:

    private static final Set<String> AXE_TOOL_CLASSES = Collections.singleton("axe");

    @Override
    public Set<String> getToolClasses(ItemStack stack) {
        return AXE_TOOL_CLASSES;
    }

It should be easy to figure out the classes for each tool by looking at canMineBlock() There will be some gotchas, e.g. Some have multiple classes, like ToolSaw is both a saw and and an axe. And saws can also be used as shears, but that is handled differently because it is instabreak.

Exzept1on commented 3 years ago

I don't understand much about this, but if you fix it, it will help my modpack a lot :)

Exzept1on commented 3 years ago

The same problem is with the hoe, I can't use the hoe(GT) to plow the TFC land.

warjort commented 3 years ago

I don't understand much about this, but if you fix it, it will help my modpack a lot :)

Fixing it is not the problem. Getting it accepted into the codebase is hard. I still have a major bug fix from over 6 months ago that isn't accepted.

Exzept1on commented 3 years ago

I got it. In this case, we expect. Or there is an option to offer this solution for GTCEu

warjort commented 3 years ago

I outlined the fix above, if they want to implement it in GTCEu they can, but I don't work on forks.

Exzept1on commented 3 years ago

okaay, thanks anyway

Exaxxion commented 3 years ago

Fixing it is not the problem. Getting it accepted into the codebase is hard. I still have a major bug fix from over 6 months ago that isn't accepted.

There are a lot of things going on at any point in this repository, and a limited number of people who have the knowledge and authority to review pull requests. We have to triage issues based on severity and sometimes things take a while to get to.

As for the proposed solution for this issue, based on what the folks over at dynamictreestfc have stated the issue is, this seems like a reasonable approach.