Fix plant right-clicking never returned any seeds

This commit is contained in:
Ellpeck 2016-01-22 18:27:28 +01:00
parent 6d719f781c
commit 6edab422c4
2 changed files with 4 additions and 1 deletions

View file

@ -53,9 +53,11 @@ public class BlockPlant extends BlockCrops{
if(!world.isRemote){
List<ItemStack> 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);

View file

@ -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+" ";