From 6edab422c47240e4d0b1639ffe3166255c97dba7 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Fri, 22 Jan 2016 18:27:28 +0100 Subject: [PATCH] Fix plant right-clicking never returned any seeds --- .../ellpeck/actuallyadditions/mod/blocks/base/BlockPlant.java | 4 +++- .../de/ellpeck/actuallyadditions/mod/event/TooltipEvent.java | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockPlant.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockPlant.java index 5ef231662..6f19e5d1e 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockPlant.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockPlant.java @@ -53,9 +53,11 @@ public class BlockPlant extends BlockCrops{ if(!world.isRemote){ List drops = getDrops(world, pos, state, 0); + boolean deductedSeedSize = false; for(ItemStack stack : drops){ - if(stack != null && stack.getItem() == this.getSeed()){ + if(stack != null && stack.getItem() == this.seedItem && !deductedSeedSize){ stack.stackSize--; + deductedSeedSize = true; } EntityItem entity = new EntityItem(world, pos.getX()+.5, pos.getY()+.5, pos.getZ()+.5, stack); world.spawnEntityInWorld(entity); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/event/TooltipEvent.java b/src/main/java/de/ellpeck/actuallyadditions/mod/event/TooltipEvent.java index 163a584fa..0a81def15 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/event/TooltipEvent.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/event/TooltipEvent.java @@ -21,6 +21,7 @@ import net.minecraftforge.event.entity.player.ItemTooltipEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.oredict.OreDictionary; +//TODO Add meta & nbt info public class TooltipEvent{ private static final String ADVANCED_INFO_TEXT_PRE = EnumChatFormatting.DARK_GRAY+" ";