This commit is contained in:
Matiss 2019-05-02 10:13:05 +03:00 committed by Brennan Ward
parent b81a91d1d6
commit 34ef9d89de

View file

@ -16,7 +16,6 @@ import de.ellpeck.actuallyadditions.mod.util.ItemUtil;
import de.ellpeck.actuallyadditions.mod.util.StackUtil; import de.ellpeck.actuallyadditions.mod.util.StackUtil;
import net.minecraft.block.BlockCrops; import net.minecraft.block.BlockCrops;
import net.minecraft.block.state.IBlockState; import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumRarity; import net.minecraft.item.EnumRarity;
import net.minecraft.item.Item; import net.minecraft.item.Item;
@ -28,6 +27,7 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess; import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.EnumPlantType; import net.minecraftforge.common.EnumPlantType;
import net.minecraftforge.items.ItemHandlerHelper;
import java.util.Random; import java.util.Random;
@ -105,8 +105,7 @@ public class BlockPlant extends BlockCrops implements ItemBlockBase.ICustomRarit
} }
if(StackUtil.isValid(drop)){ if(StackUtil.isValid(drop)){
EntityItem entity = new EntityItem(world, pos.getX()+0.5, pos.getY()+0.5, pos.getZ()+0.5, drop); ItemHandlerHelper.giveItemToPlayer(player, drop);
world.spawnEntity(entity);
} }
} }
} }