Tough As Nails

Tough As Nails

21M Downloads

Endermen and Fire don't react to rain.

erindal opened this issue ยท 5 comments

commented

2016-07-17_21 45 20

commented

I've been trying to debug TAN integration with Forestry farms, which respond to rain. Atm they never detect rain as falling, I've tracked the issue down to World.isRainingAt(BlockPos) which TAN uses ASM to insert Season info, which all seems to work up to the point that needs to return the computed boolean, even when SeasonASMHelper.isRainingAtInSeason(World, BlockPos, Season) is stepped into and returns true, World.isRainingAt(BlockPos) still returns false, which leads me to believe the ASM is returning the wrong value.

commented

Turns out that line 125 makes the function always return false.

insnList.add(new InsnNode(Opcodes.ICONST_0)); //Necessary for compatibility with RandomThingsCore

commented

Wow, I wasnt able to debug it to the line. I just knew that the override of isRainingAt does not work as expected.

commented

Could this also mean that the rain collector does not work? I also have the problem that the forestry rain tank does not recognize the rain. Without Tough As Nails it is collecting water.

This can easily be tested with:
Minecraft 1.10.2
Forge: build 2011
forestry_1.10.2-5.2.3.213.jar (https://minecraft.curseforge.com/projects/forestry/files/2318374)
ToughAsNails-1.9.4-1.0.10.jar

Edit: I build a dev workspace with TAN. After adding forestry in there, the rain tank works quite nice and endermen do get damage. But thats only working in the dev env. After building it with Forge 2011 and MC1.10.2 it still has the problems.

commented

The rain collector uses a different method of checking for rain, so it does work (I tested it when I added them).

It's something with one of our ASM overrides, and it's something Adubbz will have to fix, and once again, I don't know when that'll be...