Skip to content

Commit

Permalink
Revert use of AppleCore's isFood in ItemTweaks
Browse files Browse the repository at this point in the history
 * Causes a crash in TiC (see squeek502/AppleCore#9) and is probably not worth the potential risk when iterating the entire item list (there are likely other mods that do unsafe things in getItemUseAction)
  • Loading branch information
squeek502 committed Dec 30, 2014
1 parent 593d586 commit 593689d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/java/iguanaman/hungeroverhaul/util/ItemTweaks.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemFood;
import net.minecraft.item.ItemStack;
import net.minecraft.util.WeightedRandomChestContent;
import net.minecraftforge.common.ChestGenHooks;
import iguanaman.hungeroverhaul.config.IguanaConfig;
import squeek.applecore.api.AppleCoreAPI;
import squeek.applecore.api.food.FoodValues;

public class ItemTweaks
Expand All @@ -28,8 +28,8 @@ public static enum VillagerType

public static void init()
{
boolean worthLooping = IguanaConfig.modifyFoodStackSize
|| IguanaConfig.addTradesButcher
boolean worthLooping = IguanaConfig.modifyFoodStackSize
|| IguanaConfig.addTradesButcher
|| IguanaConfig.addHarvestCraftChestLoot
|| IguanaConfig.addTradesFarmer
|| IguanaConfig.addSaplingTradesFarmer;
Expand All @@ -38,7 +38,7 @@ public static void init()
for (Object obj : Item.itemRegistry)
{
Item item = (Item) obj;
if (AppleCoreAPI.accessor.isFood(new ItemStack(item)))
if (item instanceof ItemFood)
{
ItemStack stack = new ItemStack(item);
FoodValues values = FoodValues.get(stack);
Expand Down

0 comments on commit 593689d

Please sign in to comment.