Easy Emerald Tools & More [FABRIC]

Easy Emerald Tools & More [FABRIC]

577k Downloads

Tree Axe and Spectrum not interacting well

fzzyhmstrs opened this issue · 4 comments

commented

First, I believe this is an issue with the pugh-tools library, not emerald tools directly, but the issue was seen with Emerald Tools.

(This may also affect other tools such as the hammer)

Spectrum has many "cloaked" blocks, some of which include colored trees that disguise themselves as oak unless you are far enough in the mod. When you break one of these logs with your fist, it will drop the colored log if you are far enough in the mod, otherwise it will just drop oak.

When a Tree Axe is used on an "un-cloaked" colored tree (the player has advanced far enough to access them), the block directly broken by the axe breaks as expected, but all of the "vein mined" logs only drop as oak.

When I investigated the source a bit, I eventually made my way to pugh-tools and the processList method in the TreeAxe class. This method uses world.breakBlock circled in red, but that method doesn't provide breaking entity context. Spectrum needs this context to determine whether or not the breaking player has progressed far enough:
image

Since processList is passed the player, I believe this is an easy fix of simply updating the breakBlock method:
image

commented

I believe this should address the issue

Screenshot 2024-06-03 at 12 41 28 PM

commented

the processList() is no longer being used, it is controlled by a server tick event

commented

This will be included in the upcoming 1.21 release for fabric

commented

Update: Does not affect excavators or hammers in the same way, they use different breaking methods that seem to mesh with Spectrum.