mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-18 11:19:28 +00:00
Put harvested farm resources back in the resources slot
This commit is contained in:
1 parent
087780fbf8
commit
46c4c65488
1 file changed
+19
-11
@@ -534,23 +534,31 @@ public class TileFarmPlain extends TileFarm implements IFarmHousing, ISocketable
|
||||
listener.hasCollected(collected, logic);
|
||||
|
||||
for (ItemStack produce : collected) {
|
||||
|
||||
// Germlings try to go into germling slots first.
|
||||
if (logic.isAcceptedGermling(produce))
|
||||
produce.stackSize -= inventory.addStack(produce, SLOT_GERMLINGS_1, SLOT_COUNT_RESERVOIRS, false, true);
|
||||
|
||||
if (produce.stackSize <= 0)
|
||||
continue;
|
||||
produce.stackSize -= inventory.addStack(produce, SLOT_PRODUCTION_1, SLOT_COUNT_PRODUCTION, false, true);
|
||||
if (produce.stackSize <= 0)
|
||||
continue;
|
||||
|
||||
addProduceToInventory(produce);
|
||||
pendingProduce.push(produce);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private void addProduceToInventory(ItemStack produce) {
|
||||
|
||||
for (IFarmLogic logic : getFarmLogics()) {
|
||||
// Germlings try to go into germling slots first.
|
||||
if (logic.isAcceptedGermling(produce))
|
||||
produce.stackSize -= inventory.addStack(produce, SLOT_GERMLINGS_1, SLOT_COUNT_RESERVOIRS, false, true);
|
||||
if (produce.stackSize <= 0)
|
||||
return;
|
||||
|
||||
if (logic.isAcceptedResource(produce))
|
||||
produce.stackSize -= inventory.addStack(produce, SLOT_RESOURCES_1, SLOT_COUNT_RESERVOIRS, false, true);
|
||||
if (produce.stackSize <= 0)
|
||||
return;
|
||||
}
|
||||
|
||||
produce.stackSize -= inventory.addStack(produce, SLOT_PRODUCTION_1, SLOT_COUNT_PRODUCTION, false, true);
|
||||
}
|
||||
|
||||
private boolean cullCrop(ICrop crop, IFarmLogic provider) {
|
||||
|
||||
// Let event handlers handle the harvest first.
|
||||
|
||||
Reference in new issue
Block a user