Tech Reborn

Tech Reborn

30M Downloads

(electrical) treetap doesn't tap.

Katorone opened this issue ยท 1 comments

commented

Describe the bug
Both the wooden treetap and electrical treetap don't harvest sap from rubber logs since the newly released version. (TechReborn-1.15-3.3.2+build.179 / RebornCore-1.15-4.2.2+build.97)

Steps to Reproduce
Steps to reproduce the behavior:

  • Craft any kind of tap
  • Try to harvest sap
  • No animation displayed and no sap harvested when right clicking a harvestable log.

Environment (please complete the following information with the version):

  • Minecraft: 1.15.2
  • Mod Loader: Fabric

Logs
N/A

Additional context
Probably related to this bugfix, released today: #2013 (comment)
To be clear, this fix works in the sense that no other electric tools can harvest sap either, right now.

commented

looks like the electric tree tap item is not an instance of treetapitem, and the wooden one has no energy leading to both failing.

I suggest something like:
if ( ( stack.getItem() instanceof ElectricTreetapItem && (Energy.valid(stack) && Energy.of(stack).getEnergy() > 20)) || stack.getItem() instanceof TreeTapItem) {
which will check if it is the electric one, and if so check for energy, and if not, check if its the wooden one.