Industrial Foregoing

Industrial Foregoing

95M Downloads

[1.16] Animal Feeder

DSMatticus opened this issue ยท 19 comments

commented

Industrial Foregoing Version: 3.1.1-a834e76

Titanium Version: 3.1.0

The animal feeder doesn't seem to be feeding animals - or at least not wheat to cows. Tested with all other mods stripped out on a fresh world with both forge 34.1.16 and 34.1.19.

https://media.discordapp.net/attachments/357597633566605315/766222684723871755/2020-10-15_04.54.17.png?width=1242&height=677

https://media.discordapp.net/attachments/357597633566605315/766222694093160468/2020-10-15_04.54.21.png?width=1242&height=677

commented

Having the same issue in 1.16.5

  • forgeVersion, 36.2.39
  • industrial-foregoing-1.16.5-3.2.14.7-16
  • titanium-1.16.5-3.2.8.7-22

Additionally, it does not consume any energy, it is running, but it does not consume anything.

Running on a local server, is there anything I can share so that you get a bit more info ? (custom modpack)

commented

I think I am still seeing this issue. Only about 8 cows and they aren't being fed.

Forge 34.1.42
Titanium 3.2
IF: 3.1.1

commented

You need atleast version 3.2.0 of IF.

commented

Updated Valhelsia 3 and directly copied my save over. It works now. Thank you.

commented

I'm also on 1.16.3-3.1.1-a834e76.jar, and I can't get the animal feeder to feed cows. Haven't tested it on anything else. It has power and wheat and there's only like 5 cows in the pen so I really do agree that it's bugged.

commented

I cannot reproduce this in dev.
Are you sure that there are no hidden animals near the pen or the cows are on their breeding cd? Maybe some other mod is messing with the valid breeding items?

commented

I have this issue too. Also industrial-foregoing-1.16.3-3.1.1-a834e76.jar but on ATM6 1.1.5

commented

Same issue 1.16.3 forge, only a couple of cows in front, tried a few different things, cant get it to work

commented

Oh yes this is reproducible with just Forge 34.1.23, Titanium 3.1.0 & IF 3.1.1.

commented

I cannot reproduce this in dev.
Are you sure that there are no hidden animals near the pen or the cows are on their breeding cd? Maybe some other mod is messing with the valid breeding items?

I made this video of me reproducing it, which was not hard to do, it really just does not work as you can see. I had no other mods, the cows were breedable by hand, etc etc. After I recorded I tested with the other breedable vanilla mobs and it doesn't work with any of them, so its definitely bugged.

https://www.youtube.com/watch?v=cDpmZ_v7eSM

commented

I did some digging.
The Animal Feeder checks a few things:

  • !animalEntity.isChild()
  • animalEntity.getGrowingAge() == 0
  • animalEntity.canBreed()
  • !animalEntity.isInLove()
  • !getFeedingItem(animalEntity).isEmpty()

When the player tries to breed an animal this is checked:

  • this.isBreedingItem(heldItemstack)
  • this.getGrowingAge() == 0
  • this.canBreed()

Which is basically the same, except for the baby check (it's included in getGrowingAge()) and the in love check (it's included in canBreed()).
But the problem lies in animalEntity.canBreed() which returns false for the Animal Feeder. Everything else passes with true.

Internally (for basic animals) canBreed() checks if the in-love-timer is <= 0 and isInLove() returns if the timer is > 0.
So theoretically !canBreed() and isInLove() should always return the same result... BUT THEY DO NOT. WTF?
Directly checking the timer yields 0 btw.

commented

With some debug logging:

[Server thread/INFO] [AnimalFeederTile/]: Starting work tick
[Server thread/INFO] [AnimalFeederTile/]: Found 2 animals in working area
[Server thread/INFO] [AnimalFeederTile/]: Removing unbreedable animals in working area
[Server thread/INFO] [AnimalFeederTile/]: CowEntity['Cow'/11, l='ServerLevel[New World]', x=-33.50, y=64.00, z=205.50] from net.minecraft.entity.passive.CowEntity: inLoveTime=0, growingAge=0, feedingItem=32 wheat, isChild=false, growingAgeNot0=false, cannotBreed=true, inLove=false, noFeedingItem=false
[Server thread/INFO] [AnimalFeederTile/]: animalEntity.inLove = 0
[Server thread/INFO] [AnimalFeederTile/]: animalEntity.canBreed() = false
[Server thread/INFO] [AnimalFeederTile/]: animalEntity.isInLove() = false
[Server thread/INFO] [AnimalFeederTile/]: {
  Brain: {
    memories: {}
  },
  HurtByTimestamp: 0,
  ForgeData: {},
  Attributes: [
    {
      Base: 0.20000000298023224d,
      Name: "minecraft:generic.movement_speed"
    },
    {
      Base: 16.0d,
      Modifiers: [
        {
          Amount: 0.024509712605415d,
          Operation: 1,
          UUID: [I; 1229355391, 1939754024, -1928417617, 1437367801],
          Name: "Random spawn bonus"
        }
      ],
      Name: "minecraft:generic.follow_range"
    },
    {
      Base: 0.08d,
      Name: "forge:entity_gravity"
    }
  ],
  Invulnerable: 0b,
  FallFlying: 0b,
  ForcedAge: 0,
  PortalCooldown: 0,
  AbsorptionAmount: 0.0f,
  FallDistance: 0.0f,
  InLove: 0,
  CanUpdate: 1b,
  DeathTime: 0s,
  HandDropChances: [0.085f, 0.085f],
  PersistenceRequired: 0b,
  id: "minecraft:cow",
  UUID: [I; -498894578, -1845408403, -1504730014, 620697675],
  Age: 0,
  Motion: [0.0d, -0.0784000015258789d, 0.0d],
  Health: 10.0f,
  LeftHanded: 0b,
  Air: 300s,
  OnGround: 1b,
  Rotation: [8.042057f, 0.0f],
  HandItems: [
    {},
    {}
  ],
  ArmorDropChances: [0.085f, 0.085f, 0.085f, 0.085f],
  Pos: [-33.5d, 64.0d, 205.5d],
  Fire: -1s,
  ArmorItems: [
    {},
    {},
    {},
    {}
  ],
  CanPickUpLoot: 0b,
  HurtTime: 0s
}
[Server thread/INFO] [AnimalFeederTile/]: CowEntity['Cow'/12, l='ServerLevel[New World]', x=-36.08, y=64.00, z=202.53] from net.minecraft.entity.passive.CowEntity: inLoveTime=0, growingAge=0, feedingItem=32 wheat, isChild=false, growingAgeNot0=false, cannotBreed=true, inLove=false, noFeedingItem=false
[Server thread/INFO] [AnimalFeederTile/]: animalEntity.inLove = 0
[Server thread/INFO] [AnimalFeederTile/]: animalEntity.canBreed() = false
[Server thread/INFO] [AnimalFeederTile/]: animalEntity.isInLove() = false
[Server thread/INFO] [AnimalFeederTile/]: {
  Brain: {
    memories: {}
  },
  HurtByTimestamp: 0,
  ForgeData: {},
  Attributes: [
    {
      Base: 0.20000000298023224d,
      Name: "minecraft:generic.movement_speed"
    },
    {
      Base: 16.0d,
      Modifiers: [
        {
          Amount: -0.04274048136542697d,
          Operation: 1,
          UUID: [I; -1040883999, 1630424164, -1734661354, 1110338739],
          Name: "Random spawn bonus"
        }
      ],
      Name: "minecraft:generic.follow_range"
    },
    {
      Base: 0.08d,
      Name: "forge:entity_gravity"
    }
  ],
  Invulnerable: 0b,
  FallFlying: 0b,
  ForcedAge: 0,
  PortalCooldown: 0,
  AbsorptionAmount: 0.0f,
  FallDistance: 0.0f,
  InLove: 0,
  CanUpdate: 1b,
  DeathTime: 0s,
  HandDropChances: [0.085f, 0.085f],
  PersistenceRequired: 0b,
  id: "minecraft:cow",
  UUID: [I; 1820461863, 1144277460, -1244548436, -119568201],
  Age: 0,
  Motion: [-0.04704271895612535d, -0.0784000015258789d, -0.0014967420382314303d],
  Health: 10.0f,
  LeftHanded: 0b,
  Air: 300s,
  OnGround: 1b,
  Rotation: [94.01227f, -3.6522388f],
  HandItems: [
    {},
    {}
  ],
  ArmorDropChances: [0.085f, 0.085f, 0.085f, 0.085f],
  Pos: [-36.07532043904621d, 64.0d, 202.53308960726866d],
  Fire: -1s,
  ArmorItems: [
    {},
    {},
    {},
    {}
  ],
  CanPickUpLoot: 0b,
  HurtTime: 0s
}
[Server thread/INFO] [AnimalFeederTile/]: Reduced to 0 breedable animals in working area
[Server thread/INFO] [AnimalFeederTile/]: Did not find two valid animals to breed
commented

I think this might be a Forge bug

commented

Forge replaces the method AnimalEntity.canFallInLove() (func_204701_dC) with AgeableEntity.canBreed() (func_204701_dC).
In the dev environment every usage of canFallInLove is correctly replaced with canBreed. But in a normal install the vanilla code uses canFallInLove (which has the correct logic). The AnimalFeeder uses canBreed, as its the only available method. It always returns false in a normal install.
So I think we have to move this over to the Forge issue tracker.

commented

Confirmed MCP issue by Lex

commented

So do we just download the latest forge 1.16.3-34.1.25 (didnt fix the issue) or is there another patch as such we have to download?

commented

Fixed in MinecraftForge/MinecraftForge#7424 I will integrate this into #858

commented

I'm going to leave this open for a bit because I know that people will open a new issue for a while.

Thanks @iTitus for looking into it

commented

You need the latest Forge (34.1.25) AND a new build of Industrial Foregoing with #858 merged. Stay patient, it will come soon ;)