Enigmatica 2: Expert - Extended

Enigmatica 2: Expert - Extended

214k Downloads

Forestry's date and papaya pod become corrupted/unusable when right-clicked while fully grown

ReiDaTecnologia opened this issue ยท 7 comments

commented

Description

Pretty much the title. The pod become unusable as it can't grow or accept bone meal, it also don't even give date/papaya fruit when you first try it...
My guess is that, whatever is allowing you to right-click it, reset the block state and keep the NBT data but for it to actually work you need to set "MT" (maturity) to 0 (it need to be same value as the age of the pod).
To Reproduce

Steps to reproduce the behavior:

  1. Plant and grow a papaya or date tree
  2. Bone meal or wait for the date/papaya pod to fully grow
  3. Right-click it

Modpack version v1.44.3

debug.log or Crash report

commented

Yeah, I saw that too, but i thoung this is some kind of feature I dont understand. I will try to fix that, but not soon.
For now, you can use Forestry multifarm to fart Date and Papaya.

commented

With further investigation I found that this most probably because BlockFruitPod calling getDrops() instead of pickFruit() method of TileFruitPod, which causing desync of Block and TileEntity data. I will try to fix this with a mixin.

commented

Random Things' lotus can be right-clicked while not fully grown and therefore it reset back to age 0 but at least it don't get unusable, it is just annoying so a minor issue

commented

Its ok i guess

commented

With further investigation I found that this most probably because BlockFruitPod calling getDrops() instead of pickFruit() method of TileFruitPod, which causing desync of Block and TileEntity data. I will try to fix this with a mixin.

So, I tried this ZenUtils mixin and have no luck:

#mixin Mixin
#{targets: "forestry.arboriculture.blocks.BlockFruitPod"}
zenClass MixinBlockFruitPod {
    #mixin Redirect
    #{
    #   method: "removedByPlayer",
    #   at: {
    #       value: "INVOKE",
    #       target: "Lforestry/arboriculture/tiles/TileFruitPod;getDrops()Lnet/minecraft/util/NonNullList;"
    #   }
    #}
    function correctGettingFruits(tile as TileFruitPod) as native.net.minecraft.util.NonNullList {
        return tile.pickFruit(null);
    }
}

The idea is to just redirect call into pickFruit() method. I assumed that it will change Tile Entity properties, such as maturity, but in reality MT data tag is the same and wont be changed...

Seems like I just dont understand how Forestry source code working or have not enough experience in Java.
So, I cant fix this issue from my position.

I will keep issue for some time, maybe some enthusiasts will come and help me and point where fix should be made.

commented

Report to Forestry GitHub

commented

Oh, seems like @ACGaming and @thedarkcolour started to contribute to Forestry!

image

Thats add chances for the bug to be fixed. I will close current issue and hope for redirected issue on Forestry issue tracker will be fixed!