package joshie.harvest.quests.trade;

import joshie.harvest.api.npc.INPC;
import joshie.harvest.api.quests.HFQuest;
import joshie.harvest.api.quests.Quest;
import joshie.harvest.buildings.HFBuildings;
import joshie.harvest.core.helpers.InventoryHelper;
import joshie.harvest.quests.HFQuests;
import joshie.harvest.quests.Quests;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

import java.util.Set;

import static joshie.harvest.core.helpers.InventoryHelper.ORE_DICTIONARY;
import static joshie.harvest.npc.HFNPCs.GODDESS;

@HFQuest("trade.carpenter")
public class QuestGoddessCarpenter extends QuestTrade {
    public QuestGoddessCarpenter() {
        setNPCs(GODDESS);
    }

    @Override
    public boolean canStartQuest(Set<Quest> active, Set<Quest> finished) {
        return finished.contains(Quests.TUTORIAL_CARPENTER);
    }

    @SideOnly(Side.CLIENT)
    @Override
    public String getLocalizedScript(EntityPlayer player, EntityLiving entity, INPC npc) {
        return InventoryHelper.hasInInventory(player, ORE_DICTIONARY, "logWood", HFQuests.LOGS_CARPENTER) ? getLocalized("thanks") : null;
    }

    @Override
    public void onChatClosed(EntityPlayer player, EntityLiving entity, INPC npc) {
        if (InventoryHelper.takeItemsInInventory(player, ORE_DICTIONARY, "logWood", HFQuests.LOGS_CARPENTER)) {
            rewardItem(player, HFBuildings.CARPENTER.getBlueprint());
        }
    }
}

@@ -1137,22 +1137,23 @@
 per.
-hasInInventory
+getHandItemIsIn
 (pla
@@ -1208,16 +1208,24 @@
 RPENTER)
+ != null
  ? getLo
@@ -1396,18 +1396,13 @@
 emsI
-nInventory
+fHeld
 (pla
@@ -1457,16 +1457,24 @@
 RPENTER)
+ != null
 ) %7B%0A    

Make goddess only take wood if it's held (when trading, not the quest).