Growthcraft Community Edition

Growthcraft Community Edition

1M Downloads

Fishtrap StrictBait not working as intended

Alatyami opened this issue · 1 comments

commented

Reported by naninunenoahaha on CurseForge

I found a bug in fishTrap.

TileEntityFishtrap.java:Line 67
if (GrowthcraftFishtrapConfig.baitRequired) { If (! HasBait ()) return; } // If strictBait is enable, check the bait inventory for a valid item. if (! hasBait (GrowthcraftFishtrapConfig.strictBait)) { return; }

hasBait (GrowthcraftFishtrapConfig.strictBait) will always be false, so even if GrowthcraftFishtrapConfig.baitRequired is false, it will return here.

(In hasHait (boolean strict), it always returns false if there is no bait)

Therefore, regardless of the contents of config, fishtrap does not work if bait is not present, and if bait is present we can not obtain anything other than fish.

It worked even without food by modifying it as follows.

`
if (GrowthcraftFishtrapConfig.baitRequired) {
If (! HasBait ()) return;

// If strictBait is enable, check the bait inventory for a valid item.
If (! HasBait (GrowthcraftFishtrapConfig.strictBait)) {
 return;
}
}
`

I am glad if it leads to the solution.

commented

Fixed the strict bait issue, it is also important to double check the config options. But found that the inventory isn't saving correctly.