Skip to content

Commit

Permalink
All extra items gotten from crafting such as hides from scraping shee…
Browse files Browse the repository at this point in the history
…pskin and straw from refining grain are always dropped at the player's feet instead of first attempting to place it in their inventory.
  • Loading branch information
Kittychanley committed Dec 21, 2015
1 parent 97f5f9a commit 8871075
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
5 changes: 2 additions & 3 deletions src/Common/com/bioxx/tfc/Handlers/CraftingHandler.java
Expand Up @@ -77,9 +77,8 @@ else if (item == TFCItems.wool)
if (iinventory.getStackInSlot(i).getItem() == TFCItems.sheepSkin)
size = iinventory.getStackInSlot(i).getItemDamage();
}
boolean add = !player.inventory.addItemStackToInventory(new ItemStack(TFCItems.hide, 1, size));
if (add)
player.entityDropItem(new ItemStack(TFCItems.hide, 1, size), 1);

TFC_Core.giveItemToPlayer(new ItemStack(TFCItems.hide, 1, size), player);
}
else if(item == TFCItems.woolYarn)
{
Expand Down
7 changes: 3 additions & 4 deletions src/Common/com/bioxx/tfc/Handlers/FoodCraftingHandler.java
Expand Up @@ -12,6 +12,7 @@
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.PlayerEvent.ItemCraftedEvent;

import com.bioxx.tfc.Core.TFC_Core;
import com.bioxx.tfc.Food.ItemFoodTFC;
import com.bioxx.tfc.Items.Tools.ItemKnife;
import com.bioxx.tfc.api.Food;
Expand Down Expand Up @@ -64,8 +65,7 @@ public void onFoodCrafting(ItemCraftedEvent e)
for (int j = 0; j < foodWeight; j += 4)
strawCount++;

if (!e.player.inventory.addItemStackToInventory(new ItemStack(TFCItems.straw, strawCount)))
e.player.dropItem(TFCItems.straw, strawCount);
TFC_Core.giveItemToPlayer(new ItemStack(TFCItems.straw, strawCount), e.player);
}
}
else if (makingDough(craftResult, craftingInv))
Expand Down Expand Up @@ -541,8 +541,7 @@ public static void preCraft(EntityPlayer player, ItemStack craftResult, IInvento
for (int j = 0; j < foodWeight; j += 4)
strawCount++;

if (!player.inventory.addItemStackToInventory(new ItemStack(TFCItems.straw, strawCount)))
player.dropItem(TFCItems.straw, strawCount);
TFC_Core.giveItemToPlayer(new ItemStack(TFCItems.straw, strawCount), player);
}
}
else if (makingDough(craftResult, craftingInv))
Expand Down

0 comments on commit 8871075

Please sign in to comment.